Commit Graph

24 Commits

Author SHA1 Message Date
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 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 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
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 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
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 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
Rintaro Kuroiwa c48a94d60f Add MpdNotifier that tries to generate IOP compliant MPD
- Add DashIopMpdNotifier for generating DASH-IF IOP v3 compliant MPD.

Change-Id: I201b4cdafde6bb963f74d4bbaee3fecc432cb9d7
2015-07-27 17:35:52 -07:00
Rintaro Kuroiwa fe851f692b Calculate (sub)SegmentAlignment for AdaptationSets
- AdaptationSet::OnNewSegmentForRepresentation() calculates whether the
  Representations are aligned by looking at the start time and duration.
  (Except that duration is not used in this implementation).
- Add RepresentationStateChangeListener to callback
  AdaptationSet::OnNewSegmentForRepresentation() from Representation.

Change-Id: I3c30bd6652880dabb9d5c619d8a733ffc789eec9
2015-07-22 21:16:15 -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 f492cccc1d Add a method to add roles to AdaptationSets
Change-Id: Ib0de3b2817870c58fda9bcabf4686c27d60a72c5
2015-07-14 10:32:30 -07:00
Rintaro Kuroiwa 4e2b70c939 Add method to set AdaptationSet@group
Change-Id: Iba147806417aa2a87525318b00a4980b68c38c39
2015-07-13 22:58:49 -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 5f7a55b1db Set AdaptationSet contentType
- "video" and "audio" content type are set. No "text" support yet.

Change-Id: I15a9aae1aab15022627ca737668e6c97069a2e95
2015-06-29 14:15:16 -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 a02e3b60df max{Width,Height,FrameRate} for AdaptationSet
- DASH IOP requires AdaptationSets with video Representations to have:
  @maxWidth (or @width if all the Representations have the same width).
  @maxHeight (or @height if all the Representations have the same width).
  @maxFrameRate (or @frameRate if all the Representations have the same
  frame rate).

Change-Id: I1247b7461237255aeb70b7fb40f78d4439f9c529
2015-06-25 11:20:13 -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
Rintaro Kuroiwa fcaac3de33 Check for sample aspect ratio, frame duration, and time scale
- These fields are required to generate DASH IOP compliant MPDs
  of type=video.

Change-Id: I142ecd662e454ae10d06d66aa5519171f5995303
2015-06-19 13:16:07 -07:00
Joey Parrish 77ec23afe4 Split up AdaptationSets by language.
Additionally, for XML schema correctness, convert ISO-639-2 language
tags (three-letter codes) to ISO-639-1 tags (two-letter codes) when
possible.  This follows BCP-47, which says to always use the shortest
language tag when there are multiple possibilities.

b/18613148

Change-Id: I120fb7b42ac4da5feb4ca046bba93d9e58acd7a9
2015-02-03 16:50:00 -08:00
KongQun Yang 80db1c7bbf Handle non-MSE compliant fmp4 properly
MSE requires 'base-data-offset-present' not to be set, but FFmpeg may
generate fmp4 files with this flag though it actually uses moof as base.
Log a warning instead of failing directly in this case.

FFmpeg may also generates fmp4 files without tfdt box
(TrackFragmentDecodeTime) box, which is again non-MSE compliant. Handle
this scenario properly.

Bug: 18613712

Also fixes a test failure in SegmentTemplateTest introduced in an earlier
change.

Bug: 19235748

Change-Id: I4bcbb675b22a832a88cd33ee64c3e99a1c6e3a63
2015-02-03 13:19:19 -08:00
Thomas Inskip a1ce657a06 Use relative paths for files referenced in the MPD (2nd round).
Change-Id: I929b777dc3353fb868489b42e11578d2aa075510
2014-12-17 15:25:11 -08: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