[vlc-commits] stream_filter: dash: add representation baseurl

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


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 18 15:30:59 2014 +0100| [62dd5ef745e430febe3edee75d487775d612f3ca] | committer: Francois Cartegnie

stream_filter: dash: add representation baseurl

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

 modules/stream_filter/dash/mpd/IsoffMainParser.cpp |    4 ++++
 modules/stream_filter/dash/mpd/Representation.cpp  |   13 +++++++++++++
 modules/stream_filter/dash/mpd/Representation.h    |    4 ++++
 3 files changed, 21 insertions(+)

diff --git a/modules/stream_filter/dash/mpd/IsoffMainParser.cpp b/modules/stream_filter/dash/mpd/IsoffMainParser.cpp
index 35faa4d..0f5ae6c 100644
--- a/modules/stream_filter/dash/mpd/IsoffMainParser.cpp
+++ b/modules/stream_filter/dash/mpd/IsoffMainParser.cpp
@@ -87,6 +87,10 @@ void    IsoffMainParser::setRepresentations (Node *adaptationSetNode, Adaptation
         this->currentRepresentation = new Representation;
         Node *repNode = representations.at(i);
 
+        std::vector<Node *> baseUrls = DOMHelper::getChildElementByTagName(repNode, "BaseURL");
+        if(!baseUrls.empty())
+            currentRepresentation->setBaseUrl( new BaseUrl( baseUrls.front()->getText() ) );
+
         if(repNode->hasAttribute("width"))
             this->currentRepresentation->setWidth(atoi(repNode->getAttributeValue("width").c_str()));
 
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp b/modules/stream_filter/dash/mpd/Representation.cpp
index 94ba3f2..26a3abf 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -39,6 +39,7 @@ Representation::Representation  () :
                 parentGroup     ( NULL ),
                 segmentBase     ( NULL ),
                 segmentList     ( NULL ),
+                baseUrl         ( NULL ),
                 width           (0),
                 height          (0)
 
@@ -49,6 +50,7 @@ Representation::~Representation ()
 {
     delete(this->segmentInfo);
     delete(this->trickModeType);
+    delete baseUrl;
 }
 
 const std::string&  Representation::getId                   () const
@@ -141,6 +143,17 @@ void                Representation::setSegmentBase          (SegmentBase *base)
 {
     this->segmentBase = base;
 }
+
+BaseUrl* Representation::getBaseUrl() const
+{
+    return baseUrl;
+}
+
+void Representation::setBaseUrl(BaseUrl *base)
+{
+    baseUrl = base;
+}
+
 void                Representation::setWidth                (int width)
 {
     this->width = width;
diff --git a/modules/stream_filter/dash/mpd/Representation.h b/modules/stream_filter/dash/mpd/Representation.h
index 62a1195..e8cce46 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -32,6 +32,7 @@
 #include "mpd/TrickModeType.h"
 #include "mpd/SegmentBase.h"
 #include "mpd/SegmentList.h"
+#include "mpd/BaseUrl.h"
 
 namespace dash
 {
@@ -80,6 +81,8 @@ namespace dash
                 int                 getWidth                () const;
                 void                setHeight               (int height);
                 int                 getHeight               () const;
+                BaseUrl*            getBaseUrl              () const;
+                void                setBaseUrl              (BaseUrl *baseUrl);
 
             private:
                 uint64_t                            bandwidth;
@@ -91,6 +94,7 @@ namespace dash
                 const AdaptationSet                         *parentGroup;
                 SegmentBase                         *segmentBase;
                 SegmentList                         *segmentList;
+                BaseUrl                             *baseUrl;
                 int                                 width;
                 int                                 height;
         };



More information about the vlc-commits mailing list