Commit 11ab2cdc authored by François Cartegnie's avatar François Cartegnie 🤞
Browse files

demux: adaptative: merge stream outputs

parent 0e944452
...@@ -447,10 +447,10 @@ AbstractStreamOutput *DefaultStreamOutputFactory::create(demux_t *demux, int for ...@@ -447,10 +447,10 @@ AbstractStreamOutput *DefaultStreamOutputFactory::create(demux_t *demux, int for
switch(format) switch(format)
{ {
case StreamFormat::MP4: case StreamFormat::MP4:
return new MP4StreamOutput(demux); return new BaseStreamOutput(demux, "mp4");
case StreamFormat::MPEG2TS: case StreamFormat::MPEG2TS:
return new MPEG2TSStreamOutput(demux); return new BaseStreamOutput(demux, "ts");
default: default:
throw VLC_EBADVAR; throw VLC_EBADVAR;
...@@ -460,18 +460,10 @@ AbstractStreamOutput *DefaultStreamOutputFactory::create(demux_t *demux, int for ...@@ -460,18 +460,10 @@ AbstractStreamOutput *DefaultStreamOutputFactory::create(demux_t *demux, int for
} }
MP4StreamOutput::MP4StreamOutput(demux_t *demux) : BaseStreamOutput::BaseStreamOutput(demux_t *demux, const std::string &name) :
AbstractStreamOutput(demux) AbstractStreamOutput(demux)
{ {
demuxstream = stream_DemuxNew(demux, "mp4", fakeesout); demuxstream = stream_DemuxNew(demux, name.c_str(), fakeesout);
if(!demuxstream)
throw VLC_EGENERIC;
}
MPEG2TSStreamOutput::MPEG2TSStreamOutput(demux_t *demux) :
AbstractStreamOutput(demux)
{
demuxstream = stream_DemuxNew(demux, "ts", fakeesout);
if(!demuxstream) if(!demuxstream)
throw VLC_EGENERIC; throw VLC_EGENERIC;
} }
...@@ -141,18 +141,11 @@ namespace adaptative ...@@ -141,18 +141,11 @@ namespace adaptative
virtual AbstractStreamOutput *create(demux_t*, int streamType) const; virtual AbstractStreamOutput *create(demux_t*, int streamType) const;
}; };
class MP4StreamOutput : public AbstractStreamOutput class BaseStreamOutput : public AbstractStreamOutput
{ {
public: public:
MP4StreamOutput(demux_t *); BaseStreamOutput(demux_t *, const std::string &);
virtual ~MP4StreamOutput(){} virtual ~BaseStreamOutput(){}
};
class MPEG2TSStreamOutput : public AbstractStreamOutput
{
public:
MPEG2TSStreamOutput(demux_t *);
virtual ~MPEG2TSStreamOutput(){}
}; };
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment