Commit Graph

487 Commits

Author SHA1 Message Date
Tom Finegan
93c4690449 webm2pes: Add PES packet parsing tests.
Add test that parses the first packet output by Webm2Pes.

Change-Id: I6d2282e0e87eed759abf2483994fc767f022f0ff
2016-02-02 09:54:22 -08:00
Tom Finegan
65ca38fa20 Merge "test_util: Fix gcc build." 2016-01-26 22:14:52 +00:00
Tom Finegan
520ca6c9d0 Merge "parser_tests: Fix gcc build." 2016-01-26 22:14:39 +00:00
Tom Finegan
37a38cab9a test_util: Fix gcc build.
Change-Id: I287b8c31f354bbf871d76a4b39109dd711af7b00
2016-01-26 13:37:51 -08:00
Tom Finegan
ee0ebbaa69 parser_tests: Fix gcc build.
Change-Id: I7f29d584aad377e2a04687e778b3d07806b28882
2016-01-26 13:37:25 -08:00
Tom Finegan
c32f970f54 Replace auto_ptr usage with unique_ptr.
Change-Id: I4061686fa4739b4e5c32dfaac341dfba393dd254
2016-01-26 13:02:11 -08:00
Tom Finegan
e569ab0f7c webm2pes/ts: Fix gcc build.
Fix the build and tidy up a couple things along the way.

- Add -std=c++11 to CMakeLists.txt CXX flags.
- Add missing include to libwebm_utils.h (<memory>).
- Setup CMAKE_CXX_FLAGS properly (allow user override).
- Add missing URL for gtest repo to README.libwebm.

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

Change-Id: I894729216737ff92f58a7b7601484ba8fba73b25
2016-01-25 12:18:56 -08:00
Tom Finegan
2e55d6c5f7 Merge "add bitcode embedding support for ios" 2016-01-25 17:44:24 +00:00
TETRA2000
0cfb2dcbcb add bitcode embedding support for ios
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1135

Change-Id: Id3940d25216dd9fe430ce86bc1684ffe53029eb2
2016-01-23 19:24:52 +09:00
Tom Finegan
bb8cefd516 webm2ts: Converts WebM VPx video to a MPEG TS.
Built atop webm2pes, takes the output from webm2pes and packetizes it
into MPEG TS.

Change-Id: Ia122479ee91a112ad7fe223a571ca6d7ba66d406
2016-01-22 20:28:04 +00:00
Tom Finegan
453bf44d32 webm2pes: Begin addition of tests.
Just the basics:
- Some new test utilities.
- Basic setup for webm2pes testing.

Change-Id: I16bf0f5ef36e7c01f2788b2c92600d6a936bbd40
2016-01-22 11:02:34 -08:00
Tom Finegan
9299bbb6ed libwebm: Googletest integration.
Add basic mux/parse tests and test data.

Change-Id: I3bef014f32ad4898d23bca792fb3fe275fe4e7c9
2016-01-11 18:46:55 -08:00
Tom Finegan
3bec1ba7a1 Merge changes I7bcb5b3e,I8ce733be,I98a928ff,I71910f24
* changes:
  libwebm_utils: Add FileDeleter.
  webm2pes: Add a WebM parser init method.
  webm2pes: Rename Convert to ConvertToFile().
  webm2pes: Fix super frame splitting.
2016-01-06 18:40:41 +00:00
Vignesh Venkatasubramanian
5c83bbec9a Fix ParseElementHeader to support 0 payload elements
BUG=https://bugs.chromium.org/p/webm/issues/detail?id=1125

Please see the bug description for more details. This patch fixes
parsing of the file attached in the bug.

Change-Id: I2e929b6ef0ee92ea6d034b501b44a62784edf9f1
2016-01-05 13:35:00 -08:00
Tom Finegan
be35869ce3 libwebm_utils: Add FileDeleter.
Put the FILE clean up functor in a common place to avoid duplication.

Change-Id: I7bcb5b3e4df7aa37bb90920ecb8acccf94eeaa57
2015-12-17 08:50:23 -08:00
Tom Finegan
d6db1e1960 webm2pes: Add a WebM parser init method.
Pre-refactor a little to avoid some code duplication.

Change-Id: I8ce733be0c9e07544fc25bd9890d68fb14a7e84d
2015-12-17 08:50:23 -08:00
Tom Finegan
aa3593ec36 webm2pes: Rename Convert to ConvertToFile().
Change-Id: I98a928ff5b00e8961183136316be3615fd7462fe
2015-12-17 08:50:23 -08:00
Tom Finegan
e8fca12fb6 webm2pes: Fix super frame splitting.
Super frame index is at the end of the frame; not the beginning. Adjust
length to process instead of offsetting the start point for breaking up
the super frame.

