[vlc-commits] demux: adaptive: remove streams/source ContentType propagation

Francois Cartegnie git at videolan.org
Mon Mar 15 20:56:31 UTC 2021


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 15 17:57:11 2021 +0100| [cf71d9197fce6a7a1e160e66d9dc6f68c64638fa] | committer: Francois Cartegnie

demux: adaptive: remove streams/source ContentType propagation

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

 modules/demux/adaptive/AbstractSource.hpp        |  1 -
 modules/demux/adaptive/Streams.cpp               | 10 --------
 modules/demux/adaptive/Streams.hpp               |  1 -
 modules/demux/adaptive/plumbing/SourceStream.cpp | 31 +-----------------------
 modules/demux/adaptive/plumbing/SourceStream.hpp |  3 ---
 5 files changed, 1 insertion(+), 45 deletions(-)

diff --git a/modules/demux/adaptive/AbstractSource.hpp b/modules/demux/adaptive/AbstractSource.hpp
index 98a3d9ed7f..ecbdf1ca66 100644
--- a/modules/demux/adaptive/AbstractSource.hpp
+++ b/modules/demux/adaptive/AbstractSource.hpp
@@ -29,7 +29,6 @@ namespace adaptive
         public:
             virtual ~AbstractSource() {}
             virtual block_t *readNextBlock() = 0;
-            virtual std::string getContentType() = 0;
     };
 }
 
diff --git a/modules/demux/adaptive/Streams.cpp b/modules/demux/adaptive/Streams.cpp
index b94f8a5686..b7a3850405 100644
--- a/modules/demux/adaptive/Streams.cpp
+++ b/modules/demux/adaptive/Streams.cpp
@@ -524,16 +524,6 @@ ChunkInterface * AbstractStream::getNextChunk() const
     return segmentTracker->getNextChunk(!b_restarting, connManager);
 }
 
-std::string AbstractStream::getContentType()
-{
-    if (currentChunk == nullptr && !eof)
-        currentChunk = getNextChunk();
-    if(currentChunk)
-        return currentChunk->getContentType();
-    else
-        return std::string();
-}
-
 block_t * AbstractStream::readNextBlock()
 {
     if (currentChunk == nullptr && !eof)
diff --git a/modules/demux/adaptive/Streams.hpp b/modules/demux/adaptive/Streams.hpp
index dc78e2fdc5..bf7480ca97 100644
--- a/modules/demux/adaptive/Streams.hpp
+++ b/modules/demux/adaptive/Streams.hpp
@@ -96,7 +96,6 @@ namespace adaptive
         void runUpdates();
 
         /* Used by demuxers fake streams */
-        virtual std::string getContentType() override;
         virtual block_t *readNextBlock() override;
 
         /**/
diff --git a/modules/demux/adaptive/plumbing/SourceStream.cpp b/modules/demux/adaptive/plumbing/SourceStream.cpp
index 39530aed92..75b5792dfa 100644
--- a/modules/demux/adaptive/plumbing/SourceStream.cpp
+++ b/modules/demux/adaptive/plumbing/SourceStream.cpp
@@ -59,9 +59,8 @@ int AbstractChunksSourceStream::seek_Callback(stream_t *s, uint64_t i_pos)
     return me->Seek(i_pos);
 }
 
-int AbstractChunksSourceStream::control_Callback(stream_t *s, int i_query, va_list args)
+int AbstractChunksSourceStream::control_Callback(stream_t *, int i_query, va_list args)
 {
-    AbstractChunksSourceStream *me = reinterpret_cast<AbstractChunksSourceStream *>(s->p_sys);
     switch( i_query )
     {
         case STREAM_GET_SIZE:
@@ -75,17 +74,6 @@ int AbstractChunksSourceStream::control_Callback(stream_t *s, int i_query, va_li
             *va_arg( args, bool * ) = false;
             return VLC_SUCCESS;
 
-        case STREAM_GET_CONTENT_TYPE:
-        {
-            std::string type = me->getContentType();
-            if(!type.empty())
-            {
-                *va_arg( args, char ** ) = strdup(type.c_str());
-                return VLC_SUCCESS;
-            }
-        }
-        break;
-
         case STREAM_GET_PTS_DELAY:
             *(va_arg( args, vlc_tick_t * )) = DEFAULT_PTS_DELAY;
             return VLC_SUCCESS;
@@ -134,16 +122,6 @@ void ChunksSourceStream::Reset()
     AbstractChunksSourceStream::Reset();
 }
 
-std::string ChunksSourceStream::getContentType()
-{
-    if(!b_eof && !p_block)
-    {
-        p_block = source->readNextBlock();
-        b_eof = !p_block;
-    }
-    return source->getContentType();
-}
-
 size_t ChunksSourceStream::Peek(const uint8_t **pp, size_t sz)
 {
     if(!b_eof && !p_block)
@@ -305,13 +283,6 @@ size_t BufferedChunksSourceStream::Peek(const uint8_t **pp, size_t sz)
     return i_read;
 }
 
-std::string BufferedChunksSourceStream::getContentType()
-{
-    if(block_BytestreamRemaining(&bs) == 0)
-        fillByteStream(1);
-    return source->getContentType();
-}
-
 void BufferedChunksSourceStream::fillByteStream(size_t level)
 {
     while(!b_eof && level > block_BytestreamRemaining(&bs))
diff --git a/modules/demux/adaptive/plumbing/SourceStream.hpp b/modules/demux/adaptive/plumbing/SourceStream.hpp
index 105b310fb8..6ecf8bf2a4 100644
--- a/modules/demux/adaptive/plumbing/SourceStream.hpp
+++ b/modules/demux/adaptive/plumbing/SourceStream.hpp
@@ -49,7 +49,6 @@ namespace adaptive
         protected:
             virtual ssize_t Read(uint8_t *, size_t) = 0;
             virtual int     Seek(uint64_t) = 0;
-            virtual std::string getContentType() = 0;
             bool b_eof;
             vlc_object_t *p_obj;
             AbstractSource *source;
@@ -72,7 +71,6 @@ namespace adaptive
             virtual ssize_t Read(uint8_t *, size_t) override;
             virtual int     Seek(uint64_t) override;
             virtual size_t  Peek(const uint8_t **, size_t) override;
-            virtual std::string getContentType() override;
 
         private:
             block_t *p_block;
@@ -89,7 +87,6 @@ namespace adaptive
             virtual ssize_t Read(uint8_t *, size_t) override;
             virtual int     Seek(uint64_t) override;
             virtual size_t  Peek(const uint8_t **, size_t) override;
-            virtual std::string getContentType() override;
 
         private:
             ssize_t doRead(uint8_t *, size_t);



More information about the vlc-commits mailing list