Commit Graph

619 Commits

Author SHA1 Message Date
Vignesh Venkatasubramanian
8e96863b56 mkvmuxer: Set is_key to true for metadata blocks.
Per matroska semantics, all metadata blocks should be considered
key frames. Set it to true in AddMetadata functions.

Change-Id: Ibc26845dc6cc72ccbf90ae8d4dcc27c948e8a375
2015-06-01 10:49:19 -07:00
Vignesh Venkatasubramanian
a9e4819e9f sample_muxer: Use AddGenericFrame to add frames.
Use Segment::AddGenericFrame to add frames to the output file. The
other AddFrame* functions will soon be deprecated and this will be
the preferred way of adding frames.

Change-Id: I3ed862543a1e0199617dc613a1760ff5f233ce7d
2015-06-01 10:32:07 -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
James Zern
f99f3b20fb mkvmuxerutil::EbmlDateElementSize: remove value param
this is unused as the size of dates is fixed:
Date - signed 8 octets integer in nanoseconds with 0 indicating the
precise beginning of the millennium (at 2001-01-01T00:00:00,000000000
UTC)

Change-Id: I7d44c92a6b746e92e4041238b110115b56e38a93
2015-05-23 10:33:12 -07:00
James Zern
ff572b5399 Frame::IsValid: fix track_number check
previously IsValidTrackNumber() expected a track_number > 0
this also fixes a warning:
'comparison of unsigned expression < 0 is always false'

Change-Id: I839863986ff776aae59e38ee7e4a1a710081303a
2015-05-23 10:32:56 -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
Tom Finegan
4baaa2c9a3 Add framework build script: iosbuild.sh
Builds WebM.framework.

Change-Id: I6f71defa18a7cbb21e290dbbb819a85353912e53
2015-05-06 10:33:48 -07:00
James Zern
3d06eb1e2c PATENTS: fix a typo: constitutes -> constitute
Change-Id: Iec2d5fea1b89fc97f981f5cd0a545b83110bd8c2
2015-04-30 15:40:13 -07: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
Leonel Togniolli
d3a44cd549 Fix track transversal when listing Cues on sample
It could skip tracks or crash if track numbers were non-sequential or tracks were missing.

Change-Id: I485bd4c14c73500775f2944b4486f9a5e154a5e8
2015-04-11 00:24:30 +01:00
Leonel Togniolli
c6255af02a Tweak .gitignore so git status is clean after checkout and build:
- added missing underscore to sample_muxer
- added cmake and make related files

Change-Id: Id9a6f12be83d28c95941098b57b61a7a11510f1b
2015-04-09 00:38:17 +01:00
James Zern
b5229c7bc8 Makefile.unix: s/samplemuxer/sample_muxer/
this matches the target name used in CMakeLists.txt and the writing app
stored in the output file

Change-Id: I161675c6bff8ebfa041331a329589441d3874514
2015-03-18 15:33:06 -07: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
a4b68f825e parser: Fix bug in Chapters::Atom::Parse()
Reading the UID is considered to be failed only if status is < 0
and not the value read.

Change-Id: I88fee3aa5b8c323d099930a6823406c012b70f81
2015-03-03 12:08:28 -08:00
Tom Finegan
bab0a002c5 cmake: Set library and project name the proper way on Windows.
Revert previous hack and use target properties to correct project
and library names.

Change-Id: Ib35da1cedcedf86f3f020d879cd39199fd236572
2015-03-02 12:43:56 -08:00
Tom Finegan
feeb9b13ff Set library name to match Windows expectations.
Back to libwebm.lib from webm.lib.

Change-Id: I6ced362c987a7b5d3d56365a1ed53de7bf9f849b
2015-02-25 15:37:05 -08:00
Vignesh Venkatasubramanian
b9a549b467 Fix CMakefile to generate libwebm.a
The existing CMakeLists.txt ends up generating a static library
with name "liblibwebm.a" rather than "libwebm.a". This patch fixes
it.

Change-Id: I4dabac5158530714a38045b8af29e75ade0a939e
2015-02-25 14:04:04 -08:00
Tom Finegan
b386aa5c6b Add CMakeLists.txt and msvc_runtime.cmake.
- These files facilitate project/makefile generation.
- Remove old Visual Studio projects.
- Rename Makefile to Makefile.unix.

Change-Id: If786edd75d44c462538526c286eccc5cbf15d828
2015-02-13 16:07:01 -08:00
Vignesh Venkatasubramanian
b0f8a81df9 parser: Fix memory leak in Chapter parsing
Fix a memory leak in parsing Chapters element.

Change-Id: I95324299014174d3f0926d96022eeb747b07d1a7
2015-02-06 15:17:28 -08: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
Lajos Molnar
27bb7476dd allow subtitle tracks with ContentEncodings
This is allowed by matroska spec

Change-Id: I1842b6e7c6bab4ba0f86938bbe6b110be0c5435f
2015-01-13 12:56:25 -08:00
James Zern
623d182613 DoLoadCluster: tolerate empty clusters
previously only empty clusters of known size were accepted; with
clusters of unknown size the cluster has been successfully parsed and a
working copy of the file position updated, so parsing can continue.
clusters of this type are discarded as clusters of known size currently
are.

Change-Id: I3ef848768519ab7f1887a11629c50af72249cead
2014-10-01 12:53:14 -07:00
Lou Quillio
1156da8d29 Update PATENTS to reflect s/VP8/WebM/g
Sync with http://www.webmproject.org/license/additional/

