aboutsummaryrefslogtreecommitdiffstats
path: root/Adaptation
diff options
context:
space:
mode:
authorJacques Samain <jsamain+fdio@cisco.com>2018-01-03 14:21:23 +0100
committerJacques Samain <jsamain+fdio@cisco.com>2018-01-03 14:21:23 +0100
commitaff4155325a95f0e1dce85426c18592b22062cfa (patch)
treeaa8ad157fb1acecede747c1489864a430bc25317 /Adaptation
parent3abd95a2501be987eca0fa5c59f01e84a98cf202 (diff)
Refactoring adaptation logic
Refactoring GUI: removed prefix/suffix to have only one video URI Change-Id: Ie0add7c1d8ace89410917ab7cc414c668c528394 Signed-off-by: Jacques Samain <jsamain+fdio@cisco.com>
Diffstat (limited to 'Adaptation')
-rw-r--r--Adaptation/AdapTech.cpp (renamed from Adaptation/BufferBasedAdaptationWithRateBased.cpp)32
-rw-r--r--Adaptation/AdapTech.h (renamed from Adaptation/BufferBasedAdaptationWithRateBased.h)14
-rw-r--r--Adaptation/AdaptationLogicFactory.cpp6
-rw-r--r--Adaptation/AdaptationLogicFactory.h2
-rw-r--r--Adaptation/IAdaptationLogic.h2
5 files changed, 28 insertions, 28 deletions
diff --git a/Adaptation/BufferBasedAdaptationWithRateBased.cpp b/Adaptation/AdapTech.cpp
index 3df1cf84..dc88fae6 100644
--- a/Adaptation/BufferBasedAdaptationWithRateBased.cpp
+++ b/Adaptation/AdapTech.cpp
@@ -13,7 +13,7 @@
* limitations under the License.
*/
-#include "BufferBasedAdaptationWithRateBased.h"
+#include "AdapTech.h"
#include<stdio.h>
using namespace dash::mpd;
@@ -21,7 +21,7 @@ using namespace libdash::framework::adaptation;
using namespace libdash::framework::input;
using namespace libdash::framework::mpd;
-BufferBasedAdaptationWithRateBased::BufferBasedAdaptationWithRateBased(viper::managers::StreamType type, MPDWrapper *mpdWrapper, struct AdaptationParameters *params) :
+AdapTechAdaptation::AdapTechAdaptation(viper::managers::StreamType type, MPDWrapper *mpdWrapper, struct AdaptationParameters *params) :
AbstractAdaptationLogic(type, mpdWrapper)
{
this->alphaRate = params->Adaptech_Alpha;
@@ -45,35 +45,35 @@ BufferBasedAdaptationWithRateBased::BufferBasedAdaptationWithRateBased(viper::ma
Debug("BufferRateBasedParams:\talpha:%f\tfirst threshold: %f\tsecond threshold: %f\tswitch-up margin: %d\tSlack: %f\n",this->alphaRate, (double)reservoirThreshold/100, (double)maxThreshold/100, this->switchUpThreshold, this->slackParam);
Debug("Buffer Adaptation: STARTED\n");
}
-BufferBasedAdaptationWithRateBased::~BufferBasedAdaptationWithRateBased ()
+AdapTechAdaptation::~AdapTechAdaptation()
{
}
-LogicType BufferBasedAdaptationWithRateBased::getType()
+LogicType AdapTechAdaptation::getType()
{
return adaptation::BufferBased;
}
-bool BufferBasedAdaptationWithRateBased::isUserDependent()
+bool AdapTechAdaptation::isUserDependent()
{
return false;
}
-bool BufferBasedAdaptationWithRateBased::isRateBased()
+bool AdapTechAdaptation::isRateBased()
{
return true;
}
-bool BufferBasedAdaptationWithRateBased::isBufferBased()
+bool AdapTechAdaptation::isBufferBased()
{
return true;
}
-void BufferBasedAdaptationWithRateBased::setMultimediaManager(viper::managers::IMultimediaManagerBase *_mmManager)
+void AdapTechAdaptation::setMultimediaManager(viper::managers::IMultimediaManagerBase *_mmManager)
{
this->multimediaManager = _mmManager;
}
-void BufferBasedAdaptationWithRateBased::notifyBitrateChange()
+void AdapTechAdaptation::notifyBitrateChange()
{
this->mpdWrapper->setRepresentation(this->type, this->representation);
if(this->multimediaManager)
@@ -90,12 +90,12 @@ void BufferBasedAdaptationWithRateBased::notifyBitrateChange()
// this->shouldAbort = false;
}
-uint64_t BufferBasedAdaptationWithRateBased::getBitrate()
+uint64_t AdapTechAdaptation::getBitrate()
{
return this->currentBitrate;
}
-void BufferBasedAdaptationWithRateBased::setBitrate(uint32_t bufferFill)
+void AdapTechAdaptation::setBitrate(uint32_t bufferFill)
{
uint32_t phi1, phi2;
std::vector<IRepresentation *> representations;
@@ -171,7 +171,7 @@ void BufferBasedAdaptationWithRateBased::setBitrate(uint32_t bufferFill)
Debug("ADAPTATION_LOGIC:\tFor %s:\tlast_buffer: %f\tbuffer_level: %f, instantaneousBw: %lu, AverageBW: %lu, choice: %d\n",(this->type == viper::managers::StreamType::VIDEO) ? "video" : "audio",(double)lastBufferFill/100 , (double)bufferFill/100, this->instantBw, this->averageBw , this->myQuality);
}
-void BufferBasedAdaptationWithRateBased::bitrateUpdate(uint64_t bps, uint32_t segNum)
+void AdapTechAdaptation::bitrateUpdate(uint64_t bps, uint32_t segNum)
{
Debug("rate estimation: %lu\n", bps);
this->instantBw = bps;
@@ -185,16 +185,16 @@ void BufferBasedAdaptationWithRateBased::bitrateUpdate(uint64_t bps, uint32_t se
}
}
-void BufferBasedAdaptationWithRateBased::onEOS(bool value)
+void AdapTechAdaptation::onEOS(bool value)
{
this->bufferEOS = value;
}
-void BufferBasedAdaptationWithRateBased::checkedByDASHReceiver()
+void AdapTechAdaptation::checkedByDASHReceiver()
{
this->isCheckedForReceiver = false;
}
-void BufferBasedAdaptationWithRateBased::bufferUpdate(uint32_t bufferFill, int maxC)
+void AdapTechAdaptation::bufferUpdate(uint32_t bufferFill, int maxC)
{
Debug("buffer update: %u\n", bufferFill);
EnterCriticalSection(&this->monitorLock);
@@ -203,7 +203,7 @@ void BufferBasedAdaptationWithRateBased::bufferUpdate(uint32_t bufferFill, int m
LeaveCriticalSection(&this->monitorLock);
}
-void BufferBasedAdaptationWithRateBased::dLTimeUpdate(double time)
+void AdapTechAdaptation::dLTimeUpdate(double time)
{
}
diff --git a/Adaptation/BufferBasedAdaptationWithRateBased.h b/Adaptation/AdapTech.h
index 45147ed2..c7f4e33c 100644
--- a/Adaptation/BufferBasedAdaptationWithRateBased.h
+++ b/Adaptation/AdapTech.h
@@ -13,8 +13,8 @@
* limitations under the License.
*/
-#ifndef LIBDASH_FRAMEWORK_ADAPTATION_BUFFERBASEDADAPTATIONRATE_H_
-#define LIBDASH_FRAMEWORK_ADAPTATION_BUFFERBASEDADAPTATIONRATE_H_
+#ifndef LIBDASH_FRAMEWORK_ADAPTATION_ADAPTECH_H_
+#define LIBDASH_FRAMEWORK_ADAPTATION_ADAPTECH_H_
#include "AbstractAdaptationLogic.h"
#include "../MPD/AdaptationSetStream.h"
@@ -26,12 +26,12 @@ namespace framework
{
namespace adaptation
{
-class BufferBasedAdaptationWithRateBased : public AbstractAdaptationLogic
+class AdapTechAdaptation : public AbstractAdaptationLogic
{
public:
-// BufferBasedAdaptationWithRateBased(dash::mpd::IMPD *mpd, dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, bool isVid, struct AdaptationParameters *params);
- BufferBasedAdaptationWithRateBased(viper::managers::StreamType type, libdash::framework::mpd::MPDWrapper *mpdWrapper, struct AdaptationParameters *params);
- virtual ~BufferBasedAdaptationWithRateBased();
+// AdapTech(dash::mpd::IMPD *mpd, dash::mpd::IPeriod *period, dash::mpd::IAdaptationSet *adaptationSet, bool isVid, struct AdaptationParameters *params);
+ AdapTechAdaptation(viper::managers::StreamType type, libdash::framework::mpd::MPDWrapper *mpdWrapper, struct AdaptationParameters *params);
+ virtual ~AdapTechAdaptation();
virtual LogicType getType();
virtual bool isUserDependent();
@@ -70,4 +70,4 @@ private:
}
}
-#endif /* LIBDASH_FRAMEWORK_ADAPTATION_BUFFERBASEDADAPTATIONRATE_H_ */
+#endif /* LIBDASH_FRAMEWORK_ADAPTATION_ADAPTECH_H_ */
diff --git a/Adaptation/AdaptationLogicFactory.cpp b/Adaptation/AdaptationLogicFactory.cpp
index b2cae9c1..f2029b5d 100644
--- a/Adaptation/AdaptationLogicFactory.cpp
+++ b/Adaptation/AdaptationLogicFactory.cpp
@@ -29,9 +29,9 @@ IAdaptationLogic* AdaptationLogicFactory::create(LogicType logic, viper::manager
case BufferBased:
Debug("Buffer based\n");
return new BufferBasedAdaptation(type, mpdWrapper, paramsForAdaptation);
- case BufferRateBased:
- Debug("Buffer Rate based\n");
- return new BufferBasedAdaptationWithRateBased(type, mpdWrapper, paramsForAdaptation);
+ case AdapTech:
+ Debug("AdapTech\n");
+ return new AdapTechAdaptation(type, mpdWrapper, paramsForAdaptation);
case BufferBasedThreeThreshold:
Debug("Buffer based 3 threshold\n");
return new BufferBasedThreeThresholdAdaptation(type, mpdWrapper, paramsForAdaptation);
diff --git a/Adaptation/AdaptationLogicFactory.h b/Adaptation/AdaptationLogicFactory.h
index e78d2865..62d59360 100644
--- a/Adaptation/AdaptationLogicFactory.h
+++ b/Adaptation/AdaptationLogicFactory.h
@@ -16,7 +16,7 @@
#include "AlwaysLowestLogic.h"
#include "RateBasedAdaptation.h"
#include "BufferBasedAdaptation.h"
-#include "BufferBasedAdaptationWithRateBased.h"
+#include "AdapTech.h"
#include "BufferBasedThreeThresholdAdaptation.h"
#include "Panda.h"
#include "Bola.h"
diff --git a/Adaptation/IAdaptationLogic.h b/Adaptation/IAdaptationLogic.h
index 081366dd..a8d885c1 100644
--- a/Adaptation/IAdaptationLogic.h
+++ b/Adaptation/IAdaptationLogic.h
@@ -32,7 +32,7 @@ namespace adaptation
ADAPTATIONLOGIC(AlwaysLowest) \
ADAPTATIONLOGIC(RateBased) \
ADAPTATIONLOGIC(BufferBased) \
- ADAPTATIONLOGIC(BufferRateBased) \
+ ADAPTATIONLOGIC(AdapTech) \
ADAPTATIONLOGIC(BufferBasedThreeThreshold) \
ADAPTATIONLOGIC(Panda) \
ADAPTATIONLOGIC(Bola) \