Commit Graph

71 Commits

Author SHA1 Message Date
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
d6af52a1e6 Change check to fix compile error.
Change-Id: I01490cca4a0b6ae51b20117738a723b8c9788919
2016-09-15 15:33:23 -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
Tom Finegan
2346f8fafa Add mkvparser wrapper functions.
Add a couple mkvparser wrapper functions for testing mkvmuxer
output. Also expose HasCuePoints() via test_util.h for use
in cue point related tests.

Change-Id: I77321840926f41b60b6ceac65a1e3cfd79b7d2c2
2016-08-29 14:51:28 -07:00
Tom Finegan
8f521f2192 mkvparser_tests: Add invalid BlockGroup test.
Change-Id: I2b24859a92d2beb5558c2afa817237c1f78f644d
2016-08-25 13:18:19 -07:00
Tom Finegan
837746f4d2 mkvparser_tests: Add invalid block test.
Add test that confirms expected failure when a block
that ends beyond the current cluster is encountered.

Change-Id: I27abcab6d00b78c14b7ca00f51c97e43c5cdd34c
2016-08-23 17:55:52 -07:00
Tom Finegan
a112d71cd0 mkvparser_tests: Refactor invalid file loading code.
Combine duped loading code into one method.

Change-Id: I3c4f9b7003f032a04b734f452f3c684d1af8e841
2016-08-23 17:55:49 -07:00
Tom Finegan
5dea33eacc Disambiguate test source and target names.
Rename source files and targets to better reflect what is
actually being tested.

muxer_tests => mkvmuxer_tests
parser_tests => mkvparser_tests

Change-Id: I921901f37d269f294b96ba20732b31c27f81945b
2016-08-23 10:29:30 -07:00
Tom Finegan
125049eecd parser_tests: Add another truncated chapter string test.
Causes mkvparser to fail in a slightly different way.

Change-Id: Id60fd43e6d0ef1871842367d19db52f60a8721cc
2016-08-19 12:44:43 -07:00
Tom Finegan
1de8d4cb4f parser_tests: Add truncated chapter string test.
Change-Id: I1714fbfea5bab61cca61cd32a0a0d30315ed56fc
2016-08-19 12:13:14 -07:00
Tom Finegan
ff8c2b6af7 parser_tests: Move cue validation to test_util.
And tidy it up a bit.

Change-Id: I68e7f16ad2aa922fdb064802e8986a6955364c32
2016-08-19 11:57:08 -07:00
Tom Finegan
4b0690faa2 parser_tests: Add invalid lacing test.
Also fixes leak this test exposed in mkvparser::Cluster.

Change-Id: I06ae11b72bc89219b6b2b407b4cc215982e3ae65
2016-08-19 11:57:05 -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
b451c3ba96 Add a basic video frame storage class.
Includes simple tests.

Change-Id: I52276686d6c2bc7b62d260af37affe78aa4dcf50
2016-07-22 15:07:33 -07:00
Vignesh Venkatasubramanian
cc62ecd23f Add test for Cluster memory leak
Tests the scenario described in this CL:
https://chromium-review.googlesource.com/#/c/341251/

Change-Id: I4d732eebc11140691ed516321cf490905991720b
2016-04-29 11:42:36 -07:00
Frank Galligan
eacb314525 Merge "Add parsing support for new features in CodecPrivate." 2016-04-29 00:17:28 +00: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
Frank Galligan
47f2843e79 Add parsing support for new features in CodecPrivate.
Adds support for parsing bit depth and chroma subsampling features.

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

Change-Id: I8d11829f5d43a518cbe0e5c0bdd4fd37db7b6266
2016-04-27 09:27:24 -07:00
Frank Galligan
296429a7dc Add support to parse VP9 profile.
This is the VP9 profile contained in the CodecPrivate data.

Change-Id: If5fd5667bfc86ff596354457539da363367128db
2016-04-18 12:15:59 -07:00
Frank Galligan
a1dc4f2f22 Fix parsing of VP9 level.
The VP9 level is contained in the CodecPrivate data.

