[vlc-commits] demux: adaptive: pass ressources to chunk

Francois Cartegnie git at videolan.org
Mon Mar 30 16:15:18 CEST 2020


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Apr 18 16:12:20 2019 +0200| [00861a55ad85d9c83459f9d544456029b43ff0d0] | committer: Francois Cartegnie

demux: adaptive: pass ressources to chunk

(cherry picked from commit 4e6e6ce029823ce9f53e398f5b558dcd98799d33)

> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=00861a55ad85d9c83459f9d544456029b43ff0d0
---

 modules/demux/adaptive/SegmentTracker.cpp           | 6 +++---
 modules/demux/adaptive/playlist/Segment.cpp         | 3 ++-
 modules/demux/adaptive/playlist/Segment.h           | 5 ++++-
 modules/demux/smooth/playlist/ForgedInitSegment.cpp | 4 +++-
 modules/demux/smooth/playlist/ForgedInitSegment.hpp | 4 +++-
 5 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/modules/demux/adaptive/SegmentTracker.cpp b/modules/demux/adaptive/SegmentTracker.cpp
index a2d9548ce1..b4ee755ae3 100644
--- a/modules/demux/adaptive/SegmentTracker.cpp
+++ b/modules/demux/adaptive/SegmentTracker.cpp
@@ -230,7 +230,7 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed,
         init_sent = true;
         segment = rep->getSegment(BaseRepresentation::INFOTYPE_INIT);
         if(segment)
-            return segment->toChunk(next, rep, connManager);
+            return segment->toChunk(resources, connManager, next, rep);
     }
 
     if(!index_sent)
@@ -238,7 +238,7 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed,
         index_sent = true;
         segment = rep->getSegment(BaseRepresentation::INFOTYPE_INDEX);
         if(segment)
-            return segment->toChunk(next, rep, connManager);
+            return segment->toChunk(resources, connManager, next, rep);
     }
 
     bool b_gap = false;
@@ -255,7 +255,7 @@ SegmentChunk * SegmentTracker::getNextChunk(bool switch_allowed,
         initializing = false;
     }
 
-    SegmentChunk *chunk = segment->toChunk(next, rep, connManager);
+    SegmentChunk *chunk = segment->toChunk(resources, connManager, next, rep);
 
     /* Notify new segment length for stats / logic */
     if(chunk)
diff --git a/modules/demux/adaptive/playlist/Segment.cpp b/modules/demux/adaptive/playlist/Segment.cpp
index 38cb412f67..4f805de4f2 100644
--- a/modules/demux/adaptive/playlist/Segment.cpp
+++ b/modules/demux/adaptive/playlist/Segment.cpp
@@ -67,7 +67,8 @@ void ISegment::onChunkDownload(block_t **, SegmentChunk *, BaseRepresentation *)
 
 }
 
-SegmentChunk* ISegment::toChunk(size_t index, BaseRepresentation *rep, AbstractConnectionManager *connManager)
+SegmentChunk* ISegment::toChunk(SharedResources *, AbstractConnectionManager *connManager,
+                                size_t index, BaseRepresentation *rep)
 {
     const std::string url = getUrlSegment().toString(index, rep);
     HTTPChunkBufferedSource *source = new (std::nothrow) HTTPChunkBufferedSource(url, connManager,
diff --git a/modules/demux/adaptive/playlist/Segment.h b/modules/demux/adaptive/playlist/Segment.h
index 8dca5e9538..1a2c217d58 100644
--- a/modules/demux/adaptive/playlist/Segment.h
+++ b/modules/demux/adaptive/playlist/Segment.h
@@ -35,6 +35,8 @@
 
 namespace adaptive
 {
+    class SharedResources;
+
     namespace http
     {
         class AbstractConnectionManager;
@@ -58,7 +60,8 @@ namespace adaptive
                  *          That is basically true when using an Url, and false
                  *          when using an UrlTemplate
                  */
-                virtual SegmentChunk*                   toChunk         (size_t, BaseRepresentation *, AbstractConnectionManager *);
+                virtual SegmentChunk*                   toChunk         (SharedResources *, AbstractConnectionManager *,
+                                                                         size_t, BaseRepresentation *);
                 virtual void                            setByteRange    (size_t start, size_t end);
                 virtual void                            setSequenceNumber(uint64_t);
                 virtual uint64_t                        getSequenceNumber() const;
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.cpp b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
index 258bf26756..7be0cc7eb7 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.cpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.cpp
@@ -35,6 +35,7 @@ extern "C"
     #include "../../demux/mp4/libmp4.h" /* majors */
 }
 
+using namespace adaptive;
 using namespace adaptive::playlist;
 using namespace smooth::playlist;
 using namespace smooth::http;
@@ -304,7 +305,8 @@ block_t * ForgedInitSegment::buildMoovBox()
     return moov;
 }
 
-SegmentChunk* ForgedInitSegment::toChunk(size_t, BaseRepresentation *rep, AbstractConnectionManager *)
+SegmentChunk* ForgedInitSegment::toChunk(SharedResources *, AbstractConnectionManager *,
+                                         size_t, BaseRepresentation *rep)
 {
     block_t *moov = buildMoovBox();
     if(moov)
diff --git a/modules/demux/smooth/playlist/ForgedInitSegment.hpp b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
index 9dd60bc7e6..6e04d51035 100644
--- a/modules/demux/smooth/playlist/ForgedInitSegment.hpp
+++ b/modules/demux/smooth/playlist/ForgedInitSegment.hpp
@@ -30,6 +30,7 @@ namespace smooth
 {
     namespace playlist
     {
+        using namespace adaptive;
         using namespace adaptive::playlist;
         using namespace adaptive::http;
 
@@ -40,7 +41,8 @@ namespace smooth
                 ForgedInitSegment(ICanonicalUrl *parent, const std::string &,
                                   uint64_t, uint64_t);
                 virtual ~ForgedInitSegment();
-                virtual SegmentChunk* toChunk(size_t, BaseRepresentation *, AbstractConnectionManager *); /* reimpl */
+                virtual SegmentChunk* toChunk(SharedResources *, AbstractConnectionManager *,
+                                              size_t, BaseRepresentation *); /* reimpl */
                 void setWaveFormatEx(const std::string &);
                 void setCodecPrivateData(const std::string &);
                 void setChannels(uint16_t);



More information about the vlc-commits mailing list