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;
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;
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;
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();
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()
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);
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);