[vlc-commits] dash: Store the parent Group in every representations.

Hugo Beauzée-Luyssen git at videolan.org
Tue Jan 24 23:22:00 CET 2012


vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Tue Jan  3 16:05:09 2012 +0100| [3e6823521f37f2582d38583064211569538f10d6] | committer: Jean-Baptiste Kempf

dash: Store the parent Group in every representations.

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit bc77d458c167012d56054404a481c5f328e1da3b)

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc/vlc-1.2.git/?a=commit;h=3e6823521f37f2582d38583064211569538f10d6
---

 modules/stream_filter/dash/mpd/BasicCMParser.cpp  |    3 ++-
 modules/stream_filter/dash/mpd/Representation.cpp |   17 ++++++++++++++---
 modules/stream_filter/dash/mpd/Representation.h   |   11 ++++++++---
 3 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/BasicCMParser.cpp b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
index 25d3f6d..9b5f0f2 100644
--- a/modules/stream_filter/dash/mpd/BasicCMParser.cpp
+++ b/modules/stream_filter/dash/mpd/BasicCMParser.cpp
@@ -287,7 +287,8 @@ void    BasicCMParser::setRepresentations   (Node *root, Group *group)
     {
         const std::map<std::string, std::string>    attributes = representations.at(i)->getAttributes();
 
-        Representation *rep = new Representation( attributes );
+        Representation *rep = new Representation;
+        rep->setParentGroup( group );
         if ( this->parseCommonAttributesElements( representations.at( i ), rep, group ) == false )
         {
             delete rep;
diff --git a/modules/stream_filter/dash/mpd/Representation.cpp b/modules/stream_filter/dash/mpd/Representation.cpp
index 079323b..f7be5bf 100644
--- a/modules/stream_filter/dash/mpd/Representation.cpp
+++ b/modules/stream_filter/dash/mpd/Representation.cpp
@@ -31,11 +31,11 @@
 
 using namespace dash::mpd;
 
-Representation::Representation  (const std::map<std::string, std::string>&  attributes) :
+Representation::Representation() :
     qualityRanking( -1 ),
-    attributes( attributes ),
     segmentInfo( NULL ),
-    trickModeType( NULL )
+    trickModeType( NULL ),
+    parentGroup( NULL )
 {
 }
 
@@ -82,6 +82,17 @@ void                Representation::setTrickMode        (TrickModeType *trickMod
     this->trickModeType = trickModeType;
 }
 
+const Group *Representation::getParentGroup() const
+{
+    return this->parentGroup;
+}
+
+void Representation::setParentGroup(const Group *group)
+{
+    if ( group != NULL )
+        this->parentGroup = group;
+}
+
 void                Representation::setSegmentInfo          (SegmentInfo *info)
 {
     this->segmentInfo = info;
diff --git a/modules/stream_filter/dash/mpd/Representation.h b/modules/stream_filter/dash/mpd/Representation.h
index 04c25b7..0d01c47 100644
--- a/modules/stream_filter/dash/mpd/Representation.h
+++ b/modules/stream_filter/dash/mpd/Representation.h
@@ -35,10 +35,12 @@ namespace dash
 {
     namespace mpd
     {
+        class Group;
+
         class Representation : public CommonAttributesElements
         {
             public:
-                Representation          ( const std::map<std::string, std::string>&  attributes);
+                Representation();
                 virtual ~Representation ();
 
                 const std::string&  getId                   () const;
@@ -65,14 +67,17 @@ namespace dash
 
                 void                setSegmentInfo( SegmentInfo *info );
                 void                setTrickMode( TrickModeType *trickModeType );
+                const Group*        getParentGroup() const;
+                void                setParentGroup( const Group *group );
 
             private:
                 int                                 bandwidth;
-                std::string                         id; int                                 qualityRanking;
+                std::string                         id;
+                int                                 qualityRanking;
                 std::list<const Representation*>    dependencies;
-                std::map<std::string, std::string>  attributes;
                 SegmentInfo                         *segmentInfo;
                 TrickModeType                       *trickModeType;
+                const Group                         *parentGroup;
         };
     }
 }



More information about the vlc-commits mailing list