Commit Graph

25 Commits

Author SHA1 Message Date
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 8c53995335 Text support for MpdBuilder
Change-Id: I75e1da391356e9edfcb520941029341941c31332
2015-11-03 17:55:50 -08: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
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
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 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
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 817b2a3a19 Add tests for SimpleMpdNotifier
- Add Mock{MpdBuilder, AdaptationSet, Representation}.

Change-Id: I7444e0fa955abedded83809fbb8b20ea6357e78a
2015-07-23 10:42:17 -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 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
Thomas Inskip e3d18b684c Added static initialization and cleanup of libxml and libcurl.
Change-Id: I31cfc9a76c3c90c66059998ffc77371619a43acc
2015-03-24 11:01:10 -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
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 7798a1b845 move mpd_options to its own file
Also always generates sidx box for segments for now.

Change-Id: I61f71ebd281195b737902b57557a345c8e0b0c66
2014-12-15 19:04:40 +00: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