Commit Graph

89 Commits

Author SHA1 Message Date
Bei Li 8563db4cff Support Dolby audio Enhanced AC3 in ISO BMFF (Part 2)
- Box definitions for box type DEC3.
- Parser/muxer changes to support Enhanced-AC3 audio codecs.
- MPD signaling will come in Part 3.

Issue #64

Change-Id: Ifcd5efa1f61b470ec225127925631e4329853259
2016-01-15 14:44:06 -08:00
Jacob Trimble d1d75f477c Add encryption support to WebM.
This does not support key-rotation and will give an error.  This is
because WebM does not have a way to indicate a change in key ID using
media segments.

b/22463551

Change-Id: I9b3dac818dc370302a5afc0d25d8a060b64d30cd
2016-01-15 11:51:41 -08:00
Jacob Trimble 61a8d4f09e Add codec private data to WebM muxer.
Added packager tests for WebM audio.  Also now only outputs the
language if it's not empty.  Fixed the packager tests for that.

b/26540606

Change-Id: Ica804bd710055bcaa2113f948d723dedd78ef909
2016-01-14 12:36:17 -08:00
KongQun Yang a040fb711c Handle side data properly in webm
Change-Id: Ic8c81154ea66374df62a4a46d66c45b3035a7829
2016-01-09 00:32:08 +00:00
Bei Li 58b95fd3d5 Support Dolby audio AC3 in ISO BMFF (Part 1)
- Box definitions for box type DAC3.
- Parser/muxer changes to support AC3 audio codecs.
- EC3 audio sample entry will come in Part 2.
- MPD signaling will come in Part 3.

Issue #64

Change-Id: I790b46ae8179b933bb8f7da9cdd38591fe8da43d
2016-01-08 15:56:48 -08:00
Jacob Trimble db9460ca4e Added packager version to WebM muxer.
Also fixed WebM unit tests to match.

Change-Id: Ia0825b13f074667bc2fb13c60f3a1a9c4e4bf67a
2016-01-08 11:20:31 -08:00
KongQun Yang e0040a4910 Add version information in generated outputs
For mp4 outputs, a metadata box with version information is added to
moov box.

For mpd outputs, a text comment with version information is added in
the beginning of mpd file.

Issue #60

Change-Id: I783ba370781c0a8f77c910ff1172bad2e7edff75
2016-01-08 19:08:56 +00:00
KongQun Yang 458d376343 Block align frames in superframe for vp9 cenc
Change-Id: I065151c05d55c993ffbd0c30f2aa521e8476833c
2016-01-07 20:08:03 +00:00
KongQun Yang 7c61aa15ed Remove webm_tools which is not needed
- Another minor change in segmenter_test_base: scoped_refptr can
  be passed by value, remove ".Pass".

Change-Id: I31f0cf74c5ad0aba8890d3b1845155d63d7326a0
2016-01-07 10:33:10 -08:00
Jacob Trimble 7b52f0a3ed Added unit tests for WebM Segmenters.
* Changed Segmenters to accept StreamInfo rather than MediaStream
  to help in testing.
* Changed MemoryFile behavior to mirror local file:
  * Read non-existent file is an error.
  * Write deletes any existing file.
* Fixed a bug in SingleSegmentSegmenter.

Change-Id: I339e35597ca4661b7a26c6fdbbfa2f9f511c7da0
2016-01-07 17:07:02 +00:00
KongQun Yang b3e85ff810 Enable '-Wimplicit-fallthrough' and fix issues
Change-Id: I9e1e09f3924dcd8f59af2fbc952456b81e2d7c4e
2016-01-06 17:12:49 -08:00
Bei Li bb073cef51 Add support for DTS in ESDS. Needed to handle DTS audio generated by FFMPEG.
Issue #52

Change-Id: Ibd97054bce0b7ccb344f4bb34370399b8e051f30
2016-01-06 22:30:52 +00:00
KongQun Yang 098e087459 Implement SampleEncryption box parsing and generation
Issue #41

Change-Id: Ic57436b6e6c8b58fc264037fd81c98627c525932
2016-01-05 01:56:06 +00:00
Jacob Trimble c0df6b3239 Cleaned up Status class.
Change-Id: I1ff470410b38d32ad828618f756487585660a272
2016-01-05 01:02:34 +00:00
KongQun Yang 0c870b7c02 Define SampleEncryption 'senc' box
Issue #41

Change-Id: Ib28c079209f3a58ecd8d7b86d720a1c8c774b669
2015-12-31 01:26:18 +00:00
KongQun Yang 814d2414e3 Implement vp8 bit stream parser.
Change-Id: I8b7997ceb8e7484399442f7c1072f4d5aa33ff4e
2015-12-30 21:40:10 +00:00
KongQun Yang 94401d750a VP9 codec string from bitstream and subsample encryption support
- Parse vp9 bitstream to get vpx codec configuration
- Add subsample encryption for vp9
- Also fixed a bug in VP9 parser if segmentation update_map is enabled

