Commit Graph

93 Commits

Author SHA1 Message Date
Frank Galligan
deb41c2ea1 Add support to parse DisplayUnit.
BUG=https://code.google.com/p/webm/issues/detail?id=1009

Change-Id: I209ee6caf5bc10dfc1761e650821cc2338a4b13c
2015-06-02 16:17:13 -07:00
Leonel Togniolli
5a3be734f3 Change assertions to checks when load CuePoints
Malformed files would cause the parser to assert.

Instead now it stops parsing and skips the segment.

Change-Id: I07e3baf5c9eb6feb115e155f226d8abc2c37698e
2015-05-25 01:27:38 +01:00
Tom Finegan
d3849c2f7b mkvparser: Dead code removal.
Change-Id: Ic4cf359ecc80641b97f40c20639ce9c32b34077d
2015-04-14 23:36:29 -07:00
Leonel Togniolli
f439e523b8 Change assertions to checks when preloading Cues
If a malformed webm file contains invalid information on the Cues
the segment, the parser would assert.

Instead, now it ignores the Cues and skips the segment.

Change-Id: I9270f6a0935ce9e9a3765a5f324ae542c1ade1c7
2015-04-14 01:25:25 +01:00
Sasi Inguva
e3616a6614 Add support to parse stereo mode, display width and display height in mkvparser
Change-Id: I7ff99275b70e96b84601c32836f1b79f95fcf0d4
2015-03-12 00:25:58 -07:00
Vignesh Venkatasubramanian
4df111e60a clang-format on mkvparser.[ch]pp
Conformance of mkvparser.[ch]pp to Google C++ style guide.

Change-Id: I459adac3da1496b432b71b3580b4dbd63037df2b
2014-04-29 11:30:00 -07:00
Tom Finegan
5c14a3f035 mkvparser/mkvreader/sample: CRLF -> LF
Change-Id: Id4a5bea411d104289548b276d0e996352cc816b1
2014-01-23 10:57:06 -08:00
Tom Finegan
81c1d8415c mkvparser: Add support for CodecDelay, DiscardPadding, and SeekPreRoll elements.
Change-Id: Ic9e6ebcc2ba533f8cc1ab933d0bf55782ccab932
2014-01-08 17:33:03 -08:00
Patrik2 Carlsson
a9f43fe8e7 mkvparser: Get frame default duration
Track::GetDefaultDuration is implemented as an alternative
to VideoTrack::GetFrameRate which seems to be deprecated.

Change-Id: I2c7a6d56a232125b8632d87eab75b9600c5451e1
2013-05-02 16:04:34 +02:00
Patrik Carlsson
3af8d02ca1 mkvparser: support seek for generic tracks (subtitles)
To support seek in generic tracks with subtitles the audio track
implementation of seek is made generic and inherited by audio track.

Change-Id: Ic88d2e859d077a1054b2af7d7680cfddfba8a589
2013-02-28 15:47:04 +01:00
Patrik Carlsson
0d5b3fc5ae mkvparser: add support for compression elements
ContentCompression elements are now parsed.

Change-Id: I9a67ae444ed929e49c7ea223a16c13c9d16a4c13
2013-02-28 15:46:58 +01:00
Patrik Carlsson
3980cf4159 mkvparser: read track language information
Track::GetLanguageAsUTF8 is implemented to allow the user to
choose between available audio and subtitle tracks.

Change-Id: I5ec9b1c1c00182da759681ba486cbace46e9b63f
2013-02-27 15:40:33 +01:00
Matthew Heaney
28222b4927 Add support for WebVTT cue identifier line
Modified the mkvmuxer to write the ChapterStringUID
sub-element of the Chapter Atom element.

Modified the mkvparser to read the ChapterStringUID
sub-element of the chapter atom.

Modified the vttdemux app to write the Cue Identifier
line of the WebVTT cue.

Change-Id: I06fe386f44897ada3fe10cbf89096df104dcf779
2012-11-13 12:44:06 -08:00
Matthew Heaney
c26db03d5a vttdemux: add support for WebVTT chapters
Change-Id: If5e12ff7057ce4217907ef91d493e1bcd8a72656
2012-11-12 11:52:15 -08:00
Matthew Heaney
386928d8b8 mkvparser: add missing definitions
Change-Id: I043a6d974bdf146a8726d090722159943eb20752
2012-11-08 18:12:30 -08:00
Matthew Heaney
50ee255b8c mkvparser: add support for MKV chapters
Change-Id: I2404b6886ed592fe505ee973bf05c769a9d134b1
2012-11-02 14:42:40 -07:00
Matthew Heaney
2fc496a0d6 mkvparser: create generic track objects
Formerly, it was only possible to create instances of
the Track subclasses, VideoTrack and AudioTrack.  However,
we now populate WebM files with WebVTT metadata blocks,
so we must allow for a third kind of track object.

