Commit Graph

57 Commits

Author SHA1 Message Date
Tom Finegan
a281a22955 mkvmuxer: Add support for the Colour element and its children.
Change-Id: I8026a2ba6c664cbf0ce0a6602a79942283b194b1
2016-02-09 18:21:44 -08:00
Tom Finegan
01fdee435c mkvmuxer: Disallow AddTrack() after Tracks element is output.
BUG=https://code.google.com/p/webm/issues/detail?id=1083

Change-Id: I6a603337ba5fea1333f3f1c2595f9b87b148c427
2015-10-21 09:07:00 -07:00
Vignesh Venkatasubramanian
a58c32339e mkvmuxer: Add codec id constant for VP10.
This was added in the libvpx's snapshot here:
https://chromium-review.googlesource.com/#/c/293861

Change-Id: I58b9635c62535ecdb0dff14dc294466262590861
2015-09-10 12:10:01 -07:00
Francisco Facioni
b6de61a5c0 Adds support for simple tags
Change-Id: I285e4b73df0a7112bbde7ef13eddf8fdccf59178
2015-07-22 17:07:25 -03:00
Vignesh Venkatasubramanian
c3550fdacf mkvmuxer: Write Block key frames correctly.
Per matroska Block Structure [1], for keyframes the flag should not be
set (unlike SimpleBlocks). For Blocks, keyframes is inferred by the
absence of ReferenceBlock element.

This CL fixes Issue #933 [2].

[1] http://www.matroska.org/technical/specs/index.html#block_structure
[2] https://code.google.com/p/webm/issues/detail?id=933

Change-Id: Ia3f811c3fe17fb4dededda2f6834cf7cf2d2e022
2015-06-01 11:04:12 -07:00
Vignesh Venkatasubramanian
b6311dc16f mkvmuxer: Refactor to remove a lot of duplicate code
Refactor muxer to remove a lot of duplicate code. This CL strives
to not change the API as much as possible. Although, there is one
minor public API change (constructor of the Cluster class). Other
than that, all the functions should work exactly the same way as
before.

Following up on this CL, we are going to make AddGenericFrame the
preferred way of adding frames to a segment and deprecate (and
eventually remove) all the other specific AddFrame* functions.

Change-Id: Ie410f1a64a981e1545ade53ce476bbe8b3610c4f
2015-05-20 10:24:26 -07:00
Vignesh Venkatasubramanian
256cd02327 Merge "mkvmuxer: DiscardPadding should be signed integer." 2015-05-14 13:42:50 +00:00
Vignesh Venkatasubramanian
16c8e78265 mkvmuxer: s/frame/data in all AddFrame* functions.
Rename variable "frame" to "data" in all the AddFrame* functions.
This is in prepararation for a follow-up CL.

Change-Id: Ifd0d96cfbeca85c12be23d854bc87e085436984d
2015-05-12 15:31:07 -07:00
Vignesh Venkatasubramanian
c5e511c00a mkvmuxer: DiscardPadding should be signed integer.
Discard Padding getter and setter should take and return a signed
integer respectively.

Change-Id: Ieb6b9cd8c9830c2335ffdbcd608c727a3d135bb8
2015-05-12 14:56:12 -07:00
Vignesh Venkatasubramanian
f06e152abd mkvmuxer: Fix MoveCuesBeforeClustersHelper recursive call.
The third parameter of the MoveCuesBeforeClustersHelper recursive function
should always be the size of the cues element without the master element's size
(i.e.) it should be the sum of size of all Cue Points. This way, the changes in
the Length of the master element itself will be computed correctly.

Change-Id: I05ff1606fb74168f80ffed81fd3c0de3f237c579
2015-02-02 18:34:18 -08:00
Vignesh Venkatasubramanian
e12fff0ebb mkvmuxer: Overload WriteEbmlHeader for backward compatibility
WriteEbmlHeader function was updated on
a321704b4c. It is a public function that
is exposed outside of the library. Overload it with an old signature
to maintain compatibility. The overloaded function writes the
doc_type_version as 2 by default (thereby retaining the old behavior).

