Commit 08b864b7 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: adaptative: remove confusing namespace

parent da6b5aac
...@@ -53,14 +53,14 @@ PlaylistManager::PlaylistManager( AbstractPlaylist *pl, ...@@ -53,14 +53,14 @@ PlaylistManager::PlaylistManager( AbstractPlaylist *pl,
stream ( stream ), stream ( stream ),
nextPlaylistupdate ( 0 ) nextPlaylistupdate ( 0 )
{ {
for(int i=0; i<Streams::count; i++) for(int i=0; i<StreamTypeCount; i++)
streams[i] = NULL; streams[i] = NULL;
} }
PlaylistManager::~PlaylistManager () PlaylistManager::~PlaylistManager ()
{ {
delete conManager; delete conManager;
for(int i=0; i<Streams::count; i++) for(int i=0; i<StreamTypeCount; i++)
delete streams[i]; delete streams[i];
} }
...@@ -70,13 +70,13 @@ bool PlaylistManager::start(demux_t *demux) ...@@ -70,13 +70,13 @@ bool PlaylistManager::start(demux_t *demux)
if(!period) if(!period)
return false; return false;
for(int i=0; i<Streams::count; i++) for(int i=0; i<StreamTypeCount; i++)
{ {
Streams::Type type = static_cast<Streams::Type>(i); StreamType type = static_cast<StreamType>(i);
const BaseAdaptationSet *set = period->getAdaptationSet(type); const BaseAdaptationSet *set = period->getAdaptationSet(type);
if(set) if(set)
{ {
streams[type] = new (std::nothrow) Streams::Stream(set->getMimeType()); streams[type] = new (std::nothrow) Stream(set->getMimeType());
if(!streams[type]) if(!streams[type])
continue; continue;
AbstractAdaptationLogic *logic = createLogic(logicType); AbstractAdaptationLogic *logic = createLogic(logicType);
...@@ -112,22 +112,22 @@ bool PlaylistManager::start(demux_t *demux) ...@@ -112,22 +112,22 @@ bool PlaylistManager::start(demux_t *demux)
return true; return true;
} }
Streams::Stream::status PlaylistManager::demux(mtime_t nzdeadline) Stream::status PlaylistManager::demux(mtime_t nzdeadline)
{ {
Streams::Stream::status i_return = Streams::Stream::status_demuxed; Stream::status i_return = Stream::status_demuxed;
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
Streams::Stream::status i_ret = Stream::status i_ret =
streams[type]->demux(conManager, nzdeadline); streams[type]->demux(conManager, nzdeadline);
if(i_ret < Streams::Stream::status_eof) if(i_ret < Stream::status_eof)
return i_ret; return i_ret;
else if (i_ret == Streams::Stream::status_buffering) else if (i_ret == Stream::status_buffering)
i_return = Streams::Stream::status_buffering; i_return = Stream::status_buffering;
} }
return i_return; return i_return;
...@@ -136,7 +136,7 @@ Streams::Stream::status PlaylistManager::demux(mtime_t nzdeadline) ...@@ -136,7 +136,7 @@ Streams::Stream::status PlaylistManager::demux(mtime_t nzdeadline)
mtime_t PlaylistManager::getPCR() const mtime_t PlaylistManager::getPCR() const
{ {
mtime_t pcr = VLC_TS_INVALID; mtime_t pcr = VLC_TS_INVALID;
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
...@@ -148,7 +148,7 @@ mtime_t PlaylistManager::getPCR() const ...@@ -148,7 +148,7 @@ mtime_t PlaylistManager::getPCR() const
int PlaylistManager::getGroup() const int PlaylistManager::getGroup() const
{ {
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
...@@ -160,7 +160,7 @@ int PlaylistManager::getGroup() const ...@@ -160,7 +160,7 @@ int PlaylistManager::getGroup() const
int PlaylistManager::esCount() const int PlaylistManager::esCount() const
{ {
int es = 0; int es = 0;
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
...@@ -183,7 +183,7 @@ bool PlaylistManager::setPosition(mtime_t time) ...@@ -183,7 +183,7 @@ bool PlaylistManager::setPosition(mtime_t time)
for(int real = 0; real < 2; real++) for(int real = 0; real < 2; real++)
{ {
/* Always probe if we can seek first */ /* Always probe if we can seek first */
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
...@@ -200,7 +200,7 @@ bool PlaylistManager::seekAble() const ...@@ -200,7 +200,7 @@ bool PlaylistManager::seekAble() const
if(playlist->isLive()) if(playlist->isLive())
return false; return false;
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
......
...@@ -50,7 +50,7 @@ namespace adaptative ...@@ -50,7 +50,7 @@ namespace adaptative
bool start(demux_t *); bool start(demux_t *);
Streams::Stream::status demux(mtime_t); Stream::status demux(mtime_t);
mtime_t getDuration() const; mtime_t getDuration() const;
mtime_t getPCR() const; mtime_t getPCR() const;
int getGroup() const; int getGroup() const;
...@@ -66,7 +66,7 @@ namespace adaptative ...@@ -66,7 +66,7 @@ namespace adaptative
AbstractAdaptationLogic::LogicType logicType; AbstractAdaptationLogic::LogicType logicType;
AbstractPlaylist *playlist; AbstractPlaylist *playlist;
stream_t *stream; stream_t *stream;
Streams::Stream *streams[Streams::count]; Stream *streams[StreamTypeCount];
mtime_t nextPlaylistupdate; mtime_t nextPlaylistupdate;
}; };
......
...@@ -53,7 +53,7 @@ void SegmentTracker::resetCounter() ...@@ -53,7 +53,7 @@ void SegmentTracker::resetCounter()
prevRepresentation = NULL; prevRepresentation = NULL;
} }
Chunk * SegmentTracker::getNextChunk(Streams::Type type) Chunk * SegmentTracker::getNextChunk(StreamType type)
{ {
BaseRepresentation *rep; BaseRepresentation *rep;
ISegment *segment; ISegment *segment;
......
...@@ -58,7 +58,7 @@ namespace adaptative ...@@ -58,7 +58,7 @@ namespace adaptative
void setAdaptationLogic(AbstractAdaptationLogic *); void setAdaptationLogic(AbstractAdaptationLogic *);
void resetCounter(); void resetCounter();
Chunk* getNextChunk(Streams::Type); Chunk* getNextChunk(StreamType);
bool setPosition(mtime_t, bool); bool setPosition(mtime_t, bool);
mtime_t getSegmentStart() const; mtime_t getSegmentStart() const;
......
...@@ -28,23 +28,21 @@ ...@@ -28,23 +28,21 @@
#include <vlc_stream.h> #include <vlc_stream.h>
#include <vlc_demux.h> #include <vlc_demux.h>
using namespace adaptative::Streams; using namespace adaptative;
using namespace adaptative::http; using namespace adaptative::http;
using namespace adaptative::logic; using namespace adaptative::logic;
using namespace adaptative::Streams;
Stream::Stream(const std::string &mime) Stream::Stream(const std::string &mime)
{ {
init(mimeToType(mime), mimeToFormat(mime)); init(mimeToType(mime), mimeToFormat(mime));
} }
Stream::Stream(const Type type, const Format format) Stream::Stream(const StreamType type, const StreamFormat format)
{ {
init(type, format); init(type, format);
} }
void Stream::init(const Type type_, const Format format_) void Stream::init(const StreamType type_, const StreamFormat format_)
{ {
type = type_; type = type_;
format = format_; format = format_;
...@@ -63,31 +61,31 @@ Stream::~Stream() ...@@ -63,31 +61,31 @@ Stream::~Stream()
delete segmentTracker; delete segmentTracker;
} }
Type Stream::mimeToType(const std::string &mime) StreamType Stream::mimeToType(const std::string &mime)
{ {
Type mimetype; StreamType mimetype;
if (!mime.compare(0, 6, "video/")) if (!mime.compare(0, 6, "video/"))
mimetype = Streams::VIDEO; mimetype = StreamType::VIDEO;
else if (!mime.compare(0, 6, "audio/")) else if (!mime.compare(0, 6, "audio/"))
mimetype = Streams::AUDIO; mimetype = StreamType::AUDIO;
else if (!mime.compare(0, 12, "application/")) else if (!mime.compare(0, 12, "application/"))
mimetype = Streams::APPLICATION; mimetype = StreamType::APPLICATION;
else /* unknown of unsupported */ else /* unknown of unsupported */
mimetype = Streams::UNKNOWN; mimetype = StreamType::UNKNOWN;
return mimetype; return mimetype;
} }
Format Stream::mimeToFormat(const std::string &mime) StreamFormat Stream::mimeToFormat(const std::string &mime)
{ {
Format format = Streams::UNSUPPORTED; StreamFormat format = StreamFormat::UNSUPPORTED;
std::string::size_type pos = mime.find("/"); std::string::size_type pos = mime.find("/");
if(pos != std::string::npos) if(pos != std::string::npos)
{ {
std::string tail = mime.substr(pos + 1); std::string tail = mime.substr(pos + 1);
if(tail == "mp4") if(tail == "mp4")
format = Streams::MP4; format = StreamFormat::MP4;
else if (tail == "mp2t") else if (tail == "mp2t")
format = Streams::MPEG2TS; format = StreamFormat::MPEG2TS;
} }
return format; return format;
} }
...@@ -96,10 +94,10 @@ void Stream::create(demux_t *demux, AbstractAdaptationLogic *logic, SegmentTrack ...@@ -96,10 +94,10 @@ void Stream::create(demux_t *demux, AbstractAdaptationLogic *logic, SegmentTrack
{ {
switch(format) switch(format)
{ {
case adaptative::Streams::MP4: case StreamFormat::MP4:
output = new MP4StreamOutput(demux); output = new MP4StreamOutput(demux);
break; break;
case adaptative::Streams::MPEG2TS: case StreamFormat::MPEG2TS:
output = new MPEG2TSStreamOutput(demux); output = new MPEG2TSStreamOutput(demux);
break; break;
default: default:
......
...@@ -44,102 +44,101 @@ namespace adaptative ...@@ -44,102 +44,101 @@ namespace adaptative
class AbstractAdaptationLogic; class AbstractAdaptationLogic;
} }
namespace Streams
{
class AbstractStreamOutput;
using namespace http; class AbstractStreamOutput;
using namespace logic;
class Stream using namespace http;
{ using namespace logic;
public:
Stream(const std::string &mime);
Stream(const Type, const Format);
~Stream();
bool operator==(const Stream &) const;
static Type mimeToType(const std::string &mime);
static Format mimeToFormat(const std::string &mime);
void create(demux_t *, AbstractAdaptationLogic *, SegmentTracker *);
bool isEOF() const;
mtime_t getPCR() const;
int getGroup() const;
int esCount() const;
bool seekAble() const;
typedef enum {status_eof, status_buffering, status_demuxed} status;
status demux(HTTPConnectionManager *, mtime_t);
bool setPosition(mtime_t, bool);
mtime_t getPosition() const;
private:
Chunk *getChunk();
void init(const Type, const Format);
size_t read(HTTPConnectionManager *);
Type type;
Format format;
AbstractStreamOutput *output;
AbstractAdaptationLogic *adaptationLogic;
SegmentTracker *segmentTracker;
http::Chunk *currentChunk;
bool eof;
};
class AbstractStreamOutput class Stream
{
public:
Stream(const std::string &mime);
Stream(const StreamType, const StreamFormat);
~Stream();
bool operator==(const Stream &) const;
static StreamType mimeToType(const std::string &mime);
static StreamFormat mimeToFormat(const std::string &mime);
void create(demux_t *, AbstractAdaptationLogic *, SegmentTracker *);
bool isEOF() const;
mtime_t getPCR() const;
int getGroup() const;
int esCount() const;
bool seekAble() const;
typedef enum {status_eof, status_buffering, status_demuxed} status;
status demux(HTTPConnectionManager *, mtime_t);
bool setPosition(mtime_t, bool);
mtime_t getPosition() const;
private:
Chunk *getChunk();
void init(const StreamType, const StreamFormat);
size_t read(HTTPConnectionManager *);
StreamType type;
StreamFormat format;
AbstractStreamOutput *output;
AbstractAdaptationLogic *adaptationLogic;
SegmentTracker *segmentTracker;
http::Chunk *currentChunk;
bool eof;
};
class AbstractStreamOutput
{
public:
AbstractStreamOutput(demux_t *);
virtual ~AbstractStreamOutput();
virtual void pushBlock(block_t *);
mtime_t getPCR() const;
int getGroup() const;
int esCount() const;
bool seekAble() const;
void setPosition(mtime_t);
void sendToDecoder(mtime_t);
protected:
mtime_t pcr;
int group;
es_out_t *fakeesout; /* to intercept/proxy what is sent from demuxstream */
stream_t *demuxstream;
bool seekable;
private:
demux_t *realdemux;
static es_out_id_t *esOutAdd(es_out_t *, const es_format_t *);
static int esOutSend(es_out_t *, es_out_id_t *, block_t *);
static void esOutDel(es_out_t *, es_out_id_t *);
static int esOutControl(es_out_t *, int, va_list);
static void esOutDestroy(es_out_t *);
class Demuxed
{ {
public: friend class AbstractStreamOutput;
AbstractStreamOutput(demux_t *); Demuxed();
virtual ~AbstractStreamOutput(); ~Demuxed();
void drop();
virtual void pushBlock(block_t *); es_out_id_t *es_id;
mtime_t getPCR() const; block_t *p_queue;
int getGroup() const; block_t **pp_queue_last;
int esCount() const;
bool seekAble() const;
void setPosition(mtime_t);
void sendToDecoder(mtime_t);
protected:
mtime_t pcr;
int group;
es_out_t *fakeesout; /* to intercept/proxy what is sent from demuxstream */
stream_t *demuxstream;
bool seekable;
private:
demux_t *realdemux;
static es_out_id_t *esOutAdd(es_out_t *, const es_format_t *);
static int esOutSend(es_out_t *, es_out_id_t *, block_t *);
static void esOutDel(es_out_t *, es_out_id_t *);
static int esOutControl(es_out_t *, int, va_list);
static void esOutDestroy(es_out_t *);
class Demuxed
{
friend class AbstractStreamOutput;
Demuxed();
~Demuxed();
void drop();
es_out_id_t *es_id;
block_t *p_queue;
block_t **pp_queue_last;
};
std::list<Demuxed *> queues;
vlc_mutex_t lock;
}; };
std::list<Demuxed *> queues;
vlc_mutex_t lock;
};
class MP4StreamOutput : public AbstractStreamOutput class MP4StreamOutput : public AbstractStreamOutput
{ {
public: public:
MP4StreamOutput(demux_t *); MP4StreamOutput(demux_t *);
virtual ~MP4StreamOutput(){} virtual ~MP4StreamOutput(){}
}; };
class MPEG2TSStreamOutput : public AbstractStreamOutput
{
public:
MPEG2TSStreamOutput(demux_t *);
virtual ~MPEG2TSStreamOutput(){}
};
class MPEG2TSStreamOutput : public AbstractStreamOutput
{
public:
MPEG2TSStreamOutput(demux_t *);
virtual ~MPEG2TSStreamOutput(){}
};
}
} }
#endif // STREAMS_HPP #endif // STREAMS_HPP
...@@ -22,25 +22,24 @@ ...@@ -22,25 +22,24 @@
namespace adaptative namespace adaptative
{ {
namespace Streams
enum StreamType
{
UNKNOWN = 0,
VIDEO,
AUDIO,
APPLICATION
};
enum StreamFormat
{ {
enum Type UNSUPPORTED = 0,
{ MP4,
UNKNOWN = 0, MPEG2TS
VIDEO, };
AUDIO,
APPLICATION
};
enum Format static const int StreamTypeCount = APPLICATION + 1;
{
UNSUPPORTED = 0,
MP4,
MPEG2TS
};
static const int count = APPLICATION + 1;
}
} }
#endif #endif
...@@ -46,7 +46,7 @@ namespace adaptative ...@@ -46,7 +46,7 @@ namespace adaptative
AbstractAdaptationLogic (); AbstractAdaptationLogic ();
virtual ~AbstractAdaptationLogic (); virtual ~AbstractAdaptationLogic ();
virtual BaseRepresentation* getCurrentRepresentation(Streams::Type, BasePeriod *) const = 0; virtual BaseRepresentation* getCurrentRepresentation(StreamType, BasePeriod *) const = 0;
virtual void updateDownloadRate (size_t, mtime_t); virtual void updateDownloadRate (size_t, mtime_t);
enum LogicType enum LogicType
......
...@@ -36,7 +36,7 @@ AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic () : ...@@ -36,7 +36,7 @@ AlwaysBestAdaptationLogic::AlwaysBestAdaptationLogic () :
{ {
} }
BaseRepresentation *AlwaysBestAdaptationLogic::getCurrentRepresentation(Streams::Type type, BasePeriod *period) const BaseRepresentation *AlwaysBestAdaptationLogic::getCurrentRepresentation(StreamType type, BasePeriod *period) const
{ {
RepresentationSelector selector; RepresentationSelector selector;
return selector.select(period, type); return selector.select(period, type);
......
...@@ -36,7 +36,7 @@ namespace adaptative ...@@ -36,7 +36,7 @@ namespace adaptative
public: public:
AlwaysBestAdaptationLogic (); AlwaysBestAdaptationLogic ();
virtual BaseRepresentation *getCurrentRepresentation(Streams::Type, BasePeriod *) const; virtual BaseRepresentation *getCurrentRepresentation(StreamType, BasePeriod *) const;
}; };
} }
} }
......
...@@ -28,7 +28,7 @@ AlwaysLowestAdaptationLogic::AlwaysLowestAdaptationLogic(): ...@@ -28,7 +28,7 @@ AlwaysLowestAdaptationLogic::AlwaysLowestAdaptationLogic():
{ {
} }
BaseRepresentation *AlwaysLowestAdaptationLogic::getCurrentRepresentation(Streams::Type type, BasePeriod *period) const BaseRepresentation *AlwaysLowestAdaptationLogic::getCurrentRepresentation(StreamType type, BasePeriod *period) const
{ {
RepresentationSelector selector; RepresentationSelector selector;
return selector.select(period, type, 0); return selector.select(period, type, 0);
......
...@@ -31,7 +31,7 @@ namespace adaptative ...@@ -31,7 +31,7 @@ namespace adaptative
public: public:
AlwaysLowestAdaptationLogic(); AlwaysLowestAdaptationLogic();
virtual BaseRepresentation* getCurrentRepresentation(Streams::Type, BasePeriod *) const; virtual BaseRepresentation* getCurrentRepresentation(StreamType, BasePeriod *) const;
}; };
} }
} }
......
...@@ -42,7 +42,7 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic (int w, int h) : ...@@ -42,7 +42,7 @@ RateBasedAdaptationLogic::RateBasedAdaptationLogic (int w, int h) :
height = h; height = h;
} }
BaseRepresentation *RateBasedAdaptationLogic::getCurrentRepresentation(Streams::Type type, BasePeriod *period) const BaseRepresentation *RateBasedAdaptationLogic::getCurrentRepresentation(StreamType type, BasePeriod *period) const
{ {
if(period == NULL) if(period == NULL)
return NULL; return NULL;
...@@ -82,7 +82,7 @@ FixedRateAdaptationLogic::FixedRateAdaptationLogic(size_t bps) : ...@@ -82,7 +82,7 @@ FixedRateAdaptationLogic::FixedRateAdaptationLogic(size_t bps) :
currentBps = bps; currentBps = bps;
} }
BaseRepresentation *FixedRateAdaptationLogic::getCurrentRepresentation(Streams::Type type, BasePeriod *period) const BaseRepresentation *FixedRateAdaptationLogic::getCurrentRepresentation(StreamType type, BasePeriod *period) const
{ {
if(period == NULL) if(period == NULL)
return NULL; return NULL;
......
...@@ -39,7 +39,7 @@ namespace adaptative ...@@ -39,7 +39,7 @@ namespace adaptative
public: public:
RateBasedAdaptationLogic (int, int); RateBasedAdaptationLogic (int, int);
BaseRepresentation *getCurrentRepresentation(Streams::Type, BasePeriod *) const; BaseRepresentation *getCurrentRepresentation(StreamType, BasePeriod *) const;
virtual void updateDownloadRate(size_t, mtime_t); virtual void updateDownloadRate(size_t, mtime_t);
private: private:
...@@ -55,7 +55,7 @@ namespace adaptative ...@@ -55,7 +55,7 @@ namespace adaptative
public: public:
FixedRateAdaptationLogic(size_t); FixedRateAdaptationLogic(size_t);
BaseRepresentation *getCurrentRepresentation(Streams::Type, BasePeriod *) const; BaseRepresentation *getCurrentRepresentation(StreamType, BasePeriod *) const;
private: private:
size_t currentBps; size_t currentBps;
......
...@@ -29,11 +29,11 @@ RepresentationSelector::RepresentationSelector() ...@@ -29,11 +29,11 @@ RepresentationSelector::RepresentationSelector()
{ {
} }
BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams::Type type) const BaseRepresentation * RepresentationSelector::select(BasePeriod *period, StreamType type) const
{ {
return select(period, type, std::numeric_limits<uint64_t>::max()); return select(period, type, std::numeric_limits<uint64_t>::max());
} }
BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams::Type type, uint64_t bitrate) const BaseRepresentation * RepresentationSelector::select(BasePeriod *period, StreamType type, uint64_t bitrate) const
{ {
if (period == NULL) if (period == NULL)
return NULL; return NULL;
...@@ -56,7 +56,7 @@ BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams: ...@@ -56,7 +56,7 @@ BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams:
return best; return best;
} }
BaseRepresentation * RepresentationSelector::select(BasePeriod *period, Streams::Type type, uint64_t bitrate, BaseRepresentation * RepresentationSelector::select(BasePeriod *period, StreamType type, uint64_t bitrate,
int width, int height) const int width, int height) const
{ {
if(period == NULL) if(period == NULL)
......
...@@ -40,9 +40,9 @@ namespace adaptative ...@@ -40,9 +40,9 @@ namespace adaptative
public: public:
RepresentationSelector(); RepresentationSelector();
virtual ~RepresentationSelector() {} virtual ~RepresentationSelector() {}
virtual BaseRepresentation * select(BasePeriod *period, Streams::Type) const; virtual BaseRepresentation * select(BasePeriod *period, StreamType) const;
virtual BaseRepresentation * select(BasePeriod *period, Streams::Type, uint64_t bitrate) const; virtual BaseRepresentation * select(BasePeriod *period, StreamType, uint64_t bitrate) const;
virtual BaseRepresentation * select(BasePeriod *period, Streams::Type, uint64_t bitrate, virtual BaseRepresentation * select(BasePeriod *period, StreamType, uint64_t bitrate,
int width, int height) const; int width, int height) const;
protected: protected:
virtual BaseRepresentation * select(std::vector<BaseRepresentation *>&reps, virtual BaseRepresentation * select(std::vector<BaseRepresentation *>&reps,
......
...@@ -55,13 +55,13 @@ const std::vector<BaseAdaptationSet*>& BasePeriod::getAdaptationSets() const ...@@ -55,13 +55,13 @@ const std::vector<BaseAdaptationSet*>& BasePeriod::getAdaptationSets() const
return adaptationSets; return adaptationSets;
} }
const std::vector<BaseAdaptationSet*> BasePeriod::getAdaptationSets(Streams::Type type) const const std::vector<BaseAdaptationSet*> BasePeriod::getAdaptationSets(StreamType type) const
{ {
std::vector<BaseAdaptationSet*> list; std::vector<BaseAdaptationSet*> list;
std::vector<BaseAdaptationSet*>::const_iterator it; std::vector<BaseAdaptationSet*>::const_iterator it;
for(it = adaptationSets.begin(); it!= adaptationSets.end(); ++it) for(it = adaptationSets.begin(); it!= adaptationSets.end(); ++it)
{ {
if( Streams::Stream::mimeToType((*it)->getMimeType()) == type ) if( Stream::mimeToType((*it)->getMimeType()) == type )
list.push_back(*it); list.push_back(*it);
} }
return list; return list;
...@@ -76,12 +76,12 @@ void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet) ...@@ -76,12 +76,12 @@ void BasePeriod::addAdaptationSet(BaseAdaptationSet *adaptationSet)
} }
} }
BaseAdaptationSet * BasePeriod::getAdaptationSet(Streams::Type type) const BaseAdaptationSet * BasePeriod::getAdaptationSet(StreamType type) const
{ {
std::vector<BaseAdaptationSet *>::const_iterator it; std::vector<BaseAdaptationSet *>::const_iterator it;
for(it = adaptationSets.begin(); it != adaptationSets.end(); ++it) for(it = adaptationSets.begin(); it != adaptationSets.end(); ++it)
{ {
if ( Streams::Stream::mimeToType((*it)->getMimeType()) == type ) if ( Stream::mimeToType((*it)->getMimeType()) == type )
return *it; return *it;
} }
return NULL; return NULL;
......
...@@ -43,8 +43,8 @@ namespace adaptative ...@@ -43,8 +43,8 @@ namespace adaptative
virtual ~BasePeriod (); virtual ~BasePeriod ();
const std::vector<BaseAdaptationSet *>& getAdaptationSets () const; const std::vector<BaseAdaptationSet *>& getAdaptationSets () const;
const std::vector<BaseAdaptationSet *> getAdaptationSets (Streams::Type) const; const std::vector<BaseAdaptationSet *> getAdaptationSets (StreamType) const;
BaseAdaptationSet * getAdaptationSet (Streams::Type) const; BaseAdaptationSet * getAdaptationSet (StreamType) const;
void addAdaptationSet (BaseAdaptationSet *AdaptationSet); void addAdaptationSet (BaseAdaptationSet *AdaptationSet);
std::vector<std::string> toString (int = 0) const; std::vector<std::string> toString (int = 0) const;
......
...@@ -84,7 +84,7 @@ bool DASHManager::updatePlaylist() ...@@ -84,7 +84,7 @@ bool DASHManager::updatePlaylist()
} }
mtime_t minsegmentTime = 0; mtime_t minsegmentTime = 0;
for(int type=0; type<Streams::count; type++) for(int type=0; type<StreamTypeCount; type++)
{ {
if(!streams[type]) if(!streams[type])
continue; continue;
......
...@@ -183,15 +183,15 @@ static int Demux(demux_t *p_demux) ...@@ -183,15 +183,15 @@ static int Demux(demux_t *p_demux)
{ {
demux_sys_t *p_sys = p_demux->p_sys; demux_sys_t *p_sys = p_demux->p_sys;
Streams::Stream::status status = Stream::status status =
p_sys->p_dashManager->demux(p_sys->i_nzpcr + DEMUX_INCREMENT); p_sys->p_dashManager->demux(p_sys->i_nzpcr + DEMUX_INCREMENT);
switch(status) switch(status)
{ {
case Streams::Stream::status_eof: case Stream::status_eof:
return VLC_DEMUXER_EOF; return VLC_DEMUXER_EOF;
case Streams::Stream::status_buffering: case Stream::status_buffering:
break; break;
case Streams::Stream::status_demuxed: case Stream::status_demuxed:
p_sys->i_nzpcr += DEMUX_INCREMENT; p_sys->i_nzpcr += DEMUX_INCREMENT;
int group = p_sys->p_dashManager->getGroup(); int group = p_sys->p_dashManager->getGroup();
es_out_Control(p_demux->out, ES_OUT_SET_GROUP_PCR, group, VLC_TS_0 + p_sys->i_nzpcr); es_out_Control(p_demux->out, ES_OUT_SET_GROUP_PCR, group, VLC_TS_0 + p_sys->i_nzpcr);
......
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