Change-Id: I71910f24cc060934bb974548a29617b985985ed9
2015-12-17 08:50:17 -08:00
Tom Finegan
3cb96b6e33 webm2pes: Move main() and helper functions into their own files.
- main() and Usage() to webm2pes_main.cc
- Other helpers to common/libwebm_utils.{cc,h}

Change-Id: I59e45f0e63449066b493c4e536e0be001372504c
2015-12-17 08:38:13 -08:00
Tom Finegan
021432be9d webm2pes: Fix the linux build.
- Fix narrowing warnings in BCMVHeader::Write
- Add missing include for std::memcpy (cstring).

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

Change-Id: I5e89a5d4f30c9925fc6110502dc927172c709c03
2015-12-11 11:23:53 -08:00
Tom Finegan
82ac5fcdc8 Remove RELEASE.TXT.
It's stale and redundant.

Change-Id: I91c3a1e0f0c717c8f1b3ae30d648127cb2f3590c
2015-12-09 08:12:34 -08:00
Tom Finegan
852e1733a8 webm2pes: Split super frames and packetize large frames.
- PES depacketizers don't want anything but simple encoded frames.
- Large in this case means frame size + size of PES header
  is > UINT16_MAX.

Change-Id: Ifb76caaa97a0dcf3600228a0cbc4d4f2533027a7
2015-12-07 20:14:53 -08:00
Tom Finegan
faf85c227d webm2pes: Refactor header/optional header writing.
- Move class declarations to webm2pes.h.
- Add some visual demarcation between the method definitions for each
  class in webm2pes.cc.
- Reorganize the output code to make further development simpler.
- Also, clang format noise.

Change-Id: Id6d156e1f255cefe30a62784a3eadde6b93ae614
2015-12-03 14:42:37 -08:00
Tom Finegan
7c19266548 Add Webm2Pes.
Add tool for converting WebM VPx streams to Packetized Elementary
Streams.

Change-Id: I599de053df5423a803a3ea450876c52c3e400034
2015-12-02 11:42:24 -08:00
Tom Finegan
01fdee435c mkvmuxer: Disallow AddTrack() after Tracks element is output.
BUG=https://code.google.com/p/webm/issues/detail?id=1083

Change-Id: I6a603337ba5fea1333f3f1c2595f9b87b148c427
2015-10-21 09:07:00 -07:00
James Zern
1ad314e297 mkvparser: EBMLHeader::Parse: remove dead init
Change-Id: Ie06b44c3b7fd948d11aa86ae521a196ea668312b
2015-10-13 16:10:55 -07:00
James Zern
476366249e mkvparser: fix type warnings
Change-Id: Ia77a9a4e694986ece4c2e0f86f2857f320432f48
2015-09-11 18:56:09 -07:00
James Zern
267f71c76e mkvparser: SafeArrayAlloc fix type warning
num_bytes has been validated so it's safe to cast to size_t for use with
new

Change-Id: If1a6c5521dd6fbcb7e30f434b81daa3b26bd0386
2015-09-11 18:56:09 -07:00
James Zern
f1a99d5f25 mkvparser: s/LONG_LONG_MAX/LLONG_MAX/ for compatibility
Change-Id: If3b80bfd08f02ec9cba0be223ff95991564f6fd7
2015-09-11 18:56:09 -07:00
James Zern
bff1aa512d mkvparser: add msvc compatibility for isnan/isinf
fixes build errors related to these functions on visual studio prior to
2013

Change-Id: I8272f9065195e5447055aad7d0f899afa0294ea9
2015-09-11 18:55:03 -07:00
Vignesh Venkatasubramanian
a58c32339e mkvmuxer: Add codec id constant for VP10.
This was added in the libvpx's snapshot here:
https://chromium-review.googlesource.com/#/c/293861

Change-Id: I58b9635c62535ecdb0dff14dc294466262590861
2015-09-10 12:10:01 -07:00
Tom Finegan
714f3c4e4f mkvparser: validate results in EBMLHeader::Parse.
Return an error when DocType, DocTypeReadVersion, DocTypeVersion
EBMLMaxIDLength or EBMLMaxSizeLength are invalid or cannot be
handled by mkvparser.

Update samples to respect the return value from EBMLHeader::Parse.

BUG=https://code.google.com/p/webm/issues/detail?id=1057

Change-Id: I9337f13c1d5fa366b1101e48fe6bc46eb5b2ee97
2015-09-05 08:06:45 -07:00
Tom Finegan
cec98d4110 mkvparser: Correct the ReadID implementation.
Return real, known MKV IDs when reading them. Previously
IDs were treated as EBML integer values. This was both
wrong and confusing. Wrong because this results in values
that are not part of the Matroska spec, and confusing
because the code was littered with magic numbers
representing the invented IDs.

Currently uses mkvmuxer::MkvId; A TODO in the code addresses this.
Additional IDs have been added that were not previously in the enum:
mkvparser parses many elements that we do not write in the muxer.

