Commit Graph

23 Commits

Author SHA1 Message Date
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
Rintaro Kuroiwa 29e14a3d6b VOD text support
Change-Id: Ic69169c31d0a54de4895d49ff8b4a758039733a7
2015-11-11 12:26:25 -08:00
KongQun Yang 8fc7f51d81 Move AVCDecoderConfiguration parsing to media/filters
Change-Id: I7daa616e53bdef2206ce145f907b8f55cde87740
2015-10-28 00:31:43 +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
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
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
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 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 fca2bb1e44 Handle MpdNotifyMuxerListener::OnSampleDurationReady() for VOD
- Saves sample_duration in the media_info protobuf.
- When MpdNotifyMuxerListener::OnMediaEnd() is called, media_info passed
  to MpdNotifier::NotifyNewContainer() should contain the sample
  duration.
- Add tests for MpdNotifyMuxerListener.
- Moved common code from vod_media_info_dump_muxer_listener_unittest.cc
  and mpd_notify_muxer_listener_unittest.cc to
  muxer_listener_test_helper.cc.

Change-Id: Ibf2340076d45828d26f1af54a1ed8e95e5884c23
2015-08-03 13:07:18 -07:00
Rintaro Kuroiwa 60c54975d7 MpdBuilder should not automatically add ContentProtection elements
- ContentProtection elements should be added explicitly by the
  AddContentProtection() methods.
- This is because some MPDs should have ContentProtection at
  AdaptationSet level instead of Representation.
- Change SimpleMpdNotifier, which uses MpdBuilder, to add
  ContentProtectionElements. The logic is moved from MuxerListener.
- Add Element class for specifying subelements for
  ContentProtectionElement.

Change-Id: I9bedfb3e5a5ac0b3d5c702f1e6e4a8608c978d1d
2015-07-20 10:37:20 -07:00
Rintaro Kuroiwa 5c8efd332e Pass content protection information to MuxerListener
- The UUID and DRM name can be fetched from KeySource.
- Add ProtectedContent message to MediaInfo. The message contains basic
  information for the protected content, such as the default key ID for
  the content.
- The message is required to separate Representations with different
  content protection information into different AdaptationSets.

Change-Id: Ib9dc834ae0abf93b7ca0acdf52a865b1394a4816
2015-07-13 19:03:44 -07:00
Rintaro Kuroiwa 21e43966db Use pixel_{height,width} to set AdaptationSet@par
- Pass pixel_height and pixel_width from VideoStreamInfo to MediaInfo.
- par can only be set if all the Representations have the same
  picture aspect ratio. That is the ratio of sar_x*width:sar_y*height
  should all be the same.
- If there is a Representation that does not have the sar attribute set,
  par is also not set.

Change-Id: Id34c95e4a99da9ce028a9f35737cfe5bca9e5697
2015-07-01 11:53:09 -07:00
Rintaro Kuroiwa c3c971ebd9 Add pixel_{width,height} to VideoStreamInfo
- Added logic to container parsers to extract pixel width and height.
- If the container doesn't contain the pixel width and height of the
  stream and the stream is H264, this parses the SPS to get the
  sar_width and sar_height.
- If extracted sar_width and sar_height are 0s then they imply 1s.
- Add hb2_v_frag.mp4 for test media. This does not have a
  'pasp' box and has sar_width = 8 sar_height = 9.

Change-Id: I4a06ce95582547bec19adb7905e7612c5a1f359e
2015-06-29 11:17:28 -07:00
Rintaro Kuroiwa 2cf673055c Make {Video,Audio,Text}Info optional
- The fields used to be repeated but there is no use case at the moment.
- DASH IOP explicitly disallows segments with multiple tracks.

Change-Id: Ia0af2048210c546dfaa178735605a81052ea1123
2015-06-25 17:41:00 -07:00
Rintaro Kuroiwa d685edef62 Pass sample duration to MPD
- Get the first sample duration in Segmenter.
- Pass the value all the way to Representation thru MuxerListener.

Change-Id: I76fd970f8140d359863363dc347958f680cca5ae
2015-06-23 13:12:17 -07:00
Thomas Inskip a14ea461fb Added trick_play_rate to VideoStreamInfo.
Added ability to query the Demuxer for the container name (type).

Change-Id: I328215f7c5badfe117c5419dd42f5262c568112a
2015-06-02 22:54:13 +00:00
Kongqun Yang 8277236fe7 Add ProgressListener for progress updates
Bug: 19730025
Change-Id: If60d7629c69d84b245f0c96fb564704d7af82ea2
2015-05-14 19:09:02 -07:00
Kongqun Yang e9f402a328 Drop media::event namespace
Change-Id: I736a645a604a22ef5ce969aeb7533e003a386172
2015-05-07 14:06:16 -07:00
KongQun Yang 50c3f3a52e Bug fix for VodMediaInfoDumpMuxerListener::OnNewSegment
Change-Id: Ied43a7b71a551d093db11fd5b99e023d57dfa46a
2015-01-13 09:45:23 -08:00
KongQun Yang 8ffb41df76 Fix various errors discovered during integration
Change-Id: I927ba02bbe99bf6e6c9877968a4554ad949cf07f
2014-10-06 12:44:54 -07:00
KongQun Yang 15ae26e12f Modify include headers to have "packager" in the path
This is a follow up to previous CL.

Generated using command:
find {media,app,mpd} -type f -exec sed -r -i 's/#include "(.*)"/#include
"packager\/\1"/' {} \;

common.gypi and mpd.gyp are also modified to take the path change into
consideration.

Change-Id: I1fb102b4eb73ae5fde5f4ab303a12cec09b05c33
2014-10-02 12:53:29 -07:00
KongQun Yang b8126bc9da Move source code into packager directory
Make it easier to be included and integrated into other code.

Change-Id: I609881688cc20f8fac676cbd91fde4753af32ee5
2014-10-02 12:32:14 -07:00