Commit Graph

769 Commits

Author SHA1 Message Date
James Zern
9b97ca197d vp9_header_parser_tests: check parser return
ensure ParseUncompressedHeader() succeeds with valid bitstreams

Change-Id: I1e3900fc08f3b6b2e86bc2f59fd8fd96bc26ad0f
2017-04-21 15:15:26 -07:00
James Zern
300d6d8719 CuePoint::Find: check Track pointer
replace assert with a check of the pointer, this is a public function so
should be tolerant of invalid parameters

BUG=webm:1415

Change-Id: I28a3a2ef905d62f11928dbbe54c119411d2b1f74
2017-04-19 23:24:27 -07:00
James Zern
50c44bb44d webm_info,OutputCues: fix indexing of tracks
use GetTrackByIndex() rather than GetTrackByNumber(). the former is
0-based the latter is by track id, this loop iterates through all tracks
based on the track count.
fixes a segfault with tracks non-starting at 1 / increasing by 1.

BUG=webm:1415

Change-Id: I916328575d0871cf4090b1d123644d6f01e6ffb1
2017-04-19 23:10:33 -07:00
James Zern
a0d27f0d51 mkvparser,Block::Parse: remove incorrect assert
this path has been error checked since:
986b64b mkvparser: Add error checking in Block::Parse.

BUG=webm:1405

Change-Id: I1c17c05076455f25ab888555d71d7b27c032e9dd
2017-04-18 12:45:43 -07:00
James Zern
784fc1bb7c vttdemux,CloseFiles: check file pointer before closing
BUG=webm:1405

Change-Id: I7729277c632d40d478aa80ca6a009f95038196fb
2017-04-17 15:55:17 -07:00
Tom Finegan
c59278c4b4 Merge ".gitattributes: force mkv/webm to be treated as binary" 2017-04-12 15:55:58 +00:00
James Zern
b4522c1cdf .gitattributes: force mkv/webm to be treated as binary
Change-Id: I91463cd9b709dcfbb4aedc128b89f98f40550f69
2017-04-11 12:45:30 -07:00
Tom Finegan
9bbec4c905 Fix permissions on test file.
Change-Id: I062b685899e9125a4da29914357a494d2c63e256
2017-04-10 09:32:51 -07:00
James Zern
2cef4d51a2 mkvparser:Parse: s/FLT_MIN/-FLT_MAX/
FLT_MIN is the smallest finite value (numeric_limits::min()) -FLT_MAX is
the correct for the most negative (numeric_limits::lowest())

http://en.cppreference.com/w/cpp/types/numeric_limits

BUG=b/36255773
BUG=webm:1381

Change-Id: Iaaff611acffc3df28fef12af81ac5299791f0148
2017-03-23 16:27:41 -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
Tom Finegan
5a418303e3 mkvparser: Avoid double free when Chromaticity parse fails.
PrimaryChromaticity::Parse never owns the PrimaryChromaticity
it allocates-- avoid freeing it because doing so results in a
double free when the MasteringMetadata dtor runs.

BUG=webm:1381

Change-Id: Ief0159f6ab667234e3fdc51c65f23ef5efb32a71
2017-03-21 10:44:09 -07:00
Tom Finegan
67e3ffa908 mkvparser: Avoid casts of values too large for float in Projection elements.
Return a parse error when values are out of range.

BUG=b/36255773

Change-Id: I977c41c9108b97592f3707bf8c01373cf36f2365
2017-03-20 14:03:19 -07:00
James Zern
87bcddf0e5 vttdemux::ChapterAtomParser: check for NULL display string
prevents segfault due to strlen(NULL)

BUG=webm:1382

Change-Id: I536663e287d151e11bf7074349a34d922cb9856a
2017-03-09 12:50:41 -08:00
Vignesh Venkatasubramanian
992a330ec0 Merge "Update .gitignore" 2017-03-08 02:41:03 +00:00
Vignesh Venkatasubramanian
a534a24f58 Update .gitignore
Update .gitignore to reflect recent changes in binary names.

Change-Id: I4c010c5b948a2824c259fac37ad812be19d9e200
2017-03-07 13:53:44 -08: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
686664eba2 Fix cmake generation warnings on Windows.
A target must exist before its properties can be set. Defer
libwebm target rename on windows until after creation of the
webm library target.

Change-Id: I29c5e90f1f653a00ff156316c03b0ffd78e9a998
2017-01-26 07:57:32 -08:00
Tom Finegan
2b2c196558 cmake: Fix required flag check.
It always passed after first test due to lack of CACHE in unset()
call. Also:

- Fix flag name in error message.
- Use actual flag instead of hard coded -std=c++11

Change-Id: I29c0dc4fd0f5ce97f658919a5739e15831a00281
2017-01-23 10:58:45 -08:00
Tom Finegan
4494ce468a Merge "Cmake refactor." 2017-01-19 23:50:26 +00:00
Tom Finegan
166e40fa97 Cmake refactor.
- Split sources from targets. Source files are stored in list variables,
  and targets now use the list vars.
- Surface all build settings control in CMakeLists.txt.
- Remove individual C++11 tests in favor of requiring support
  for --std=c++11.
- Improve organization; stop reopening the same if's.

Change-Id: I1989803fdfd9c032f417a5fc12985671455148bd
2017-01-19 08:40:31 -08:00
Tom Finegan
9fb774ab80 Add missing include in webm2pes.cc.
We need <algorithm> on some platforms.

Change-Id: I65fa3ad52265b05c4141e14d97d6de0af1649b29
2017-01-18 07:26:30 -08: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
Tom Finegan
54f155986d cmake: Cache results of CXX flag tests.
Avoid re-testing to improve cmake build and regen speed.

