Commit Graph

40 Commits

Author SHA1 Message Date
Jerome Jiang
0ae757087f Fix android build failure with NDK r15b.
BUG=webm:1447

Change-Id: I8defe45cb94eb9c209ba72ce446786f24c14c0b8
2017-07-17 14:00:18 -07:00
James Zern
84e82579f7 disable -Wdeprecated-declarations in legacy code
this avoids downstream projects from needing to add this flag to their
build.

BUG=webm:1445

Change-Id: I03f3cc20496bc52245b6c3c013ae3c13936f4b4f
2017-06-20 19:18:42 -07:00
James Zern
a98f4950f6 AddGenericFrame: fix memory leak on failure
quiets a static analysis warning

Change-Id: I9fac3c495beefb0a76d0476573b95700662e082c
2017-05-01 18:50:20 -07:00
James Zern
da131dd350 AddCuePoint: fix memory leak on failure
quiets a static analysis warning

Change-Id: I288ab6216ecd066f7d6542a7465db1f182859c32
2017-05-01 15:18:38 -07:00
James Zern
b0cea9ce24 Add(Audio|Video)Track: fix memory leak on failure
quiets a static analysis warning

Change-Id: Iaa6909e94deae81ace3e65f37ab746d72031620f
2017-05-01 15:17:30 -07:00
Vignesh Venkatasubramanian
35a3c88728 mkvmuxer: Turn off estimate_file_duration_ by default
Users who want this feature can explicitly turn it on. Since it
involves estimating, it should be off by default.

Change-Id: I3e934169d19b68a276c21d694179350c5b315a5a
2017-03-23 12:27:48 -07:00
Vignesh Venkatasubramanian
a0d67d081c mkvmuxer: Fix hard-coded data size in EbmlElementSize
EbmlElementSize for char* assumes that the varint encoding of
payload size is always 1-byte. Fix that by using the correct
number of bytes.

mkvinfo of the new gold file: http://pastebin.com/ncR7DqEf

Change-Id: I2d10708de77b2b8089900a8719ee3797dfb6994c
2017-03-07 11:42:16 -08:00
KO Myung-Hun
c36112caa0 mkvparser: #include sys/type.h
On OS/2, off_t requires sys/types.h.

Change-Id: Ic307347a62754b0b6d940c4d89228038f5f4e84b
2017-02-01 20:13:14 +00:00
Tom Finegan
4956b2dec6 mkvmuxer: Force new clusters when audio queue gets too long.
Force creation of a new Cluster when writing queued audio would
cause an error due to violating maximum block duration.

BUG=675521

Change-Id: I6ad09c2a2f71d95bb04eed5ead04dc8072aaa59d
2017-01-12 13:15:46 -08:00
James Zern
9732ae991e EbmlElementSize: quiet uint64->int32 conv warning
Change-Id: I189c3a3ee2f946034a5f7ad1bd5e1d0a301d24c0
2016-10-18 15:31:17 -07:00
James Zern
da04ebae9b SetProjectionPrivate: quiet uint64->size_t conv warning
Change-Id: Iae467f650770e98ef59fede6d714e222b502f5bb
2016-10-18 15:30:48 -07:00
James Zern
3bb0dfae6a cosmetics: fix a couple lint warnings
remove trailing ';' and s/const static/static const/

Change-Id: Id5587b057a8e2b088eac8538d8e2b5e9053fdcf4
2016-10-17 18:28:38 -07:00
Frank Galligan
c04a134986 Add support for overriding PixelWidth and PixelHeight.
Change-Id: I226f6bb6be99e71373fcbd8ec9b9d556064305e4
2016-10-15 18:19:19 -07:00
Frank Galligan
c0160e0ab5 Add support to explicitly set segment duration.
Adds a flag to sample muxer to copy input file's duration.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1100

Change-Id: I9138f0301fa5c9f467c802d75e6ba32db156ae4f
2016-10-14 17:20:20 -07:00
Frank Galligan
02bc809f9d Add support to estimate file duration.
The code will estimate the file duration if the last block duration is
0. This is not totally correct, but better then what we currently have.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1100