Change-Id: I65475363ee230b422a8cdce8172f6262cb3329e7
2016-04-12 23:00:03 -07:00
Tom Finegan
d3656fdb8b muxer_tests: ignore iwyu re gtest-message.h
Just pull it in via gtest.h.

Change-Id: If04d569a74da925f8544858861057af497f3f2bf
2016-04-12 14:49:21 -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
5c50e310e7 Add support for parsing VPx track codec private data.
Currently only the VP9 profile level is supported.

http://www.webmproject.org/vp9/profiles/

Change-Id: Iff7238e104621b53fdd51a67d752bd72b2dbbacb
2016-04-04 11:16:33 -07:00
Tom Finegan
ccf75f67a0 msvc/muxer_tests: Silence integer conversion warnings.
Change-Id: Ic11a83968aa5a70ca364ebce97d465f74cda5eee
2016-03-31 10:43:10 -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
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
f578419a01 mkvmuxer: Move sources to mkvmuxer/ sub dir.
Change-Id: I22dff1e2ece102c294081ab2ec8600fdb872922e
2016-03-21 14:41:19 -07:00
Tom Finegan
12f6dc34b4 Use <stdint.h> types instead of custom typedefs.
Change-Id: Ia43b81649a14d0509aef2119be7a0ea9be955201
2016-03-21 12:41:45 -07:00
Vignesh Venkatasubramanian
0407360dcf mkvmuxer: Write last block in each Cluster with Duration
This helps browsers implementing Media Source Extensions (MSE) to
know the exact duration of a Cluster without relying on the next
Cluster.

Change-Id: Idd0422e432430c5702a4864740f89fc6d3c85189
2016-03-18 12:24:42 -07: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
clang-format
91ca780522 reapply clang-format
Change-Id: Ic04e8429b07fe9b7dc15dc836d16ba9f30317ee2
2016-03-16 12:18:08 -07:00
Vignesh Venkatasubramanian
90861d4fb6 Clean up AddAudioTrack in muxer_tests
Moving AddAudioTrack into a separate function and keeping it
simple so that it can be re-used from other tests that might
require adding an audio track.

Change-Id: Ia60ed63ddbe617764596eb9c5a2bf96108c47cdd
2016-03-15 17:23:13 -07:00
Tom Finegan
18834bcad0 iwyu/parser_tests: Update includes.
Include what you use analysis based include update.

Change-Id: I6bfb2c126cb8ade813e820d56bc0f965c8880c3b
2016-03-09 13:54:09 -08:00
Tom Finegan
9c00ae32e3 iwyu/muxer_tests: Update includes.
Include what you use analysis based include update.

Change-Id: I2f0c2626fe9f365a0dd9bcf47e873c1105e2e4d9
2016-03-09 13:51:34 -08:00
Tom Finegan
41a17eb108 iwyu/test_util: Update includes
Include what you use analysis based include update.

Change-Id: I92a2cb481f5475be51ffc8651782df7babe852ef
2016-03-09 13:50:56 -08:00
Tom Finegan
b6174be19d muxer_tests: Fix windows brokenness.
- Wrap MkvWriter in std::unique_ptr to allow use of the
  MkvWriter(FILE*) ctor (because MuxerTest owns the FILE*).
- Test temporary FILE* in Init(); don't assume it's valid.
- Close output FILE* before attempting to read it in
  CuesBeforeClusters().

Change-Id: I4848adec7a24c8987fdd0924e7474b264837e8a9
2016-03-08 11:25:50 -08:00
Tom Finegan
b9dc4ac09c test_util: Don't pass NULL to std::string() in GetTestDataDir().
Change-Id: Iaafa78a17580d962e260d9553b11d2cd3cb4726f
Also: quiet MSVC warnings that suggest making code non-portable.
2016-03-08 11:15:43 -08:00
Tom Finegan
1f74651b5b webmts: Move PES/TS sources to m2ts sub directory.
Change-Id: I5c02b62460a6bf8dd73fb9274d1668a5a13af373
2016-03-07 14:32:08 -08:00