modified:   PATENTS.TXT

Change-Id: I3e1b3a570b26ada0e6e0d344f1783ef0e3cd5fa1
2014-08-11 14:30:54 -07:00
Tom Finegan
0d4cb404ea mkvmuxerutil: Use rand() in MSVC builds.
Instead of rand_s(), which can make things unpleasant for downstream
projects.

Change-Id: Ie172867c28aaa43223dc5fb694eb4a4fd26515d6
2014-07-18 11:37:06 -07: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
James Zern
574045edd4 mkvmuxer: fix DiscardPadding
DiscardPadding is a signed int.
this change fixes 2 things:
- allows negative values for discard padding
- fixes cases where an unsigned value would be written such that on read
  the sign would be flipped

Change-Id: I9418da7a22c09768e02d5b61da8d01c2bccb5dee
2014-06-18 12:50:25 -07:00
Sergey Ulanov
8be63972fd Include crop elements when calculating size of Video element
Change acf788 added Crop* elements support, but they were not
added when calculating size of Video element.

Change-Id: I64495cc35406a28b86b40d915dbc291f45aa1263
2014-06-06 00:40:50 -07:00
James Zern
8f2d1b3cde mkvparser: fix DiscardPadding extraction
the element length was being read twice; the second attempt would
consume a portion of the discard padding field often failing due to
limitations in GetUIntLength.

Change-Id: Ibbe3f082e2d05460734a0e1f7d23f3c665e3f24b
2014-05-30 14:44:28 -07:00
Vignesh Venkatasubramanian
1c36c24694 mkvmuxer: fix style guide violations
fix a few style guide violations in mkvmuxer.cpp

Change-Id: If800a5d6851f8ba4b904341fd054e1c2091e281e
2014-05-29 08:30:30 -07:00
Vignesh Venkatasubramanian
568504e64e Merge "UUIDs can have their high bit set" 2014-05-23 09:01:20 -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
418188b03e Merge "muxer: codec_id is a mandatory element" 2014-05-18 12:48:29 -07:00
Vignesh Venkatasubramanian
07688c92d7 mkvmuxer: Reject frames if invalid track number is passed.
Reject frames if an invalid track number is passed. Also change sample_muxer
to reject files which have Block elements with invalid track numbers.

Fixes Issue #659: https://code.google.com/p/webm/issues/detail?id=659

Change-Id: Ie6cf39a409b68bb4d2261f308409ee0c36d5dd8e
2014-05-18 12:45:49 -07:00
Vignesh Venkatasubramanian
2a63e473d8 muxer: codec_id is a mandatory element
codec_id element for a Track is mandatory and it does not have a default.
Rejecting the file if that happens.

Change-Id: I4fb0dfcd4c09eeabf22634db7fdf6ca818c93917
2014-05-16 11:42:05 -07:00
Vignesh Venkatasubramanian
d13c017744 UUIDs can have their high bit set
mkvparser::UnserializeUInt() assumes that unsigned values never have
their high bit set. This is too limiting for UUIDs. In addition, the
Chapters::Atom::Parse() method would truncate a "negative" 64-bit UUID
value to 32 bits and return the truncated value as a status code.
This value then might or might not be treated as an error by the caller
depending on whether the truncated value was itself negative.

Change-Id: I15624ac62d0b02691a1405ee6a5f7eb441b3bc48
2014-05-16 11:25:22 -07:00
James Zern
249629d46c make Mkv(Reader|Writer)(FILE*) explicit
Change-Id: I2c6e0df3049903f8ea53babeacffaa87f6c222b0
2014-05-02 11:47:44 -07:00
Vignesh Venkatasubramanian
7f3cda494a mkvparser: fix a bunch of windows warnings
fix a bunch of windows warnings in parser.

Change-Id: Ia9a03879540595306d8fa2b90ceb9b3b5b0d93a6
2014-05-01 13:50:19 -07:00
Vignesh Venkatasubramanian
5c0617852f Merge "clang-format on mkvparser.[ch]pp" 2014-05-01 11:50:03 -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
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
c6767b94fd Change AlignTrailingComments to false in .clang-format
AlignTrailingComments set to true seems to be causing some unwanted
alignments. Turning it off.

Change-Id: I5fd99db90b00c76cc7891f2cd1c80ec69ae97697
2014-04-29 00:38:14 -07:00
Vignesh Venkatasubramanian
9097a0691b Merge "muxer: Reject file if TrackType is never specified" 2014-04-29 00:18:55 -07:00
Vignesh Venkatasubramanian
eddf9744cb Merge "clang-format on mkvmuxertypes.hpp and webmids.hpp" 2014-04-28 10:40:43 -07:00
Vignesh Venkatasubramanian
def325c010 muxer: Reject file if TrackType is never specified
According to matroska specification, TrackType is a mandatory element without a
default value [1]. But we have been producing invalid matroska files when
TrackType is never specified because we write 0 by default.

This patch will reject writing a track without specifying the TrackType value.
Specifically, this path will be triggered when Segment::AddTrack() is called
but there is no subsequent call to Track::set_type().

[1] http://www.matroska.org/technical/specs/index.html#TrackType

Fixes issue #769: https://code.google.com/p/webm/issues/detail?id=769

Change-Id: I4d75d169fd96c7e1fad278561f0e7a3e1135989c
2014-04-26 03:14:05 -07:00
Vignesh Venkatasubramanian
41f869cb0c Merge "clang-format on webvttparser.(cc|h)" 2014-04-25 22:19:26 -07:00