From bd809fc04c3f9c36f8d145999e5a008ffd90a10b Mon Sep 17 00:00:00 2001 From: Jacques Samain Date: Mon, 26 Jun 2017 14:11:58 +0200 Subject: Corrected typo Change-Id: I85fa9fd7adedcd26cf866847b3c747f99a14f2c3 Signed-off-by: Jacques Samain --- Input/DASHManager.cpp | 1 - Input/DASHManager.h | 25 ++++++++++++------------- Input/DASHReceiver.cpp | 11 +---------- Input/DASHReceiver.h | 17 +++++------------ MPD/AbstractRepresentationStream.cpp | 4 ++-- MPD/AbstractRepresentationStream.h | 32 ++++++++++++++++---------------- MPD/IMPDWrapper.h | 18 +++++++++--------- MPD/IRepresentationStream.h | 4 ++-- MPD/MPDWrapper.cpp | 6 +++--- MPD/SegmentTemplateStream.cpp | 11 +++++------ MPD/SegmentTemplateStream.h | 6 +++--- Managers/MultimediaManager.cpp | 1 + Managers/MultimediaStream.h | 4 +--- UI/DASHPlayer.cpp | 13 ------------- libdash/include/ISegmentTemplate.h | 6 +++--- libdash/include/ITimeline.h | 8 ++++---- libdash/source/mpd/SegmentTemplate.cpp | 15 +++++++-------- libdash/source/mpd/SegmentTemplate.h | 10 +++++----- libdash/source/mpd/Timeline.cpp | 14 +++++++------- libdash/source/mpd/Timeline.h | 18 +++++++++--------- libdash/source/xml/Node.cpp | 1 + 21 files changed, 96 insertions(+), 129 deletions(-) diff --git a/Input/DASHManager.cpp b/Input/DASHManager.cpp index 3377c1a8..a771572a 100644 --- a/Input/DASHManager.cpp +++ b/Input/DASHManager.cpp @@ -160,7 +160,6 @@ void DASHManager::onBufferStateChanged(BufferType type, uint32_t fillstateInPerc if(this->adaptationLogic->isBufferBased()) this->receiver->OnSegmentBufferStateChanged(fillstateInPercent, maxC); } - void DASHManager::fetchMPD() { this->multimediaStream->fetchMPD(); diff --git a/Input/DASHManager.h b/Input/DASHManager.h index c2b4a88b..4bd301e7 100644 --- a/Input/DASHManager.h +++ b/Input/DASHManager.h @@ -42,11 +42,10 @@ public: bool start(); void stop(); uint32_t getPosition(); - void setPosition(uint32_t segmentNumber); // to implement + void setPosition(uint32_t segmentNumber); void setLooping(bool looping); void setPositionInMsec(uint32_t millisec); void clear(); -// 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); @@ -65,17 +64,17 @@ public: void fetchMPD(); private: - float beta; - float drop; - buffer::Buffer *buffer; - DASHReceiver *receiver; - uint32_t readSegmentCount; - IDASHManagerObserver *multimediaStream; - bool isRunning; - bool icn; - double icnAlpha; - bool noDecoding; - libdash::framework::adaptation::IAdaptationLogic *adaptationLogic; + float beta; + float drop; + buffer::Buffer *buffer; + DASHReceiver *receiver; + uint32_t readSegmentCount; + IDASHManagerObserver *multimediaStream; + bool isRunning; + bool icn; + double icnAlpha; + bool noDecoding; + libdash::framework::adaptation::IAdaptationLogic *adaptationLogic; }; } } diff --git a/Input/DASHReceiver.cpp b/Input/DASHReceiver.cpp index c6dafb93..c1f1acc6 100644 --- a/Input/DASHReceiver.cpp +++ b/Input/DASHReceiver.cpp @@ -22,11 +22,7 @@ using duration_in_seconds = std::chrono::duration >; DASHReceiver::DASHReceiver (viper::managers::StreamType type, MPDWrapper *mpdWrapper, IDASHReceiverObserver *obs, Buffer *buffer, uint32_t bufferSize, bool icnEnabled, double icnAlpha, float beta, float drop) : type (type), mpdWrapper (mpdWrapper), -// period (NULL), -// adaptationSet (NULL), -// representation (NULL), adaptationSetStream (NULL), -// representationStream (NULL), segmentNumber (0), observer (obs), buffer (buffer), @@ -51,14 +47,8 @@ DASHReceiver::DASHReceiver (viper::managers::StreamType type, MPDWrappe { readMax = 32768; readBuffer = (uint8_t*)malloc(sizeof(uint8_t)*readMax); -// this->period = this->mpd->GetPeriods().at(0); -// this->adaptationSet = this->period->GetAdaptationSets().at(0); -// this->representation = this->adaptationSet->GetRepresentation().at(0); - this->adaptationSetStream = new AdaptationSetStream(type, mpdWrapper); -// this->representationStream = adaptationSetStream->getRepresentationStream(this->representation); this->segmentOffset = CalculateSegmentOffset(); -// this->representationStream->setSegmentOffset(this->segmentOffset); this->mpdWrapper->setSegmentOffset(type, this->segmentOffset); this->conn = NULL; this->initConn = NULL; @@ -408,3 +398,4 @@ void DASHReceiver::SetDrop (float drop) this->drop = drop; } + diff --git a/Input/DASHReceiver.h b/Input/DASHReceiver.h index ed98b9e1..9d221ec5 100644 --- a/Input/DASHReceiver.h +++ b/Input/DASHReceiver.h @@ -62,7 +62,7 @@ public: void SetPosition(uint32_t segmentNumber); void SetLooping(bool isLoopinp); void SetPositionInMsecs(uint32_t milliSecs); - + dash::mpd::IRepresentation* GetRepresentation(); void SetRepresentation(); void SetAdaptationLogic(adaptation::IAdaptationLogic *_adaptationLogic); libdash::framework::adaptation::IAdaptationLogic* GetAdaptationLogic(); @@ -86,17 +86,11 @@ private: float drop; bool withFeedBack; bool isBufferBased; -// std::map initSegments; - std::map initSegments; + std::map initSegments; libdash::framework::buffer::Buffer *buffer; IDASHReceiverObserver *observer; - libdash::framework::mpd::MPDWrapper *mpdWrapper; -// dash::mpd::IMPD *mpd; -// dash::mpd::IPeriod *period; -// dash::mpd::IAdaptationSet *adaptationSet; -// dash::mpd::IRepresentation *representation; + libdash::framework::mpd::MPDWrapper *mpdWrapper; mpd::AdaptationSetStream *adaptationSetStream; -// mpd::IRepresentationStream *representationStream; uint32_t segmentNumber; uint32_t positionInMsecs; uint32_t segmentOffset; @@ -121,13 +115,12 @@ private: int bufferLevelAtUpdate; int readMax; uint8_t *readBuffer; - viper::managers::StreamType type; + viper::managers::StreamType type; + uint32_t CalculateSegmentOffset(); void NotifySegmentDownloaded(); -// void DownloadInitSegment(dash::mpd::IRepresentation* rep); void DownloadInitSegment(); void DownloadInitSegmentWithoutLock(); -// bool InitSegmentExists(dash::mpd::IRepresentation* rep); bool InitSegmentExists(int rep); static void* DoBuffering(void *receiver); static void* DoMPDFetching(void * data); diff --git a/MPD/AbstractRepresentationStream.cpp b/MPD/AbstractRepresentationStream.cpp index e02f65cb..1ffee924 100644 --- a/MPD/AbstractRepresentationStream.cpp +++ b/MPD/AbstractRepresentationStream.cpp @@ -94,11 +94,11 @@ void AbstractRepresentationStream::setSegmentOffset (uint32_t offset) this->segmentOffset = offset; } -uint32_t AbstractRepresentationStream::getTime(size_t segmentNumber) +uint64_t AbstractRepresentationStream::getTime(size_t segmentNumber) { return 0; } -size_t AbstractRepresentationStream::getSegmentNumber(uint32_t time) +size_t AbstractRepresentationStream::getSegmentNumber(uint64_t time) { return 0; } diff --git a/MPD/AbstractRepresentationStream.h b/MPD/AbstractRepresentationStream.h index 87400c0c..113720ed 100644 --- a/MPD/AbstractRepresentationStream.h +++ b/MPD/AbstractRepresentationStream.h @@ -47,27 +47,27 @@ public: virtual dash::mpd::ISegment* getBitstreamSwitchingSegment() = 0; virtual RepresentationStreamType getStreamType() = 0; - virtual uint32_t getSize(); - virtual uint32_t getFirstSegmentNumber(); - virtual uint32_t getCurrentSegmentNumber(); - virtual uint32_t getLastSegmentNumber(); - virtual uint32_t getAverageSegmentDuration(); + virtual uint32_t getSize(); + virtual uint32_t getFirstSegmentNumber(); + virtual uint32_t getCurrentSegmentNumber(); + virtual uint32_t getLastSegmentNumber(); + virtual uint32_t getAverageSegmentDuration(); - virtual uint32_t getTimescale(); - virtual void setSegmentOffset(uint32_t offset); - virtual uint32_t getTime(size_t segmentNumber); - virtual size_t getSegmentNumber(uint32_t time); + virtual uint32_t getTimescale(); + virtual void setSegmentOffset(uint32_t offset); + virtual uint64_t getTime(size_t segmentNumber); + virtual size_t getSegmentNumber(uint64_t time); protected: virtual void setBaseUrls(const std::vector baseurls); - std::vector baseUrls; - libdash::framework::mpd::IMPDWrapper *mpdWrapper; - dash::mpd::IPeriod *period; - dash::mpd::IAdaptationSet *adaptationSet; - dash::mpd::IRepresentation *representation; - uint32_t segmentOffset; - viper::managers::StreamType type; + std::vector baseUrls; + libdash::framework::mpd::IMPDWrapper *mpdWrapper; + dash::mpd::IPeriod *period; + dash::mpd::IAdaptationSet *adaptationSet; + dash::mpd::IRepresentation *representation; + uint32_t segmentOffset; + viper::managers::StreamType type; }; } } diff --git a/MPD/IMPDWrapper.h b/MPD/IMPDWrapper.h index 7390494e..61a8a1c3 100644 --- a/MPD/IMPDWrapper.h +++ b/MPD/IMPDWrapper.h @@ -28,15 +28,15 @@ namespace mpd class IMPDWrapper { public: - virtual std::string getAvailabilityStarttime() = 0; - virtual std::string getTimeShiftBufferDepth() = 0; - virtual std::string getTypeWithoutLock() = 0; - virtual uint32_t getFetchTime() = 0; - virtual std::string getMinimumUpdatePeriodWithoutLock() = 0; - virtual std::vector resolveBaseUrl(viper::managers::StreamType type, size_t mpdBaseUrl, size_t periodBaseUrl, size_t adaptationSetBaseUrl) = 0; - virtual std::vector resolveBaseUrl(viper::managers::StreamType type, size_t mpdBaseUrl, size_t periodBaseUrl, size_t adaptationSetBaseUrl, dash::mpd::IMPD* mpd) = 0; - virtual void releaseLock() = 0; - virtual std::string getMediaPresentationDuration() = 0; + virtual std::string getAvailabilityStarttime() = 0; + virtual std::string getTimeShiftBufferDepth() = 0; + virtual std::string getTypeWithoutLock() = 0; + virtual uint32_t getFetchTime() = 0; + virtual std::string getMinimumUpdatePeriodWithoutLock() = 0; + virtual std::vector resolveBaseUrl(viper::managers::StreamType type, size_t mpdBaseUrl, size_t periodBaseUrl, size_t adaptationSetBaseUrl) = 0; + virtual std::vector resolveBaseUrl(viper::managers::StreamType type, size_t mpdBaseUrl, size_t periodBaseUrl, size_t adaptationSetBaseUrl, dash::mpd::IMPD* mpd) = 0; + virtual void releaseLock() = 0; + virtual std::string getMediaPresentationDuration() = 0; }; } } diff --git a/MPD/IRepresentationStream.h b/MPD/IRepresentationStream.h index 5734c4cf..bf8b08c4 100644 --- a/MPD/IRepresentationStream.h +++ b/MPD/IRepresentationStream.h @@ -44,8 +44,8 @@ public: virtual uint32_t getLastSegmentNumber() = 0; virtual uint32_t getAverageSegmentDuration() = 0; virtual void setSegmentOffset(uint32_t offset) = 0; - virtual uint32_t getTime(size_t segmentNumber) = 0; - virtual size_t getSegmentNumber(uint32_t time) = 0; + virtual uint64_t getTime(size_t segmentNumber) = 0; + virtual size_t getSegmentNumber(uint64_t time) = 0; }; diff --git a/MPD/MPDWrapper.cpp b/MPD/MPDWrapper.cpp index 4c8baa6b..163ed19d 100644 --- a/MPD/MPDWrapper.cpp +++ b/MPD/MPDWrapper.cpp @@ -141,7 +141,7 @@ void MPDWrapper::findVideoRepresentation (IMPD* mpd) } this->videoRepresentation = representations.at(0); this->initializeAdaptationSetStreamWithoutLock(viper::managers::StreamType::VIDEO, mpd); - this->videoSegmentNumber = this->videoRepresentations->find(this->videoRepresentation)->second->getSegmentNumber(time); + this->videoSegmentNumber = 0; } else { @@ -162,7 +162,7 @@ void MPDWrapper::findAudioRepresentation (IMPD* mpd) { if(id == std::stoi(representations.at(i)->GetId())) { - this->videoRepresentation = representations.at(i); + this->audioRepresentation = representations.at(i); this->destroyAdaptationSetStream(viper::managers::StreamType::AUDIO); this->initializeAdaptationSetStreamWithoutLock(viper::managers::StreamType::AUDIO, mpd); this->audioSegmentNumber = this->audioRepresentations->find(this->audioRepresentation)->second->getSegmentNumber(time); @@ -173,7 +173,7 @@ void MPDWrapper::findAudioRepresentation (IMPD* mpd) } this->audioRepresentation = representations.at(0); this->initializeAdaptationSetStreamWithoutLock(viper::managers::StreamType::AUDIO,mpd); - this->audioSegmentNumber = this->audioRepresentations->find(this->audioRepresentation)->second->getSegmentNumber(time); + this->audioSegmentNumber = 0; } else { diff --git a/MPD/SegmentTemplateStream.cpp b/MPD/SegmentTemplateStream.cpp index a62a9bab..409d8e59 100644 --- a/MPD/SegmentTemplateStream.cpp +++ b/MPD/SegmentTemplateStream.cpp @@ -179,10 +179,10 @@ void SegmentTemplateStream::calculateSegmentStartTimes() return; size_t numOfTimelines = 0; - uint32_t segStartTime = 0; - uint32_t segDuration = 0; + uint64_t segStartTime = 0; + uint64_t segDuration = 0; size_t repeatCount = 0; - uint32_t totalDuration = 0; + uint64_t totalDuration = 0; numOfTimelines = this->segmentTemplate->GetSegmentTimeline()->GetTimelines().size(); @@ -192,7 +192,6 @@ void SegmentTemplateStream::calculateSegmentStartTimes() segStartTime = this->segmentTemplate->GetSegmentTimeline()->GetTimelines().at(i)->GetStartTime(); segDuration = this->segmentTemplate->GetSegmentTimeline()->GetTimelines().at(i)->GetDuration(); totalDuration = totalDuration + segDuration; - if (repeatCount > 0) { for (size_t j = 0; j <= repeatCount; j++) @@ -215,7 +214,7 @@ void SegmentTemplateStream::calculateSegmentStartTimes() this->averageDuration = totalDuration / numOfTimelines; } -uint32_t SegmentTemplateStream::getTime(size_t segmentNumber) +uint64_t SegmentTemplateStream::getTime(size_t segmentNumber) { if(segmentNumber < this->segmentStartTimes.size()) return this->segmentStartTimes.at(segmentNumber); @@ -223,7 +222,7 @@ uint32_t SegmentTemplateStream::getTime(size_t segmentNumber) return 0; } -size_t SegmentTemplateStream::getSegmentNumber(uint32_t time) +size_t SegmentTemplateStream::getSegmentNumber(uint64_t time) { size_t i; for(i = 0; i < this->segmentStartTimes.size(); i ++) diff --git a/MPD/SegmentTemplateStream.h b/MPD/SegmentTemplateStream.h index 68d4f848..0bd0ad13 100644 --- a/MPD/SegmentTemplateStream.h +++ b/MPD/SegmentTemplateStream.h @@ -40,15 +40,15 @@ public: virtual uint32_t getSize(); virtual uint32_t getAverageSegmentDuration(); virtual uint32_t getTimescale(); - virtual uint32_t getTime(size_t segmentNumber); - virtual size_t getSegmentNumber(uint32_t time); + virtual uint64_t getTime(size_t segmentNumber); + virtual size_t getSegmentNumber(uint64_t time); private: dash::mpd::ISegmentTemplate* findSegmentTemplate(); void calculateSegmentStartTimes(); dash::mpd::ISegmentTemplate *segmentTemplate; - std::vector segmentStartTimes; + std::vector segmentStartTimes; uint32_t averageDuration; bool inSync; uint32_t currentSegment; diff --git a/Managers/MultimediaManager.cpp b/Managers/MultimediaManager.cpp index 44473b04..23118464 100644 --- a/Managers/MultimediaManager.cpp +++ b/Managers/MultimediaManager.cpp @@ -280,6 +280,7 @@ void MultimediaManager::stopAudio() bool MultimediaManager::setVideoQuality() { + if (this->videoStream) this->videoStream->setRepresentation(); return true; diff --git a/Managers/MultimediaStream.h b/Managers/MultimediaStream.h index d5661b01..454cca23 100644 --- a/Managers/MultimediaStream.h +++ b/Managers/MultimediaStream.h @@ -56,7 +56,6 @@ public: void setPosition(uint32_t segmentNumber); void setLooping(bool looping); void setPositionInMsec(uint32_t milliSecs); - libdash::framework::input::MediaObject* getSegment(); void setEOS(bool value); void notifyBufferChange(uint32_t bufferfill, int maxC); @@ -89,10 +88,9 @@ private: StreamType type; bool icn; double icnAlpha; - mutable CRITICAL_SECTION monitorMutex; bool noDecoding; - void init (); + void init(); }; } } diff --git a/UI/DASHPlayer.cpp b/UI/DASHPlayer.cpp index d83e4020..31db2165 100644 --- a/UI/DASHPlayer.cpp +++ b/UI/DASHPlayer.cpp @@ -99,19 +99,6 @@ void DASHPlayer::onSettingsChanged(int period, int videoAdaptationSet, int video if (!this->settingsChanged(period, videoAdaptationSet, videoRepresentation, audioAdaptationSet, audioRepresentation)) return; -// IPeriod *currentPeriod = this->multimediaManager->getMPD()->GetPeriods().at(period); -// std::vector videoAdaptationSets = AdaptationSetHelper::getVideoAdaptationSets(currentPeriod); -// std::vector audioAdaptationSets = AdaptationSetHelper::getAudioAdaptationSets(currentPeriod); -// if (videoAdaptationSet >= 0 && videoRepresentation >= 0) -// { -// this->multimediaManager->setVideoQuality(currentPeriod, -// videoAdaptationSets.at(videoAdaptationSet), -// videoAdaptationSets.at(videoAdaptationSet)->GetRepresentation().at(videoRepresentation)); -// } -// else -// { -// this->multimediaManager->setVideoQuality(currentPeriod, NULL, NULL); -// } this->mpdWrapper->settingsChanged(period, videoAdaptationSet, videoRepresentation, audioAdaptationSet, audioRepresentation); this->multimediaManager->setVideoQuality(); } diff --git a/libdash/include/ISegmentTemplate.h b/libdash/include/ISegmentTemplate.h index d7072956..19fe6418 100644 --- a/libdash/include/ISegmentTemplate.h +++ b/libdash/include/ISegmentTemplate.h @@ -126,7 +126,7 @@ namespace dash * This integer will be formated according to a possibly contained format tag in the \em \$Time\$ identifier. * @return a pointer to a dash::mpd::ISegment object */ - virtual ISegment* GetMediaSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const = 0; + virtual ISegment* GetMediaSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const = 0; /** * Returns a pointer to a dash::mpd::ISegment object that represents a Index Segment and can be downloaded. @@ -140,9 +140,9 @@ namespace dash * This integer will be formated according to a possibly contained format tag in the \em \$Time\$ identifier. * @return a pointer to a dash::mpd::ISegment object */ - virtual ISegment* GetIndexSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const = 0; + virtual ISegment* GetIndexSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const = 0; }; } } -#endif /* ISEGMENTTEMPLATE_H_ */ \ No newline at end of file +#endif /* ISEGMENTTEMPLATE_H_ */ diff --git a/libdash/include/ITimeline.h b/libdash/include/ITimeline.h index e1f8e953..0315fba3 100644 --- a/libdash/include/ITimeline.h +++ b/libdash/include/ITimeline.h @@ -43,14 +43,14 @@ namespace dash * \em StartTime corresponds to the \c \@t attribute. * @return an unsigned integer */ - virtual uint32_t GetStartTime () const = 0; + virtual uint64_t GetStartTime () const = 0; /** * Returns the integer that specifies the Segment duration, in units of the value of the \c \@timescale. \n\n * \em Duration corresponds to the \c \@d attribute. * @return an unsigned integer */ - virtual uint32_t GetDuration () const = 0; + virtual uint64_t GetDuration () const = 0; /** * Returns an integer that specifies the repeat count of the number of following contiguous Segments with the same duration expressed by the value of \c \@d. @@ -58,9 +58,9 @@ namespace dash * \em RepeatCount corresponds to the \c \@r attribute. * @return an unsigned integer */ - virtual uint32_t GetRepeatCount () const = 0; + virtual uint64_t GetRepeatCount () const = 0; }; } } -#endif /* ITIMELINE_H_ */ \ No newline at end of file +#endif /* ITIMELINE_H_ */ diff --git a/libdash/source/mpd/SegmentTemplate.cpp b/libdash/source/mpd/SegmentTemplate.cpp index b92c4692..f64f58c1 100644 --- a/libdash/source/mpd/SegmentTemplate.cpp +++ b/libdash/source/mpd/SegmentTemplate.cpp @@ -73,15 +73,15 @@ ISegment* SegmentTemplate::GetIndexSegmentFromNumber (const std:: { return ToSegment(this->index, baseurls, representationID, bandwidth, dash::metrics::IndexSegment, number); } -ISegment* SegmentTemplate::GetMediaSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const +ISegment* SegmentTemplate::GetMediaSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const { return ToSegment(this->media, baseurls, representationID, bandwidth, dash::metrics::MediaSegment, 0, time); } -ISegment* SegmentTemplate::GetIndexSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const +ISegment* SegmentTemplate::GetIndexSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const { return ToSegment(this->index, baseurls, representationID, bandwidth, dash::metrics::IndexSegment, 0, time); } -std::string SegmentTemplate::ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint32_t time) const +std::string SegmentTemplate::ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint64_t time) const { std::vector chunks; std::string replacedUri = ""; @@ -127,19 +127,18 @@ std::string SegmentTemplate::ReplaceParameters (const std:: return replacedUri; } } -void SegmentTemplate::FormatChunk (std::string& uri, uint32_t number) const +void SegmentTemplate::FormatChunk (std::string& uri, uint64_t number) const { char formattedNumber [50]; size_t pos = 0; - std::string formatTag = "%01d"; + std::string formatTag = "%01lu"; if ( (pos = uri.find("%0")) != std::string::npos) formatTag = uri.substr(pos).append("d"); - sprintf(formattedNumber, formatTag.c_str(), number); uri = formattedNumber; } -ISegment* SegmentTemplate::ToSegment (const std::string& uri, const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, HTTPTransactionType type, uint32_t number, uint32_t time) const +ISegment* SegmentTemplate::ToSegment (const std::string& uri, const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, HTTPTransactionType type, uint32_t number, uint64_t time) const { Segment *seg = new Segment(); @@ -149,4 +148,4 @@ ISegment* SegmentTemplate::ToSegment (const std:: delete(seg); return NULL; -} \ No newline at end of file +} diff --git a/libdash/source/mpd/SegmentTemplate.h b/libdash/source/mpd/SegmentTemplate.h index e5782a83..52aae8ab 100644 --- a/libdash/source/mpd/SegmentTemplate.h +++ b/libdash/source/mpd/SegmentTemplate.h @@ -36,8 +36,8 @@ namespace dash ISegment* ToBitstreamSwitchingSegment (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth) const; ISegment* GetMediaSegmentFromNumber (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t number) const; ISegment* GetIndexSegmentFromNumber (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t number) const; - ISegment* GetMediaSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const; - ISegment* GetIndexSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint32_t time) const; + ISegment* GetMediaSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const; + ISegment* GetIndexSegmentFromTime (const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, uint64_t time) const; void SetMedia (const std::string& media); void SetIndex (const std::string& index); @@ -45,10 +45,10 @@ namespace dash void SetBitstreamSwitching (const std::string& bitstreamSwichting); private: - std::string ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint32_t time) const; - void FormatChunk (std::string& uri, uint32_t number) const; + std::string ReplaceParameters (const std::string& uri, const std::string& representationID, uint32_t bandwidth, uint32_t number, uint64_t time) const; + void FormatChunk (std::string& uri, uint64_t number) const; ISegment* ToSegment (const std::string& uri, const std::vector& baseurls, const std::string& representationID, uint32_t bandwidth, - dash::metrics::HTTPTransactionType type, uint32_t number = 0, uint32_t time = 0) const; + dash::metrics::HTTPTransactionType type, uint32_t number = 0, uint64_t time = 0) const; std::string media; std::string index; diff --git a/libdash/source/mpd/Timeline.cpp b/libdash/source/mpd/Timeline.cpp index 624c6585..d054f655 100644 --- a/libdash/source/mpd/Timeline.cpp +++ b/libdash/source/mpd/Timeline.cpp @@ -23,27 +23,27 @@ Timeline::~Timeline () { } -uint32_t Timeline::GetStartTime () const +uint64_t Timeline::GetStartTime () const { return this->startTime; } -void Timeline::SetStartTime (uint32_t startTime) +void Timeline::SetStartTime (uint64_t startTime) { this->startTime = startTime; } -uint32_t Timeline::GetDuration () const +uint64_t Timeline::GetDuration () const { return this->duration; } -void Timeline::SetDuration (uint32_t duration) +void Timeline::SetDuration (uint64_t duration) { this->duration = duration; } -uint32_t Timeline::GetRepeatCount () const +uint64_t Timeline::GetRepeatCount () const { return this->repeatCount; } -void Timeline::SetRepeatCount (uint32_t repeatCount) +void Timeline::SetRepeatCount (uint64_t repeatCount) { this->repeatCount = repeatCount; -} \ No newline at end of file +} diff --git a/libdash/source/mpd/Timeline.h b/libdash/source/mpd/Timeline.h index 3caa331f..eea3cd55 100644 --- a/libdash/source/mpd/Timeline.h +++ b/libdash/source/mpd/Timeline.h @@ -27,18 +27,18 @@ namespace dash Timeline (); virtual ~Timeline (); - uint32_t GetStartTime () const; - uint32_t GetDuration () const; - uint32_t GetRepeatCount () const; + uint64_t GetStartTime () const; + uint64_t GetDuration () const; + uint64_t GetRepeatCount () const; - void SetStartTime (uint32_t startTime); - void SetDuration (uint32_t duration); - void SetRepeatCount (uint32_t repeatCount); + void SetStartTime (uint64_t startTime); + void SetDuration (uint64_t duration); + void SetRepeatCount (uint64_t repeatCount); private: - uint32_t startTime; - uint32_t duration; - uint32_t repeatCount; + uint64_t startTime; + uint64_t duration; + uint64_t repeatCount; }; } } diff --git a/libdash/source/xml/Node.cpp b/libdash/source/xml/Node.cpp index 53193207..0747a8e1 100644 --- a/libdash/source/xml/Node.cpp +++ b/libdash/source/xml/Node.cpp @@ -209,6 +209,7 @@ dash::mpd::Timeline* Node::ToTimeline () cons if (this->HasAttribute("t")) { + uint64_t yolo = strtoul(this->GetAttributeValue("t").c_str(), NULL, 10); timeline->SetStartTime(strtoul(this->GetAttributeValue("t").c_str(), NULL, 10)); } if (this->HasAttribute("d")) -- cgit 1.2.3-korg