[vlc-commits] demux: adaptative: remove unused Chunk members

Francois Cartegnie git at videolan.org
Tue Oct 27 19:13:51 CET 2015


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Oct 15 16:39:44 2015 +0200| [65433f09b5714ad36ce595675273128e347f526f] | committer: Francois Cartegnie

demux: adaptative: remove unused Chunk members

still carried from early impl

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

 modules/demux/adaptative/http/Chunk.cpp            |   24 ++------------------
 modules/demux/adaptative/http/Chunk.h              |    7 ------
 .../adaptative/http/HTTPConnectionManager.cpp      |    5 ----
 .../demux/adaptative/http/HTTPConnectionManager.h  |    2 --
 modules/demux/adaptative/playlist/Segment.cpp      |    8 -------
 modules/demux/adaptative/playlist/Segment.h        |    1 -
 6 files changed, 2 insertions(+), 45 deletions(-)

diff --git a/modules/demux/adaptative/http/Chunk.cpp b/modules/demux/adaptative/http/Chunk.cpp
index 12ff8fb..2bc689c 100644
--- a/modules/demux/adaptative/http/Chunk.cpp
+++ b/modules/demux/adaptative/http/Chunk.cpp
@@ -35,7 +35,6 @@ using namespace adaptative::http;
 Chunk::Chunk        (const std::string& url) :
        startByte    (0),
        endByte      (0),
-       bitrate      (1),
        port         (0),
        length       (0),
        bytesRead    (0),
@@ -98,24 +97,12 @@ void                Chunk::setStartByte         (size_t startByte)
     if (endByte > startByte)
         bytesToRead = endByte - startByte;
 }
-void                Chunk::addOptionalUrl       (const std::string& url)
-{
-    this->optionalUrls.push_back(url);
-}
+
 bool                Chunk::usesByteRange        () const
 {
     return (startByte != endByte);
 }
 
