[vlc-commits] dash: Fixing STREAM_GET_SIZE control query.

Hugo Beauzée-Luyssen git at videolan.org
Thu Feb 2 14:40:24 CET 2012


vlc | branch: master | Hugo Beauzée-Luyssen <beauze.h at gmail.com> | Wed Jan 25 18:10:00 2012 +0100| [6b984f72fa46594513f2ed0973efb65c8454b297] | committer: Hugo Beauzée-Luyssen

dash: Fixing STREAM_GET_SIZE control query.

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

 modules/stream_filter/dash/DASHManager.cpp       |    5 +++++
 modules/stream_filter/dash/DASHManager.h         |    1 +
 modules/stream_filter/dash/dash.cpp              |   13 ++++++++++++-
 modules/stream_filter/dash/mpd/SegmentTemplate.h |    1 -
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/modules/stream_filter/dash/DASHManager.cpp b/modules/stream_filter/dash/DASHManager.cpp
index f14e1f7..4033be7 100644
--- a/modules/stream_filter/dash/DASHManager.cpp
+++ b/modules/stream_filter/dash/DASHManager.cpp
@@ -109,3 +109,8 @@ const logic::IAdaptationLogic*  DASHManager::getAdaptionLogic() const
 {
     return this->adaptationLogic;
 }
+
+const Chunk *DASHManager::getCurrentChunk() const
+{
+    return this->currentChunk;
+}
diff --git a/modules/stream_filter/dash/DASHManager.h b/modules/stream_filter/dash/DASHManager.h
index 860eee2..1fef884 100644
--- a/modules/stream_filter/dash/DASHManager.h
+++ b/modules/stream_filter/dash/DASHManager.h
@@ -47,6 +47,7 @@ namespace dash
             int peek( const uint8_t **pp_peek, size_t i_peek );
             const mpd::IMPDManager*         getMpdManager() const;
             const logic::IAdaptationLogic*  getAdaptionLogic() const;
+            const http::Chunk *getCurrentChunk() const;
 
         private:
             http::HTTPConnectionManager         *conManager;
diff --git a/modules/stream_filter/dash/dash.cpp b/modules/stream_filter/dash/dash.cpp
index ab3acee..d44661c 100644
--- a/modules/stream_filter/dash/dash.cpp
+++ b/modules/stream_filter/dash/dash.cpp
@@ -199,9 +199,20 @@ static int  Control         (stream_t *p_stream, int i_query, va_list args)
         case STREAM_SET_POSITION:
             return VLC_EGENERIC;
         case STREAM_GET_SIZE:
+        {
+            uint64_t*   res = (va_arg (args, uint64_t *));
             if(p_sys->isLive)
-                *(va_arg (args, uint64_t *)) = 0;
+                *res = 0;
+            else
+            {
+                const dash::mpd::Representation *rep = p_sys->p_dashManager->getAdaptionLogic()->getCurrentRepresentation();
+                if ( rep == NULL )
+                    *res = 0;
+                else
+                    *res = p_sys->p_mpd->getDuration() * rep->getBandwidth();
+            }
             break;
+        }
         default:
             return VLC_EGENERIC;
     }
diff --git a/modules/stream_filter/dash/mpd/SegmentTemplate.h b/modules/stream_filter/dash/mpd/SegmentTemplate.h
index 8439050..dea7fcc 100644
--- a/modules/stream_filter/dash/mpd/SegmentTemplate.h
+++ b/modules/stream_filter/dash/mpd/SegmentTemplate.h
@@ -42,7 +42,6 @@ namespace dash
                 virtual void            done();
             private:
                 bool                    containRuntimeIdentifier;
-                Representation*         representation;
                 size_t                  beginTime;
                 size_t                  beginIndex;
                 int                     currentSegmentIndex;



More information about the vlc-commits mailing list