Change-Id: I5db2b4d70d786d5239d2e2a0cbff4e7f8d844aa6
2015-09-04 09:55:59 -07:00
Tom Finegan
eb36ae4840 Merge changes I029a268e,Ia272b150,I5c4d1bbc,Ia47a2478,I3a2e2226
* changes:
  mkvparser: Cluster::Parse clean up.
  mkvparser: Disallow EBML IDs equal to 0.
  mkvparser: Cluster::Load clean up.
  mkvparser: Segment::Load asserts to error checks.
  mkvparser: Segment::PreloadCluster asserts to error checks.
2015-08-31 22:48:36 +00:00
Tom Finegan
229f49347d Merge "mkvparser: Segment::AppendCluster asserts to error checks." 2015-08-31 22:10:13 +00:00
Tom Finegan
287faf95f6 Merge "mkvparser: Segment::DoLoadClusterUnknownSize asserts to error checks." 2015-08-31 22:09:51 +00:00
Tom Finegan
1a87b59032 Merge "mkvparser: Segment assert clean up." 2015-08-31 22:09:37 +00:00
Tom Finegan
d26ec6909d mkvparser: Cluster::Parse clean up.
- Remove "// weird"'s.
- Remove commented out asserts.
- Asserts to error checks.
- Use ReadID to read IDs.

Change-Id: I029a268e4fa45931e3c6a72e41448f0b8fb2d0c3
2015-08-31 14:32:53 -07:00
Tom Finegan
f2029be5f4 mkvparser: Disallow EBML IDs equal to 0.
Change-Id: Ia272b1505dc62fdadf06348365a6aef058b081d8
2015-08-31 14:23:38 -07:00
Tom Finegan
19f5694277 mkvparser: Cluster::Load clean up.
- Remove "// weird"'s.
- Remove needless extra scoping.
- Asserts to error checks.

Change-Id: I5c4d1bbc59d9debe95e1e35e63ff0679335048ff
2015-08-31 13:59:35 -07:00
Tom Finegan
27a07c1fd1 mkvparser: Segment::Load asserts to error checks.
Change-Id: Ia47a24786789d6f94a786f76e313318e013f4f40
2015-08-31 13:38:35 -07:00
Tom Finegan
d0313dd7ce mkvparser: Segment::PreloadCluster asserts to error checks.
Change-Id: I3a2e2226f30ee047f96f5136c52e4cb9081d42c8
2015-08-31 13:36:15 -07:00
Tom Finegan
b108695b9b mkvparser: Segment::AppendCluster asserts to error checks.
Change-Id: Id6bb378b22a7c6397e3d950c2fdd84396279e881
2015-08-31 12:40:24 -07:00
Tom Finegan
4630f80f79 mkvparser: Segment::DoLoadClusterUnknownSize asserts to error checks.
Change-Id: I4597416261efb9202d2307e1ac4abfeb38e7c515
2015-08-31 12:38:20 -07:00
Tom Finegan
841a9b5fd9 mkvparser: Segment assert clean up.
- Remove asserts from ~Segment, CreateInstance, and DoLoadCluster.
- Adds new return constant (E_PARSE_FAILED == -1); most places in
  mkvparser that return -1 are the result of an internal inconsistency
  and/or misusing the API. In those cases E_FILE_FORMAT_INVALID is not
  appropriate as a return value because it's misleading to libwebm users.

Change-Id: I0d46e831b3475d69432b8745066de3329419fa11
2015-08-31 12:38:09 -07:00
Tom Finegan
8c4ca2ea04 Merge "mkvparser: Make mkvparser namespace usage uniform." 2015-08-28 21:55:13 +00:00
Tom Finegan
49ae6f0dd9 Merge "mkvparser: Fix include order." 2015-08-28 21:54:04 +00:00
Tom Finegan
0735bb5bdc mkvparser: Make mkvparser namespace usage uniform.
Instead of being weird and defining the first few functions
in mkvparser by explicitly prepending the namespace, open the
namespace immediately and define all functions within it.

Change-Id: I9a44a0fda8b04f89c8f874a2a6edc78f1b8e5bcc
2015-08-28 14:26:46 -07:00
Tom Finegan
93b24c4195 mkvparser: Fix include order.
Change-Id: Ia03ce824c78c19f5ab62c736069ea0972b8c93ea
2015-08-28 11:06:03 -07:00
James Zern
a57d6602b4 sample_muxer: fix Segment memory leak on error
use an auto_ptr<mkvparser::Segment> for compatibility which should be
harmless as there is no attempt to transfer ownership; sample.cpp
operates similarly.

Change-Id: I2cb6982aa64c62ff2ec7cbbd646770cb4e782509
2015-08-27 21:09:16 -07:00