Commit Graph

228 Commits

Author SHA1 Message Date
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
Rintaro Kuroiwa 5ad076d92c Fix schematron validation problem for live
- From DASH spec 2014, MPD@publishTime and Period@id are required for
  'dynamic' MPD.
- Period@id is always set to "0".
- MPD@publishTime is set to the time when the MPD is output.

Issue #55

Change-Id: I5e50aa11067176e69a2343fbc82ca42129703e1b
2016-01-14 16:53:25 -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 27a6e31595 Fix test break in previous cl
- Golden files were not updated correctly.

Change-Id: I4f2bd92261b1e5ee789f5125db05d83bc9335a59
2016-01-13 14:37:44 -08:00
KongQun Yang 4b111a030e Update end to end test with vpx packaging
Change-Id: I70886693b5ad7d4c52170e57901c2437eba69214
2016-01-13 19:34:50 +00:00
KongQun Yang b4e9b5ac2b Set codec string for webm contents correctly
The new codec strings may not be accepted by old versions of browsers.

Change-Id: Ic1bdde80f204f56674fca1f959a3897146953bcf
2016-01-13 19:29:04 +00:00
Rintaro Kuroiwa 2909a53568 Remove redundant attributes from Representation
- @width, @height, @frameRate for Representation element will not be
  set if the attributes are set at AdaptationSet level.

Issue #55

Change-Id: Ib4e669142874f9e8f0ca773df9f87a3fef01b729
2016-01-08 16:42:10 -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
KongQun Yang b17d240060 Fix a memory leak due to thread object tracking
ThreadedIoFile spawns a new thread for every new file. Thread
information is stored for tracking purpose by base::tracked_objects.
The tracking object remains even if the thread itself is destroyed.
This results in memory usage increased by a couple of bytes for every
new segment created in live mode (new segments spawns new threads).

Use WorkerPool instead to avoid spawning new threads.

Fixes Issue #61.

Change-Id: Id93283903c3ba8ebf172a0d58e19b082a72c6cf0
2016-01-08 23:41:41 +00: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 43d5a9ef6e Add new option build_type to packager_test.py
Change-Id: Ifb1109b48e2d93e81561c3e71c5512052851bb56
2016-01-07 20:36:19 +00:00
Rintaro Kuroiwa 62a70e71ee Add MPD schema validation for subsegmentAlignment
- No tests checked the MPD output with AdaptationSet@subsegmentAlignment
  set.

Change-Id: Id45d2bf6865c4550b57c6be1d423b527d3f45cfb
2016-01-07 20:28:20 +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 a4659c40dd Fix AssetId overflow for classic WVM decryption
Javascript/JSON does not support int64_t or unsigned numbers. asset_id,
if greater than 0x80000000 will be converted to negative number. Use
double to represent asset_id instead as 32-bit integer can be lossless
represented using double.

Bug: 26309000

Change-Id: I3e800c396a1231375776295154fb0d96156e980b
2016-01-06 20:18:42 +00:00
Rintaro Kuroiwa a9b039c3f9 Fix MPD validation problems
- Replaced urn:mpeg:DASH:schema:MPD:2011 with
  urn:mpeg:dash:schema:mpd:2011. The former is from the old spec.
- Replaced the MPD schema with the latest one.
- Fixed subSegmentAlignment typo with subsegmentAlignment.

Issue #55

Change-Id: Icffa9872ffc462627b81900a48f59e7b76687c11
2016-01-05 13:50:32 -08: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
Jacob Trimble 8a0458c17b Added MemoryFile, a File type stored in memory.
This can be used for unit tests to reduce the need for temporary
files.  A MemoryFile acts the same as any other File object, but
stores the contents in memory.  The memory pointer can be accessed
directly.  A file with the 'memory://' prefix will be a memory file.

Change-Id: I10ae3ed5391c8fd838e6dfb33106dec959bdc224
2016-01-04 22:50:07 +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
KongQun Yang 9c95309c12 Pull profiling dependency from Chromium
Profiling can be enabled by setting profiling=1 in gyp, e.g.
  GYP_DEFINES="profiling=1" gclient runhooks