Change-Id: I69dc97088aa38c94c6d37fdbcf3d9cfc942a3df6
2015-12-30 21:39:34 +00:00
Rintaro Kuroiwa 09d1c2ce9f Box definitions for WebVTT
Change-Id: I94d38bef918eed18df7cd312126e2d589aadf9c7
2015-12-22 14:05:50 -08:00
KongQun Yang c8e3345959 Some code clean ups in box definitions
- Add Box::WriteHeader and Box::HeaderSize methods. The concrete
  box implementations should not need care about whether it is a
  Box or FullBox normally.
- Rename Box::ReadWrite to Box::ReadWriteInternal to make it clear
  that it is an internal methods. Make it private so it cannot be
  incorrectly called in box implementions.
- Make an internal implementation of ComputeSizeInternal to compute
  box size. |atom_size| is updated in ComputeSize, which wraps
  ComputeSizeInternal.

Change-Id: I3fbcf8c527581b676d9d13f1ac1dd798da7c4d5f
2015-12-21 18:40:05 +00:00
KongQun Yang af7d6a7921 Estimate duration of last sample in cluster from next cluster
Change-Id: I7dbc4045d366bbfb0c12f9652ffe97b8fcf447cf
2015-12-15 22:34:01 +00:00
Jacob Trimble 07378e806c Added WebM muxer.
* Added WebM muxer that supports both single and multi-segment modes.
* WebM muxer supports MPD generation.
* Enabled WebM muxer and demuxer in packager.

b/22463220
b/25089245
b/25089714

Change-Id: I9f6e8fc51e08fbb1d685229c5cb54ea60f7bed8f
2015-12-15 20:34:44 +00:00
Rintaro Kuroiwa 1cdce29343 WebVttMediaParser and TextStreamInfo
- Add WebVttMediaParser which parses and creates MediaSamples from text
  WebVtt inputt

Change-Id: Ia7bb7474df7f15e454e887b8c291fdfdc3195e46
2015-12-14 13:58:21 -08:00
Bei Li aa805b9632 Support DTS audio in MP4 - Part 2
Issue #52

Change-Id: Ib71077c5063aced23f9d060b35facbf8e6eb0a3a
2015-12-10 20:49:13 +00:00
Bei Li 2806dffb47 Support DTS audio in MP4 - Part 1
Issue #52

Change-Id: I5061e2a674d5c1b039a49729e53d4d15a4120a5c
2015-12-08 23:06:52 +00:00
Bei Li c647c25d5f Revert "Support DTS audio in MP4 - Part 1"
This reverts commit 9b0d4abece.

Change-Id: I3897fffde2ab162638876df1eafa7a4058573e49
2015-12-07 19:35:11 +00:00
Bei Li 9b0d4abece Support DTS audio in MP4 - Part 1
Change-Id: I4464f869552f5cd0cb77d1b3e97c8efc4b00c552
2015-12-04 16:03:16 -08:00
KongQun Yang 4c10755d40 Support HEVC in mp4 parser and muxer
Issue #46

Change-Id: I36bf8418a335181ad71509e6e0cccdce210467f0
2015-11-04 17:18:41 -08:00
KongQun Yang c577e6132f Implement initial support for vpx in iso-bmff
Also update the code to generate CompressorName in VideoSampleEntry
for both AVC1 and various VP codecs.

Change-Id: I2355f8008a72806e852aa1ec6c80e9141b97d963
2015-11-04 00:34:00 +00:00
KongQun Yang 8fc7f51d81 Move AVCDecoderConfiguration parsing to media/filters
Change-Id: I7daa616e53bdef2206ce145f907b8f55cde87740
2015-10-28 00:31:43 +00:00
KongQun Yang 3842a5b43c Use StrEq for string comparison in webm_parser_unittest
Change-Id: Iaa02b7e8f318508b4de38bd258453095686c431d
2015-10-22 17:40:11 -07:00
KongQun Yang 95d2dbf68d Relax requirement on reserved bits when parsing AVCC
Issue #44

Change-Id: I84235a4d94225e2bf1777443611ad19429b958d4
2015-10-22 19:09:40 +00:00
Jacob Trimble 074bce8425 Added libwebm and webm-tools to imports
b/25089850

Change-Id: If97fc4dec70c3c94054b0f7ec5f243d9d5bd676e
2015-10-22 11:16:29 -07:00
Thomas Inskip 05f80f961c Fix for race condition when flushing ThreadedIoFile.
Change-Id: I46f26fa9fddf53ca5231c31d6442053ab5202ade
2015-10-20 16:44:15 +00:00
KongQun Yang afbab86399 Additional clean ups on comments and TODOs
Also rename WebMStreamParser to WebMMediaParser.

Change-Id: I0defca481f9d7774dd84810a5abd52902d5f47b6
2015-10-19 17:23:46 +00:00
KongQun Yang 845766f69a Make webm parser compile and unittest pass
Change-Id: Ib93fbb3eba6f0638f3aa57a9a47e73e8738792d1
2015-10-16 15:51:56 -07:00
KongQun Yang 5a4234f4da Update webm_cluster_parser to emit samples
Change-Id: I02436cfcb53b96210d6f683227cdabb994f4c01f
2015-10-16 15:46:36 -07:00
KongQun Yang 732e06fde0 Adjust webm code for packager
- Adding namespace edash_packager
- Fix includes
- (u)int(8|16|32|64) to (u)int(8|16|32|64)_t
- Remove MEDIA_EXPORT
- Remove MediaLog

