]> git.sesse.net Git - vlc/commitdiff
stream_filter: dash: add representation baseurl
authorFrancois Cartegnie <fcvlcdev@free.fr>
Tue, 18 Nov 2014 14:30:59 +0000 (15:30 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Thu, 18 Dec 2014 20:23:48 +0000 (21:23 +0100)
modules/stream_filter/dash/mpd/IsoffMainParser.cpp
modules/stream_filter/dash/mpd/Representation.cpp
modules/stream_filter/dash/mpd/Representation.h

index 35faa4dd3b0df4a40af148d7eaf75dd49f3bf382..0f5ae6c5d9a94c5792a137e8ffc58c9ec58dfe67 100644 (file)
@@ -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()));
 
index 94ba3f2dec23030145dd243eab406e30dbaaf672..26a3abf22ec8da78baf0932293009194c9b2a8b5 100644 (file)
@@ -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;
index 62a1195e815e3b102dfbaee93a63c09763ba2939..e8cce46c5303f45dab84c62b21c0ab3989022340 100644 (file)
@@ -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;
         };