Change-Id: If887a1bfa3e81e7e639c986a922aa5155faab2cf
2014-07-09 11:24:09 -07:00
James Zern
a321704b4c mkvmuxer: write correct DocTypeVersion
Change-Id: I9a463394dec5e69ae8a7b5a1378f19d390e441e4
2: default
4: if CodecDelay/SeekPreRoll/DiscardPadding are present
2014-06-24 16:17:29 -07:00
Sergey Ulanov
acf788bedd Add support for CropLeft, CropRight, CropTop and CropBottom elements.
Change-Id: Ic5993a3e04b3eefccc3016fbe6b49d1e4a5fc05d
2014-05-21 19:46:36 -07:00
Vignesh Venkatasubramanian
7b2450131c clang-format re-run.
Re-running clang-format to take into account the recent change in it.
(https://gerrit.chromium.org/gerrit/#/c/69926/ )

Change-Id: Ie11afcaaf07a1967f65fd765f1a7c7112c85875a
2014-04-29 11:27:31 -07:00
Vignesh Venkatasubramanian
fb6b6e6444 clang-format on mkvmuxer.[ch]pp
Conformance of mkvmuxer.[ch]pp to Google C++ style guide.

Change-Id: I9bcd14710adbad4f32aa1a6be2ea7e40fb715e91
2014-04-11 11:41:01 -07:00
Sergey Ulanov
0fcec38045 Add support for DateUTC and DefaultDuration in MKV Muxer.
BUG=crbug.com/321825

Change-Id: I5ff8c5b9fd4e6be23ef2bc91a7a4ba021db6441f
2014-04-08 21:48:00 -07:00
Tom Finegan
cd6f7bff4b mkvmuxer: Add DiscardPadding support.
Also a bit of refactoring to remove some duplicate code.

Change-Id: Ia3d17461ae5f6275534e06c31f348bdfc4bba169
2014-01-22 23:26:26 -08:00
Tom Finegan
5efd6e3c1d mkvmuxer: Add support for VP9 and Opus tracks.
Also make codec ID constants really constant.

Change-Id: I951d25e83ce507afb1ca475e2d5dbfe6402f3d61
2014-01-10 15:03:47 -08:00
Tom Finegan
a6c71c1407 mkvmuxer: Add support for writing CodecDelay and SeekPreRoll elements.
Change-Id: Iad8c671b76c4b97abad58946df7f3c0ebe6cb01b
2014-01-10 11:32:56 -08:00
Vignesh Venkatasubramanian
872cc57de4 Adding set_uid to Chapter Class
Adding set_uid function to the Chapter class. It can be used to
achieve deterministic output from the muxer. For example, for files
with only one segment, track number or track id can be used for
chapter uid.

Change-Id: I2e94c6150e32cb9019a6623af7919acc099aa20d
2013-10-25 09:33:28 -07:00
Vignesh Venkatasubramanian
4134f6e04e Adding AddLastFrame to Segment
Adding AddLastFrame function to the Segment muxer so that the duration
of the Segment can be accurately calculated given the last Block's duration.
We now provide an AddLastFrame function which will take duration of that block
as a parameter. When this function is used to add the last frame, the duration
of it is taken into account when computing the Segment's duration.

Change-Id: I3e1456299fefa1a4dd6d845c47292951d1ce3ad0
2013-10-25 08:28:23 -07:00
Tom Finegan
c5892de23b Fix mkvmuxer::Track::set_uid().
Modifying const variables doesn't work.

Change-Id: Ie1aa9ce1779002973ec93f808ba5e86c569b9df4
2013-08-19 11:01:49 -07:00
Tom Finegan
15a708e416 Add set_uid() to mkvmuxer::Track.
Allow users of libwebm's MKV muxer to control the Track UID. This,
for example, allows creation of tests that rely on checksum comparisons
to verify output from the library.

Change-Id: I8b052e6dd5af734d76122b2a1b6b16382ffba214
2013-08-16 10:58:17 -07:00
Vignesh Venkatasubramanian
8206558561 Handling chunking_ being set to true on repositioning cues.
CopyAndMoveCuesBeforeClusters should return false (fail gracefully)
if chunking_ is set to true.

Change-Id: Idf4d573e3f15b59c25ee0774a7875e5dfda9c02e
2013-06-27 11:30:17 -07:00
Vignesh Venkatasubramanian
4ac7b755f4 Repositing Cues before Clusters
A whole new approach to repositioning Cues before Clusters. This
patchset adds a new function CopyAndMoveCuesBeforeClusters to the
Segment class. This function should be called after
Segment::Finalize() to obtain a copy of the same output file with
Cues positioned before the Clusters.

Removing everything else that was added to accomplish the same in
the previous few commits.

Also, adding std:: qualifier to one of the variables in
sample_muxer_metadata which was missed accidentally in the previous
commit.

Change-Id: I2810d06a6251325add2f5e54d32d1da6e2fe143f
2013-06-14 13:01:48 -07:00
Vignesh Venkatasubramanian
54ca052b1c Changing IMkvReadableWriter to IMkvWriteEOFReader
Changing the IMkvReadableWriter interface to IMkvWriteEOFReader.
Also changing the default implementation.

Change-Id: Id37ffd7ef0af2ff7a392fb4fb0b1b134664ab20f
2013-06-11 15:11:18 -07:00
Vignesh Venkatasubramanian
9b42d039ad Support for placing Cues before Clusters
Adding support for placing Cues element before the Cluster element. We
recompute the new offsets using a recursive algorithm and update the Cues and
Seek Heads with the updates offsets.

Change-Id: I038f1a403b1defa853b9026bd3e48f4ad1006866
2013-06-03 10:27:27 -07:00
Vignesh Venkatasubramanian
5af56bb9ee Elements and functions to support BlockAdditional
Adding elements and functions to support muxing of BlockAdditional element.
This is required for supporting muxing of streams with Alpha Channel (where the
Alpha data goes into BlockAdditional). Detailed design doc of Alpha Channel can
be found here: http://goo.gl/wCP1y

Change-Id: Idac144d9588de16685734850585ab7115ddd08a4
2013-04-24 16:16:14 -07:00
Frank Galligan
baefebcf1c libwebm: Fix BlockNumber on CuePoint
- libwebm was writing the BlockNumber of the next Block instead
  of the Block that was just written.

Change-Id: I344800fcea919a82d7f0a04a54cf510be3851ec6
2012-11-12 08:35:39 -08:00
Matthew Heaney
c99838a5fe Merge "mkvmuxer: add support for WebVTT chapters" 2012-10-31 18:03:59 -07:00
Matthew Heaney
2c5836837e mkvmuxer: add support for WebVTT chapters
Change-Id: I469ce3bd79a9b50b82e00ac8c63fc3d1db220887
2012-10-30 17:07:38 -07:00
Frank Galligan
50afbea946 muxer: Add support to force Cluster placement.
Change-Id: I7d4653561ca760885ba6926825ba6b80cdbea8ab
2012-10-29 09:24:41 -07:00
Matthew Heaney
7ef225de9f sample_muxer: added WebVTT support
Change-Id: If72d31ca4828adf39e4637003979a314e5dda98e
2012-09-28 10:38:19 -07:00
Matthew Heaney
711af0c505 mkvmuxer: add operations for muxing metadata
Change-Id: Ia17166ee9133b4841f7d206aa7d5ec81f800e994
2012-09-24 12:13:45 -07:00
Matthew Heaney
38173f9d49 add operation to add generic track
Change-Id: I34e4ab14c0a5b022b77b98d9403125550024e730
2012-09-21 16:37:30 -07:00
Frank Galligan
21a2bd14c7 Make AddCuePoint function public.
Change-Id: I08df2b604185d6ae1d63eb360e68e84efa2cebfa
2012-09-21 16:21:03 -07:00
Frank Galligan
9ec562f72d Add Track number to AddCuePoint function.
Change-Id: I67fd8db3d436f8931f5d50deeb1f1d41cfdc0836
2012-09-21 15:42:57 -07:00
Frank Galligan
a2ca300513 Merge "mkvmuxer: default track_num to 0 in AddTrack" 2012-09-21 14:08:08 -07:00
Frank Galligan
4df02ce68b libwebm: Add support for setting muxing app.
Change-Id: I78f4d08142aeeaacf5f9c175bab6a4993b917b1b
2012-09-21 12:17:03 -07:00
Matthew Heaney
4ffb162798 mkvmuxer: default track_num to 0 in AddTrack
Change-Id: I484cb56df7be7677a821db262c75cf8bdf1d30af
2012-09-21 11:55:47 -07:00
Matthew Heaney
76d9cf9cf4 mkvmuxer: handle large gaps in frame timestamps
Change-Id: If223a03cc37f2f373893c914e417475f62949717
2012-09-20 14:58:45 -07:00
Matthew Heaney
db20aaa2b1 mkvmuxer: refactored code that creates a new cluster
Change-Id: I5db03b0e1ea23f45820dd47b7be9e4b0422f3e6a
2012-09-14 10:17:09 -07:00
Matthew Heaney
c9e284b9e7 refactor code to make a new cluster
Change-Id: Ifa7938134494e3524d6479bd026aea6d1b309d52
2012-09-13 10:15:59 -07:00
Matthew Heaney
07ac1947f0 Change return type of Segment::WriteFramesAll()
Change-Id: I7fb45f1779c384bcc1cdea507f1f2f51c28dd827
2012-09-12 10:29:40 -07:00
Matthew Heaney
0edf087bbb Refactor Cluster::AddFrame member function
Change-Id: Ibff460918243647eb76785508bb50490bc1d8561
2012-09-11 14:58:56 -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
Frank Galligan
28d54555a7 Fix for audio and video track size calculation.
- There was a bug where the calculation for the audio and video
track size where the code would calculate the size of the track
elements minus the size of the audio or video elements. If the
coded size of the track elements was one byte smaller than with
the audio or video elements then the muxer would return an
error.
- Fixed another issue that the track's virtual Size function was
calling the Track's PayloadSize function where it should have
been calling the virtual PayloadSize function.

Change-Id: Ie6d66d6d720334180a11e06926a3bd8c7788a1f1
2012-01-25 13:23:40 -05:00
Tom Finegan
1e37a264f1 mkvmuxer: Add element start notification.
Just before the first byte of an element identifier is written
the muxer calls IMkvWriter::ElementStartNotify to report the
position of the element in the WebM stream.

Change-Id: Iac40090587bd9496b05f41203aace00902f5606e
2012-01-19 20:21:35 -05:00
Tom Finegan
01d5924817 mkvmuxer: Cosmetics.
- Use c++ versions of C library includes.
- Make Segment::~Segment non-virtual.

Change-Id: I868c1f3769b5a87362efe99383cca880586b57f3
2012-01-19 20:21:35 -05:00
Tom Finegan
69df730519 mkvmuxer: Add Init method to Cluster and Segment.
Remove asserts on the MkvWriter pointer in each constructor,
and assign the pointer in each Init method. Update Segment::Init
usage site in sample_muxer.

Change-Id: Id940f76b50dc15603742e76afc04cdffe0ec4990
2012-01-19 20:21:25 -05:00