-void                Chunk::setBitrate           (uint64_t bitrate)
-{
-    this->bitrate = bitrate;
-}
-int                 Chunk::getBitrate           ()
-{
-    return this->bitrate;
-}
-
 const std::string&  Chunk::getScheme            () const
 {
     return scheme;
@@ -133,10 +120,7 @@ int                 Chunk::getPort              () const
 {
     return this->port;
 }
-uint64_t            Chunk::getLength            () const
-{
-    return this->length;
-}
+
 void                Chunk::setLength            (uint64_t length)
 {
     this->length = length;
@@ -160,10 +144,6 @@ uint64_t            Chunk::getBytesToRead       () const
         return length - bytesRead;
 }
 
-size_t              Chunk::getPercentDownloaded () const
-{
-    return (size_t)(((float)this->bytesRead / this->length) * 100);
-}
 HTTPConnection*     Chunk::getConnection           () const
 {
     return this->connection;
diff --git a/modules/demux/adaptative/http/Chunk.h b/modules/demux/adaptative/http/Chunk.h
index 22d5315..5d9bc1c 100644
--- a/modules/demux/adaptative/http/Chunk.h
+++ b/modules/demux/adaptative/http/Chunk.h
@@ -50,10 +50,8 @@ namespace adaptative
                 const std::string&  getHostname             () const;
                 const std::string&  getPath                 () const;
                 int                 getPort                 () const;
-                uint64_t            getLength               () const;
                 uint64_t            getBytesRead            () const;
                 uint64_t            getBytesToRead          () const;
-                size_t              getPercentDownloaded    () const;
                 HTTPConnection*     getConnection           () const;
 
                 void                setConnection   (HTTPConnection *connection);
@@ -62,10 +60,7 @@ namespace adaptative
                 void                setLength       (uint64_t length);
                 void                setEndByte      (size_t endByte);
                 void                setStartByte    (size_t startByte);
-                void                addOptionalUrl  (const std::string& url);
                 bool                usesByteRange   () const;
-                void                setBitrate      (uint64_t bitrate);
-                int                 getBitrate      ();
 
                 virtual void        onDownload      (block_t **) {}
 
@@ -74,10 +69,8 @@ namespace adaptative
                 std::string                 scheme;
                 std::string                 path;
                 std::string                 hostname;
-                std::vector<std::string>    optionalUrls;
                 size_t                      startByte;
                 size_t                      endByte;
-                int                         bitrate;
                 int                         port;
                 uint64_t                    length;
                 uint64_t                    bytesRead;
diff --git a/modules/demux/adaptative/http/HTTPConnectionManager.cpp b/modules/demux/adaptative/http/HTTPConnectionManager.cpp
index 6912520..ccaeb77 100644
--- a/modules/demux/adaptative/http/HTTPConnectionManager.cpp
+++ b/modules/demux/adaptative/http/HTTPConnectionManager.cpp
@@ -32,8 +32,6 @@
 
 using namespace adaptative::http;
 
-const uint64_t  HTTPConnectionManager::CHUNKDEFAULTBITRATE    = 1;
-
 HTTPConnectionManager::HTTPConnectionManager    (vlc_object_t *stream) :
                        stream                   (stream)
 {
@@ -98,8 +96,5 @@ bool HTTPConnectionManager::connectChunk(Chunk *chunk)
 
     conn->bindChunk(chunk);
 
-    if(chunk->getBitrate() <= 0)
-        chunk->setBitrate(HTTPConnectionManager::CHUNKDEFAULTBITRATE);
-
     return true;
 }
diff --git a/modules/demux/adaptative/http/HTTPConnectionManager.h b/modules/demux/adaptative/http/HTTPConnectionManager.h
index d4ffa97..12a0d66 100644
--- a/modules/demux/adaptative/http/HTTPConnectionManager.h
+++ b/modules/demux/adaptative/http/HTTPConnectionManager.h
@@ -54,8 +54,6 @@ namespace adaptative
                 std::vector<HTTPConnection *>                       connectionPool;
                 vlc_object_t                                       *stream;
 
-                static const uint64_t   CHUNKDEFAULTBITRATE;
-
                 HTTPConnection * getConnectionForHost    (const std::string &hostname);
         };
     }
diff --git a/modules/demux/adaptative/playlist/Segment.cpp b/modules/demux/adaptative/playlist/Segment.cpp
index aa8168c..3cdb3f2 100644
--- a/modules/demux/adaptative/playlist/Segment.cpp
+++ b/modules/demux/adaptative/playlist/Segment.cpp
@@ -225,14 +225,6 @@ Url Segment::getUrlSegment() const
     }
 }
 
-SegmentChunk* Segment::toChunk(size_t index, BaseRepresentation *ctxrep)
-{
-    SegmentChunk *chunk = ISegment::toChunk(index, ctxrep);
-    if (chunk && ctxrep)
-        chunk->setBitrate(ctxrep->getBandwidth());
-    return chunk;
-}
-
 std::vector<ISegment*> Segment::subSegments()
 {
     std::vector<ISegment*> list;
diff --git a/modules/demux/adaptative/playlist/Segment.h b/modules/demux/adaptative/playlist/Segment.h
index c7d1213..94fc048 100644
--- a/modules/demux/adaptative/playlist/Segment.h
+++ b/modules/demux/adaptative/playlist/Segment.h
@@ -94,7 +94,6 @@ namespace adaptative
                 ~Segment();
                 virtual void setSourceUrl( const std::string &url );
                 virtual Url getUrlSegment() const; /* impl */
-                virtual SegmentChunk* toChunk(size_t, BaseRepresentation * = NULL);
                 virtual std::vector<ISegment*> subSegments();
                 virtual void debug(vlc_object_t *,int = 0) const;
                 virtual void addSubSegment(SubSegment *);



More information about the vlc-commits mailing list