Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <MPD mediaPresentationDuration="PT7M57.72S">
  2. <Period>
  3. <AdaptationSet mimeType="audio/mp4" segmentAlignment="true" startWithSAP="1">
  4. ...
  5. </AdaptationSet>
  6.  
  7. <AdaptationSet mimeType="video/mp4" segmentAlignment="true" startWithSAP="1">
  8. ...
  9. </AdaptationSet>
  10. </Period>
  11. </MPD>
  12.  
  13. using ptree_t = boost::property_tree;
  14. using shared_ptree_t = boost::shared_ptr<ptree_t>;
  15.  
  16. shared_ptree_t GetAudioAdaptSet(shared_ptree_t & spMPDtree)
  17. {
  18. using namespace std;
  19.  
  20. shared_ptree_t spAudioAdaptSet;
  21.  
  22. auto range = spMPDtree->get_child("MPD.Period").equal_range("AdaptationSet");
  23.  
  24. for (auto itr = range.first; itr != range.second; ++ itr)
  25. {
  26. if (boost::iequals(itr->first, "AdaptationSet") &&
  27. boost::iequals(itr->second.get<string>("<xmlattr>.mimeType", ""), "audio/mp4"))
  28. {
  29. spAudioAdaptSet.reset(new ptree_t(*itr));
  30. break;
  31. }
  32.  
  33. }
  34.  
  35. return spAudioAdaptSet;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement