[vlc-commits] stream_filter: dash: have vlc_object accessible from, at least, segments

Francois Cartegnie git at videolan.org
Thu Dec 18 22:39:50 CET 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 25 13:14:11 2014 +0100| [47af7ca1a031c282717c8f679a9f626669e23334] | committer: Francois Cartegnie

stream_filter: dash: have vlc_object accessible from, at least, segments

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=47af7ca1a031c282717c8f679a9f626669e23334
---

 modules/stream_filter/dash/mpd/BasicCMParser.cpp   |    2 +-
 modules/stream_filter/dash/mpd/IsoffMainParser.cpp |    2 +-
 modules/stream_filter/dash/mpd/MPD.cpp             |   10 +++++++++-
 modules/stream_filter/dash/mpd/MPD.h               |    4 +++-
 modules/stream_filter/dash/mpd/Representation.cpp  |   10 ++++++++--
 modules/stream_filter/dash/mpd/Representation.h    |    2 ++
 6 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 4d785c5..6470716 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -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");
diff --git a/modules/stream_filter/dash/mpd/IsoffMainParser.cpp b/modules/stream_filter/dash/mpd/IsoffMainParser.cpp
index 14a6455..9f9f53b 100644
--- a/modules/stream_filter/dash/mpd/IsoffMainParser.cpp
+++ b/modules/stream_filter/dash/mpd/IsoffMainParser.cpp
@@ -45,7 +45,7 @@ IsoffMainParser::~IsoffMainParser   ()
 
 bool    IsoffMainParser::parse              ()
 {
-    mpd = new MPD();
+    mpd = new MPD(p_stream);
     setMPDAttributes();
     setMPDBaseUrl(root);
     setPeriods(root);
diff --git a/modules/stream_filter/dash/mpd/MPD.cpp b/modules/stream_filter/dash/mpd/MPD.cpp
index 0397fc1..68b97ac 100644
--- a/modules/stream_filter/dash/mpd/MPD.cpp
+++ b/modules/stream_filter/dash/mpd/MPD.cpp
@@ -26,11 +26,14 @@
 #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);
+}
diff --git a/modules/stream_filter/dash/mpd/MPD.h b/modules/stream_filter/dash/mpd/MPD.h
index bc77e2b..c6afdf8 100644
--- a/modules/stream_filter/dash/mpd/MPD.h
+++ b/modules/stream_filter/dash/mpd/MPD.h
@@ -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;
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp b/modules/stream_filter/dash/mpd/Representation.cpp
index 93e077e..a1306f1 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -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;
+}
diff --git a/modules/stream_filter/dash/mpd/Representation.h b/modules/stream_filter/dash/mpd/Representation.h
index 7a09714..6d971cb 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -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;



More information about the vlc-commits mailing list