[vlc-commits] demux: adaptive: remove MimeDemuxer
Francois Cartegnie
git at videolan.org
Mon Mar 15 20:56:30 UTC 2021
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Mar 15 17:53:35 2021 +0100| [b9f4904d44e9a8971cbd5b66a6610f4da7286cd6] | committer: Francois Cartegnie
demux: adaptive: remove MimeDemuxer
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=b9f4904d44e9a8971cbd5b66a6610f4da7286cd6
---
modules/demux/adaptive/plumbing/Demuxer.cpp | 81 -----------------------------
modules/demux/adaptive/plumbing/Demuxer.hpp | 19 -------
modules/demux/hls/HLSStreams.cpp | 5 +-
3 files changed, 1 insertion(+), 104 deletions(-)
diff --git a/modules/demux/adaptive/plumbing/Demuxer.cpp b/modules/demux/adaptive/plumbing/Demuxer.cpp
index 0317f7309a..b3cb365045 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.cpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.cpp
@@ -89,87 +89,6 @@ AbstractDemuxer::Status AbstractDemuxer::returnCode(int i_ret)
};
}
-MimeDemuxer::MimeDemuxer(vlc_object_t *p_obj_,
- const DemuxerFactoryInterface *factory_,
- es_out_t *out, AbstractSourceStream *source)
- : AbstractDemuxer()
-{
- p_es_out = out;
- factory = factory_;
- p_obj = p_obj_;
- demuxer = nullptr;
- sourcestream = source;
-}
-
-MimeDemuxer::~MimeDemuxer()
-{
- if( demuxer )
- delete demuxer;
-}
-
-bool MimeDemuxer::create()
-{
- stream_t *p_newstream = sourcestream->makeStream();
- if(!p_newstream)
- return false;
-
- StreamFormat format(StreamFormat::UNKNOWN);
-
- /* Try to probe */
- const uint8_t *p_peek;
- size_t i_peek = sourcestream->Peek(&p_peek, StreamFormat::PEEK_SIZE);
- format = StreamFormat(reinterpret_cast<const void *>(p_peek), i_peek);
-
- if(format == StreamFormat(StreamFormat::UNKNOWN))
- {
- char *type = stream_ContentType(p_newstream);
- if(type)
- {
- format = StreamFormat(std::string(type));
- free(type);
- }
- }
-
- if(format != StreamFormat(StreamFormat::UNKNOWN))
- demuxer = factory->newDemux(VLC_OBJECT(p_obj), format,
- p_es_out, sourcestream);
-
- vlc_stream_Delete(p_newstream);
-
- if(!demuxer || !demuxer->create())
- return false;
-
- b_startsfromzero = demuxer->alwaysStartsFromZero();
- b_reinitsonseek = demuxer->needsRestartOnSeek();
- b_alwaysrestarts = demuxer->needsRestartOnEachSegment();
- b_candetectswitches = demuxer->bitstreamSwitchCompatible();
-
- return true;
-}
-
-void MimeDemuxer::destroy()
-{
- if(demuxer)
- {
- delete demuxer;
- demuxer = nullptr;
- }
- sourcestream->Reset();
-}
-
-void MimeDemuxer::drain()
-{
- if(demuxer)
- demuxer->drain();
-}
-
-AbstractDemuxer::Status MimeDemuxer::demux(vlc_tick_t t)
-{
- if(!demuxer)
- return Status::Eof;
- return demuxer->demux(t);
-}
-
Demuxer::Demuxer(vlc_object_t *p_obj_, const std::string &name_,
es_out_t *out, AbstractSourceStream *source)
: AbstractDemuxer()
diff --git a/modules/demux/adaptive/plumbing/Demuxer.hpp b/modules/demux/adaptive/plumbing/Demuxer.hpp
index 38d85300dc..b22a21855f 100644
--- a/modules/demux/adaptive/plumbing/Demuxer.hpp
+++ b/modules/demux/adaptive/plumbing/Demuxer.hpp
@@ -59,25 +59,6 @@ namespace adaptive
bool b_candetectswitches;
};
- class MimeDemuxer : public AbstractDemuxer
- {
- public:
- MimeDemuxer(vlc_object_t *, const DemuxerFactoryInterface *,
- es_out_t *, AbstractSourceStream *);
- virtual ~MimeDemuxer();
- virtual Status demux(vlc_tick_t) override;
- virtual void drain() override;
- virtual bool create() override;
- virtual void destroy() override;
-
- protected:
- AbstractSourceStream *sourcestream;
- vlc_object_t *p_obj;
- AbstractDemuxer *demuxer;
- const DemuxerFactoryInterface *factory;
- es_out_t *p_es_out;
- };
-
class Demuxer : public AbstractDemuxer
{
public:
diff --git a/modules/demux/hls/HLSStreams.cpp b/modules/demux/hls/HLSStreams.cpp
index 2604b5acf2..41a15b8f70 100644
--- a/modules/demux/hls/HLSStreams.cpp
+++ b/modules/demux/hls/HLSStreams.cpp
@@ -153,11 +153,8 @@ AbstractDemuxer *HLSStream::newDemux(vlc_object_t *p_obj, const StreamFormat &fo
break;
*/
- case StreamFormat::UNKNOWN:
- ret = new MimeDemuxer(p_obj, this, out, source);
- break;
-
default:
+ case StreamFormat::UNKNOWN:
case StreamFormat::UNSUPPORTED:
break;
}
More information about the vlc-commits
mailing list