Change-Id: I8f81df0bd592e6f7b1925fa2637a2e09cf182742
2016-10-14 14:35:30 -07:00
James Zern
26f434423f MakeUID: quiet unused param warning in Android builds
Change-Id: Id389af1d92184009c511ff641e86ac27c6767567
2016-09-28 18:51:03 -07:00
Tom Finegan
5023f2b5ca mkvmuxer: Fix Colour::Valid()
Ignore Colour::kValueNotPresent and allow writing of partial
Colour elements, and add a test confirming this works.

Change-Id: I77e6bd0d92cadc46142af92de2f9f474006dceb7
2016-09-01 11:56:03 -07:00
Tom Finegan
93e9fb35f9 Validate Colour element values.
webm:1284

Change-Id: Idc9fc2eee41e7ab445d90366c5ee3e8ca2509c81
2016-08-31 21:18:24 -07:00
Tom Finegan
027861614c mkvmuxer: Colour accessors/mutators.
Make data members of Colour and children private, and add
accessors and mutators for the changes members.

Change-Id: I203f6b4e8047cd4dae5c1b662649b535e05148fd
2016-08-30 18:13:51 -07:00
Tom Finegan
65fee06599 mkvmuxer_sample: Add support for Projection element.
Part of the Spherical Video V2 draft specification:
https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md

Change-Id: If8cc7a102933ca7fe81990919dbabe7db97812f8
2016-08-29 14:51:25 -07:00
Tom Finegan
483a0ff800 mkvmuxer: Add Projection element support.
Part of the Spherical Video V2 draft specification:
https://github.com/google/spatial-media/blob/master/docs/spherical-video-v2-rfc.md

Change-Id: Ia935ba975a0f01c1fb2919325ab7f70254c2ed10
2016-08-29 14:29:25 -07:00
Tom Finegan
725f36207e mkvmuxer: Fix memory leak when Colour is set multiple times.
Change-Id: I5650ca1116a5ae678b11ac5f6a8abf1590bc9e3f
2016-08-26 21:08:30 -07:00
Tom Finegan
9828e39874 mkvmuxer: Set default doc type version to 4.
mkvmuxer can write matroska v4 elements in all modes, but does
not always confirm that the doc type is high enough for all
elements written. The main culprits are Colour and its
children. Avoid problems by using 4 as the default version.
This avoids problems in all cases but those where users who
know what they are doing have written the EBML header manually.

Update the test files because the new default causes the file
compare abuse in the muxer tests to fail.

Update expected doc type version in the parsing tests.

BUG=webm:1201

Change-Id: I4c69000af4c1d5efe66315c17f3953344ef04993
2016-08-11 14:20:53 -07:00
Tom Finegan
76630ca4a3 mkvwriter: Fix shorten-64-to-32 warning in 32 bit builds.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1207

Change-Id: I2dc1ce59ebf8051c9661b919813d5ab7cb115da0
2016-05-06 11:40:44 -07:00
Vignesh Venkatasubramanian
cbd676bb66 mkvmuxer: Fix leak when a Cluster isn't finalized
There's a leak in the following scenario:
  * AccurateClusterDuration is set to true.
  * Add a few frames.
  * An error is encountered while adding a frame and the
    application bails without calling Cluster::Finalize
  * All the frames we queues in QueueOrWriteFrames now leak.

This patch fixes this scenario by delete'ing any left over frames
in the Cluster's destructor.

Change-Id: I104f6814db18a86fae9877decfe6cc75b8937fcb
2016-04-28 12:30:29 -07:00
Tom Finegan
9a235e0bc9 mkvmuxer: Set doctype to matroska when muxing non-WebM codecs.
Also, add some constants for WebVTT codec ID strings so they
won't cause doctype to incorrectly change to matroska.

Change-Id: I4740a3e45b28a22e462601b9ce051aa01817dace
2016-04-28 08:44:14 -07:00
Vignesh Venkatasubramanian
87832d487a mkvmuxer: Fix Segment::Finalize in kLive mode
Do not call Cluster::Finalize in kLive mode unless
accurate_cluster_duration_ is set.

Change-Id: Id2627b5df9eaee065e12d08b494ee02ae0a33564
2016-04-15 20:32:19 -07:00
Tom Finegan
ec479287ff mkvmuxerutil: Revert to using mkvmuxertypes.
- The direct change to stdint.h types causes too much downstream
  churn. Need an intermediate step or a wrapper because quite a
  bit of user code explicitly casts args passed to mkvmuxerutil
  functions to types defined in mkvmuxertypes.
