From 05c1a838c881ea502888659848d8792843b28718 Mon Sep 17 00:00:00 2001 From: Luca Muscariello Date: Sat, 25 Feb 2017 23:42:31 +0100 Subject: Initial commit: video player - viper Change-Id: Id5aa33598ce34659bad4a7a9ae5006bfb84f9bd1 Signed-off-by: Luca Muscariello --- libdash/source/mpd/MPD.cpp | 212 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 libdash/source/mpd/MPD.cpp (limited to 'libdash/source/mpd/MPD.cpp') diff --git a/libdash/source/mpd/MPD.cpp b/libdash/source/mpd/MPD.cpp new file mode 100644 index 00000000..84e0e614 --- /dev/null +++ b/libdash/source/mpd/MPD.cpp @@ -0,0 +1,212 @@ +/* + * MPD.cpp + ***************************************************************************** + * Copyright (C) 2012, bitmovin Softwareentwicklung OG, All Rights Reserved + * + * Email: libdash-dev@vicky.bitmovin.net + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "MPD.h" + +using namespace dash::mpd; +using namespace dash::metrics; + +MPD::MPD () : + id(""), + type("static"), + availabilityStarttime(""), + availabilityEndtime(""), + mediaPresentationDuration(""), + minimumUpdatePeriod(""), + minBufferTime(""), + timeShiftBufferDepth(""), + suggestedPresentationDelay(""), + maxSegmentDuration(""), + maxSubsegmentDuration("") +{ +} +MPD::~MPD () +{ + for(size_t i = 0; i < this->programInformations.size(); i++) + delete(this->programInformations.at(i)); + for(size_t i = 0; i < this->metrics.size(); i++) + delete(this->metrics.at(i)); + for(size_t i = 0; i < this->periods.size(); i++) + delete(this->periods.at(i)); + for(size_t i = 0; i < this->baseUrls.size(); i++) + delete(this->baseUrls.at(i)); +} + +const std::vector& MPD::GetProgramInformations () const +{ + return (std::vector &) this->programInformations; +} +void MPD::AddProgramInformation (ProgramInformation *programInformation) +{ + this->programInformations.push_back(programInformation); +} +const std::vector& MPD::GetBaseUrls () const +{ + return (std::vector &) this->baseUrls; +} +void MPD::AddBaseUrl (BaseUrl *url) +{ + this->baseUrls.push_back(url); +} +const std::vector& MPD::GetLocations () const +{ + return this->locations; +} +void MPD::AddLocation (const std::string& location) +{ + this->locations.push_back(location); +} +const std::vector& MPD::GetPeriods () const +{ + return (std::vector &) this->periods; +} +void MPD::AddPeriod (Period *period) +{ + this->periods.push_back(period); +} +const std::vector& MPD::GetMetrics () const +{ + return (std::vector &) this->metrics; +} +void MPD::AddMetrics (Metrics *metrics) +{ + this->metrics.push_back(metrics); +} +const std::string& MPD::GetId () const +{ + return this->id; +} +void MPD::SetId (const std::string& id) +{ + this->id = id; +} +const std::vector& MPD::GetProfiles () const +{ + return this->profiles; +} +void MPD::SetProfiles (const std::string& profiles) +{ + dash::helpers::String::Split(profiles, ',', this->profiles); +} +const std::string& MPD::GetType () const +{ + return this->type; +} +void MPD::SetType (const std::string& type) +{ + this->type = type; +} +const std::string& MPD::GetAvailabilityStarttime () const +{ + return this->availabilityStarttime; +} +void MPD::SetAvailabilityStarttime (const std::string& availabilityStarttime) +{ + this->availabilityStarttime = availabilityStarttime; +} +const std::string& MPD::GetAvailabilityEndtime () const +{ + return this->availabilityEndtime; +} +void MPD::SetAvailabilityEndtime (const std::string& availabilityEndtime) +{ + this->availabilityEndtime = availabilityEndtime; +} +const std::string& MPD::GetMediaPresentationDuration () const +{ + return this->mediaPresentationDuration; +} +void MPD::SetMediaPresentationDuration (const std::string& mediaPresentationDuration) +{ + this->mediaPresentationDuration = mediaPresentationDuration; +} +const std::string& MPD::GetMinimumUpdatePeriod () const +{ + return this->minimumUpdatePeriod; +} +void MPD::SetMinimumUpdatePeriod (const std::string& minimumUpdatePeriod) +{ + this->minimumUpdatePeriod = minimumUpdatePeriod; +} +const std::string& MPD::GetMinBufferTime () const +{ + return this->minBufferTime; +} +void MPD::SetMinBufferTime (const std::string& minBufferTime) +{ + this->minBufferTime = minBufferTime; +} +const std::string& MPD::GetTimeShiftBufferDepth () const +{ + return this->timeShiftBufferDepth; +} +void MPD::SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth) +{ + this->timeShiftBufferDepth = timeShiftBufferDepth; +} +const std::string& MPD::GetSuggestedPresentationDelay () const +{ + return this->suggestedPresentationDelay; +} +void MPD::SetSuggestedPresentationDelay (const std::string& suggestedPresentationDelay) +{ + this->suggestedPresentationDelay = suggestedPresentationDelay; +} +const std::string& MPD::GetMaxSegmentDuration () const +{ + return this->maxSegmentDuration; +} +void MPD::SetMaxSegmentDuration (const std::string& maxSegmentDuration) +{ + this->maxSegmentDuration = maxSegmentDuration; +} +const std::string& MPD::GetMaxSubsegmentDuration () const +{ + return this->maxSubsegmentDuration; +} +void MPD::SetMaxSubsegmentDuration (const std::string& maxSubsegmentDuration) +{ + this->maxSubsegmentDuration = maxSubsegmentDuration; +} +IBaseUrl* MPD::GetMPDPathBaseUrl () const +{ + return this->mpdPathBaseUrl; +} +void MPD::SetMPDPathBaseUrl (BaseUrl *mpdPath) +{ + this->mpdPathBaseUrl = mpdPath; +} +uint32_t MPD::GetFetchTime () const +{ + return this->fetchTime; +} +void MPD::SetFetchTime (uint32_t fetchTimeInSec) +{ + this->fetchTime = fetchTimeInSec; +} + + +const std::vector& MPD::GetTCPConnectionList () const +{ + return (std::vector &) this->tcpConnections; +} +void MPD::AddTCPConnection (TCPConnection *tcpConn) +{ + this->tcpConnections.push_back(tcpConn); +} +const std::vector& MPD::GetHTTPTransactionList () const +{ + return (std::vector &) this->httpTransactions; +} +void MPD::AddHTTPTransaction (HTTPTransaction *httpTransAct) +{ + this->httpTransactions.push_back(httpTransAct); +} -- cgit 1.2.3-korg