Change-Id: Ifa116d966ab70ae1b3c299ae1f6f7044d7ae0cc6
2015-10-16 15:46:36 -07:00
KongQun Yang 87993c5dc7 Add WebM parser code from Chromium
Also includes its dependencies, like media/base/text_track_config.*
and media/filters/webvtt_util.h

Change-Id: I5b26245daf004da19b912b7c5b2c21ce4ba85688
2015-10-16 15:46:36 -07:00
Kongqun Yang 9c0ae378bc Switch to boringssl. Also update curl accordingly.
Boringssl and yasm gyp and patches will follow in a separate cl.

Bug: 22463853

Change-Id: I87b91ac089866db58ac433def006fe9ac4744bd6
2015-10-16 20:10:38 +00:00
Kongqun Yang 47c79d08ce Update code to resolve problems due to base updates.
Notably deprecate of OVERRIDE, to be replaced with C++11 override.

Bug: 22463130
Bug: 22664127

Change-Id: I12c82e092e9e8eb0870da4363307c3563a3531b7
2015-10-16 20:09:56 +00:00
Thomas Inskip a9b6fcedd7 Added fallback to computed AVCDecoderConfigurationRecord if the one
stored in the WVM metadata is invalid.

Change-Id: I9e3c7ba4677f1ac7c19ec4d51f600d28bb427acb
2015-10-14 09:46:14 -07:00
Thomas Inskip cb7173d280 Added support for multiple audio & video configurations in WVM parser.
BUG=24614172

Change-Id: I197a0ebdfa6df90abc27358762cae041e4f8fd45
2015-10-13 10:42:49 -07:00
KongQun Yang 93e6c4fc92 Reduce test file sizes and remove unused test files
Change-Id: I7e3b24e92b2a16de857e0424c85232cc31444182
2015-10-12 20:16:03 +00:00
Thomas Inskip d0fb8ced4b Use default audio and video PES stream IDs (0xc0 and 0xe0 respectively)
if not specified in the WVM metadata.

BUG=24753064

Change-Id: I4c4cd0b30f0e153d46639382682da13b127dd305
2015-10-08 13:16:00 -07:00
Rintaro Kuroiwa 76e5be3756 More fix for live
- Neither live with or without key rotation did not output the right
  result.
- No key rotation: did not produce any ContentProtection element.
- With key rotation: did not have DRM specific ContentProtection.
- To get key rotation working with shaka player, <cenc:pssh> elements
  are removed.

Change-Id: I1f34d303ae1f3ea81820e3368ab66b8420498372
2015-09-29 15:12:46 -07:00
Kongqun Yang 3a5fdd2d9c Fix incorrect width/height in VisualSampleEntry for mp2t stream with cropping
Cropping is necessary if width/height are not exactly disivible by 16 due
to 16x16 macroblock size.

The width and height fields in VisualSampleEntry must correctly document
the cropped frame dimentions (visual presentation size) of the AVC stream
that is described by that entry.

Also fixes width/height in input mp4 and wvm streams if the values in
VisualSampleEntry / metadata do not match with the values in
AVCDecoderConfigurationRecord (SPS).

Issue: 39

Change-Id: Id55c5acf245bee3f4e66302b2042eb7d9c488c19
2015-09-18 17:42:52 +00:00
Rintaro Kuroiwa c75d319985 Live profile MPD did not have ContentProtection
- Because MpdBuilder no longer sets ContentProtection, live was broken.
- For key-rotation, <cenc:pssh> element is updated.

Change-Id: I45bb80a12faff39ccf5deb82439c0732ed9cea59
2015-09-16 15:50:00 -07:00
Kongqun Yang 6cc81137a8 Add filters dependency to mp4 target
This fixes the build.

Change-Id: Iae0f6599d66ddcba82a3a826c22baf075e2bb560
2015-08-25 17:47:27 +00:00
Kongqun Yang 2a95367dd4 Move SAR extraction out of video_stream_info.cc
This fixes a circular dependency of media_base depends on filter and
filter depends on media_base.

Also added code to extract sar in WvmMediaParser if it is not yet
extracted when setting extra_data.

Change-Id: I1b5aef2444e4134c9b6663911ac5e5c4c220404a
2015-08-24 23:16:49 +00:00
Kongqun Yang e5b6096857 Generate tkhd and pasp boxes properly with non-square pixels
- Width/Height in tkhd box should be display resolution instead of
  coded resolution.
- pasp was not generated earlier.
- Assuming SAR as 1:1 if it failed to be extracted successfully.
- Also update test files for mp4_media_parser_unittest.

This fixes Issue #35.

Change-Id: Iedbe6a44465aac6723b6ea2de30aed180821eccd
2015-08-07 21:46:08 +00:00