diff options
author | Jacques Samain <jsamain+fdio@cisco.com> | 2017-07-24 15:11:58 +0200 |
---|---|---|
committer | Jacques Samain <jsamain+fdio@cisco.com> | 2017-07-24 15:11:58 +0200 |
commit | ce4d018aa8185da0bbf5445eaf54d88700f1a381 (patch) | |
tree | 161b3977d2c7a9cf265e9fde739ccae25882908b /Input | |
parent | 04424399a22c592a95b19dad95a958cb1566a8e2 (diff) |
moving MPDFetching to MultimediaManager class, DASHReceiver might have two instances (video + audio)
Change-Id: Ifae7dab2db80d8b1a17ff7749cdfb879958cfee1
Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
Diffstat (limited to 'Input')
-rw-r--r-- | Input/DASHManager.cpp | 4 | ||||
-rw-r--r-- | Input/DASHManager.h | 1 | ||||
-rw-r--r-- | Input/DASHReceiver.cpp | 39 | ||||
-rw-r--r-- | Input/DASHReceiver.h | 2 | ||||
-rw-r--r-- | Input/ICNConnectionConsumerApi.cpp | 2 | ||||
-rw-r--r-- | Input/IDASHManagerObserver.h | 1 | ||||
-rw-r--r-- | Input/IDASHReceiverObserver.h | 1 |
7 files changed, 2 insertions, 48 deletions
diff --git a/Input/DASHManager.cpp b/Input/DASHManager.cpp index b3ff8305..0c393353 100644 --- a/Input/DASHManager.cpp +++ b/Input/DASHManager.cpp @@ -160,7 +160,3 @@ void DASHManager::onBufferStateChanged(BufferType type, uint32_t fillstateInPerc if(this->adaptationLogic->isBufferBased()) this->receiver->OnSegmentBufferStateChanged(fillstateInPercent, maxC); } -void DASHManager::fetchMPD() -{ - this->multimediaStream->fetchMPD(); -} diff --git a/Input/DASHManager.h b/Input/DASHManager.h index 4bd301e7..3b9bf005 100644 --- a/Input/DASHManager.h +++ b/Input/DASHManager.h @@ -61,7 +61,6 @@ public: void setTargetDownloadingTime(double); MediaObject* getSegment(); void onBufferStateChanged(BufferType type, uint32_t fillstateInPercent, int maxC); - void fetchMPD(); private: float beta; diff --git a/Input/DASHReceiver.cpp b/Input/DASHReceiver.cpp index 1af8ad05..59514e57 100644 --- a/Input/DASHReceiver.cpp +++ b/Input/DASHReceiver.cpp @@ -42,8 +42,7 @@ DASHReceiver::DASHReceiver (viper::managers::StreamType type, MPDWrappe isLooping (false), beta (beta), drop (drop), - bufferingThread (NULL), - mpdFetcherThread (NULL) + bufferingThread (NULL) { readMax = 32768; readBuffer = (uint8_t*)malloc(sizeof(uint8_t)*readMax); @@ -96,15 +95,6 @@ bool DASHReceiver::Start () this->isBuffering = false; return false; } - //if dynamic, set up the fetching loop - if(!strcmp(this->mpdWrapper->getType().c_str(), "dynamic")) - { - this->mpdFetcherThread = createThreadPortable(DoMPDFetching, this); - if(this->mpdFetcherThread == NULL) - { - std::cout << "mpd Fetcher thread is NULL. Need to think of how to handle this?" << std::endl; - } - } return true; } void DASHReceiver::Stop() @@ -120,11 +110,6 @@ void DASHReceiver::Stop() JoinThread(this->bufferingThread); destroyThreadPortable(this->bufferingThread); } - if(this->mpdFetcherThread != NULL) - { - JoinThread(this->mpdFetcherThread); - destroyThreadPortable(this->mpdFetcherThread); - } } MediaObject* DASHReceiver::GetNextSegment () @@ -351,28 +336,6 @@ void* DASHReceiver::DoBuffering (void *recei return NULL; } -void* DASHReceiver::DoMPDFetching (void* receiver) -{ - DASHReceiver* dashReceiver = (DASHReceiver*) receiver; - uint32_t currTime = TimeResolver::getCurrentTimeInSec(); - uint32_t publishedTime = dashReceiver->mpdWrapper->getFetchTime(); -// To avoid clock synchronisation issues: using fetching time instead of publish time -// uint32_t publishedTime = TimeResolver::getUTCDateTimeInSec(dashReceiver->mpdWrapper->getPublishTime()); - uint32_t period = TimeResolver::getDurationInSec(dashReceiver->mpdWrapper->getMinimumUpdatePeriod()); - while(dashReceiver->isBuffering) - { - while(dashReceiver->isBuffering && currTime < publishedTime + period) - { - usleep(((publishedTime + period) - currTime) * 1000000); - currTime = TimeResolver::getCurrentTimeInSec(); - } - dashReceiver->observer->fetchMPD(); - publishedTime = dashReceiver->mpdWrapper->getFetchTime(); -// publishedTime = TimeResolver::getUTCDateTimeInSec(dashReceiver->mpdWrapper->getPublishTime()); - period = TimeResolver::getDurationInSec(dashReceiver->mpdWrapper->getMinimumUpdatePeriod()); - } -} - //can Push video to buffer in the renderer bool DASHReceiver::CanPush () { diff --git a/Input/DASHReceiver.h b/Input/DASHReceiver.h index 9d221ec5..ee2df388 100644 --- a/Input/DASHReceiver.h +++ b/Input/DASHReceiver.h @@ -107,7 +107,6 @@ private: IICNConnection *conn; IICNConnection *initConn; THREAD_HANDLE bufferingThread; - THREAD_HANDLE mpdFetcherThread; bool isBuffering; bool icn; double icnAlpha; @@ -123,7 +122,6 @@ private: void DownloadInitSegmentWithoutLock(); bool InitSegmentExists(int rep); static void* DoBuffering(void *receiver); - static void* DoMPDFetching(void * data); }; } } diff --git a/Input/ICNConnectionConsumerApi.cpp b/Input/ICNConnectionConsumerApi.cpp index e6715e68..84e210cb 100644 --- a/Input/ICNConnectionConsumerApi.cpp +++ b/Input/ICNConnectionConsumerApi.cpp @@ -59,7 +59,7 @@ ICNConnectionConsumerApi::ICNConnectionConsumerApi(double alpha, float beta, flo libl4::transport::ConsumerSocket &c = this->hTTPClientConnection->getConsumer(); bool configFile = false; //CHECK if we are not going to override the configuration file. (if !autotune) - if(FILE *fp = fopen("/usr/local/etc/hicn-consumer.conf", "r")) + if(FILE *fp = fopen("/usr/etc/consumer.conf", "r")) { fclose(fp); configFile = true; diff --git a/Input/IDASHManagerObserver.h b/Input/IDASHManagerObserver.h index 57f15726..0f2d95df 100644 --- a/Input/IDASHManagerObserver.h +++ b/Input/IDASHManagerObserver.h @@ -33,7 +33,6 @@ public: virtual void notifyQualityDownloading (uint32_t quality) = 0; virtual bool canPush() = 0; virtual int getBufferLevel() = 0; - virtual void fetchMPD() = 0; }; } } diff --git a/Input/IDASHReceiverObserver.h b/Input/IDASHReceiverObserver.h index f6a2baa1..0a334aa2 100644 --- a/Input/IDASHReceiverObserver.h +++ b/Input/IDASHReceiverObserver.h @@ -28,7 +28,6 @@ public: virtual void notifyQualityDownloading(uint32_t quality) = 0; virtual bool canPush() = 0; virtual int getBufferLevel() = 0; - virtual void fetchMPD() = 0; }; } } |