aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Samain <jsamain+fdio@cisco.com>2017-06-23 18:47:47 +0200
committerJacques Samain <jsamain+fdio@cisco.com>2017-06-23 18:47:47 +0200
commit65bb20ba5cf4ede70026142d61e728c44cc78f9c (patch)
tree56a9305c0985d0abbe831675f286dfd70c67a17a
parentea99c36cadfab26fe4bf523931f87132c01a54a2 (diff)
clean up: removed useless functions
Change-Id: If55237df9f9bc67b97912321b86273588f7bedd6 Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
-rw-r--r--Input/DASHManager.cpp5
-rw-r--r--Input/DASHManager.h1
-rw-r--r--Input/DASHReceiver.cpp40
-rw-r--r--Input/DASHReceiver.h8
-rw-r--r--Input/IDASHManagerObserver.h1
-rw-r--r--Managers/MultimediaManager.cpp1
-rw-r--r--Managers/MultimediaStream.cpp37
-rw-r--r--Managers/MultimediaStream.h31
-rw-r--r--UI/DASHPlayer.cpp2
-rw-r--r--UI/ViperGui.cpp64
-rw-r--r--UI/ViperGui.h66
11 files changed, 58 insertions, 198 deletions
diff --git a/Input/DASHManager.cpp b/Input/DASHManager.cpp
index 4d52a638..3377c1a8 100644
--- a/Input/DASHManager.cpp
+++ b/Input/DASHManager.cpp
@@ -161,11 +161,6 @@ void DASHManager::onBufferStateChanged(BufferType type, uint32_t fillstateInPerc
this->receiver->OnSegmentBufferStateChanged(fillstateInPercent, maxC);
}
-void DASHManager::updateMPD(IMPD* mpd)
-{
-// this->receiver->updateMPD(mpd);
-}
-
void DASHManager::fetchMPD()
{
this->multimediaStream->fetchMPD();
diff --git a/Input/DASHManager.h b/Input/DASHManager.h
index 6bd54da9..c2b4a88b 100644
--- a/Input/DASHManager.h
+++ b/Input/DASHManager.h
@@ -62,7 +62,6 @@ public:
void setTargetDownloadingTime(double);
MediaObject* getSegment();
void onBufferStateChanged(BufferType type, uint32_t fillstateInPercent, int maxC);
- void updateMPD(dash::mpd::IMPD* mpd);
void fetchMPD();
private:
diff --git a/Input/DASHReceiver.cpp b/Input/DASHReceiver.cpp
index aaa75205..c6dafb93 100644
--- a/Input/DASHReceiver.cpp
+++ b/Input/DASHReceiver.cpp
@@ -204,10 +204,7 @@ libdash::framework::adaptation::IAdaptationLogic* DASHReceiver::GetAdaptationLog
{
return this->adaptationLogic;
}
-dash::mpd::IRepresentation* DASHReceiver::GetRepresentation ()
-{
- return NULL;
-}
+
uint32_t DASHReceiver::CalculateSegmentOffset ()
{
return this->mpdWrapper->calculateSegmentOffset(type, bufferSize);
@@ -218,14 +215,6 @@ void DASHReceiver::NotifySegmentDownloaded ()
this->observer->onSegmentDownloaded();
}
-void DASHReceiver::NotifyBitrateChange(dash::mpd::IRepresentation *representation)
-{
-// if(this->representation != representation)
-// {
-// this->representation = representation;
-// this->SetRepresentation(this->period,this->adaptationSet,this->representation);
-// }
-}
void DASHReceiver::DownloadInitSegmentWithoutLock ()
{
int rep = std::stoi(this->mpdWrapper->getRepresentationIDWithoutLock(type).c_str());
@@ -419,30 +408,3 @@ void DASHReceiver::SetDrop (float drop)
this->drop = drop;
}
-void DASHReceiver::updateMPD(IMPD* mpd)
-{
-// EnterCriticalSection(&this->monitorMutex);
- //First we need to find the new segmentNumber -> what is the segment time now?
-// uint32_t time = this->representationStream->getTime(this->segmentNumber);
-// printf("old segmentNumber!: %d\n", this->segmentNumber);
-// printf("time: %u\n", time);
- //Second, replace the MPD with the new one
-// delete(this->mpd);
-// this->mpd = mpd;
-//
- //Third, Update all the structures associated to the mpd
-// this->period = this->mpd->GetPeriods().at(0);
-// this->adaptationSet = this->period->GetAdaptationSets().at(0);
-// this->representation = this->adaptationSet->GetRepresentation().at(0);
-// delete(this->adaptationSetStream);
-// this->adaptationSetStream = new AdaptationSetStream(mpd, period, adaptationSet);
-// this->representationStream = adaptationSetStream->getRepresentationStream(this->representation);
-// this->segmentOffset = CalculateSegmentOffset();
-// this->representationStream->setSegmentOffset(this->segmentOffset);
-//
- //Fourth, Set the new segmentNumber by finding the index of the segment associated to 'uint32_t time' in the new mpd
-// this->segmentNumber = this->representationStream->getSegmentNumber(time);
-// printf("new segmentNumber!: %d\n", this->segmentNumber);
-// LeaveCriticalSection(&this->monitorMutex);
-}
-
diff --git a/Input/DASHReceiver.h b/Input/DASHReceiver.h
index cf56166b..ed98b9e1 100644
--- a/Input/DASHReceiver.h
+++ b/Input/DASHReceiver.h
@@ -57,23 +57,18 @@ public:
input::MediaObject* GetSegment(uint32_t segmentNumber);
input::MediaObject* GetInitSegment();
input::MediaObject* GetInitSegmentWithoutLock();
-// input::MediaObject* FindInitSegment(dash::mpd::IRepresentation *representation);
input::MediaObject* FindInitSegment(int representation);
uint32_t GetPosition();
void SetPosition(uint32_t segmentNumber);
void SetLooping(bool isLoopinp);
void SetPositionInMsecs(uint32_t milliSecs);
- dash::mpd::IRepresentation* GetRepresentation();
-// void SetRepresentation(dash::mpd::IPeriod *period,
-// dash::mpd::IAdaptationSet *adaptationSet,
-// dash::mpd::IRepresentation *representation);
+
void SetRepresentation();
void SetAdaptationLogic(adaptation::IAdaptationLogic *_adaptationLogic);
libdash::framework::adaptation::IAdaptationLogic* GetAdaptationLogic();
void NotifyQualityDownloading(uint32_t quality);
void Notifybps(uint64_t bps);
void NotifyDLTime(double time);
- void NotifyBitrateChange(dash::mpd::IRepresentation *representation);
void OnSegmentBufferStateChanged(uint32_t fillstateInPercent, int maxC);
bool IsICN();
void ShouldAbort();
@@ -85,7 +80,6 @@ public:
bool CanPush();
void SetBeta(float beta);
void SetDrop(float drop);
- void updateMPD(dash::mpd::IMPD* mpd);
private:
float beta;
diff --git a/Input/IDASHManagerObserver.h b/Input/IDASHManagerObserver.h
index 1003d8a1..57f15726 100644
--- a/Input/IDASHManagerObserver.h
+++ b/Input/IDASHManagerObserver.h
@@ -26,7 +26,6 @@ class IDASHManagerObserver
public:
virtual ~IDASHManagerObserver() {}
- virtual void addFrame(QImage *frame) = 0;
virtual void setEOS(bool value)= 0;
virtual void onSegmentBufferStateChanged(uint32_t fillstateInPercent, int maxC) = 0;
diff --git a/Managers/MultimediaManager.cpp b/Managers/MultimediaManager.cpp
index 23118464..44473b04 100644
--- a/Managers/MultimediaManager.cpp
+++ b/Managers/MultimediaManager.cpp
@@ -280,7 +280,6 @@ void MultimediaManager::stopAudio()
bool MultimediaManager::setVideoQuality()
{
-
if (this->videoStream)
this->videoStream->setRepresentation();
return true;
diff --git a/Managers/MultimediaStream.cpp b/Managers/MultimediaStream.cpp
index 4b5b66fe..86cde35d 100644
--- a/Managers/MultimediaStream.cpp
+++ b/Managers/MultimediaStream.cpp
@@ -19,22 +19,20 @@ using namespace libdash::framework::mpd;
using namespace dash::mpd;
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),
- mpdWrapper (mpdWrapper),
- icn (icnEnabled),
- icnAlpha (icnAlpha),
- noDecoding (nodecoding),
- beta (beta),
- drop (drop)
-{
-// InitializeCriticalSection (&this->monitorMutex);
+ type (type),
+ segmentBufferSize (bufferSize),
+ dashManager (NULL),
+ mpdWrapper (mpdWrapper),
+ icn (icnEnabled),
+ icnAlpha (icnAlpha),
+ noDecoding (nodecoding),
+ beta (beta),
+ drop (drop)
+{
this->init();
}
MultimediaStream::~MultimediaStream ()
{
-// DestroyCriticalSection (&this->monitorMutex);
this->stop();
delete this->dashManager;
}
@@ -106,15 +104,6 @@ void MultimediaStream::clear()
this->dashManager->clear();
}
-void MultimediaStream::addFrame(QImage *frame)
-{
-}
-
-QImage* MultimediaStream::getFrame()
-{
- return NULL;
-}
-
void MultimediaStream::attachStreamObserver(IStreamObserver *observer)
{
this->observers.push_back(observer);
@@ -210,12 +199,6 @@ 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++)
diff --git a/Managers/MultimediaStream.h b/Managers/MultimediaStream.h
index d9db5f66..d5661b01 100644
--- a/Managers/MultimediaStream.h
+++ b/Managers/MultimediaStream.h
@@ -57,15 +57,9 @@ public:
void setLooping(bool looping);
void setPositionInMsec(uint32_t milliSecs);
- void addFrame(QImage *frame);
- QImage* getFrame();
libdash::framework::input::MediaObject* getSegment();
-
void setEOS(bool value);
-
void notifyBufferChange(uint32_t bufferfill, int maxC);
-
-// void setRepresentation(dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation);
void setRepresentation();
void enqueueRepresentation(dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, dash::mpd::IRepresentation *representation);
void setAdaptationLogic(libdash::framework::adaptation::IAdaptationLogic *logic);
@@ -82,23 +76,22 @@ public:
bool isICN();
void shouldAbort();
void setTargetDownloadingTime(double);
- void updateMPD(dash::mpd::IMPD* mpd);
void fetchMPD();
private:
- float beta;
- float drop;
- std::vector<IStreamObserver *> observers;
- libdash::framework::mpd::MPDWrapper *mpdWrapper;
- libdash::framework::adaptation::IAdaptationLogic *logic;
- libdash::framework::input::DASHManager *dashManager;
- uint32_t segmentBufferSize;
- StreamType type;
- bool icn;
- double icnAlpha;
- mutable CRITICAL_SECTION monitorMutex;
+ float beta;
+ float drop;
+ std::vector<IStreamObserver *> observers;
+ libdash::framework::mpd::MPDWrapper *mpdWrapper;
+ libdash::framework::adaptation::IAdaptationLogic *logic;
+ libdash::framework::input::DASHManager *dashManager;
+ uint32_t segmentBufferSize;
+ StreamType type;
+ bool icn;
+ double icnAlpha;
+ mutable CRITICAL_SECTION monitorMutex;
+ bool noDecoding;
- bool noDecoding;
void init ();
};
}
diff --git a/UI/DASHPlayer.cpp b/UI/DASHPlayer.cpp
index cdad7d5a..d83e4020 100644
--- a/UI/DASHPlayer.cpp
+++ b/UI/DASHPlayer.cpp
@@ -159,7 +159,7 @@ bool DASHPlayer::onDownloadMPDPressed (const std::string &url)
}
}
this->setSettings(-1, -1, -1, -1, -1);
- this->gui->setGuiFields(this->mpdWrapper->getMPD());
+ this->gui->setMPDDuration(this->mpdWrapper->getMPD());
return true;
}
diff --git a/UI/ViperGui.cpp b/UI/ViperGui.cpp
index 24dcfad2..e23bd308 100644
--- a/UI/ViperGui.cpp
+++ b/UI/ViperGui.cpp
@@ -54,25 +54,8 @@ ViperGui::~ViperGui()
pthread_mutex_destroy(&(this->monitorMutex));
}
-void ViperGui::setGuiFields(dash::mpd::IMPD* mpd)
-{
-//USELESS CALLS
-// this->setPeriodComboBox(mpd);
-// if (mpd->GetPeriods().size() > 0)
-// {
-// IPeriod *period = mpd->GetPeriods().at(0);
-// this->setVideoAdaptationSetComboBox(period);
-// if (!AdaptationSetHelper::getVideoAdaptationSets(period).empty())
-// {
-// IAdaptationSet *adaptationSet = AdaptationSetHelper::getVideoAdaptationSets(period).at(0);
-// this->setRepresentationComoboBox(adaptationSet);
-// }
-// if (!AdaptationSetHelper::getAudioAdaptationSets(period).empty())
-// {
-// IAdaptationSet *adaptationSet = AdaptationSetHelper::getAudioAdaptationSets(period).at(0);
-// this->setRepresentationComoboBox(adaptationSet);
-// }
-// }
+void ViperGui::setMPDDuration(dash::mpd::IMPD* mpd)
+{
if(!strcmp(mpd->GetType().c_str(),"static"))
{
parse8601(mpd->GetMediaPresentationDuration());
@@ -90,49 +73,6 @@ void ViperGui::parse8601(std::string durationISO8601)
this->durationString.assign(timeStamp);
}
-void ViperGui::setRepresentationComoboBox(dash::mpd::IAdaptationSet *adaptationSet)
-{
- std::vector<IRepresentation *> represenations = adaptationSet->GetRepresentation();
- for(size_t i = 0; i < represenations.size(); i++)
- {
- IRepresentation *representation = represenations.at(i);
- }
-}
-void ViperGui::setAdaptationSetComboBox(dash::mpd::IPeriod *period)
-{
- std::vector<IAdaptationSet *> adaptationSets = period->GetAdaptationSets();
- for(size_t i = 0; i < adaptationSets.size(); i++)
- {
- IAdaptationSet *adaptationSet = adaptationSets.at(i);
- }
-}
-
-void ViperGui::setAudioAdaptationSetComboBox(dash::mpd::IPeriod *period)
-{
- std::vector<IAdaptationSet *> adaptationSets = AdaptationSetHelper::getAudioAdaptationSets(period);
- for(size_t i = 0; i < adaptationSets.size(); i++)
- {
- IAdaptationSet *adaptationSet = adaptationSets.at(i);
- }
-}
-
-void ViperGui::setVideoAdaptationSetComboBox(dash::mpd::IPeriod *period)
-{
- std::vector<IAdaptationSet *> adaptationSets = AdaptationSetHelper::getVideoAdaptationSets(period);
- for(size_t i = 0; i < adaptationSets.size(); i++)
- {
- IAdaptationSet *adaptationSet = adaptationSets.at(i);
- }
-}
-void ViperGui::setPeriodComboBox(dash::mpd::IMPD *mpd)
-{
- std::vector<IPeriod *> periods = mpd->GetPeriods();
- for(size_t i = 0; i < periods.size(); i++)
- {
- IPeriod *period = periods.at(i);
- }
-}
-
ViperBuffer* ViperGui::getStreamBuffer()
{
return this->streamBuffer;
diff --git a/UI/ViperGui.h b/UI/ViperGui.h
index 1ce8e574..6431257d 100644
--- a/UI/ViperGui.h
+++ b/UI/ViperGui.h
@@ -48,7 +48,7 @@ public:
void setListSegmentSize(int listSegmentSize);
ViperBuffer* getStreamBuffer();
QtAV::AVPlayer* getVideoPlayer();
- void setGuiFields(dash::mpd::IMPD* mpd);
+ void setMPDDuration(dash::mpd::IMPD* mpd);
void setLifeLabel(QObject *lifeLabel);
void setNowLabel(QObject *nowLabel);
void setPlayButton(QObject *playButton);
@@ -87,41 +87,37 @@ public:
void resetGraphValues();
private:
- pthread_mutex_t monitorMutex;
- GraphDataSource *graphDataSource;
- managers::MultimediaStream *videoStream;
- int64_t offset;
- int64_t durationMilliseconds;
- qint64 position;
- std::string durationString;
- QtAV::AVPlayer *videoPlayer;
- ViperBuffer *streamBuffer;
- std::map<std::string, std::string> keyValues;
- std::map<std::string, int> keyIndices;
- std::map<std::string, std::vector<std::string>> video;
- std::map<std::string, std::vector<std::string>> audio;
- QObject *lifeLabel;
- QObject *nowLabel;
- QObject *progressBar;
- QObject *playButton;
- std::vector<IDASHPlayerGuiObserver *> observers;
- dash::mpd::IMPD *mpd;
- void setPeriodComboBox(dash::mpd::IMPD *mpd);
- void setAdaptationSetComboBox(dash::mpd::IPeriod *period);
- void setVideoAdaptationSetComboBox(dash::mpd::IPeriod *period);
- void setAudioAdaptationSetComboBox(dash::mpd::IPeriod *period);
- void setRepresentationComoboBox(dash::mpd::IAdaptationSet *adaptationSet);
+ pthread_mutex_t monitorMutex;
+ GraphDataSource *graphDataSource;
+ managers::MultimediaStream *videoStream;
+ int64_t offset;
+ int64_t durationMilliseconds;
+ qint64 position;
+ std::string durationString;
+ QtAV::AVPlayer *videoPlayer;
+ ViperBuffer *streamBuffer;
+ std::map<std::string, std::string> keyValues;
+ std::map<std::string, int> keyIndices;
+ std::map<std::string, std::vector<std::string>> video;
+ std::map<std::string, std::vector<std::string>> audio;
+ QObject *lifeLabel;
+ QObject *nowLabel;
+ QObject *progressBar;
+ QObject *playButton;
+ std::vector<IDASHPlayerGuiObserver *> observers;
+ dash::mpd::IMPD *mpd;
+ int listSegmentSize;
+ int segment;
+ int64_t bufferDuration;
+ int64_t segmentDuration;
+ int64_t lastSegmentDuration;
+ bool play;
+ bool stop;
+ bool pause;
+ bool repeat;
+ QObject *rootObject;
+
void parse8601(std::string durationISO8601);
- int listSegmentSize;
- int segment;
- int64_t bufferDuration;
- int64_t segmentDuration;
- int64_t lastSegmentDuration;
- bool play;
- bool stop;
- bool pause;
- bool repeat;
- QObject *rootObject;
};
}