Commit Graph

56 Commits

Author SHA1 Message Date
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
Tom Finegan
1b895e97d0 Rename libwebm_utils to libwebm_util.
Use a single naming convention.

Change-Id: Ia48089b05e5a453a402d4b4e7f258a56bee8a001
2016-03-07 14:27:07 -08:00
Tom Finegan
e6a0033a8c Add file_util.
Move file utility classes and functions from testing/test_util to
common/file_util, and make them part of libwebm.

Change-Id: If5b25a63b20efacc16b0fecaa8876ade4ecc4b26
2016-03-07 14:27:03 -08:00
Tom Finegan
6dc81c1648 muxer_tests: Die immediately when unable to prep for file writing.
Change-Id: I42c4294b3089cf1a785eac3ce5ec7e47d534ea36
2016-02-29 13:44:27 -08:00
Tom Finegan
741ba686b9 muxer_tests: Replace std::tmpnam() with GetTempFileName().
Change-Id: I58d66666ba0a1ef27608265b53613dd046e7c1a3
2016-02-29 15:24:21 -05:00
Tom Finegan
6159e837e9 Merge "test_util: add missing include for close()" 2016-02-29 19:51:24 +00:00
Tom Finegan
ff81c74c97 parser_tests: Fix sign compare warnings.
Change-Id: I656f05407b88a3878920c779d49ebf89231f09f1
2016-02-29 11:33:43 -08:00
James Zern
163f57d232 test_util: add missing include for close()
Change-Id: I3825d3613e35dfdb0a5a2460a207f2d0662328f6
2016-02-27 11:11:39 -08:00
Tom Finegan
7c89eb576e Merge "test_util: Remove tmpnam() usage on non-MSVC targets." 2016-02-27 01:11:29 +00:00
Tom Finegan
c4b8686542 Merge "webm2pes_tests: Fix sign compare warnings." 2016-02-27 00:34:42 +00:00
Tom Finegan
82f376f356 test_util: Remove tmpnam() usage on non-MSVC targets.
Change-Id: Icd3a68fa4e52401a41f4afe52a6206d6092bc8fb
2016-02-26 11:45:35 -08:00
Tom Finegan
4d31d6bc16 webm2pes_tests: Fix sign compare warnings.
Change-Id: I92f4c18c51f26beea45246a9fa2f56a6369b9ecf
2016-02-26 11:44:06 -08:00
Tom Finegan
07ed7e01d1 muxer_tests: Fix sign compare warnings.
Change-Id: Icb549aeeb146b6dca4a89bf2b70f6fa50a893d38
2016-02-26 12:14:48 -05:00
Tom Finegan
ae2fbfe0cf parser_tests: Silence sign compare warning.
Change-Id: I5286cf99129cc8fd5336e792990886f43332b720
2016-02-26 08:57:43 -08:00
Tom Finegan
8c8cba6af6 webm2pes: Fix tests.
Abuse of vector::capacity and vector::reserve in combination with
abuse of vector::operator[] was a bad idea.

Change-Id: Id7bdb71888b9d0d174f5243f8cf2771d181888be
2016-02-09 20:05:32 -08:00
Tom Finegan
b873000acf parser_tests: Add validation of cues.
Make sure clusters are where the Cues element actually says they
are.

Change-Id: Ib2a4642d3bf6079d5f3985c30eeefc3b20503eaa
2016-02-05 09:48:37 -08:00