To turn on heap profiling, use the HEAPPROFILE environment variable
to specify a filename for the heap profile dump, e.g.
  HEAPPROFILE=/tmp/heapprofile out/Release/packager ...

To turn on cpu profiling, use the CPUPROFILE environment variable
to specify a filename for the cpu profile dump, e.g.
  CPUPROFILE=/tmp/cpuprofile out/Release/packager ...

Note that profiling may not work for debug builds, so use release
build if possible.

See docs/linux_profiling.md for details.

This change will help identify and resolve problem behind Issue #61.

Change-Id: I6f85a04ed82dd0cb3588e6b38e8ceb68dac6c436
2015-12-29 17:14:02 -08: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
Jacob Trimble 05f5682728 Added stream descriptor for output format.
Added two stream descriptors that are both used to tell the output
format.  If it is not given, the packager will use the output file
extension to determine the output format.

Change-Id: Ib8d5dcf52956c2d451e77ea6a90d9502d4a77064
2015-12-16 15:10:35 -08: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
KongQun Yang e1bf322b83 s/::STLElementDeleter/STLElementDeleter/ to improve portability
Change-Id: I5234b415a6ae88ba26da571f56cc8b16748203ae
2015-12-11 15:14:26 -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
KongQun Yang e7a4dde677 Replace "pixel aspect ratio" with "pixel_aspect_ratio" in stream info msg
Change-Id: Ia70b084df9b1b4bdf94a308bcc746f3ad2b5ad8e
2015-12-09 23:55:01 +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
Thomas Inskip 329afd0ade Added Seek & Tell functionality to ThreadedIoFile.
Change-Id: I3c714014e961d08110ce194ad865322e0b487fcb
2015-12-08 22:55:08 +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 6ca2ea9a24 Update end to end packager_test with multiple inputs
- Also set --clear_lead to 1 if encryption is enabled to make sure some
  of the segments are encrypted.
- Also fixed glint errors.

Change-Id: Ie92ad3ea1a3fd95d059e424a114b863ac393e6bf
2015-11-20 11:31:25 -08:00
Rintaro Kuroiwa ef7b136116 Better TTML input check
- Check whether if it can be parsed by libxml2 and check if the root
  element is a 'tt' element.
- Added unit tests for determining TTML and WebVTT.

Change-Id: I4fea1881f0ab70970700601d8d7cea32cc04752c
2015-11-18 19:02:04 +00:00
KongQun Yang c393b71b6f Implement vp9 bitstream parser
Bug: 25586821

Change-Id: I42d77a85c7214262842f49fec83689b6b58cad3d
2015-11-18 00:21:48 +00:00
Rintaro Kuroiwa d3c52cffd9 Use alias template for ScopedXmlPtr
- Also renamed to scoped_xml_ptr to match other smart pointers.

Change-Id: Idb998aa3252d4f3a50068a09e26a05f124e94a2f
2015-11-17 22:07:10 +00:00
KongQun Yang 8072fd1eaf Disable HAVE_STROPTS_H which is not available in CentOS
Change-Id: I98c2a4f2ecbbb39dff7a76522243e4f227911c91
2015-11-17 19:55:32 +00:00
Thomas Inskip 7b74ca12de Fixed a miniscule odds race condition found by tsan (Thread sanitizer)
in ThreadedIofile.
Added loop to handle partial writes in ThreadedIoFile.

Change-Id: Ib62855ab849ffbfd00afc5b226dd81d4cd38ff51
2015-11-17 18:42:10 +00:00
Rintaro Kuroiwa 981041a3a8 Remove locks from MpdBuilder and lock at MpdNotifier level
- Since most use cases use notifier implementations that already uses
  locks, removing locks from MpdBuilder.
- Added locks to MpdNotifier::Flush() implementations. Multiple threads
  were able to write to the same file.

Issue #45, #49

Change-Id: I6e39824485672f40e6c947da97f1743fac174167
2015-11-16 11:29:06 -08:00
Rintaro Kuroiwa e251863130 Add ignore file for TSan build
- Added ignores.txt file. When doing a tsan build,
  tsan_blacklist gyp flag should point to the file.

