Commit Graph

115 Commits

Author SHA1 Message Date
Tom Finegan
1be5889a6d Add temporary include shims at old file locations.
Helps ease the downstream transition to the new libwebm layout.

BUG=28069412

Change-Id: I0d4182e22a10fecdd5982b8aceba687dea9529d8
2016-04-11 23:25:20 +00:00
Tom Finegan
008aa63d6a mkvparser: move to mkvparser sub dir.
Move mkvparser and mkvreader to mkvparser/.

Change-Id: I18c4575483f628344034d81b7d90d3aa86c163ff
2016-03-18 10:22:22 -07:00
Tom Finegan
e64bf75688 Namespace reorg: Make everything a child of libwebm.
(that is not already)
Some details:
- mkvmuxer and mkvparser wrapped by libwebm
- Matroska element constants moved from mkvmuxer to libwebm
- integer types moved from mkvmuxer to libwebm

Change-Id: Ic91e887e50adbc2d735bf6264534a5d01135df31
2016-03-18 10:22:16 -07:00
Tom Finegan
75790e1e63 iwyu/mkvparser: Update includes.
Include what you use analysis based include update.

Change-Id: If117dad749c6854dd2023a64abef9ab3b163196b
2016-03-10 09:21:48 -08:00
Tom Finegan
2d0912837c Colour element: TransferFunction renamed to TransferCharacteristics.
Change-Id: I02e8d9b375d3aeba26d99866df90e25e1605143f
2016-02-18 12:03:41 -08:00
Tom Finegan
f2fc28e044 Colour element: Matrix renamed to MatrixCoefficients.
Change-Id: I148e81be6c23f0d0e61dc5820a1ae80f685af57f
2016-02-18 12:03:36 -08:00
Tom Finegan
d7fc382dea Track updates to the proposed Matroska Colour spec.
https://mailarchive.ietf.org/arch/msg/cellar/cCjxCohD-2xM93ijoFVaYYMLFas

Changes:
- ChromaSubsampling replaced by ChromaSubsamplingHorz,
  and ChromaSubsamplingVert.
- CbSubsamplingHorz and CbSubsamplingVert added.

Change-Id: I0848f9f41b3162afb5485b82704620d9e03f9b5e
2016-02-12 11:28:30 -08:00
Tom Finegan
ae4ae7ef77 mkvparser: Make omitted values detectable in the Colour element.
Add constants that allow users to determine when an element or value
was omitted from Colour and its child elements.

Change-Id: If909274850127938a456f2d0a1e490dcbb9c1bde
2016-02-10 09:14:34 -08:00
Tom Finegan
fb1406ec3b mkvparser: Add support for the Colour element and its children.
Change-Id: Idffafaee221e2949c21f56c81df6e4d1c3e959a5
2016-02-08 09:23:57 -08:00
Tom Finegan
48b1e9a4a0 mkvparser: clang format run
Change-Id: Ib416e3ea3a955090bf4269113b36e15922107438
2016-02-04 09:56:48 -08:00
Tom Finegan
841a9b5fd9 mkvparser: Segment assert clean up.
- Remove asserts from ~Segment, CreateInstance, and DoLoadCluster.
- Adds new return constant (E_PARSE_FAILED == -1); most places in
  mkvparser that return -1 are the result of an internal inconsistency
  and/or misusing the API. In those cases E_FILE_FORMAT_INVALID is not
  appropriate as a return value because it's misleading to libwebm users.

Change-Id: I0d46e831b3475d69432b8745066de3329419fa11
2015-08-31 12:38:09 -07:00
Tom Finegan
93b24c4195 mkvparser: Fix include order.
Change-Id: Ia03ce824c78c19f5ab62c736069ea0972b8c93ea
2015-08-28 11:06:03 -07:00
Tom Finegan
7f77201dca Merge "mkvparser: Add ReadID." 2015-08-26 19:49:11 +00:00
Tom Finegan
23bb18b76d mkvparser: Add ReadID.
Enforce ID rules in one place instead of every time
an ID is read.

Change-Id: I6e39a2e2dbafa2d5926dea790dd563cc3a48f67e
2015-08-25 13:37:35 -07:00
Tom Finegan
7b57e37fde mkvparser: add SafeArrayAlloc.
A new wrapper that makes array allocations safer by
limiting allocated size.

BUG=23430787

Change-Id: I901ee61dc2b601e8c0b5bf13f7499b5d2479ba7a
2015-08-25 13:06:27 -07:00
Tom Finegan
1a6dc4f210 mkvparser: Cues::PreloadCuePoint now returns bool.
Check allocations and fail appropriately.

Change-Id: Ie16d258a47e46b5e15c5c6275ea83ebead8b0f49
2015-08-24 16:20:13 -07:00
James Zern
064f2eed62 Segment::PreloadCluster(): return a bool status
BUG=23430793

Change-Id: I10aab67e94961868be806ee7ee9df550a5187e5a
2015-08-22 11:02:55 -07:00
James Zern
3778408b2a Segment::AppendCluster(): return a bool status
BUG=23430793

Change-Id: I6072234bfe211153ad143ccf7a3c6bbfa8cd166e
2015-08-22 11:01:47 -07:00
James Zern
2dec09426a mkvparser: normalize UnserializeInt signature
long size -> long long; fixes a conversion warning under visual studio

Change-Id: I216151236f4ad7e1b8af4d8b7d19e3b36083fd14
2015-08-04 19:01:06 -07:00
Francisco Facioni
b6de61a5c0 Adds support for simple tags
Change-Id: I285e4b73df0a7112bbde7ef13eddf8fdccf59178
2015-07-22 17:07:25 -03:00
Frank Galligan
d66ba4470a Merge "Add support to parse DisplayUnit." 2015-06-03 00:25:32 +00:00
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
2cb6a28b09 Change assertions to checks when parsing TrackPositions
Malformed files woudl cause the parser to assert.

Instead now it stops parsing and skips the segment.

Change-Id: I256b3b72e43f969693ae16547ca98da07d665e21
2015-06-02 15:51:40 -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