vlc/vlc-1.2 | branch: master | Hugo Beauzée-Luyssen <[email protected]> | Wed 
Dec 21 23:34:09 2011 +0100| [0af2e5c2c1845e5eaac3f3172acfe24f8fa2d2e3] | 
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 <[email protected]>
(cherry picked from commit 058904517b00e08409aadb8e8f1579c5cc602387)

Signed-off-by: Jean-Baptiste Kempf <[email protected]>

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

 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);

_______________________________________________
vlc-commits mailing list
[email protected]
http://mailman.videolan.org/listinfo/vlc-commits

Reply via email to