Change-Id: Ia69f89f1906f0b386e081a7df5a7c867e411f8fd
2015-11-13 18:57:54 +00:00
KongQun Yang d60cc9416f Fix a possible crash if a file fails to be closed
Change-Id: I6bc806a68b81ea5bde09bada1175f257c296afcd
2015-11-13 10:07:13 -08:00
Rintaro Kuroiwa 29e14a3d6b VOD text support
Change-Id: Ic69169c31d0a54de4895d49ff8b4a758039733a7
2015-11-11 12:26:25 -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
Rintaro Kuroiwa 8c53995335 Text support for MpdBuilder
Change-Id: I75e1da391356e9edfcb520941029341941c31332
2015-11-03 17:55:50 -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
Rintaro Kuroiwa 749571fc07 Do MpdBuilder test TODOs
- Added factory methods for creating Representation and AdaptationSet in
  tests.
- Since most tests only needed access to the constructors for
  Representation and AdaptationSet, instead of using
  FRIEND_TEST_ALL_PREFIXES() for each test case, added factory methods
  on the test class.
- Check the 'frameRate' attribute in
  CommonMpbBuilderTest.SetSampleDuration.

Change-Id: I57bd3a90b397f90c3a3a91de03eb96000f58ef58
2015-10-30 14:48:30 -07:00
KongQun Yang cf0db383a3 Enable verbose logging through --v or --vmodule
Change-Id: I36d8d3dd11abe10ce598ef92f38a2a33a15d8f8e
2015-10-28 22:15:50 +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 b6db8b9867 Get rid of svn dependencies
- Generate local copies of libevent, libxml and protobuf.

Change-Id: Ibb29f604191519267f0e6a3ee810cad0c1f80b27
2015-10-16 20:11:20 +00:00
Kongqun Yang 571d713fec Boringssl gyp and patches from Chromium
Bug: 22463853

Change-Id: Ib108016160d2c6ecdd56e369b585ab3c3ae82601
2015-10-16 20:11:04 +00: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
KongQun Yang 3677042a7c Cleanup producer_consumer_queue_unittest
Uses EXPECT_NEAR for comparison with an acceptable error bound. Also
increases error bound to 50ms.

Change-Id: I8fc61b3b915a50f8fe33b9ea72e123aefee25a80
2015-10-01 10:31:27 -07:00
KongQun Yang 2080973f17 Fix an xml include in xml_compare.cc
Change-Id: I06867c8405b0b7ff55f17622e409a42d3eceacc0
2015-09-30 17:45:46 -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 8a850af9cd Add end to end tests for edash-packager
Test files can be updated with --test_update_golden_files if needed.

Change-Id: I5aa904634450f8963f55c46ab5fe0b63f67fef46
2015-09-29 20:38:22 +00:00
KongQun Yang 8c202047fb Make edash-packager outputs predictable for testing
- Added --iv to inject iv for fixed key encryption.
- Added support for key rotation in fixed key encryption.
- Added --use_fake_clock_for_muxer to set timestamp to 0 in the output.

Also updates stream info dump message:
- Modified pixel_width: %d\n pixel_height: %d to pixel aspect ratio: %d:%d
- Removed language from video stream info.

These flags should only be used for testing.

Change-Id: Iedf8d6d6492226219f49fe44d932645f557010e4
2015-09-29 17:19:59 +00:00
KongQun Yang 5c788c2dd5 Use StrEq for string comparison in mpd notifier unittests
Change-Id: I9960908764aea29adbe8feae2a71359f9ff4ecee
2015-09-22 16:17:28 -07:00
Rintaro Kuroiwa 6a7b32641a Get MpdWriter working again
- ContentProtection elements were missing when using MpdWriter,
  therefore mpd_generator also did not generate ContentProtection.
- MpdWriter uses MpdNotifier now, instead of directly using MpdBuiler.
- Add mock_mpd_notifier.{h,cc} to be shared by several tests.

Change-Id: Id0f6213aa0c80e50294cd4193962054b0b5c2492
2015-09-22 15:00:03 -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
Rintaro Kuroiwa fa4a172b04 Add MpdNofitier::Flush() for explicit flushing
- Without the Flush() method the implementation had to do writes in
  almost all methods. Usually the user of the notifier knows when to
  write out the MPD.