We now enable instances of type Track to be created,
by providing a new factory function, Track::Create, and
making all Track methods non-pure and with a generic
implementation.

Change-Id: I7d4c965eb566b9fc2f5ceefe1d43723cf8c1e5f0
2012-10-10 16:51:21 -07:00
Matthew Heaney
4f494f6dd4 mkvparser: implemented BlockGroup::GetDuration method
Change-Id: Ib0106df3823c29e45a8fe59669c0fa65dd13a123
2012-09-28 14:55:24 -07:00
Frank Galligan
a320f5be63 Add CTR encryption.
- Added ContentEncAESSettings, AESSettingsCipherMode,
  AESSettingsCipherInitData elements to the parser and muxer.
- Changed ParseContentEncodingsEntry, ParseContentEncodingEntry,
  and ParseEncryptionEntry to use PasreElementHeader.
- Added ParseContentEncAESSettingsEntry function.
- PS6 removed AESSettingsCipherInitData.
- PS9 Addressed comments, Fixed some LINT issues, and converted
  mkvwriter.h/.cpp to Unix line endings.
- PS10 Addressed comments.

Change-Id: I9d96a0c194f74a6c9bf0001aa0286196e410f07e
2012-07-27 09:34:31 -07:00
matthewjheaney
9a561ab4dd libwebm: handle negative time for a block
Change-Id: Iafa0254fb1554621b42635cb99d40b2c0177468f
2012-05-11 11:53:23 -04:00
matthewjheaney
041a5c5811 Parse headers outside of constructor
In several cases, the parser would parse a header
(say, a track header, or the segment info header)
in the constructor for the type.  The parser had
assumed (incorrectly) that the file was well-formed,
but this turned out to be an incorrect assumption.

The parse errors triggered some assertion failures,
but this is not acceptable in a production system.

The parser solved that problem by separating the
construction of the header object from the parsing
of the file.  There is now a separate parse method
to be called after construction of the object,
which returns a status whether the parse was
successful.

This change fixes the bugs from the following
tracker issues:

http://code.google.com/p/webm/issues/detail?id=399
http://code.google.com/p/webm/issues/detail?id=400

Change-Id: Idb09154ae7008429d8613ce3b3e8294f5a12de86
2012-03-13 14:40:17 -04:00
matthewjheaney
6fa7c7611c Block parsing is now robust
Previously, parsing of a Block element was done inside its
constructor.  Parsing errors were handled via assertion checks,
but this only works in practice if there are no actual errors
in the file.

We did come across a file, however, that used EMBL-style lacing,
but the lacing was done incorrectly and so the parse asserted.
This isn't acceptable for a production system, and more a graceful
handling of parse errors was needed.

The code was restructured such that the Block object's ctor does
only trivial initialization of member variables.  A separate Parse
method was added, that is called after the object is constructed.
If the parse succeeds all is well, otherwise the object is destroyed
and the error is reported to the caller.

This commit fixes bug tracker issue #398, described here:

http://code.google.com/p/webm/issues/detail?id=398

Change-Id: Ib95ca95d0eec08cf670b308c461e42ed8345e890
2012-02-28 14:03:21 -05:00
matthewjheaney
4c682199b0 mkvparser: cache SeekEntry start and size
Change-Id: I54a0ac4035f7174f51ae2145dedb1c3ed5ad7ec8
2011-12-08 16:07:15 -05:00
matthewjheaney
9303667611 parse void elements in seek head
Change-Id: Ifc8841909f6aa877108abebb5b5623c2344d0e35
2011-11-17 19:08:48 -05:00
Frank Galligan
4affedd0a7 Add support for encryption elements.
Added support for the ContentEncoding element to be added to a
Track element for muxing. Currently only one ContentEncoding may
be added. The ContentEncoding must be encryption of the whole
frame with AES.
Added support for parsing the ConentEncoding elements. Currently
the parser does not parse any ContentCompression elements.

