[vlc-commits] dash: Group: Adding a getter for Representation by id.

Hugo Beauzée-Luyssen git at videolan.org
Fri Dec 30 18:15:29 CET 2011


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Wed Dec 21 23:34:09 2011 +0100| [058904517b00e08409aadb8e8f1579c5cc602387] | committer: Jean-Baptiste Kempf

dash: Group: Adding a getter for Representation by id.

This will be used to implement @dependencyId

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

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

 modules/stream_filter/dash/mpd/Group.cpp |   14 ++++++++++++++
 modules/stream_filter/dash/mpd/Group.h   |    1 +
 2 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/modules/stream_filter/dash/mpd/Group.cpp b/modules/stream_filter/dash/mpd/Group.cpp
index 69d2787..0eebada 100644
--- a/modules/stream_filter/dash/mpd/Group.cpp
+++ b/modules/stream_filter/dash/mpd/Group.cpp
@@ -84,6 +84,20 @@ std::vector<Representation*>    Group::getRepresentations       ()
     return this->representations;
 }
 
+const Representation *Group::getRepresentationById(const std::string &id) const
+{
+    std::vector<Representation*>::const_iterator    it = this->representations.begin();
+    std::vector<Representation*>::const_iterator    end = this->representations.end();
+
+    while ( it != end )
+    {
+        if ( (*it)->getId() == id )
+            return *it;
+        ++it;
+    }
+    return NULL;
+}
+
 void                            Group::addRepresentation        (Representation *rep)
 {
     this->representations.push_back(rep);
diff --git a/modules/stream_filter/dash/mpd/Group.h b/modules/stream_filter/dash/mpd/Group.h
index 2fb8ae1..28c0710 100644
--- a/modules/stream_filter/dash/mpd/Group.h
+++ b/modules/stream_filter/dash/mpd/Group.h
@@ -50,6 +50,7 @@ namespace dash
 
                 std::string                     getSubSegmentAlignment  () throw(dash::exception::AttributeNotPresentException);
                 std::vector<Representation *>   getRepresentations      ();
+                const Representation*           getRepresentationById   ( const std::string &id ) const;
                 Viewpoint*                      getViewpoint            () throw(dash::exception::ElementNotPresentException);
                 Accessibility*                  getAccessibility        () throw(dash::exception::ElementNotPresentException);
                 Rating*                         getRating               () throw(dash::exception::ElementNotPresentException);



More information about the vlc-commits mailing list