[vlc-commits] demux: dash: move debug to playlist

Francois Cartegnie git at videolan.org
Thu Apr 30 20:50:22 CEST 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Apr 28 18:55:30 2015 +0200| [06b981f84736d5f61cffcba533e04221c21306a3] | committer: Francois Cartegnie

demux: dash: move debug to playlist

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

 .../demux/adaptative/playlist/AbstractPlaylist.hpp |    1 +
 modules/demux/dash/mpd/IsoffMainParser.cpp         |   26 ++------------------
 modules/demux/dash/mpd/IsoffMainParser.h           |    1 -
 modules/demux/dash/mpd/MPD.cpp                     |   24 ++++++++++++++++++
 modules/demux/dash/mpd/MPD.h                       |    1 +
 5 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/modules/demux/adaptative/playlist/AbstractPlaylist.hpp b/modules/demux/adaptative/playlist/AbstractPlaylist.hpp
index 17b13dc..4a72457 100644
--- a/modules/demux/adaptative/playlist/AbstractPlaylist.hpp
+++ b/modules/demux/adaptative/playlist/AbstractPlaylist.hpp
@@ -42,6 +42,7 @@ namespace adaptative
 
                 virtual bool                    isLive() const = 0;
                 void                            setType(const std::string &);
+                virtual void                    debug() = 0;
 
                 void    addPeriod               (BasePeriod *period);
                 void    addBaseUrl              (BaseUrl *url);
diff --git a/modules/demux/dash/mpd/IsoffMainParser.cpp b/modules/demux/dash/mpd/IsoffMainParser.cpp
index 0696e71..5a01b57 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.cpp
+++ b/modules/demux/dash/mpd/IsoffMainParser.cpp
@@ -64,7 +64,8 @@ bool    IsoffMainParser::parse              (Profile profile)
     setMPDBaseUrl(root);
     parsePeriods(root);
 
-    print();
+    if(mpd)
+        mpd->debug();
     return true;
 }
 
@@ -430,29 +431,6 @@ void IsoffMainParser::parseProgramInformation(Node * node, MPD *mpd)
     }
 }
 
-void    IsoffMainParser::print              ()
-{
-    if(mpd)
-    {
-        msg_Dbg(p_stream, "MPD profile=%s mediaPresentationDuration=%ld minBufferTime=%ld",
-                static_cast<std::string>(mpd->getProfile()).c_str(),
-                mpd->duration.Get(),
-                mpd->minBufferTime.Get());
-        msg_Dbg(p_stream, "BaseUrl=%s", mpd->getUrlSegment().toString().c_str());
-
-        std::vector<BasePeriod *>::const_iterator i;
-        for(i = mpd->getPeriods().begin(); i != mpd->getPeriods().end(); i++)
-        {
-            std::vector<std::string> debug = (*i)->toString();
-            std::vector<std::string>::const_iterator l;
-            for(l = debug.begin(); l < debug.end(); l++)
-            {
-                msg_Dbg(p_stream, "%s", (*l).c_str());
-            }
-        }
-    }
-}
-
 IsoTime::IsoTime(const std::string &str)
 {
     time = str_duration(str.c_str());
diff --git a/modules/demux/dash/mpd/IsoffMainParser.h b/modules/demux/dash/mpd/IsoffMainParser.h
index 66ac9c1..e1ae40c 100644
--- a/modules/demux/dash/mpd/IsoffMainParser.h
+++ b/modules/demux/dash/mpd/IsoffMainParser.h
@@ -61,7 +61,6 @@ namespace dash
                 virtual ~IsoffMainParser    ();
 
                 bool    parse  (Profile profile);
-                void    print  ();
 
             private:
                 void    setMPDAttributes    ();
diff --git a/modules/demux/dash/mpd/MPD.cpp b/modules/demux/dash/mpd/MPD.cpp
index 9299f44..da41f83 100644
--- a/modules/demux/dash/mpd/MPD.cpp
+++ b/modules/demux/dash/mpd/MPD.cpp
@@ -27,6 +27,10 @@
 
 #include "MPD.h"
 #include "ProgramInformation.h"
+#include "Period.h"
+
+#include <vlc_common.h>
+#include <vlc_stream.h>
 
 using namespace dash::mpd;
 
@@ -57,3 +61,23 @@ Profile MPD::getProfile() const
 {
     return profile;
 }
+
+void MPD::debug()
+{
+    msg_Dbg(stream, "MPD profile=%s mediaPresentationDuration=%ld minBufferTime=%ld",
+            static_cast<std::string>(getProfile()).c_str(),
+            duration.Get(),
+            minBufferTime.Get());
+    msg_Dbg(stream, "BaseUrl=%s", getUrlSegment().toString().c_str());
+
+    std::vector<BasePeriod *>::const_iterator i;
+    for(i = getPeriods().begin(); i != getPeriods().end(); i++)
+    {
+        std::vector<std::string> debug = (*i)->toString();
+        std::vector<std::string>::const_iterator l;
+        for(l = debug.begin(); l < debug.end(); l++)
+        {
+            msg_Dbg(stream, "%s", (*l).c_str());
+        }
+    }
+}
diff --git a/modules/demux/dash/mpd/MPD.h b/modules/demux/dash/mpd/MPD.h
index 8ed319a..1356a54 100644
--- a/modules/demux/dash/mpd/MPD.h
+++ b/modules/demux/dash/mpd/MPD.h
@@ -44,6 +44,7 @@ namespace dash
 
                 Profile                         getProfile() const;
                 virtual bool                    isLive() const;
+                virtual void                    debug();
 
                 Property<ProgramInformation *>      programInfo;
 



More information about the vlc-commits mailing list