diff options
author | Luca Muscariello <lumuscar+fdio@cisco.com> | 2017-06-23 14:51:19 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@fd.io> | 2017-06-23 14:51:19 +0000 |
commit | ea99c36cadfab26fe4bf523931f87132c01a54a2 (patch) | |
tree | 13fc8ff2f6072add96f987a1a68a15c22d68d911 /UI/ViperGui.cpp | |
parent | e207b82a2b7e70e2700cf1c4237a2e819c655809 (diff) | |
parent | a644414fd2c3a3f7f41e716b6875a78981e4cfe1 (diff) |
Merge "adding mpd live handling + automatic mpd fetching" into viper/master
Diffstat (limited to 'UI/ViperGui.cpp')
-rw-r--r-- | UI/ViperGui.cpp | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/UI/ViperGui.cpp b/UI/ViperGui.cpp index 11ba2e8e..24dcfad2 100644 --- a/UI/ViperGui.cpp +++ b/UI/ViperGui.cpp @@ -41,6 +41,7 @@ ViperGui::ViperGui(QObject *parent) : this->position = 0; this->videoPlayer = qvariant_cast<QtAV::AVPlayer *>(parent->property("mediaObject")); this->streamBuffer = new ViperBuffer(); + this->listSegmentSize = 0; pthread_mutex_init(&(this->monitorMutex), NULL); if (streamBuffer->open(QIODevice::ReadWrite)) { this->videoPlayer->setIODevice(streamBuffer); @@ -55,25 +56,28 @@ ViperGui::~ViperGui() void ViperGui::setGuiFields(dash::mpd::IMPD* mpd) { - this->setPeriodComboBox(mpd); - if (mpd->GetPeriods().size() > 0) +//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); +// } +// } + if(!strcmp(mpd->GetType().c_str(),"static")) { - 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); - } + parse8601(mpd->GetMediaPresentationDuration()); + this->lifeLabel->setProperty("text", QVariant(this->durationString.c_str())); } - parse8601(mpd->GetMediaPresentationDuration()); - this->mpd = mpd; - this->lifeLabel->setProperty("text", QVariant(this->durationString.c_str())); } void ViperGui::parse8601(std::string durationISO8601) @@ -242,7 +246,10 @@ void ViperGui::writeData(libdash::framework::input::MediaObject* media) { this->streamBuffer->writeData(media); pthread_mutex_lock(&(this->monitorMutex)); - this->segment = (this->segment + 1) % this->listSegmentSize; + if(this->listSegmentSize) + this->segment = (this->segment + 1) % this->listSegmentSize; + else + this->segment = this->segment + 1; if( this->segment > 0) { this->bufferDuration += this->segmentDuration; |