Change-Id: I8e2fe6601036cc7d176cdc3738616261a2da408b
2016-11-14 19:45:51 -08:00
Tom Finegan
81c73fc78e mkvparser: Avoid alloc failures in SeekHead::Parse.
Some run times return NULL pointers when creating 0 length
arrays. Avoid the inconsistency by skipping allocation when
the length of the SeekHead entry or void element array
is 0.

BUG=webm:1313

Change-Id: I28b4eac1d3e0ba968147637883f6e37c089e8573
2016-10-31 12:11:56 -07: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
5e1d131e6c Merge "mkvparser,Projection::Parse: fix int->bool conv" 2016-10-18 22:13:09 +00:00
James Zern
6db32d5f6e mkvparser,Projection::Parse: fix int->bool conv
this would have incorrectly returned true on parse failure

Change-Id: I1ae6fc2aae09491aa3cda47a5414529fc7a3848f
2016-10-17 23:34:06 -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
James Zern
0e179d683e update .clang-format
generated by version 3.8.1
local changes from --style=Google

3a4
> # Generated with clang-format 3.8.1
10c11
< AlignTrailingComments: true
---
> AlignTrailingComments: false
15,16c16,17
< AllowShortIfStatementsOnASingleLine: true
< AllowShortLoopsOnASingleLine: true
---
> AllowShortIfStatementsOnASingleLine: false
> AllowShortLoopsOnASingleLine: false
37c38
< BreakBeforeTernaryOperators: true
---
> BreakBeforeTernaryOperators: false

Change-Id: I4ded7e36fb8bd5407cfba6d1c4f86e0bec620c0c
2016-10-17 15:41:56 -07:00
Frank Galligan
fc5f88d3d1 Fix temp files being left on system.
The webm temp files for testing and mkvmuxer_sample were not being
deleted.

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

Change-Id: I5d402de4b434965185e0fe73f2efd5f4dad8c6d6
2016-10-15 20:54:57 -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
Frank Galligan
c97e3e7d60 Add support to output sub-sample encryption information.
See http://wiki.webmproject.org/encryption/webm-subsample-encryption
for the format.

Change-Id: Ia5d6f3566b92c46911704108d3e86cd0fac9ee34
2016-10-13 09:04:52 -07:00
James Zern
26f434423f MakeUID: quiet unused param warning in Android builds
Change-Id: Id389af1d92184009c511ff641e86ac27c6767567
2016-09-28 18:51:03 -07:00
Frank Galligan
d6af52a1e6 Change check to fix compile error.
Change-Id: I01490cca4a0b6ae51b20117738a723b8c9788919
2016-09-15 15:33:23 -07:00
Michael Bradshaw
17200208c5 webm_parser: Add Mesh value for ProjectionType
Change-Id: I0e2be134cfefdb62edc54288720523646d01479a
2016-09-13 18:16:54 -07:00
Michael Bradshaw
78f2c5ab78 webm_parser: Use ./ prefix for includes
Fixes a lint presubmit check.

Change-Id: If06a7b11c18742dfe659136736082945a4853b3e
2016-09-08 15:42:22 -07:00
Michael Bradshaw
da62f659e4 webm_parser: Remove webm/ prefix from public includes
Using a webm/ prefix requires clients to add the webm_parser/include
path to their header search paths. This is inconvenient and an
unnecessary restriction.

Change-Id: If73a4433ad42f326a544766beca5f05710f52243
2016-09-07 16:57:44 -07:00
Michael Bradshaw
e15e8f2cc7 webm_parser: Update README build instructions
Change-Id: Iade055ff076b107ac1665493dad18e812025c31f
2016-09-01 15:52:18 -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
cf1620444f mkvmuxer_tests: Actually test cue points in the cue point test.
Instead of blindly doing a file compare and hoping that we're not
in a garbage in garbage out situation.

Change-Id: Ie2f278e09ad67b3e8f40e602fcdd5c9ffb5e1b7d
2016-08-31 21:18:30 -07:00
Tom Finegan
93e9fb35f9 Validate Colour element values.
webm:1284

Change-Id: Idc9fc2eee41e7ab445d90366c5ee3e8ca2509c81
2016-08-31 21:18:24 -07:00
Tom Finegan
8036925b43 mkvparser_tests: Add Projection element test.
Change-Id: Ib57449f409548b23ae1d788ca07dc19ba21e7763
2016-08-31 10:00:05 -07:00
Tom Finegan
f52d38cc5c mkvparser_tests: Add Colour element test.
Change-Id: Ifc0c9db863a0ebe17dbab0e94b82b6a04dd64926
2016-08-31 10:00:04 -07:00
Tom Finegan
826436a42f mkvparser: minor SeekHead::Entry clean up.
- Store actual element ID in SeekHead::Entry id field (instead
  of a decoded EBML int, which is completely _wrong_).
- Add a SeekHead::Entry constructor so we get initialized values
  in SeekHead::Entry's when parsing an Entry fails.

Change-Id: I152fae54628cb84918917139dba0cd0b42a44a57
2016-08-31 10:00:04 -07:00
Tom Finegan
24fb44aa1a mkvmuxer_tests: Add Projection element test.
Change-Id: I9a1e56d0846f43851ed0430ec52e2d7b816661fc
2016-08-31 10:00:04 -07:00
Tom Finegan
1e0a8eaa3c mkvmuxer_tests: Add Colour element test.
Change-Id: I5348930fb74d43f3fc4e1815d13a525bda70f4a0
2016-08-31 10:00:02 -07:00