]> git.sesse.net Git - vlc/commitdiff
stream_filter: dash: have vlc_object accessible from, at least, segments
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 25 Nov 2014 12:14:11 +0000 (13:14 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 18 Dec 2014 20:23:50 +0000 (21:23 +0100)
modules/stream_filter/dash/mpd/BasicCMParser.cpp
modules/stream_filter/dash/mpd/IsoffMainParser.cpp
modules/stream_filter/dash/mpd/MPD.cpp
modules/stream_filter/dash/mpd/MPD.h
modules/stream_filter/dash/mpd/Representation.cpp
modules/stream_filter/dash/mpd/Representation.h

index 4d785c5b118ef7e01e893b9f0c98a08cbf4bc78c..6470716ae5f459b1e1b3914e178199ff38ecd01e 100644 (file)
@@ -63,7 +63,7 @@ BasicCMParser::~BasicCMParser   ()
 bool    BasicCMParser::parse                ()
 {
     const std::map<std::string, std::string>    attr = this->root->getAttributes();
-    this->mpd = new MPD;
+    this->mpd = new MPD(p_stream);
 
     std::map<std::string, std::string>::const_iterator  it;
     it = attr.find("mediaPresentationDuration");
index 14a645584ad1ca6d76e094cd0a706931329dd5af..9f9f53bbcbd3a7607bf16bd11dccbdd67d74bdd9 100644 (file)
@@ -45,7 +45,7 @@ IsoffMainParser::~IsoffMainParser   ()
 
 bool    IsoffMainParser::parse              ()
 {
-    mpd = new MPD();
+    mpd = new MPD(p_stream);
     setMPDAttributes();
     setMPDBaseUrl(root);
     setPeriods(root);
index 0397fc1be62a984140d60ecf6c3f5b6e5ee97a4a..68b97ac855eefbbfa841d12372e8210c963d46bc 100644 (file)
 #endif
 
 #include "MPD.h"
+#include "Helper.h"
+#include "dash.hpp"
 
 using namespace dash::mpd;
 
-MPD::MPD () :
+MPD::MPD (stream_t *stream_) :
     ICanonicalUrl(),
+    stream(stream_),
     profile( dash::mpd::Profile::Unknown ),
     live( false ),
     availabilityStartTime( -1 ),
@@ -170,3 +173,8 @@ std::string MPD::getUrlSegment() const
     else
         return std::string();
 }
+
+vlc_object_t * MPD::getVLCObject() const
+{
+    return VLC_OBJECT(stream);
+}
index bc77e2b5b6ce6e78c88ae3fee03618c255d03c7c..c6afdf8d27c7e9dee3ba16b292048fb74acb196c 100644 (file)
@@ -42,7 +42,7 @@ namespace dash
         class MPD : public ICanonicalUrl
         {
             public:
-                MPD();
+                MPD(stream_t *);
                 virtual ~MPD();
 
                 Profile                         getProfile() const;
@@ -69,8 +69,10 @@ namespace dash
                 void    setProgramInformation   (ProgramInformation *progInfo);
 
                 virtual std::string getUrlSegment() const; /* impl */
+                vlc_object_t *      getVLCObject()  const;
 
             private:
+                stream_t                           *stream;
                 Profile                             profile;
                 bool                                live;
                 time_t                              availabilityStartTime;
index 93e077e3fbcbcaf8dff6211165b678d9ea943a21..a1306f1d1d9f4a1464a5ad2875b8284732d32379 100644 (file)
@@ -32,8 +32,9 @@
 
 using namespace dash::mpd;
 
-Representation::Representation  ( MPD *mpd ) :
-                ICanonicalUrl   ( mpd ),
+Representation::Representation  ( MPD *mpd_ ) :
+                ICanonicalUrl   ( mpd_ ),
+                mpd             ( mpd_ ),
                 bandwidth       (0),
                 qualityRanking  ( -1 ),
                 segmentInfo     ( NULL ),
@@ -223,3 +224,8 @@ std::string Representation::getUrlSegment() const
         ret.append(baseUrl->getUrl());
     return ret;
 }
+
+MPD * Representation::getMPD() const
+{
+    return mpd;
+}
index 7a097143917793fd321237f60882a33042203e47..6d971cb281da91cf3986d9cea867571e712e1187 100644 (file)
@@ -84,11 +84,13 @@ namespace dash
                 void                setHeight               (int height);
                 int                 getHeight               () const;
                 void                setBaseUrl              (BaseUrl *baseUrl);
+                MPD*                getMPD                  () const;
 
                 std::vector<std::string> toString() const;
                 virtual std::string getUrlSegment           () const; /* impl */
 
             private:
+                MPD                                *mpd;
                 uint64_t                            bandwidth;
                 std::string                         id;
                 int                                 qualityRanking;