Change-Id: Ie199116a1bcc18a0c2b5eea3dba6622887c108c8
2011-11-04 14:09:56 -04:00
matthewjheaney
1ae4335c1c libwebm: liberalize handling of reference blocks
Change-Id: I3df0235e005c57507eb974ad3754b4c800a99825
2011-08-09 16:03:50 -04:00
matthewjheaney
9ecedef185 libwebm: include <cstddef>
Change-Id: Ieba2507dd82b34558ffef4febb6f80225009cc30
2011-05-03 15:48:13 -04:00
matthewjheaney
3395c36a8e libwebm: added UnserializeInt function
Change-Id: I2298e547cd38d3aea04c0c993a67e5e291b8fea8
2011-04-05 20:55:26 -07:00
matthewjheaney
ffe5a8e548 libwebm: added GetLacing selector function for Block
Change-Id: I77bff875919f7a57a8c838beb05bc9a992cadacd
2011-04-05 20:55:25 -07:00
matthewjheaney
a9c65fbbc0 libwebm: added BlockEntry::GetKind op
Change-Id: I7d7daac0d3b8be1b8839f96503250170f675e34d
2011-04-05 20:55:24 -07:00
matthewjheaney
31a9d5470e libwebm: don't alloc block object in block group
Change-Id: I55ff9451591da86b89ed58c22eb9778317b89364
2011-04-05 20:55:23 -07:00
matthewjheaney
2b84a12da8 libwebm: removed old Cluster::Load
Change-Id: I02448e6c9d5850368282353dba40a549753c26bc
2011-04-05 20:55:22 -07:00
matthewjheaney
bd833a82e4 libwebm: removed old LoadBlockEntries
Change-Id: I340f444f719fa9c5d9da986f1527522d8a5f9812
2011-04-05 20:55:21 -07:00
matthewjheaney
7b07758854 libwebm: refactor BlockEntry class
Change-Id: I68d799d5b928de0ff7be293731ab73750c7cbb86
2011-04-05 20:55:20 -07:00
matthewjheaney
00ed87aad6 libwebm: Block::GetIndex returns type long
Change-Id: I7b233a18b5054398ae22696148ede17817ea608a
2011-04-05 20:55:11 -07:00
matthewjheaney
70f9644a8d libwebm: restored Cluster::GetLast
Change-Id: I73564fb508e23004392b5aaab1f1ad7cdedc8bb1
2011-03-19 10:34:12 -04:00
matthewjheaney
2083c72300 libwebm: removed LoadBlockEntries
Change-Id: I1d65c07d91de568573f48e9fddf83b4c5672871d
2011-03-18 21:43:06 -04:00
matthewjheaney
f5ec272e54 libwebm: removed Cluster::Load (non-incremental)
Change-Id: I1f2ad153e0c643d04fa1fe1ec85410bbef1954ef
2011-03-18 11:18:46 -04:00
matthewjheaney
31b2d8689c libwebm: parse unkown cluster size
Change-Id: I74f7f552185aafaa4466556644e95c3a25063a08
2011-03-07 21:11:57 -05:00
matthewjheaney
227d62aadf libwebm: changed type from size_t to long
Change-Id: I5a684628119877a2f89116b760a1c7e41716748d
2011-03-02 19:05:28 -05:00
matthewjheaney
85beb00fe3 libwebm: changed idx from size_t to long
Change-Id: I7ea9637ab3c55d7535fe9f2fe11fe88f4d47e474
2011-03-02 18:21:21 -05:00
matthewjheaney
eb4bd69098 libwebm: do not lazy-load cue points
Change-Id: I07646f1942d1f473f051ff8ab0aa07b2f4381d4c
2011-02-26 16:59:42 -05:00
matthewjheaney
cf36dc2848 libwebm: added Cues::GetCount
Change-Id: I5b2bca8fd7229318783d9b97c50a4e20ce2ba640
2011-02-26 11:50:23 -05:00
matthewjheaney
a1aa16692a libwebm: added support for incremental cluster parsing
Change-Id: Idb1bd292a01b7c9971967760ad016691ac628c29
2011-02-22 11:51:23 -05:00
matthewjheaney
5ac9764a95 libwebm: liberalized parsing of next cluster
Change-Id: I166ecfb5a76d475b77c3e418c4ae91195ff58d32
2011-02-13 19:00:31 -05:00
matthewjheaney
5e72a2dfc2 libwebm: changed signature of CuePoint::GetTime
Change-Id: Ia80da8af5607c7067e848bafd453842cfe8cfcca
2011-01-28 00:52:13 -05:00
matthewjheaney
a131a01446 libwebm: incrementally load block entries
Change-Id: I566df5979e7638b6a5411a3338bbb0cf7d9ad111
2011-01-25 23:01:51 -05:00
matthewjheaney
94f2d589fc libwebm: tolerate errors in SeekHead element
Change-Id: I380f43dd495dc5107f5df37f9d05ff67da4f8424
2011-01-24 20:50:12 -05:00
matthewjheaney
6e723319e8 added support for incremental (partial) loading
Change-Id: Ic411e6214fdfc3e23a7e3f621f9fb8be0d650d50
2011-01-21 20:04:58 -05:00
matthewjheaney
9911f61616 incrementally parse cue points
Change-Id: I83699208eabb2433b25f634927b7c0be8623c3a2
2011-01-19 21:22:37 -05:00