Change-Id: Ic165d4594f01357a8ac7e8501eefa0f85c08d32f
2015-09-10 16:24:19 -07:00
Rintaro Kuroiwa d6fea8a8e6 Explicitly specify that availabilityStartTime is UTC
- Adding a 'Z' at the end means it is in UTC time.

Change-Id: I2e876c81449adcf3878e6d0d2b3c74f34edc8963
2015-09-10 11:55:12 -07:00
Rintaro Kuroiwa 0687b544b1 Fix SimpleMpdNotifier logic
- SimpleMpdNotifier didn't register the container ID to its map for VOD.
- AddContentProtection() was not implemented.

Change-Id: I5f1412c785ee5ad3d00910755ff283c404dd895c
2015-09-08 14:31:59 -07:00
Kongqun Yang 6e4460a245 Fix par_num / par_den not initialized problem in previous CL
Change-Id: I843d4e5ed60b05f9f68c298e11af1bdf3361ddf0
2015-08-28 21:28:36 +00:00
Kongqun Yang d71a37656a Find @par with smallest error with par_y in [1, 19]
Quotient reduction to minimal form does not work well in practice due to
rounding of the inputs.

Bug: 23432995

Change-Id: If333ab48accb7f6a3fac6ba4eb48ca7b9cee9826
2015-08-26 00:34:58 +00: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
Rintaro Kuroiwa 5a38dc9c12 Put Role element before Representation
- Follwing the MPD schema.

Change-Id: I2aadf43be224c7fb565592b1814e4bec74ac4800
2015-08-24 12:44:37 -07:00
Kongqun Yang 0614caed83 Fix a memory leak in mpd compare code
This only affects unittests.

Change-Id: I5deba5ce08c08970ec8b2de9ff5f6f7a7a5a436a
2015-08-20 19:24:52 +00:00
Rintaro Kuroiwa 869d7f4620 Add generate_dash_if_iop_compliant_mpd flag for the driver
Change-Id: I0ad320848ad6eb36dfe358fe858a3d5f1f42dbcf
2015-08-18 13:13:41 -07:00
Rintaro Kuroiwa bb8cf87617 Add logic to correctly set subSegmentAlignment for VOD
- subSegmentAlignment logic assumed that all Representations were
  added before calling Representations::AddNewSegment() on any
  Representation in an AdaptationSet. It is not a valid assumption
  for VOD and is removed.

Change-Id: Ifb7e34ee103ee30027e45a804427baf281f3137c
2015-08-18 13:09:38 -07: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
Rintaro Kuroiwa 4f60bfc6c3 Call AddRole in DashIopCompliantMpdNotifier for video AdaptationSets
- All video AdaptationSets gets Role=main.

Change-Id: I476af6fd4b75491daf260640db88bfcc33dadb9c
2015-08-07 11:55:27 -07:00
Kongqun Yang 0ac14327c2 Handle large composition offset greater than (1<<31) properly
This fixes Issue #34: Sample composition offset greater than (1<<31)
is not supported.

Change-Id: I76b7bf7ceeaa9d9a7555f61842d4972a80ee48ca
2015-08-07 18:51:49 +00:00
Rintaro Kuroiwa 3d4872ec77 Add test that adds Role and ContentProtection elements
- ContentProtection elements must appear before Role elements.

Change-Id: If517a91c977487c1bd42cfe0b973aa0cfb8223f7
2015-08-06 16:46:13 -07:00
Rintaro Kuroiwa 48ff2fbe6a Call MpdNotifier::NotifyNewSegment for VOD
- Call NotifyNewSegment() in MpdNotifyMuxerListener::OnMediaEnd() to
  notify subsegments.
- This is necessary for MpdBuilder to calculate subsegmentAlignment.

Change-Id: I9359c408da4f616e543a6d9e568b010a90c90185
2015-08-05 11:49:15 -07:00
Rintaro Kuroiwa ab8f64ea2c Wire up Representation::SetSampleDuration() to update AdaptationSet frame rate
- Representation::SetSampleDuration() calls
  AdaptatoinSet::OnSetFrameRateForRepresentation() via
  RepresentationStateChangeListener.

Change-Id: I4a76c57798c9b6dc1e84ba47336ed1c78fbabfd6
2015-08-04 22:08:58 +00:00