restore adaptation logic and android correction 25/7325/1
authorAngelo Mantellini (manangel) <[email protected]>
Tue, 27 Jun 2017 14:27:57 +0000 (16:27 +0200)
committerAngelo Mantellini (manangel) <[email protected]>
Tue, 27 Jun 2017 14:27:57 +0000 (16:27 +0200)
Change-Id: I20358214b0c1debc544e9e4b08c1cfd84aff4611
Signed-off-by: Angelo Mantellini (manangel) <[email protected]>
Input/DASHReceiver.cpp
Input/ICNConnectionConsumerApi.cpp
Input/ICNConnectionConsumerApi.h
Input/MediaObject.cpp
MPD/MPDWrapper.cpp

index c1f1acc..f559f29 100644 (file)
@@ -207,7 +207,7 @@ void                        DASHReceiver::NotifySegmentDownloaded   ()
 
 void                        DASHReceiver::DownloadInitSegmentWithoutLock    ()
 {
-    int rep = std::stoi(this->mpdWrapper->getRepresentationIDWithoutLock(type).c_str());
+    int rep = atoi(this->mpdWrapper->getRepresentationIDWithoutLock(type).c_str());
     if (this->InitSegmentExists(rep))
         return;
 
@@ -224,7 +224,7 @@ void                        DASHReceiver::DownloadInitSegmentWithoutLock    ()
 
 void                        DASHReceiver::DownloadInitSegment    ()
 {
-    int rep = std::stoi(this->mpdWrapper->getRepresentationID(type).c_str());
+    int rep = atoi(this->mpdWrapper->getRepresentationID(type).c_str());
     if (this->InitSegmentExists(rep))
         return;
 
index 04b378d..d5048cb 100644 (file)
@@ -56,25 +56,22 @@ ICNConnectionConsumerApi::ICNConnectionConsumerApi(double alpha, float beta, flo
     InitializeConditionVariable (&this->contentRetrieved);
     InitializeCriticalSection   (&this->monitorMutex);
        this->hTTPClientConnection = new libl4::http::HTTPClientConnection();
-    //this->myConsumer = new ConsumerSocket(ccnx::Name(), TransportProtocolAlgorithms::RAAQM);
-    //this->myConsumer->setSocketOption(RaaqmTransportOptions::GAMMA_VALUE, (int)gamma);
-
+       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/etc/consumer.conf", "r"))
+    if(FILE *fp = fopen("/usr/local/etc/hicn-consumer.conf", "r"))
     {
         fclose(fp);
         configFile = true;
     }
     if(!configFile)
     {
-//        qDebug("beta %f, drop %f", this->beta, this->drop);
-   //     this->myConsumer->setSocketOption(RaaqmTransportOptions::BETA_VALUE, this->beta);
-   //     this->myConsumer->setSocketOption(RaaqmTransportOptions::DROP_FACTOR, this->drop);
+        qDebug("beta %f, drop %f", this->beta, this->drop);
+
+        c.setSocketOption(libl4::transport::RaaqmTransportOptions::BETA_VALUE, this->beta);
+        c.setSocketOption(libl4::transport::RaaqmTransportOptions::DROP_FACTOR, this->drop);
     }
-    //this->myConsumer->setSocketOption(RateEstimationOptions::RATE_ESTIMATION_OBSERVER, this);
-    //this->myConsumer->setSocketOption(ConsumerCallbacksOptions::CONTENT_RETRIEVED, (ConsumerContentCallback) bind(&ICNConnectionConsumerApi::processPayload, this, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3));
-    //this->myConsumer->setSocketOption(ConsumerCallbacksOptions::CONTENT_OBJECT_TO_VERIFY, (ConsumerContentObjectVerificationCallback)bind(&ICNConnectionConsumerApi::onPacket, this, std::placeholders::_1, std::placeholders::_2));
+    c.setSocketOption(int(libl4::transport::RateEstimationOptions::RATE_ESTIMATION_OBSERVER), (libl4::transport::IcnObserver * )this);
 #ifdef NO_GUI
     if(this->icnAlpha != 20)
         this->icnRateBased = true;
index 0ee5cba..240ebca 100644 (file)
@@ -56,7 +56,7 @@ namespace libdash {
 namespace framework {
 namespace input {
 
-class ICNConnectionConsumerApi : public IICNConnection {
+class ICNConnectionConsumerApi : public IICNConnection, public libl4::transport::IcnObserver{
 public:
     ICNConnectionConsumerApi(double alpha, float beta, float drop);
     virtual ~ICNConnectionConsumerApi();
index f479a88..b2dde35 100644 (file)
@@ -28,7 +28,7 @@ MediaObject::MediaObject(ISegment *segment, IRepresentation *rep, bool withFeedB
     InitializeCriticalSection   (&this->stateLock);
     this->representationBandwidth = rep->GetBandwidth();
     this->representationHeight = rep->GetHeight();
-    this->representationId = std::stoi(rep->GetId());
+    this->representationId = atoi(rep->GetId().c_str());
 }
 
 MediaObject::~MediaObject()
index 163ed19..2f66834 100644 (file)
@@ -125,10 +125,10 @@ void      MPDWrapper::findVideoRepresentation     (IMPD* mpd)
         if(this->videoRepresentation)
         {
             uint32_t time = this->videoRepresentations->find(this->videoRepresentation)->second->getTime(this->videoSegmentNumber);
-            uint32_t id = std::stoi(this->videoRepresentation->GetId());
+            uint32_t id = atoi(this->videoRepresentation->GetId().c_str());
             for(size_t i = 0; i < representations.size(); i++)
             {
-                if(id == std::stoi(representations.at(i)->GetId()))
+                if(id == atoi(representations.at(i)->GetId().c_str()))
                 {
                     this->videoRepresentation = representations.at(i);
                     this->destroyAdaptationSetStream(viper::managers::StreamType::VIDEO);
@@ -157,10 +157,10 @@ void      MPDWrapper::findAudioRepresentation     (IMPD* mpd)
         if(this->audioRepresentation)
         {
             uint32_t time = this->audioRepresentations->find(this->audioRepresentation)->second->getTime(this->audioSegmentNumber);
-            uint32_t id = std::stoi(this->audioRepresentation->GetId());
+            uint32_t id = atoi(this->audioRepresentation->GetId().c_str());
             for(size_t i = 0; i < representations.size(); i++)
             {
-                if(id == std::stoi(representations.at(i)->GetId()))
+                if(id == atoi(representations.at(i)->GetId().c_str()))
                 {
                     this->audioRepresentation = representations.at(i);
                     this->destroyAdaptationSetStream(viper::managers::StreamType::AUDIO);