- Update call sites in mkvmuxer to avoid ambiguity errors.

Change-Id: I018445b3d8ab1da776ecdb19a290ac00af63c2cf
2016-04-14 12:58:38 -07:00
Tom Finegan
32d5ac4941 mkvmuxerutil: Fix MSVC build.
Avoid a couple implicit casts.

Change-Id: I3299272769d15c08c733ced1b0f95bdf75848e6f
2016-04-08 21:46:31 -07:00
Tom Finegan
784b6fe4fe mkvmuxer: Revert changes to IMkvWriter types.
- Restore integer typedefs in mkvmuxertypes.h.
- Revert integer type changes in IMkvWriter declaration.
- Revert integer type changes in mkvwriter.{cc,h}

Change-Id: I3e9f8a3d079f485a3ea051f7477c803f9c9087e4
2016-04-08 10:50:57 -07:00
Vignesh Venkatasubramanian
eb50da8e38 Option to write timecode using fixed # of bytes
Add an option to write the cluster timecode using exactly 8 bytes
irrespective of the actual number of bytes required to write it as
an ebml integer.

This could be useful for players that want to rewrite the timecode
in-place (e.g. live streaming).

Change-Id: I1a049251f00ab65591d71e169129f5145a8c8863
2016-04-06 15:09:19 -07:00
Tom Finegan
c1991fea81 mkvmuxer: Add missing Segment member initializer.
Change-Id: If8d6e12de3671e864ecb6c5ca0873a1fc69c3820
Segment::accurate_cluster_duration_ init missing from ctor.
2016-04-06 13:37:07 -07:00
James Zern
bb48a3fc63 mkvmuxerutil: remove stray 'int32'
fixes Android compilation of this file

Change-Id: Ib469c750baf05837f6475487a6f03465e56a9013
2016-04-02 11:45:32 -07:00
Tom Finegan
da6439685d cmake/msvc: Disable C4996 project wide.
MSVC C4996 triggers upon use of functions like fopen, and suggests
use of non-portable Microsoft replacements. Disable it project wide,
and remove the pragmas littered throughout the tree.

Change-Id: I8b890bbfd3cd7224c25350bd28f334facd8b7783
2016-03-30 12:32:22 -07:00
Tom Finegan
26306f9214 mkvmuxer: Remove unused Cluster ctor overload.
Remove Cluster ctor overload unintentionally added during a merge
because the default ctor is causing an uninit'd memory error in
valgrind.

BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1161

Change-Id: I21b8110488bc6def0a3b5d07cbede37170087e6d
2016-03-29 14:32:43 -07:00
Tom Finegan
0d765974cd mkvmuxer: Fix build with GCC 5.3.
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1160

Change-Id: I7d8a0a7fa1aef2e459e54effd448186c850453be
2016-03-29 12:21:10 -07:00
Tom Finegan
cbe5c40d12 Restore original namespaces for mkvmuxer and mkvparser.
Wrapping mkvmuxer and mkvparser in the libwebm namespace is no
longer necessary now that the tree reorganization is complete.
Put mkvmuxer and mkvparser namespaces back in the global
namespace to avoid unnecessary churn in downstream code.

Change-Id: I13a4fe0143d20bb2bb6038078c68636ff2af0c29
2016-03-21 14:41:49 -07:00
Tom Finegan
504e0f2d5b Mass file extension update.
- Use .cc and .h everywhere.
- Update includes/include guards.
- Remove extra makefile targets necessitated by previous mix
  of cpp/cc.

Change-Id: I7aad29152d4177937f8f42927c16c6572228c104
2016-03-21 14:41:47 -07:00
Tom Finegan
01db4c2d83 webmids: Move to common/ sub dir.
Change-Id: I87d0cbd78203a6680108e9e36588ff35e7ae8a4e
2016-03-21 14:41:24 -07:00
Tom Finegan
f578419a01 mkvmuxer: Move sources to mkvmuxer/ sub dir.
Change-Id: I22dff1e2ece102c294081ab2ec8600fdb872922e
2016-03-21 14:41:19 -07:00