From a644414fd2c3a3f7f41e716b6875a78981e4cfe1 Mon Sep 17 00:00:00 2001 From: jacko Date: Fri, 23 Jun 2017 16:12:18 +0200 Subject: adding mpd live handling + automatic mpd fetching Change-Id: I2c05bdf6a4d940ad22bb8632268f4b63a08a80a8 Signed-off-by: jacko --- Managers/MultimediaStream.cpp | 33 +++++++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 8 deletions(-) (limited to 'Managers/MultimediaStream.cpp') diff --git a/Managers/MultimediaStream.cpp b/Managers/MultimediaStream.cpp index ed0d967c..4b5b66fe 100644 --- a/Managers/MultimediaStream.cpp +++ b/Managers/MultimediaStream.cpp @@ -15,23 +15,26 @@ using namespace viper::managers; using namespace libdash::framework::adaptation; using namespace libdash::framework::input; using namespace libdash::framework::buffer; +using namespace libdash::framework::mpd; using namespace dash::mpd; -MultimediaStream::MultimediaStream(StreamType type, IMPD *mpd, uint32_t bufferSize, bool icnEnabled, double icnAlpha, bool nodecoding, float beta, float drop) : +MultimediaStream::MultimediaStream(StreamType type, MPDWrapper *mpdWrapper, uint32_t bufferSize, bool icnEnabled, double icnAlpha, bool nodecoding, float beta, float drop) : type (type), segmentBufferSize (bufferSize), dashManager (NULL), - mpd (mpd), - icn (icnEnabled), + mpdWrapper (mpdWrapper), + icn (icnEnabled), icnAlpha (icnAlpha), noDecoding (nodecoding), - beta (beta), - drop (drop) + beta (beta), + drop (drop) { +// InitializeCriticalSection (&this->monitorMutex); this->init(); } MultimediaStream::~MultimediaStream () { +// DestroyCriticalSection (&this->monitorMutex); this->stop(); delete this->dashManager; } @@ -68,7 +71,7 @@ void MultimediaStream::setPositionInMsec(uint32_t milliSecs) void MultimediaStream::init() { - this->dashManager = new DASHManager(this->type, this->segmentBufferSize, this, this->mpd, this->isICN(), this->icnAlpha, this->noDecoding, this->beta, this->drop); + this->dashManager = new DASHManager(this->type, this->segmentBufferSize, this, this->mpdWrapper, this->isICN(), this->icnAlpha, this->noDecoding, this->beta, this->drop); } bool MultimediaStream::start() @@ -117,9 +120,9 @@ void MultimediaStream::attachStreamObserver(IStreamObserver *observer) this->observers.push_back(observer); } -void MultimediaStream::setRepresentation(IPeriod *period, IAdaptationSet *adaptationSet, IRepresentation *representation) +void MultimediaStream::setRepresentation() { - this->dashManager->setRepresentation(period, adaptationSet, representation); + this->dashManager->setRepresentation(); } void MultimediaStream::enqueueRepresentation(IPeriod *period, IAdaptationSet *adaptationSet, IRepresentation *representation) @@ -206,3 +209,17 @@ void MultimediaStream::notifyBufferChange(uint32_t bufferfill, int maxC) { this->dashManager->onBufferStateChanged(libdash::framework::buffer::VIDEO, bufferfill, maxC); } + +void MultimediaStream::updateMPD (IMPD* mpd) +{ +// this->mpd = mpd; +// this->dashManager->updateMPD(mpd); +} + +void MultimediaStream::fetchMPD() +{ + for(size_t i=0; i < this->observers.size(); i++) + { + this->observers.at(i)->fetchMPD(); + } +} -- cgit 1.2.3-korg