From 247f329c76bb00ba6df8a5f796fc264e43fb5fee Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Mon, 19 Apr 2021 17:03:51 +0200 Subject: [PATCH 01/28] Updated DOMParser and tested libdash --- libdash/libdash/source/xml/DOMParser.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libdash/libdash/source/xml/DOMParser.cpp b/libdash/libdash/source/xml/DOMParser.cpp index 41a78a9a..83ea24a0 100644 --- a/libdash/libdash/source/xml/DOMParser.cpp +++ b/libdash/libdash/source/xml/DOMParser.cpp @@ -108,6 +108,7 @@ Node* DOMParser::ProcessNode () Node *node = new Node(); node->SetType(type); node->SetText(text); + std::cout << " " << text << std::endl; delete text; return node; } @@ -116,6 +117,8 @@ Node* DOMParser::ProcessNode () } void DOMParser::AddAttributesToNode (Node *node) { + std::stringstream ss; // Parsed values + ss << node->GetName() << ":" << std::endl; if(xmlTextReaderHasAttributes(this->reader)) { while(xmlTextReaderMoveToNextAttribute(this->reader)) @@ -123,8 +126,10 @@ void DOMParser::AddAttributesToNode (Node *node) std::string key = (const char *) xmlTextReaderConstName(this->reader); std::string value = (const char *) xmlTextReaderConstValue(this->reader); node->AddAttribute(key, value); + ss << " " << key << "=" << value << std::endl; } } + std::cout << ss.str(); } void DOMParser::Print (Node *node, int offset) { From 2b75446698b44a1ae916ec84d35158d9c07d0120 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Thu, 22 Apr 2021 09:03:07 +0200 Subject: [PATCH 02/28] libdash update - part 1 --- libdash/libdash/include/IAdaptationSet.h | 21 +++++++++- libdash/libdash/include/IBaseUrl.h | 29 +++++++++++-- libdash/libdash/include/IMPD.h | 6 +++ libdash/libdash/include/IPeriod.h | 12 ++++++ libdash/libdash/source/mpd/AdaptationSet.cpp | 29 ++++++++++++- libdash/libdash/source/mpd/AdaptationSet.h | 9 ++++ libdash/libdash/source/mpd/BaseUrl.cpp | 43 ++++++++++++++++---- libdash/libdash/source/mpd/BaseUrl.h | 23 +++++++---- libdash/libdash/source/mpd/MPD.cpp | 9 ++++ libdash/libdash/source/mpd/MPD.h | 3 ++ libdash/libdash/source/mpd/Period.cpp | 18 ++++++++ libdash/libdash/source/mpd/Period.h | 6 +++ libdash/libdash/source/xml/DOMParser.cpp | 5 +++ libdash/libdash/source/xml/Node.cpp | 36 ++++++++++++++++ 14 files changed, 228 insertions(+), 21 deletions(-) diff --git a/libdash/libdash/include/IAdaptationSet.h b/libdash/libdash/include/IAdaptationSet.h index eff9c7ec..d428cdd9 100644 --- a/libdash/libdash/include/IAdaptationSet.h +++ b/libdash/libdash/include/IAdaptationSet.h @@ -156,7 +156,19 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetXlinkActuate () const = 0; - + + /** + * Returns a reference to a string that specifies the type of link. + * @return a reference to a string + */ + virtual const std::string& GetXlinkType () const = 0; + + /** + * Returns a reference to a string that specifies where to open the link. + * @return a reference to a string + */ + virtual const std::string& GetXlinkShow () const = 0; + /** * Returns an unsigned integer that specifies an unique identifier for this Adaptation Set in the scope of the Period. * The attribute shall be unique in the scope of the containing Period. \n\n @@ -360,6 +372,13 @@ namespace dash * @return a bool value */ virtual bool GetBitstreamSwitching () const = 0; + + /** + * Returns a reference to a string that specifies the reference initialization set defined as a whitespace-separated list of unsigned integers. + * @return a reference to a string + */ + virtual const std::string& GetInitializationSetRef () const = 0; + }; } } diff --git a/libdash/libdash/include/IBaseUrl.h b/libdash/libdash/include/IBaseUrl.h index 206ad14b..174426b4 100644 --- a/libdash/libdash/include/IBaseUrl.h +++ b/libdash/libdash/include/IBaseUrl.h @@ -36,14 +36,14 @@ namespace dash * Returns the reference to a string representing a BaseURL * @return a reference to a string */ - virtual const std::string& GetUrl () const = 0; + virtual const std::string& GetUrl () const = 0; /** * Returns the reference to a string that specifies a relationship between Base URLs such that \c BaseURL elements with the same * \c \@serviceLocation value are likely to have their URLs resolve to services at a common network location, for example a common Content Delivery Network * @return a reference to a string */ - virtual const std::string& GetServiceLocation () const = 0; + virtual const std::string& GetServiceLocation () const = 0; /** * Returns the reference to a string that represents a byte range. \n @@ -53,7 +53,28 @@ namespace dash * \b NOTE: Such alternative requests are expected to not be used unless the DASH application requires this. For more details refer to Annex E. * @return a reference to a string */ - virtual const std::string& GetByteRange () const = 0; + virtual const std::string& GetByteRange () const = 0; + + /** + * Returns a number that specifies an offset to define the adjusted segment availability time. + * If the value is present in \c SegmentBase then this attribute is additive to the one in \c SegmentBase. + * @return a double + */ + virtual double GetAvailabilityTimeOffset () const = 0; + + /** + * Returns a boolean that specifies if all Segments of all associated Representation are complete at the adjusted availability start time. + * If the value is present in \c SegmentBase then this attribute should not be present. If present in \c SegmentBase and \c BaseURL, the value in \c BaseURL shall be ignored. + * @return a boolean + */ + virtual const std::string& GetAvailabilityTimeComplete () const = 0; + + /** + * Returns the reference to a string that specifies the duration of the smallest time shifting buffer for any Representation in the MPD that is guaranteed to be available for a Media Presentation with type 'dynamic'. + * This value overrides \c MPD@timeShiftBufferDepth for the resources that use this \c BaseURL. This value of the attribute is undefined if the \c MPD@type attribute is equal to \c 'static'. + * @return a reference to a string + */ + virtual const std::string& GetTimeShiftBufferDepth () const = 0; /** * Returns a pointer to a dash::mpd::ISegment object which represents a media segment that can be downloaded. Should be used for single base urls inside @@ -61,7 +82,7 @@ namespace dash * @param baseurls a vector of pointers to dash::mpd::IBaseUrl objects that represent the path to the media segment * @return a pointer to a dash::mpd::ISegment object */ - virtual ISegment* ToMediaSegment (const std::vector& baseurls) const = 0; + virtual ISegment* ToMediaSegment (const std::vector& baseurls) const = 0; }; } } diff --git a/libdash/libdash/include/IMPD.h b/libdash/libdash/include/IMPD.h index 7e69eecf..0415f907 100644 --- a/libdash/libdash/include/IMPD.h +++ b/libdash/libdash/include/IMPD.h @@ -126,6 +126,12 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetAvailabilityEndtime () const = 0; + + /** + * Returns a reference to a string that specifies the time at which the MPD file was published. When not present, the value is unknown. + * @return a reference to a string + */ + virtual const std::string& GetPublishTime () const = 0; /** * Returns a reference to a string that specifies the duration of the entire Media Presentation. If the attribute is not present, the duration of the Media Presentation is unknown. diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index 10ec9244..428c642f 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -119,6 +119,18 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetXlinkActuate () const = 0; + + /** + * Returns a reference to a string that specifies the type of link. + * @return a reference to a string + */ + virtual const std::string& GetXlinkType () const = 0; + + /** + * Returns a reference to a string that specifies where to open the link. + * @return a reference to a string + */ + virtual const std::string& GetXlinkShow () const = 0; /** * Returns an reference to a string that specifies an identifier for this Period. diff --git a/libdash/libdash/source/mpd/AdaptationSet.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index b1a0331f..c3184ad2 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -20,6 +20,8 @@ AdaptationSet::AdaptationSet () : segmentTemplate(NULL), xlinkHref(""), xlinkActuate("onRequest"), + xlinkType(""), + xlinkShow(""), id(0), lang(""), contentType(""), @@ -38,7 +40,8 @@ AdaptationSet::AdaptationSet () : usesSubsegmentAlignment(false), segmentAlignment(0), subsegmentAlignment(0), - isBitstreamSwitching(false) + isBitstreamSwitching(false), + initializationSetRef("") { } AdaptationSet::~AdaptationSet () @@ -159,6 +162,22 @@ void AdaptationSet::SetXlinkActuate { this->xlinkActuate = xlinkActuate; } +const std::string& AdaptationSet::GetXlinkType () const +{ + return this->xlinkType; +} +void AdaptationSet::SetXlinkType (const std::string& xlinkType) +{ + this->xlinkType = xlinkType; +} +const std::string& AdaptationSet::GetXlinkShow () const +{ + return this->xlinkShow; +} +void AdaptationSet::SetXlinkShow (const std::string& xlinkShow) +{ + this->xlinkShow = xlinkShow; +} uint32_t AdaptationSet::GetId () const { return this->id; @@ -341,3 +360,11 @@ void AdaptationSet::SetBitstreamSwitching { this->isBitstreamSwitching = value; } +const std::string& AdaptationSet::GetInitializationSetRef () const +{ + return this->initializationSetRef; +} +void AdaptationSet::SetInitializationSetRef (const std::string& initializationSetRef) +{ + this->initializationSetRef = initializationSetRef; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/AdaptationSet.h b/libdash/libdash/source/mpd/AdaptationSet.h index 5a17cf4a..625bd8f6 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -45,6 +45,8 @@ namespace dash const std::vector& GetRepresentation () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; + const std::string& GetXlinkType () const; + const std::string& GetXlinkShow () const; uint32_t GetId () const; uint32_t GetGroup () const; const std::string& GetLang () const; @@ -66,6 +68,7 @@ namespace dash uint32_t GetSubsegmentAlignment () const; uint8_t GetSubsegmentStartsWithSAP () const; bool GetBitstreamSwitching () const; + const std::string& GetInitializationSetRef () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -79,6 +82,8 @@ namespace dash void AddRepresentation (Representation* representation); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); + void SetXlinkType (const std::string& xlinkType); + void SetXlinkShow (const std::string& xlinkShow); void SetId (uint32_t id); void SetGroup (uint32_t group); void SetLang (const std::string& lang); @@ -96,6 +101,7 @@ namespace dash void SetSubsegmentAlignment (const std::string& subsegmentAlignment); void SetSubsegmentStartsWithSAP (uint8_t subsegmentStartsWithSAP); void SetBitstreamSwitching (bool value); + void SetInitializationSetRef (const std::string& initializationSetRef); private: std::vector accessibility; @@ -110,6 +116,8 @@ namespace dash std::vector representation; std::string xlinkHref; std::string xlinkActuate; + std::string xlinkType; + std::string xlinkShow; uint32_t id; uint32_t group; std::string lang; @@ -131,6 +139,7 @@ namespace dash uint32_t subsegmentAlignment; uint8_t subsegmentStartsWithSAP; bool isBitstreamSwitching; + std::string initializationSetRef; }; } } diff --git a/libdash/libdash/source/mpd/BaseUrl.cpp b/libdash/libdash/source/mpd/BaseUrl.cpp index 7bafe794..14db5c24 100644 --- a/libdash/libdash/source/mpd/BaseUrl.cpp +++ b/libdash/libdash/source/mpd/BaseUrl.cpp @@ -16,38 +16,65 @@ using namespace dash::mpd; BaseUrl::BaseUrl () : url(""), serviceLocation(""), - byteRange("") + byteRange(""), + availabilityTimeOffset(0), + availabilityTimeComplete(false), + timeShiftBufferDepth("") { } BaseUrl::~BaseUrl () { } -const std::string& BaseUrl::GetUrl () const +const std::string& BaseUrl::GetUrl () const { return this->url; } -void BaseUrl::SetUrl (const std::string& url) +void BaseUrl::SetUrl (const std::string& url) { this->url = url; } -const std::string& BaseUrl::GetServiceLocation () const +const std::string& BaseUrl::GetServiceLocation () const { return this->serviceLocation; } -void BaseUrl::SetServiceLocation (const std::string& serviceLocation) +void BaseUrl::SetServiceLocation (const std::string& serviceLocation) { this->serviceLocation = serviceLocation; } -const std::string& BaseUrl::GetByteRange () const +const std::string& BaseUrl::GetByteRange () const { return this->byteRange; } -void BaseUrl::SetByteRange (const std::string& byteRange) +void BaseUrl::SetByteRange (const std::string& byteRange) { this->byteRange = byteRange; } -ISegment* BaseUrl::ToMediaSegment (const std::vector& baseurls) const +double BaseUrl::GetAvailabilityTimeOffset () const +{ + return this->availabilityTimeOffset; +} +void BaseUrl::SetAvailabilityTimeOffset (double availabilityTimeOffset) +{ + this->availabilityTimeOffset = availabilityTimeOffset; +} +bool BaseUrl::GetAvailabilityTimeComplete () const +{ + return this->availabilityTimeComplete; +} +void BaseUrl::SetAvailabilityTimeComplete (bool availabilityTimeComplete) +{ + this->availabilityTimeComplete = availabilityTimeComplete; +} +const std::string& BaseUrl::GetTimeShiftBufferDepth () const +{ + return this->timeShiftBufferDepth; +} +void BaseUrl::SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth) +{ + this->timeShiftBufferDepth = timeShiftBufferDepth; +} +ISegment* BaseUrl::ToMediaSegment (const std::vector& baseurls) const { Segment *seg = new Segment(); diff --git a/libdash/libdash/source/mpd/BaseUrl.h b/libdash/libdash/source/mpd/BaseUrl.h index 0147c1ed..557adabb 100644 --- a/libdash/libdash/source/mpd/BaseUrl.h +++ b/libdash/libdash/source/mpd/BaseUrl.h @@ -28,13 +28,19 @@ namespace dash BaseUrl (); virtual ~BaseUrl(); - const std::string& GetUrl () const; - const std::string& GetServiceLocation () const; - const std::string& GetByteRange () const; - - void SetUrl (const std::string& url); - void SetServiceLocation (const std::string& serviceLocation); - void SetByteRange (const std::string& byteRange); + const std::string& GetUrl () const; + const std::string& GetServiceLocation () const; + const std::string& GetByteRange () const; + double GetAvailabilityTimeOffset () const; + bool GetAvailabilityTimeComplete () const; + const std::string& GetTimeShiftBufferDepth () const; + + void SetUrl (const std::string& url); + void SetServiceLocation (const std::string& serviceLocation); + void SetByteRange (const std::string& byteRange); + void SetAvailabilityTimeOffset (double availabilityTimeOffset); + void SetAvailabilityTimeComplete (bool availabilityTimeComplete); + void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); virtual ISegment* ToMediaSegment (const std::vector& baseurls) const; @@ -42,6 +48,9 @@ namespace dash std::string url; std::string serviceLocation; std::string byteRange; + double availabilityTimeOffset; + bool availabilityTimeComplete; + std::string timeShiftBufferDepth; }; } } diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index e949d7ea..d6b2bd3d 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -19,6 +19,7 @@ MPD::MPD () : type("static"), availabilityStarttime(""), availabilityEndtime(""), + publishTime(""), mediaPresentationDuration(""), minimumUpdatePeriod(""), minBufferTime(""), @@ -115,6 +116,14 @@ void MPD::SetAvailabilityStarttime { this->availabilityStarttime = availabilityStarttime; } +const std::string& MPD::GetPublishTime () const +{ + return this->publishTime; +} +void MPD::SetPublishTime (const std::string& publishTime) +{ + this->publishTime = publishTime; +} const std::string& MPD::GetAvailabilityEndtime () const { return this->availabilityEndtime; diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index 9bcb38af..8b04d771 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -43,6 +43,7 @@ namespace dash const std::string& GetType () const; const std::string& GetAvailabilityStarttime () const; const std::string& GetAvailabilityEndtime () const; + const std::string& GetPublishTime () const; const std::string& GetMediaPresentationDuration () const; const std::string& GetMinimumUpdatePeriod () const; const std::string& GetMinBufferTime () const; @@ -68,6 +69,7 @@ namespace dash void SetType (const std::string& type); void SetAvailabilityStarttime (const std::string& availabilityStarttime); void SetAvailabilityEndtime (const std::string& availabilityEndtime); + void SetPublishTime (const std::string& publishTime); void SetMediaPresentationDuration (const std::string& mediaPresentationDuration); void SetMinimumUpdatePeriod (const std::string& minimumUpdatePeriod); void SetMinBufferTime (const std::string& minBufferTime); @@ -89,6 +91,7 @@ namespace dash std::string type; std::string availabilityStarttime; std::string availabilityEndtime; + std::string publishTime; std::string mediaPresentationDuration; std::string minimumUpdatePeriod; std::string minBufferTime; diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index 291677ea..7510d2a9 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -19,6 +19,8 @@ Period::Period () : segmentTemplate(NULL), xlinkActuate("onRequest"), xlinkHref(""), + xlinkType(""), + xlinkShow(""), id(""), start(""), duration(""), @@ -103,6 +105,22 @@ void Period::SetXlinkActuate (const std:: { this->xlinkActuate = xlinkActuate; } +const std::string& Period::GetXlinkType () const +{ + return this->xlinkType; +} +void Period::SetXlinkType (const std::string& xlinkType) +{ + this->xlinkType = xlinkType; +} +const std::string& Period::GetXlinkShow () const +{ + return this->xlinkShow; +} +void Period::SetXlinkShow (const std::string& xlinkShow) +{ + this->xlinkShow = xlinkShow; +} const std::string& Period::GetId () const { return this->id; diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index 9e97f0cb..02c53262 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -41,6 +41,8 @@ namespace dash const std::vector& GetSubsets () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; + const std::string& GetXlinkType () const; + const std::string& GetXlinkShow () const; const std::string& GetId () const; const std::string& GetStart () const; const std::string& GetDuration () const; @@ -54,6 +56,8 @@ namespace dash void AddSubset (Subset *subset); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); + void SetXlinkType (const std::string& xlinkType); + void SetXlinkShow (const std::string& xlinkShow); void SetId (const std::string& id); void SetStart (const std::string& start); void SetDuration (const std::string& duration); @@ -68,6 +72,8 @@ namespace dash std::vector subsets; std::string xlinkHref; std::string xlinkActuate; + std::string xlinkType; + std::string xlinkShow; std::string id; std::string start; std::string duration; diff --git a/libdash/libdash/source/xml/DOMParser.cpp b/libdash/libdash/source/xml/DOMParser.cpp index 41a78a9a..83ea24a0 100644 --- a/libdash/libdash/source/xml/DOMParser.cpp +++ b/libdash/libdash/source/xml/DOMParser.cpp @@ -108,6 +108,7 @@ Node* DOMParser::ProcessNode () Node *node = new Node(); node->SetType(type); node->SetText(text); + std::cout << " " << text << std::endl; delete text; return node; } @@ -116,6 +117,8 @@ Node* DOMParser::ProcessNode () } void DOMParser::AddAttributesToNode (Node *node) { + std::stringstream ss; // Parsed values + ss << node->GetName() << ":" << std::endl; if(xmlTextReaderHasAttributes(this->reader)) { while(xmlTextReaderMoveToNextAttribute(this->reader)) @@ -123,8 +126,10 @@ void DOMParser::AddAttributesToNode (Node *node) std::string key = (const char *) xmlTextReaderConstName(this->reader); std::string value = (const char *) xmlTextReaderConstValue(this->reader); node->AddAttribute(key, value); + ss << " " << key << "=" << value << std::endl; } } + std::cout << ss.str(); } void DOMParser::Print (Node *node, int offset) { diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index 91643323..8ebbefd7 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -80,6 +80,18 @@ dash::mpd::BaseUrl* Node::ToBaseUrl () cons if(this->HasAttribute("byteRange")) { baseUrl->SetByteRange(this->GetAttributeValue("byteRange")); + } + if(this->HasAttribute("availabilityTimeOffset")) + { + baseUrl->SetAvailabilityTimeOffset(this->GetAttributeValue("availabilityTimeOffset")); + } + if(this->HasAttribute("availabilityTimeComplete")) + { + baseUrl->SetAvailabilityTimeComplete(this->GetAttributeValue("availabilityTimeComplete")); + } + if(this->HasAttribute("timeShiftBufferDepth")) + { + baseUrl->SetTimeShiftBufferDepth(this->GetAttributeValue("timeShiftBufferDepth")); } if (this->GetText() == "./") { @@ -443,6 +455,14 @@ dash::mpd::AdaptationSet* Node::ToAdaptationSet () cons if (this->HasAttribute("xlink:actuate")) { adaptationSet->SetXlinkActuate(this->GetAttributeValue("xlink:actuate")); + } + if (this->HasAttribute("xlink:type")) + { + adaptationSet->SetXlinkType(this->GetAttributeValue("xlink:type")); + } + if (this->HasAttribute("xlink:show")) + { + adaptationSet->SetXlinkShow(this->GetAttributeValue("xlink:show")); } if (this->HasAttribute("id")) { @@ -512,6 +532,10 @@ dash::mpd::AdaptationSet* Node::ToAdaptationSet () cons { adaptationSet->SetBitstreamSwitching(dash::helpers::String::ToBool(this->GetAttributeValue("bitstreamSwitching"))); } + if (this->HasAttribute("initializationSetRef")) + { + adaptationSet->SetInitializationSetRef(this->GetAttributeValue("initializationSetRef")); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -596,6 +620,14 @@ dash::mpd::Period* Node::ToPeriod () cons if (this->HasAttribute("xlink:actuate")) { period->SetXlinkActuate(this->GetAttributeValue("xlink:actuate")); + } + if (this->HasAttribute("xlink:type")) + { + period->SetXlinkType(this->GetAttributeValue("xlink:type")); + } + if (this->HasAttribute("xlink:show")) + { + period->SetXlinkShow(this->GetAttributeValue("xlink:show")); } if (this->HasAttribute("id")) { @@ -718,6 +750,10 @@ dash::mpd::MPD* Node::ToMPD () cons if (this->HasAttribute("availabilityEndTime")) { mpd->SetAvailabilityEndtime(this->GetAttributeValue("availabilityEndTime")); + } + if (this->HasAttribute("publishTime")) + { + mpd->SetPublishTime(this->GetAttributeValue("publishTime")); } if (this->HasAttribute("mediaPresentationDuration")) { From c80264418431237d54023663a69e77e59af1219e Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Mon, 26 Apr 2021 13:09:04 +0200 Subject: [PATCH 03/28] libdash update - part 2 --- libdash/libdash/include/IBaseUrl.h | 2 +- libdash/libdash/include/IContentComponent.h | 7 ++ libdash/libdash/include/IDescriptor.h | 8 +++ .../libdash/include/IMultipleSegmentBase.h | 8 +++ libdash/libdash/include/IPeriod.h | 7 +- libdash/libdash/include/IRepresentation.h | 18 +++++ libdash/libdash/include/IRepresentationBase.h | 14 ++++ libdash/libdash/include/ISegmentBase.h | 45 +++++++++++++ libdash/libdash/include/ISegmentList.h | 15 +++++ libdash/libdash/include/ISubset.h | 6 ++ libdash/libdash/source/mpd/BaseUrl.cpp | 4 +- libdash/libdash/source/mpd/BaseUrl.h | 2 +- .../libdash/source/mpd/ContentComponent.cpp | 11 +++- libdash/libdash/source/mpd/ContentComponent.h | 3 + libdash/libdash/source/mpd/Descriptor.cpp | 11 +++- libdash/libdash/source/mpd/Descriptor.h | 3 + .../source/mpd/MultipleSegmentBase.cpp | 11 +++- .../libdash/source/mpd/MultipleSegmentBase.h | 3 + libdash/libdash/source/mpd/Period.cpp | 4 +- libdash/libdash/source/mpd/Representation.cpp | 16 +++++ libdash/libdash/source/mpd/Representation.h | 6 ++ .../libdash/source/mpd/RepresentationBase.cpp | 19 +++++- .../libdash/source/mpd/RepresentationBase.h | 6 ++ libdash/libdash/source/mpd/SegmentBase.cpp | 41 ++++++++++++ libdash/libdash/source/mpd/SegmentBase.h | 15 +++++ libdash/libdash/source/mpd/SegmentList.cpp | 20 +++++- libdash/libdash/source/mpd/SegmentList.h | 6 ++ libdash/libdash/source/mpd/Subset.cpp | 12 +++- libdash/libdash/source/mpd/Subset.h | 3 + libdash/libdash/source/xml/Node.cpp | 66 ++++++++++++++++++- 30 files changed, 374 insertions(+), 18 deletions(-) diff --git a/libdash/libdash/include/IBaseUrl.h b/libdash/libdash/include/IBaseUrl.h index 174426b4..6f3da3ed 100644 --- a/libdash/libdash/include/IBaseUrl.h +++ b/libdash/libdash/include/IBaseUrl.h @@ -67,7 +67,7 @@ namespace dash * If the value is present in \c SegmentBase then this attribute should not be present. If present in \c SegmentBase and \c BaseURL, the value in \c BaseURL shall be ignored. * @return a boolean */ - virtual const std::string& GetAvailabilityTimeComplete () const = 0; + virtual bool IsAvailabilityTimeComplete () const = 0; /** * Returns the reference to a string that specifies the duration of the smallest time shifting buffer for any Representation in the MPD that is guaranteed to be available for a Media Presentation with type 'dynamic'. diff --git a/libdash/libdash/include/IContentComponent.h b/libdash/libdash/include/IContentComponent.h index 9f3be97f..30d0effa 100644 --- a/libdash/libdash/include/IContentComponent.h +++ b/libdash/libdash/include/IContentComponent.h @@ -75,6 +75,13 @@ namespace dash * @copydoc dash::mpd::IAdaptationSet::GetPar() */ virtual const std::string& GetPar () const = 0; + + /** + * Returns a reference to a string that specifies the tag of the Content Component + * which may be used for selection purposes towards the decoder. + * @return a reference to a string + */ + virtual const std::string& GetTag () const = 0; }; } diff --git a/libdash/libdash/include/IDescriptor.h b/libdash/libdash/include/IDescriptor.h index 3983e41e..f95afa46 100644 --- a/libdash/libdash/include/IDescriptor.h +++ b/libdash/libdash/include/IDescriptor.h @@ -61,6 +61,14 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetValue () const = 0; + + /** + * Returns a reference to a string that that specifies the identifier for the descriptor. + * Descriptors with identical values for this attribute shall be synonymous, i.e. the processing + * of one of the descriptors with an identical value is sufficient. + * @return a reference to a string + */ + virtual const std::string& GetId () const = 0; }; } } diff --git a/libdash/libdash/include/IMultipleSegmentBase.h b/libdash/libdash/include/IMultipleSegmentBase.h index 06d0dff3..e3b49f56 100644 --- a/libdash/libdash/include/IMultipleSegmentBase.h +++ b/libdash/libdash/include/IMultipleSegmentBase.h @@ -59,6 +59,14 @@ namespace dash * @return an unsigned integer */ virtual uint32_t GetStartNumber () const = 0; + + /** + * Returns a integer specifying the number of the last Media Segment in this Representation in the Period. \n + * If not present, the number is inferred from the duration of the Period. + * For more details refer to 5.3.9.5.3. of ISO/IEC 23009-1, Part 1, 2012. + * @return an unsigned integer + */ + virtual uint32_t GetEndNumber () const = 0; }; } } diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index 428c642f..6227b6d9 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -121,13 +121,16 @@ namespace dash virtual const std::string& GetXlinkActuate () const = 0; /** - * Returns a reference to a string that specifies the type of link. + * Returns a reference to a string that specifies the type of W3C XLINK being used. \n + * In the context of this document, all references shall be W3C XLINK simple links. The attribute \c @xlink:type is optional with fixed setting \c @xlink:type="simple". . * @return a reference to a string */ virtual const std::string& GetXlinkType () const = 0; /** - * Returns a reference to a string that specifies where to open the link. + * Returns a reference to a string that specifies the desired behaviour of the remote element entity once dereferenced from within an MPD as defined in W3C XLINK. \n + * In the context of this document, the attribute \c @xlink:show is optional with fixed setting \c @xlink:show="embed". \n + * \b NOTE In W3C XLINK, the behaviour of conforming XLink applications when embedding as a remote element entity is not defined. Thus, the actual behaviour for this document is defined in subclause 5.5.3. of ISO/IEC 23009-1. * @return a reference to a string */ virtual const std::string& GetXlinkShow () const = 0; diff --git a/libdash/libdash/include/IRepresentation.h b/libdash/libdash/include/IRepresentation.h index bdc03abd..dd0cf9b2 100644 --- a/libdash/libdash/include/IRepresentation.h +++ b/libdash/libdash/include/IRepresentation.h @@ -126,6 +126,24 @@ namespace dash * @return a reference to a vector of strings */ virtual const std::vector& GetDependencyId () const = 0; + + /** + * Returns a reference to a vector of strings that specifies all Representations. + * The Representation is associated with in the decoding and/or presentation + * process as a whitespace-separated list of values of \c Representation@id attributes. + * @return a reference to a vector of strings + */ + virtual const std::vector& GetAssociationId () const = 0; + + /** + * Returns a reference to a string that specifies, as a whitespace-separated list of values, + * the kind of association for each Representation the Representation has been associated with through the \c @associationId attribute. + * Values taken by this attribute are 4 character codes (4CCs) for track reference types registered in MP4 registration authority. \n + * This attribute shall not be present when \c @associationId is not present. \n + * When present, this attribute shall have as many values as the number of identifiers declared in the \c @associationId attribute. + * @return a reference to a string + */ + virtual const std::string& GetAssociationType () const = 0; /** * Returns a reference to a vector of strings that specifies media stream structure identifier values.\n diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index e7b7e688..e3b9c8c2 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -173,6 +173,20 @@ namespace dash * @return a string */ virtual std::string GetScanType () const = 0; + + /** + * Returns a string that specifies the selection priority for the described data structures, i.e. the one described by the containing element. + * In the absence of other information, higher numbers are the preferred selection over lower numbers. + * @return an unsigned integer + */ + virtual uint32_t GetSelectionPriority () const = 0; + + /** + * Returns a string that specifies the tag of the Representation, Adaptation Set or Preselection which may be used for selection purposes towards the decoder. \n + * NOTE This attribute is primarily introduced for the usage of Pre-Selections and Adaptation Sets, but future use for Representation and Sub-Representations is not precluded. + * @return a string + */ + virtual std::string GetTag () const = 0; }; } diff --git a/libdash/libdash/include/ISegmentBase.h b/libdash/libdash/include/ISegmentBase.h index a29a4eab..bfcfa2a4 100644 --- a/libdash/libdash/include/ISegmentBase.h +++ b/libdash/libdash/include/ISegmentBase.h @@ -56,6 +56,16 @@ namespace dash * @return an unsigned integer */ virtual uint32_t GetTimescale () const = 0; + + /** + * Returns an integer that specifies the difference between the earliest presentation time in the Representation and the value of the @presentationTimeOffset. \n + * The value of the earliest presentation time of the first Media Segment in this Representation in seconds is computed as the sum of the value of this attribute and + * the value of the @presentationTimeOffset in units of the @timescale attribute. \n + * If not present on any level, but the \c SegmentTimeline element is present, then the value is the value of the @t attribute of the first \c S element in the Segment minus the value of the @presentationTimeOffset. \n + * Otherwise, it assumed to be 0. + * @return an integer + */ + virtual int GetEptDelta () const = 0; /** * Returns an integer that specifies the presentation time offset of the Representation relative to the start of the Period.\n @@ -64,6 +74,23 @@ namespace dash * @return an unsigned integer */ virtual uint32_t GetPresentationTimeOffset () const = 0; + + /** + * Returns an integer that specifies the presentation duration of the Representation in the Period. \n + * The value of the presentation duration in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. + * Specifically, the sum of the value of the \c @presentationTimeOffset, if present, or 0 otherwise and the value of this attribute is the last presentation time to be presented for this Representation. \n + * If not present on any level, the value of this attribute is unknown and the Representation should be presented until the end of the Period, i.e. until the presentation is terminated or until the next Period starts. + * @return an unsigned integer + */ + virtual uint32_t GetPresentationDuration () const = 0; + + /** + * Returns a string that specifies the duration of the time shifting buffer for this Representation that is guaranteed to be available for a Media Presentation with type 'dynamic'. When not present, the value is of the \c @timeShiftBufferDepth + * on MPD level applies. If present, this value shall be not smaller than the value on MPD level. This value of the attribute is undefined if the \c @type attribute is equal to 'static'. \n + * \n NOTE When operating in a time-shift buffer on a Representation with value larger than the time-shift buffer signalled on MPD level, not all Representations are necessarily available for switching. + * @return a reference to a string + */ + virtual const std::string& GetTimeShiftBufferDepth () const = 0; /** * Returns a string that specifies the byte range that contains the Segment Index in all Media Segments of the Representation.\n @@ -79,6 +106,24 @@ namespace dash * @return a bool value */ virtual bool HasIndexRangeExact () const = 0; + + /** + * Returns a double that specifies an offset to define the adjusted segment availability time. The value is specified in seconds, possibly with arbitrary precision. \n + * The offset provides the time how much earlier these segments are available compared to their computed availability start time for all Segments of all associated Representation. \n + * The segment availability start time defined by this value is referred to as adjusted segment availability start time. For details on computing the adjusted segment availability start time, refer to subclause 5.3.9.5. of ISO/IEC 23009-1. \n + * If not present, no adjusted segment availability start time is defined. \n + * \b NOTE The value of \c "INF" implies availability of all segments starts at \c MPD@availabilityStartTime. + * @return a double + */ + virtual double GetAvailabilityTimeOffset () const = 0; + + /** + * Returns a boolean that specifies if all Segments of all associated Representation are complete at the adjusted availability start time. The attribute shall be ignored if \c @availabilityTimeOffset is not present on any level. \n + * If not present on any level, the value is inferred to true. \n + * \b NOTE If the value is set to false, then it can be inferred by the client that the segment is available at its announced location prior being complete. + * @return a bool value + */ + virtual bool IsAvailabilityTimeComplete () const = 0; }; } } diff --git a/libdash/libdash/include/ISegmentList.h b/libdash/libdash/include/ISegmentList.h index 803df66d..ac60490d 100644 --- a/libdash/libdash/include/ISegmentList.h +++ b/libdash/libdash/include/ISegmentList.h @@ -50,6 +50,21 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetXlinkActuate () const = 0; + + /** + * Returns a reference to a string that specifies the type of W3C XLINK being used. \n + * In the context of this document, all references shall be W3C XLINK simple links. The attribute \c @xlink:type is optional with fixed setting \c @xlink:type="simple". . + * @return a reference to a string + */ + virtual const std::string& GetXlinkType () const = 0; + + /** + * Returns a reference to a string that specifies the desired behaviour of the remote element entity once dereferenced from within an MPD as defined in W3C XLINK. \n + * In the context of this document, the attribute \c @xlink:show is optional with fixed setting \c @xlink:show="embed". \n + * \b NOTE In W3C XLINK, the behaviour of conforming XLink applications when embedding as a remote element entity is not defined. Thus, the actual behaviour for this document is defined in subclause 5.5.3. of ISO/IEC 23009-1. + * @return a reference to a string + */ + virtual const std::string& GetXlinkShow () const = 0; }; } diff --git a/libdash/libdash/include/ISubset.h b/libdash/libdash/include/ISubset.h index 6d5c8566..1f6be17d 100644 --- a/libdash/libdash/include/ISubset.h +++ b/libdash/libdash/include/ISubset.h @@ -47,6 +47,12 @@ namespace dash * @return a reference to a vector of unsigned integers */ virtual const std::vector& Contains () const = 0; + + /** + * Returns a reference to a string that specifies a unique identifier for the Subset. + * @return a reference to a string + */ + virtual const std::string& GetId () const = 0; }; } } diff --git a/libdash/libdash/source/mpd/BaseUrl.cpp b/libdash/libdash/source/mpd/BaseUrl.cpp index 14db5c24..e02e7131 100644 --- a/libdash/libdash/source/mpd/BaseUrl.cpp +++ b/libdash/libdash/source/mpd/BaseUrl.cpp @@ -17,8 +17,6 @@ BaseUrl::BaseUrl () : url(""), serviceLocation(""), byteRange(""), - availabilityTimeOffset(0), - availabilityTimeComplete(false), timeShiftBufferDepth("") { } @@ -58,7 +56,7 @@ void BaseUrl::SetAvailabilityTimeOffset (double availability { this->availabilityTimeOffset = availabilityTimeOffset; } -bool BaseUrl::GetAvailabilityTimeComplete () const +bool BaseUrl::IsAvailabilityTimeComplete () const { return this->availabilityTimeComplete; } diff --git a/libdash/libdash/source/mpd/BaseUrl.h b/libdash/libdash/source/mpd/BaseUrl.h index 557adabb..d2203882 100644 --- a/libdash/libdash/source/mpd/BaseUrl.h +++ b/libdash/libdash/source/mpd/BaseUrl.h @@ -32,7 +32,7 @@ namespace dash const std::string& GetServiceLocation () const; const std::string& GetByteRange () const; double GetAvailabilityTimeOffset () const; - bool GetAvailabilityTimeComplete () const; + bool IsAvailabilityTimeComplete () const; const std::string& GetTimeShiftBufferDepth () const; void SetUrl (const std::string& url); diff --git a/libdash/libdash/source/mpd/ContentComponent.cpp b/libdash/libdash/source/mpd/ContentComponent.cpp index ce3de857..e918c70e 100644 --- a/libdash/libdash/source/mpd/ContentComponent.cpp +++ b/libdash/libdash/source/mpd/ContentComponent.cpp @@ -17,7 +17,8 @@ ContentComponent::ContentComponent () : id(0), lang(""), contentType(""), - par("") + par(""), + tag("") { } ContentComponent::~ContentComponent () @@ -96,3 +97,11 @@ void ContentComponent::SetPar (const s { this->par = par; } +const std::string& ContentComponent::GetTag () const +{ + return this->tag; +} +void ContentComponent::SetTag (const std::string& tag) +{ + this->tag = tag; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ContentComponent.h b/libdash/libdash/source/mpd/ContentComponent.h index b59ab6d8..a14245e6 100644 --- a/libdash/libdash/source/mpd/ContentComponent.h +++ b/libdash/libdash/source/mpd/ContentComponent.h @@ -36,6 +36,7 @@ namespace dash const std::string& GetLang () const; const std::string& GetContentType () const; const std::string& GetPar () const; + const std::string& GetTag () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -45,6 +46,7 @@ namespace dash void SetLang (const std::string& lang); void SetContentType (const std::string& contentType); void SetPar (const std::string& par); + void SetTag (const std::string& tag); private: std::vector accessibility; @@ -55,6 +57,7 @@ namespace dash std::string lang; std::string contentType; std::string par; + std::string tag; }; } } diff --git a/libdash/libdash/source/mpd/Descriptor.cpp b/libdash/libdash/source/mpd/Descriptor.cpp index c6eb787b..7df9cc24 100644 --- a/libdash/libdash/source/mpd/Descriptor.cpp +++ b/libdash/libdash/source/mpd/Descriptor.cpp @@ -15,7 +15,8 @@ using namespace dash::mpd; Descriptor::Descriptor () : schemeIdUri (""), - value ("") + value (""), + id(0) { } Descriptor::~Descriptor () @@ -37,3 +38,11 @@ void Descriptor::SetValue (const std::string& value) { this->value = value; } +const std::string& Descriptor::GetId () const +{ + return this->id; +} +void Descriptor::SetId (const std::string& id) +{ + this->id = id; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Descriptor.h b/libdash/libdash/source/mpd/Descriptor.h index 5cb66b94..983012c1 100644 --- a/libdash/libdash/source/mpd/Descriptor.h +++ b/libdash/libdash/source/mpd/Descriptor.h @@ -29,13 +29,16 @@ namespace dash const std::string& GetSchemeIdUri () const; const std::string& GetValue () const; + const std::string& GetId () const; void SetValue (const std::string& value); void SetSchemeIdUri (const std::string& schemeIdUri); + void SetId (const std::string& id); private: std::string schemeIdUri; std::string value; + std::string id; }; } } diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp index ccfba515..f4dd8759 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp @@ -17,7 +17,8 @@ MultipleSegmentBase::MultipleSegmentBase () : bitstreamSwitching(NULL), segmentTimeline(NULL), duration(0), - startNumber(1) + startNumber(1), + endNumber(1) { } MultipleSegmentBase::~MultipleSegmentBase () @@ -58,3 +59,11 @@ void MultipleSegmentBase::SetStartNumber (uint32_ { this->startNumber = startNumber; } +uint32_t MultipleSegmentBase::GetEndNumber () const +{ + return this->endNumber; +} +void MultipleSegmentBase::SetEndNumber (uint32_t endNumber) +{ + this->endNumber = endNumber; +} diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.h b/libdash/libdash/source/mpd/MultipleSegmentBase.h index 386672ce..33294b2f 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.h +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.h @@ -33,17 +33,20 @@ namespace dash const IURLType* GetBitstreamSwitching () const; uint32_t GetDuration () const; uint32_t GetStartNumber () const; + uint32_t GetEndNumber () const; void SetSegmentTimeline (SegmentTimeline *segmentTimeline); void SetBitstreamSwitching (URLType *bitstreamSwitching); void SetDuration (uint32_t duration); void SetStartNumber (uint32_t startNumber); + void SetEndNumber (uint32_t endNumber); protected: SegmentTimeline *segmentTimeline; URLType *bitstreamSwitching; uint32_t duration; uint32_t startNumber; + uint32_t endNumber; }; } } diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index 7510d2a9..87e43e91 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -19,8 +19,8 @@ Period::Period () : segmentTemplate(NULL), xlinkActuate("onRequest"), xlinkHref(""), - xlinkType(""), - xlinkShow(""), + xlinkType("simple"), + xlinkShow("embed"), id(""), start(""), duration(""), diff --git a/libdash/libdash/source/mpd/Representation.cpp b/libdash/libdash/source/mpd/Representation.cpp index fab7b493..b06d6381 100644 --- a/libdash/libdash/source/mpd/Representation.cpp +++ b/libdash/libdash/source/mpd/Representation.cpp @@ -106,6 +106,22 @@ void Representation::SetDependencyId { dash::helpers::String::Split(dependencyId, ' ', this->dependencyId); } +const std::vector& Representation::GetAssociationId () const +{ + return this->associationId; +} +void Representation::SetAssociationId (const std::string& associationId) +{ + dash::helpers::String::Split(associationId, ' ', this->associationId); +} +const std::string& Representation::GetAssociationType () const +{ + return this->associationType; +} +void Representation::SetAssociationType (const std::string &associationType) +{ + this->associationType = associationType; +} const std::vector& Representation::GetMediaStreamStructureId () const { return this->mediaStreamStructureId; diff --git a/libdash/libdash/source/mpd/Representation.h b/libdash/libdash/source/mpd/Representation.h index 8e72b206..b88721e6 100644 --- a/libdash/libdash/source/mpd/Representation.h +++ b/libdash/libdash/source/mpd/Representation.h @@ -42,6 +42,8 @@ namespace dash uint32_t GetBandwidth () const; uint32_t GetQualityRanking () const; const std::vector& GetDependencyId () const; + const std::vector& GetAssociationId () const; + const std::string& GetAssociationType () const; const std::vector& GetMediaStreamStructureId () const; void AddBaseURL (BaseUrl *baseURL); @@ -53,6 +55,8 @@ namespace dash void SetBandwidth (uint32_t bandwidth); void SetQualityRanking (uint32_t qualityRanking); void SetDependencyId (const std::string &dependencyId); + void SetAssociationId (const std::string &associationId); + void SetAssociationType (const std::string &associationType); void SetMediaStreamStructureId (const std::string &mediaStreamStructureId); private: @@ -65,6 +69,8 @@ namespace dash uint32_t bandwidth; uint32_t qualityRanking; std::vector dependencyId; + std::vector associationId; + std::string associationType; std::vector mediaStreamStructureId; }; } diff --git a/libdash/libdash/source/mpd/RepresentationBase.cpp b/libdash/libdash/source/mpd/RepresentationBase.cpp index f7b8970c..5fd936b0 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.cpp +++ b/libdash/libdash/source/mpd/RepresentationBase.cpp @@ -24,7 +24,8 @@ RepresentationBase::RepresentationBase () : startWithSAP(0), maxPlayoutRate(0.0), codingDependency(false), - scanType("") + scanType(""), + selectionPriority(1) { } RepresentationBase::~RepresentationBase () @@ -173,3 +174,19 @@ void RepresentationBase::SetScanType { this->scanType = scanType; } +uint32_t RepresentationBase::GetSelectionPriority () const +{ + return this->selectionPriority; +} +void RepresentationBase::SetSelectionPriority (uint32_t selectionPriority) +{ + this->selectionPriority = selectionPriority; +} +std::string RepresentationBase::GetTag () const +{ + return this->tag; +} +void RepresentationBase::SetTag (const std::string& tag) +{ + this->tag = tag; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/RepresentationBase.h b/libdash/libdash/source/mpd/RepresentationBase.h index bb7fd287..7d3e1d8c 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.h +++ b/libdash/libdash/source/mpd/RepresentationBase.h @@ -46,6 +46,8 @@ namespace dash double GetMaxPlayoutRate () const; bool HasCodingDependency () const; std::string GetScanType () const; + uint32_t GetSelectionPriority () const; + std::string GetTag () const; void AddFramePacking (Descriptor *framePacking); void AddAudioChannelConfiguration (Descriptor *audioChannelConfiguration); @@ -64,6 +66,8 @@ namespace dash void SetMaxPlayoutRate (double maxPlayoutRate); void SetCodingDependency (bool codingDependency); void SetScanType (const std::string& scanType); + void SetSelectionPriority (uint32_t selectionPriority); + void SetTag (const std::string& tag); protected: std::vector framePacking; @@ -83,6 +87,8 @@ namespace dash double maxPlayoutRate; bool codingDependency; std::string scanType; + uint32_t selectionPriority; + std::string tag; }; } } diff --git a/libdash/libdash/source/mpd/SegmentBase.cpp b/libdash/libdash/source/mpd/SegmentBase.cpp index b1d890d9..d9fd9807 100644 --- a/libdash/libdash/source/mpd/SegmentBase.cpp +++ b/libdash/libdash/source/mpd/SegmentBase.cpp @@ -17,6 +17,7 @@ SegmentBase::SegmentBase () : initialization(NULL), representationIndex(NULL), timescale(1), + eptDelta(0), presentationTimeOffset(0), indexRange(""), indexRangeExact(false) @@ -52,6 +53,14 @@ void SegmentBase::SetTimescale (uint32_t timescale) { this->timescale = timescale; } +int SegmentBase::GetEptDelta () const +{ + return this->eptDelta; +} +void SegmentBase::SetEptDelta (int eptDelta) +{ + this->eptDelta = eptDelta; +} uint32_t SegmentBase::GetPresentationTimeOffset () const { return this->presentationTimeOffset; @@ -60,6 +69,22 @@ void SegmentBase::SetPresentationTimeOffset (uint32_t presentati { this->presentationTimeOffset = presentationTimeOffset; } +uint32_t SegmentBase::GetPresentationDuration () const +{ + return this->presentationDuration; +} +void SegmentBase::SetPresentationDuration (uint32_t presentationDuration) +{ + this->presentationDuration = presentationDuration; +} +const std::string& SegmentBase::GetTimeShiftBufferDepth () const +{ + return this->timeShiftBufferDepth; +} +void SegmentBase::SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth) +{ + this->timeShiftBufferDepth = timeShiftBufferDepth; +} const std::string& SegmentBase::GetIndexRange () const { return this->indexRange; @@ -76,3 +101,19 @@ void SegmentBase::SetIndexRangeExact (bool indexRangeExac { this->indexRangeExact = indexRangeExact; } +double SegmentBase::GetAvailabilityTimeOffset () const +{ + return this->availabilityTimeOffset; +} +void SegmentBase::SetAvailabilityTimeOffset (double availabilityTimeOffset) +{ + this->availabilityTimeOffset = availabilityTimeOffset; +} +bool SegmentBase::IsAvailabilityTimeComplete () const +{ + return this->availabilityTimeComplete; +} +void SegmentBase::SetAvailabilityTimeComplete(bool availabilityTimeComplete) +{ + this->availabilityTimeComplete = availabilityTimeComplete; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/SegmentBase.h b/libdash/libdash/source/mpd/SegmentBase.h index d627eb04..028450a7 100644 --- a/libdash/libdash/source/mpd/SegmentBase.h +++ b/libdash/libdash/source/mpd/SegmentBase.h @@ -31,24 +31,39 @@ namespace dash const IURLType* GetInitialization () const; const IURLType* GetRepresentationIndex () const; uint32_t GetTimescale () const; + int GetEptDelta () const; uint32_t GetPresentationTimeOffset () const; + uint32_t GetPresentationDuration () const; + const std::string& GetTimeShiftBufferDepth () const; const std::string& GetIndexRange () const; bool HasIndexRangeExact () const; + double GetAvailabilityTimeOffset () const; + bool IsAvailabilityTimeComplete () const; void SetInitialization (URLType *initialization); void SetRepresentationIndex (URLType *representationIndex); void SetTimescale (uint32_t timescale); + void SetEptDelta (int eptDelta); void SetPresentationTimeOffset (uint32_t presentationTimeOffset); + void SetPresentationDuration (uint32_t presentationDuration); + void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); void SetIndexRange (const std::string& indexRange); void SetIndexRangeExact (bool indexRangeExact); + void SetAvailabilityTimeOffset (double availabilityTimeOffset); + void SetAvailabilityTimeComplete (bool availabilityTimeComplete); protected: URLType *initialization; URLType *representationIndex; uint32_t timescale; + int eptDelta; uint32_t presentationTimeOffset; + uint32_t presentationDuration; + std::string timeShiftBufferDepth; std::string indexRange; bool indexRangeExact; + double availabilityTimeOffset; + bool availabilityTimeComplete; }; } } diff --git a/libdash/libdash/source/mpd/SegmentList.cpp b/libdash/libdash/source/mpd/SegmentList.cpp index d96264cb..ac3c59d0 100644 --- a/libdash/libdash/source/mpd/SegmentList.cpp +++ b/libdash/libdash/source/mpd/SegmentList.cpp @@ -15,7 +15,9 @@ using namespace dash::mpd; SegmentList::SegmentList () : xlinkHref(""), - xlinkActuate("onRequest") + xlinkActuate("onRequest"), + xlinkType("simple"), + xlinkShow("embed") { } SegmentList::~SegmentList () @@ -48,3 +50,19 @@ void SegmentList::SetXlinkActuate (const std::stri { this->xlinkActuate = xlinkActuate; } +const std::string& SegmentList::GetXlinkType () const +{ + return this->xlinkType; +} +void SegmentList::SetXlinkType (const std::string& xlinkType) +{ + this->xlinkType = xlinkType; +} +const std::string& SegmentList::GetXlinkShow () const +{ + return this->xlinkShow; +} +void SegmentList::SetXlinkShow (const std::string& xlinkShow) +{ + this->xlinkShow = xlinkShow; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/SegmentList.h b/libdash/libdash/source/mpd/SegmentList.h index b743c009..1c948669 100644 --- a/libdash/libdash/source/mpd/SegmentList.h +++ b/libdash/libdash/source/mpd/SegmentList.h @@ -31,15 +31,21 @@ namespace dash const std::vector& GetSegmentURLs () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; + const std::string& GetXlinkType () const; + const std::string& GetXlinkShow () const; void AddSegmentURL (SegmentURL *segmetURL); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); + void SetXlinkType (const std::string& xlinkType); + void SetXlinkShow (const std::string& xlinkShow); private: std::vector segmentURLs; std::string xlinkHref; std::string xlinkActuate; + std::string xlinkType; + std::string xlinkShow; }; } } diff --git a/libdash/libdash/source/mpd/Subset.cpp b/libdash/libdash/source/mpd/Subset.cpp index 6b0d2df6..3ea4cb92 100644 --- a/libdash/libdash/source/mpd/Subset.cpp +++ b/libdash/libdash/source/mpd/Subset.cpp @@ -13,8 +13,10 @@ using namespace dash::mpd; -Subset::Subset () +Subset::Subset () : + id("") { + } Subset::~Subset () { @@ -28,3 +30,11 @@ void Subset::SetSubset (const std::string& subset) { dash::helpers::String::Split(subset, ' ', this->subset); } +const std::string& Subset::GetId () const +{ + return this->id; +} +void Subset::SetId (const std::string &id) +{ + this->id = id; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Subset.h b/libdash/libdash/source/mpd/Subset.h index c56eb6e2..a4b3c3dd 100644 --- a/libdash/libdash/source/mpd/Subset.h +++ b/libdash/libdash/source/mpd/Subset.h @@ -29,11 +29,14 @@ namespace dash virtual ~Subset (); const std::vector& Contains () const; + const std::string& GetId () const; void SetSubset (const std::string& subset); + void SetId (const std::string& id); private: std::vector subset; + std::string id; }; } } diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index 8ebbefd7..97c58c87 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -83,11 +83,11 @@ dash::mpd::BaseUrl* Node::ToBaseUrl () cons } if(this->HasAttribute("availabilityTimeOffset")) { - baseUrl->SetAvailabilityTimeOffset(this->GetAttributeValue("availabilityTimeOffset")); + baseUrl->SetAvailabilityTimeOffset(strtod(this->GetAttributeValue("availabilityTimeOffset").c_str(), NULL)); } - if(this->HasAttribute("availabilityTimeComplete")) + if (this->HasAttribute("availabilityTimeComplete")) { - baseUrl->SetAvailabilityTimeComplete(this->GetAttributeValue("availabilityTimeComplete")); + baseUrl->SetAvailabilityTimeComplete(dash::helpers::String::ToBool(this->GetAttributeValue("availabilityTimeComplete"))); } if(this->HasAttribute("timeShiftBufferDepth")) { @@ -118,6 +118,10 @@ dash::mpd::Descriptor* Node::ToDescriptor () cons { descriptor->SetValue(this->GetAttributeValue("value")); } + if (this->HasAttribute("id")) + { + descriptor->SetId(this->GetAttributeValue("id")); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -148,6 +152,10 @@ dash::mpd::ContentComponent* Node::ToContentComponent () cons { contentComponent->SetPar(this->GetAttributeValue("par")); } + if (this->HasAttribute("tag")) + { + contentComponent->SetTag(this->GetAttributeValue("tag")); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -297,6 +305,14 @@ dash::mpd::SegmentList* Node::ToSegmentList () cons { segmentList->SetXlinkActuate(this->GetAttributeValue("xlink:actuate")); } + if (this->HasAttribute("xlink:type")) + { + segmentList->SetXlinkType(this->GetAttributeValue("xlink:type")); + } + if (this->HasAttribute("xlink:show")) + { + segmentList->SetXlinkShow(this->GetAttributeValue("xlink:show")); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -401,6 +417,14 @@ dash::mpd::Representation* Node::ToRepresentation () cons if (this->HasAttribute("dependencyId")) { representation->SetDependencyId(this->GetAttributeValue("dependencyId")); + } + if (this->HasAttribute("associationId")) + { + representation->SetAssociationId(this->GetAttributeValue("associationId")); + } + if (this->HasAttribute("associationType")) + { + representation->SetAssociationType(this->GetAttributeValue("associationType")); } if (this->HasAttribute("mediaStreamStructureId")) { @@ -604,6 +628,10 @@ dash::mpd::Subset* Node::ToSubset () cons { subset->SetSubset(this->GetAttributeValue("contains")); } + if (this->HasAttribute("id")) + { + subset->SetId(this->GetAttributeValue("id")); + } subset->AddRawAttributes(this->attributes); return subset; @@ -974,6 +1002,14 @@ void Node::SetCommonValuesForRep (dash::m { object.SetScanType(this->GetAttributeValue("scanType")); } + if (this->HasAttribute("selectionPriority")) + { + object.SetSelectionPriority(strtoul(this->GetAttributeValue("selectionPriority").c_str(), NULL, 10)); + } + if (this->HasAttribute("tag")) + { + object.SetTag(this->GetAttributeValue("tag")); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -1001,10 +1037,22 @@ void Node::SetCommonValuesForSeg (dash::m if (this->HasAttribute("timescale")) { object.SetTimescale(strtoul(this->GetAttributeValue("timescale").c_str(), NULL, 10)); + } + if (this->HasAttribute("eptDelta")) + { + object.SetEptDelta((int) strtol(this->GetAttributeValue("eptDelta").c_str(), NULL, 10)); } if (this->HasAttribute("presentationTimeOffset")) { object.SetPresentationTimeOffset(strtoul(this->GetAttributeValue("presentationTimeOffset").c_str(), NULL, 10)); + } + if (this->HasAttribute("presentationDuration")) + { + object.SetPresentationDuration(strtoul(this->GetAttributeValue("presentationDuration").c_str(), NULL, 10)); + } + if (this->HasAttribute("timeShiftBufferDepth")) + { + object.SetTimeShiftBufferDepth(this->GetAttributeValue("timeShiftBufferDepth")); } if (this->HasAttribute("indexRange")) { @@ -1014,6 +1062,14 @@ void Node::SetCommonValuesForSeg (dash::m { object.SetIndexRangeExact(dash::helpers::String::ToBool(this->GetAttributeValue("indexRangeExact"))); } + if (this->HasAttribute("availabilityTimeOffset")) + { + object.SetAvailabilityTimeOffset(strtod(this->GetAttributeValue("availabilityTimeOffset").c_str(), NULL)); + } + if (this->HasAttribute("availabilityTimeComplete")) + { + object.SetAvailabilityTimeComplete(dash::helpers::String::ToBool(this->GetAttributeValue("availabilityTimeComplete"))); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -1040,6 +1096,10 @@ void Node::SetCommonValuesForMSeg(dash::m object.SetDuration(strtoul(this->GetAttributeValue("duration").c_str(), NULL, 10)); } if (this->HasAttribute("startNumber")) + { + object.SetStartNumber(strtoul(this->GetAttributeValue("startNumber").c_str(), NULL, 10)); + } + if (this->HasAttribute("endNumber")) { object.SetStartNumber(strtoul(this->GetAttributeValue("startNumber").c_str(), NULL, 10)); } From b7c1e1c1ae626bb58c8912d24b60f6eff1a451f6 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Tue, 27 Apr 2021 09:52:14 +0200 Subject: [PATCH 04/28] minor bug fixes --- libdash/libdash/source/mpd/Descriptor.cpp | 2 +- libdash/libdash/source/mpd/RepresentationBase.cpp | 2 +- libdash/libdash/source/mpd/RepresentationBase.h | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libdash/libdash/source/mpd/Descriptor.cpp b/libdash/libdash/source/mpd/Descriptor.cpp index 7df9cc24..a5507e74 100644 --- a/libdash/libdash/source/mpd/Descriptor.cpp +++ b/libdash/libdash/source/mpd/Descriptor.cpp @@ -16,7 +16,7 @@ using namespace dash::mpd; Descriptor::Descriptor () : schemeIdUri (""), value (""), - id(0) + id ("") { } Descriptor::~Descriptor () diff --git a/libdash/libdash/source/mpd/RepresentationBase.cpp b/libdash/libdash/source/mpd/RepresentationBase.cpp index 5fd936b0..be69d613 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.cpp +++ b/libdash/libdash/source/mpd/RepresentationBase.cpp @@ -182,7 +182,7 @@ void RepresentationBase::SetSelectionPriority { this->selectionPriority = selectionPriority; } -std::string RepresentationBase::GetTag () const +std::string RepresentationBase::GetTag () const { return this->tag; } diff --git a/libdash/libdash/source/mpd/RepresentationBase.h b/libdash/libdash/source/mpd/RepresentationBase.h index 7d3e1d8c..70e5dcbc 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.h +++ b/libdash/libdash/source/mpd/RepresentationBase.h @@ -47,7 +47,7 @@ namespace dash bool HasCodingDependency () const; std::string GetScanType () const; uint32_t GetSelectionPriority () const; - std::string GetTag () const; + std::string GetTag () const; void AddFramePacking (Descriptor *framePacking); void AddAudioChannelConfiguration (Descriptor *audioChannelConfiguration); From cc44ed77b175120462e45a532bd00537ee4ea2dc Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Tue, 27 Apr 2021 10:48:07 +0200 Subject: [PATCH 05/28] endNumber attribute fix --- libdash/libdash/source/xml/Node.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index 97c58c87..f44dd275 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -1101,7 +1101,7 @@ void Node::SetCommonValuesForMSeg(dash::m } if (this->HasAttribute("endNumber")) { - object.SetStartNumber(strtoul(this->GetAttributeValue("startNumber").c_str(), NULL, 10)); + object.SetEndNumber(strtoul(this->GetAttributeValue("endNumber").c_str(), NULL, 10)); } for(size_t i = 0; i < subNodes.size(); i++) From c78535b2f2d0dd1d4b4413aa3e7bb8c91ed47023 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 28 Apr 2021 13:30:42 +0200 Subject: [PATCH 06/28] fixed minor issues, added @contributions, FCS and FailoverContent elements --- libdash/libdash/include/IAdaptationSet.h | 3 ++ libdash/libdash/include/IBaseUrl.h | 3 ++ libdash/libdash/include/IContentComponent.h | 3 ++ libdash/libdash/include/IDescriptor.h | 3 ++ libdash/libdash/include/IFCS.h | 52 +++++++++++++++++++ libdash/libdash/include/IFailoverContent.h | 52 +++++++++++++++++++ libdash/libdash/include/IMPD.h | 3 ++ .../libdash/include/IMultipleSegmentBase.h | 3 ++ libdash/libdash/include/IPeriod.h | 3 ++ libdash/libdash/include/IRepresentation.h | 3 ++ libdash/libdash/include/IRepresentationBase.h | 3 ++ libdash/libdash/include/ISegmentBase.h | 12 ++++- libdash/libdash/include/ISegmentList.h | 3 ++ libdash/libdash/include/ISubset.h | 3 ++ libdash/libdash/source/mpd/AdaptationSet.cpp | 3 ++ libdash/libdash/source/mpd/AdaptationSet.h | 3 ++ libdash/libdash/source/mpd/BaseUrl.cpp | 3 ++ libdash/libdash/source/mpd/BaseUrl.h | 3 ++ .../libdash/source/mpd/ContentComponent.cpp | 3 ++ libdash/libdash/source/mpd/ContentComponent.h | 3 ++ libdash/libdash/source/mpd/Descriptor.cpp | 3 ++ libdash/libdash/source/mpd/Descriptor.h | 3 ++ libdash/libdash/source/mpd/FCS.cpp | 40 ++++++++++++++ libdash/libdash/source/mpd/FCS.h | 43 +++++++++++++++ .../libdash/source/mpd/FailoverContent.cpp | 41 +++++++++++++++ libdash/libdash/source/mpd/FailoverContent.h | 44 ++++++++++++++++ libdash/libdash/source/mpd/MPD.cpp | 3 ++ libdash/libdash/source/mpd/MPD.h | 3 ++ .../source/mpd/MultipleSegmentBase.cpp | 3 ++ .../libdash/source/mpd/MultipleSegmentBase.h | 3 ++ libdash/libdash/source/mpd/Period.cpp | 3 ++ libdash/libdash/source/mpd/Period.h | 3 ++ libdash/libdash/source/mpd/Representation.cpp | 3 ++ libdash/libdash/source/mpd/Representation.h | 3 ++ .../libdash/source/mpd/RepresentationBase.cpp | 3 ++ .../libdash/source/mpd/RepresentationBase.h | 3 ++ libdash/libdash/source/mpd/SegmentBase.cpp | 12 +++++ libdash/libdash/source/mpd/SegmentBase.h | 7 +++ libdash/libdash/source/mpd/SegmentList.cpp | 3 ++ libdash/libdash/source/mpd/SegmentList.h | 3 ++ libdash/libdash/source/mpd/Subset.cpp | 3 ++ libdash/libdash/source/mpd/Subset.h | 3 ++ libdash/libdash/source/xml/Node.cpp | 47 +++++++++++++++++ libdash/libdash/source/xml/Node.h | 7 +++ 44 files changed, 455 insertions(+), 1 deletion(-) create mode 100644 libdash/libdash/include/IFCS.h create mode 100644 libdash/libdash/include/IFailoverContent.h create mode 100644 libdash/libdash/source/mpd/FCS.cpp create mode 100644 libdash/libdash/source/mpd/FCS.h create mode 100644 libdash/libdash/source/mpd/FailoverContent.cpp create mode 100644 libdash/libdash/source/mpd/FailoverContent.h diff --git a/libdash/libdash/include/IAdaptationSet.h b/libdash/libdash/include/IAdaptationSet.h index d428cdd9..fbed5dd0 100644 --- a/libdash/libdash/include/IAdaptationSet.h +++ b/libdash/libdash/include/IAdaptationSet.h @@ -45,6 +45,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IADAPTATIONSET_H_ diff --git a/libdash/libdash/include/IBaseUrl.h b/libdash/libdash/include/IBaseUrl.h index 6f3da3ed..63120f20 100644 --- a/libdash/libdash/include/IBaseUrl.h +++ b/libdash/libdash/include/IBaseUrl.h @@ -13,6 +13,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IBASEURL_H_ diff --git a/libdash/libdash/include/IContentComponent.h b/libdash/libdash/include/IContentComponent.h index 30d0effa..80be56a1 100644 --- a/libdash/libdash/include/IContentComponent.h +++ b/libdash/libdash/include/IContentComponent.h @@ -14,6 +14,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef ICONTENTCOMPONENT_H_ diff --git a/libdash/libdash/include/IDescriptor.h b/libdash/libdash/include/IDescriptor.h index f95afa46..51af12ef 100644 --- a/libdash/libdash/include/IDescriptor.h +++ b/libdash/libdash/include/IDescriptor.h @@ -27,6 +27,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IDESCRIPTOR_H_ diff --git a/libdash/libdash/include/IFCS.h b/libdash/libdash/include/IFCS.h new file mode 100644 index 00000000..ddc5875b --- /dev/null +++ b/libdash/libdash/include/IFCS.h @@ -0,0 +1,52 @@ +/** + * @class dash::mpd::IFCS + * @brief This interface is needed for accessing the attributes of FCS + * as specified in ISO/IEC 23009-1, section 5.3.9.7.2, table 22 + * @details The FCS element contains an optional \c @d attribute specifying the MPD duration of the alternative content section and a mandatory \c @t time attribute + * whereby the value of the \c @t attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time of the alternative content section. \n + * The semantics of the attributes for FCS are provided in 5.3.9.7.2, Table 22. The XML syntax of the Failover Content signalling is provided in 5.3.9.7.3. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IFCS_H_ +#define IFCS_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IFCS : public virtual IMPDElement + { + public: + virtual ~IFCS(){} + + /** + * Returns an integer that specifies the value of the \c PresentationTime which corresponds to the \c @t attribute. + * This attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time, in \c @timescale units, of the first sample in the alternative content section. \n + * The value of this attribute must be equal to or greater than the sum of the previous FCS element earliest presentation time and the sum of the contiguous section duration. + * + * @return an unsigned integer + */ + virtual uint32_t GetPresentationTime () const = 0; + + /** + * Returns an integer that specifies the alternative content section duration in units of the value of the \c @timescale. \n + * If not present, the alternative content section lasts until the start of the next FCS element, or until the end of the Period or until the end of MPD duration, whichever occurs first in the timeline. \n\n + * \em Duration corresponds to the \c \@d attribute. + * @return an unsigned integer + */ + virtual uint32_t GetDuration () const = 0; + }; + } +} + +#endif /* IFCS_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IFailoverContent.h b/libdash/libdash/include/IFailoverContent.h new file mode 100644 index 00000000..a49cf1fd --- /dev/null +++ b/libdash/libdash/include/IFailoverContent.h @@ -0,0 +1,52 @@ +/** + * @class dash::mpd::IFailoverContent + * @brief This interface is needed for accessing the common elements and attributes of FailoverContent + * as specified in ISO/IEC 23009-1, section 5.3.9.7.2, table 22 + * @details The FailoverContent element enables identification of such sections of Representations that include alternative “failover content†and should be avoided by the DASH Client, + * for example by switching to a Representation that does not include such failover content. \n + * The FailoverContent element contains a list of failover content sections, each expressed by one FCS element. + * The FCS element contains an optional \c @d attribute specifying the MPD duration of the alternative content section and a mandatory \c @t time attribute + * whereby the value of the \c @t attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time of the alternative content section. \n + * The semantics of the attributes and elements for failover content are provided in 5.3.9.7.2, Table 22. The XML syntax of the Failover Content signalling is provided in 5.3.9.7.3. + * @see dash::mpd::IFCS dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IFAILOVERCONTENT_H_ +#define IFAILOVERCONTENT_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IFCS.h" + +namespace dash +{ + namespace mpd + { + class IFailoverContent : public virtual IMPDElement + { + public: + virtual ~IFailoverContent(){} + + /** + * Returns a pointer to a vector of dash::mpd::FCS objects, each of which specifies the property of the Failover Content signalling itself. + * @return a pointer to a vector of dash::mpd::FCS objects + */ + virtual std::vector& GetFCS () const = 0; + + /** + * Returns a boolean that specifies whether the corresponding data results in a valid HTTP request + * or if the request is invalid and it is expected that a 404 is received when requesting the associated Media Segment. + * @return a bool value + */ + virtual bool IsValid () const = 0; + }; + } +} + +#endif /* IFAILOVERCONTENT_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IMPD.h b/libdash/libdash/include/IMPD.h index 0415f907..46428408 100644 --- a/libdash/libdash/include/IMPD.h +++ b/libdash/libdash/include/IMPD.h @@ -27,6 +27,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IMPD_H_ diff --git a/libdash/libdash/include/IMultipleSegmentBase.h b/libdash/libdash/include/IMultipleSegmentBase.h index e3b49f56..b66bef8f 100644 --- a/libdash/libdash/include/IMultipleSegmentBase.h +++ b/libdash/libdash/include/IMultipleSegmentBase.h @@ -12,6 +12,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IMULTIPLESEGMENTBASE_H_ diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index 6227b6d9..affea26c 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -37,6 +37,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IPERIOD_H_ diff --git a/libdash/libdash/include/IRepresentation.h b/libdash/libdash/include/IRepresentation.h index dd0cf9b2..3ed250d2 100644 --- a/libdash/libdash/include/IRepresentation.h +++ b/libdash/libdash/include/IRepresentation.h @@ -32,6 +32,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IREPRESENTATION_H_ diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index e3b9c8c2..f92243e3 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -12,6 +12,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef IREPRESENTATIONBASE_H_ diff --git a/libdash/libdash/include/ISegmentBase.h b/libdash/libdash/include/ISegmentBase.h index bfcfa2a4..52d037bb 100644 --- a/libdash/libdash/include/ISegmentBase.h +++ b/libdash/libdash/include/ISegmentBase.h @@ -9,7 +9,7 @@ * If the Representation contains more than one Media Segment, then either the attribute \c \@duration or the element SegmentTimeline shall be present. * The attribute \c \@duration and the element SegmentTimeline shall not be present at the same time. * Segments described by the Segment base information are referenced by an HTTP-URL conforming to the type URLType as defined in Table 13. - * @see dash::mpd::IURLType dash::mpd::IMPDElement + * @see dash::mpd::IURLType dash::mpd::FailoverContent dash::mpd::IMPDElement * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -18,6 +18,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef ISEGMENTBASE_H_ @@ -27,6 +30,7 @@ #include "IMPDElement.h" #include "IURLType.h" +#include "IFailoverContent.h" namespace dash { @@ -48,6 +52,12 @@ namespace dash * @return a pointer to dash::mpd::IURLType object */ virtual const IURLType* GetRepresentationIndex () const = 0; + + /** + * Returns a pointer to a dash::mpd::IFailoverContent object that specifies the sections that contain failover content. + * @return a pointer to dash::mpd::IFailoverContent object + */ + virtual const IFailoverContent* GetFailoverContent () const = 0; /** * Returns an integer representing a timescale that specifies the timescale in units per seconds diff --git a/libdash/libdash/include/ISegmentList.h b/libdash/libdash/include/ISegmentList.h index ac60490d..98eb537f 100644 --- a/libdash/libdash/include/ISegmentList.h +++ b/libdash/libdash/include/ISegmentList.h @@ -14,6 +14,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef ISEGMENTLIST_H_ diff --git a/libdash/libdash/include/ISubset.h b/libdash/libdash/include/ISubset.h index 1f6be17d..9f6fd7d6 100644 --- a/libdash/libdash/include/ISubset.h +++ b/libdash/libdash/include/ISubset.h @@ -23,6 +23,9 @@ * @copyright bitmovin Softwareentwicklung OG, All Rights Reserved \n\n * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. + * + * @contributor Daniele Lorenzi + * @contributiondate 2021 */ #ifndef ISUBSET_H_ diff --git a/libdash/libdash/source/mpd/AdaptationSet.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index c3184ad2..be3c4e57 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/AdaptationSet.h b/libdash/libdash/source/mpd/AdaptationSet.h index 625bd8f6..1dcde3e5 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/BaseUrl.cpp b/libdash/libdash/source/mpd/BaseUrl.cpp index e02e7131..62ae2a9b 100644 --- a/libdash/libdash/source/mpd/BaseUrl.cpp +++ b/libdash/libdash/source/mpd/BaseUrl.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/BaseUrl.h b/libdash/libdash/source/mpd/BaseUrl.h index d2203882..c10ae45e 100644 --- a/libdash/libdash/source/mpd/BaseUrl.h +++ b/libdash/libdash/source/mpd/BaseUrl.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/ContentComponent.cpp b/libdash/libdash/source/mpd/ContentComponent.cpp index e918c70e..d548d473 100644 --- a/libdash/libdash/source/mpd/ContentComponent.cpp +++ b/libdash/libdash/source/mpd/ContentComponent.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/ContentComponent.h b/libdash/libdash/source/mpd/ContentComponent.h index a14245e6..7bf7c801 100644 --- a/libdash/libdash/source/mpd/ContentComponent.h +++ b/libdash/libdash/source/mpd/ContentComponent.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Descriptor.cpp b/libdash/libdash/source/mpd/Descriptor.cpp index a5507e74..76a96903 100644 --- a/libdash/libdash/source/mpd/Descriptor.cpp +++ b/libdash/libdash/source/mpd/Descriptor.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Descriptor.h b/libdash/libdash/source/mpd/Descriptor.h index 983012c1..1e851871 100644 --- a/libdash/libdash/source/mpd/Descriptor.h +++ b/libdash/libdash/source/mpd/Descriptor.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/FCS.cpp b/libdash/libdash/source/mpd/FCS.cpp new file mode 100644 index 00000000..002b829f --- /dev/null +++ b/libdash/libdash/source/mpd/FCS.cpp @@ -0,0 +1,40 @@ +/* + * FCS.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "FCS.h" + +using namespace dash::mpd; + +FCS::FCS () : + presentationTime(0), + duration(0) +{ +} +FCS::~FCS () +{ +} + +uint32_t FCS::GetPresentationTime () const +{ + return this->presentationTime; +} +void FCS::SetPresentationTime (uint32_t presentationTime) +{ + this->presentationTime = presentationTime; +} +uint32_t FCS::GetDuration () const +{ + return this->duration; +} +void FCS::SetDuration (uint32_t duration) +{ + this->duration = duration; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/FCS.h b/libdash/libdash/source/mpd/FCS.h new file mode 100644 index 00000000..56ea38c2 --- /dev/null +++ b/libdash/libdash/source/mpd/FCS.h @@ -0,0 +1,43 @@ +/* + * FCS.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef FCS_H_ +#define FCS_H_ + +#include "config.h" + +#include "IFCS.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class FCS : public IFCS, public AbstractMPDElement + { + public: + FCS (); + virtual ~FCS (); + + uint32_t GetPresentationTime () const; + uint32_t GetDuration () const; + + void SetPresentationTime (uint32_t presentationTime); + void SetDuration (uint32_t duration); + + private: + uint32_t presentationTime; + uint32_t duration; + }; + } +} + +#endif /* IFCS_H_ */ diff --git a/libdash/libdash/source/mpd/FailoverContent.cpp b/libdash/libdash/source/mpd/FailoverContent.cpp new file mode 100644 index 00000000..6766233c --- /dev/null +++ b/libdash/libdash/source/mpd/FailoverContent.cpp @@ -0,0 +1,41 @@ +/* + * FailoverContent.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "FailoverContent.h" + +using namespace dash::mpd; + +FailoverContent::FailoverContent () : + valid(true) +{ +} +FailoverContent::~FailoverContent () +{ + for (size_t i=0; i < this->fcs.size(); i++) + delete(this->fcs.at(i)); +} + +std::vector& FailoverContent::GetFCS () const +{ + return (std::vector &) this->fcs; +} +void FailoverContent::AddFCS (FCS *fcs_el) +{ + this->fcs.push_back(fcs_el); +} +bool FailoverContent::IsValid () const +{ + return this->valid; +} +void FailoverContent::SetValid (bool valid) +{ + this->valid = valid; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/FailoverContent.h b/libdash/libdash/source/mpd/FailoverContent.h new file mode 100644 index 00000000..8e192f80 --- /dev/null +++ b/libdash/libdash/source/mpd/FailoverContent.h @@ -0,0 +1,44 @@ +/* + * FailoverContent.h + ***************************************************************************** * + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef FAILOVERCONTENT_H_ +#define FAILOVERCONTENT_H_ + +#include "config.h" + +#include "IFailoverContent.h" +#include "AbstractMPDElement.h" +#include "FCS.h" + +namespace dash +{ + namespace mpd + { + class FailoverContent : public IFailoverContent, public AbstractMPDElement + { + public: + FailoverContent (); + virtual ~FailoverContent (); + + std::vector& GetFCS () const; + bool IsValid () const; + + void AddFCS (FCS *fcs_el); + void SetValid (bool valid); + + protected: + std::vector fcs; + bool valid; + }; + } +} + +#endif /* FAILOVERCONTENT_H_ */ diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index d6b2bd3d..3417275d 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index 8b04d771..40791151 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp index f4dd8759..d1413702 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.h b/libdash/libdash/source/mpd/MultipleSegmentBase.h index 33294b2f..6e6ce37e 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.h +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index 87e43e91..a222a150 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index 02c53262..4044a7b6 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Representation.cpp b/libdash/libdash/source/mpd/Representation.cpp index b06d6381..1cbae918 100644 --- a/libdash/libdash/source/mpd/Representation.cpp +++ b/libdash/libdash/source/mpd/Representation.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Representation.h b/libdash/libdash/source/mpd/Representation.h index b88721e6..d6ce4f51 100644 --- a/libdash/libdash/source/mpd/Representation.h +++ b/libdash/libdash/source/mpd/Representation.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/RepresentationBase.cpp b/libdash/libdash/source/mpd/RepresentationBase.cpp index be69d613..801d517e 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.cpp +++ b/libdash/libdash/source/mpd/RepresentationBase.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/RepresentationBase.h b/libdash/libdash/source/mpd/RepresentationBase.h index 70e5dcbc..47bf24b0 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.h +++ b/libdash/libdash/source/mpd/RepresentationBase.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/SegmentBase.cpp b/libdash/libdash/source/mpd/SegmentBase.cpp index d9fd9807..76359066 100644 --- a/libdash/libdash/source/mpd/SegmentBase.cpp +++ b/libdash/libdash/source/mpd/SegmentBase.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -16,6 +19,7 @@ using namespace dash::mpd; SegmentBase::SegmentBase () : initialization(NULL), representationIndex(NULL), + failoverContent(NULL), timescale(1), eptDelta(0), presentationTimeOffset(0), @@ -45,6 +49,14 @@ void SegmentBase::SetRepresentationIndex (URLType *representa { this->representationIndex = representationIndex; } +const IFailoverContent* SegmentBase::GetFailoverContent () const +{ + return this->failoverContent; +} +void SegmentBase::SetFailoverContent (FailoverContent *failoverContent) +{ + this->failoverContent = failoverContent; +} uint32_t SegmentBase::GetTimescale () const { return this->timescale; diff --git a/libdash/libdash/source/mpd/SegmentBase.h b/libdash/libdash/source/mpd/SegmentBase.h index 028450a7..fc3a446f 100644 --- a/libdash/libdash/source/mpd/SegmentBase.h +++ b/libdash/libdash/source/mpd/SegmentBase.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -16,6 +19,7 @@ #include "ISegmentBase.h" #include "URLType.h" +#include "FailoverContent.h" #include "AbstractMPDElement.h" namespace dash @@ -30,6 +34,7 @@ namespace dash const IURLType* GetInitialization () const; const IURLType* GetRepresentationIndex () const; + const IFailoverContent* GetFailoverContent () const; uint32_t GetTimescale () const; int GetEptDelta () const; uint32_t GetPresentationTimeOffset () const; @@ -42,6 +47,7 @@ namespace dash void SetInitialization (URLType *initialization); void SetRepresentationIndex (URLType *representationIndex); + void SetFailoverContent (FailoverContent *failoverContent); void SetTimescale (uint32_t timescale); void SetEptDelta (int eptDelta); void SetPresentationTimeOffset (uint32_t presentationTimeOffset); @@ -55,6 +61,7 @@ namespace dash protected: URLType *initialization; URLType *representationIndex; + FailoverContent *failoverContent; uint32_t timescale; int eptDelta; uint32_t presentationTimeOffset; diff --git a/libdash/libdash/source/mpd/SegmentList.cpp b/libdash/libdash/source/mpd/SegmentList.cpp index ac3c59d0..5bcbc490 100644 --- a/libdash/libdash/source/mpd/SegmentList.cpp +++ b/libdash/libdash/source/mpd/SegmentList.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/SegmentList.h b/libdash/libdash/source/mpd/SegmentList.h index 1c948669..69049787 100644 --- a/libdash/libdash/source/mpd/SegmentList.h +++ b/libdash/libdash/source/mpd/SegmentList.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Subset.cpp b/libdash/libdash/source/mpd/Subset.cpp index 3ea4cb92..07031bb9 100644 --- a/libdash/libdash/source/mpd/Subset.cpp +++ b/libdash/libdash/source/mpd/Subset.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/mpd/Subset.h b/libdash/libdash/source/mpd/Subset.h index a4b3c3dd..8d04a994 100644 --- a/libdash/libdash/source/mpd/Subset.h +++ b/libdash/libdash/source/mpd/Subset.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index f44dd275..fa854e29 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -207,6 +210,45 @@ dash::mpd::URLType* Node::ToURLType (HTTPTra urlType->AddRawAttributes(this->attributes); return urlType; } +dash::mpd::FCS* Node::ToFCS () const +{ + dash::mpd::FCS* fcs = new dash::mpd::FCS(); + + if (this->HasAttribute("t")) + { + fcs->SetPresentationTime(strtoul(this->GetAttributeValue("t").c_str(), NULL, 10)); + } + if (this->HasAttribute("d")) + { + fcs->SetDuration(strtoul(this->GetAttributeValue("d").c_str(), NULL, 10)); + } + + fcs->AddRawAttributes(this->attributes); + return fcs; +} +dash::mpd::FailoverContent* Node::ToFailoverContent () const +{ + dash::mpd::FailoverContent* failoverContent = new dash::mpd::FailoverContent(); + + if (this->HasAttribute("valid")) + { + failoverContent->SetValid(dash::helpers::String::ToBool(this->GetAttributeValue("valid"))); + } + + std::vector subNodes = this->GetSubNodes(); + for(size_t i = 0; i < subNodes.size(); i++) + { + if (subNodes.at(i)->GetName() == "FCS") + { + failoverContent->AddFCS(subNodes.at(i)->ToFCS()); + continue; + } + failoverContent->AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); + } + + failoverContent->AddRawAttributes(this->attributes); + return failoverContent; +} dash::mpd::SegmentBase* Node::ToSegmentBase () const { dash::mpd::SegmentBase* segmentBase = new dash::mpd::SegmentBase(); @@ -216,6 +258,11 @@ dash::mpd::SegmentBase* Node::ToSegmentBase () cons for(size_t i = 0; i < subNodes.size(); i++) { + if (subNodes.at(i)->GetName() == "FailoverContent") + { + segmentBase->SetFailoverContent(subNodes.at(i)->ToFailoverContent()); + continue; + } if (subNodes.at(i)->GetName() != "Initialization" && subNodes.at(i)->GetName() != "RepresentationIndex") segmentBase->AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); } diff --git a/libdash/libdash/source/xml/Node.h b/libdash/libdash/source/xml/Node.h index 552d83e5..c07bd039 100644 --- a/libdash/libdash/source/xml/Node.h +++ b/libdash/libdash/source/xml/Node.h @@ -5,6 +5,9 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -20,6 +23,8 @@ #include "../mpd/BaseUrl.h" #include "../mpd/ContentComponent.h" #include "../mpd/Descriptor.h" +#include "../mpd/FailoverContent.h" +#include "../mpd/FCS.h" #include "../mpd/Metrics.h" #include "../mpd/MPD.h" #include "../mpd/MultipleSegmentBase.h" @@ -76,6 +81,8 @@ namespace dash dash::mpd::BaseUrl* ToBaseUrl () const; dash::mpd::ContentComponent* ToContentComponent () const; dash::mpd::Descriptor* ToDescriptor () const; + dash::mpd::FailoverContent* ToFailoverContent () const; + dash::mpd::FCS* ToFCS () const; dash::mpd::Metrics* ToMetrics () const; dash::mpd::Period* ToPeriod () const; dash::mpd::ProgramInformation* ToProgramInformation () const; From 382b7f28cd3ff6a682bbac44bfde2c5694855f8d Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Thu, 29 Apr 2021 12:27:28 +0200 Subject: [PATCH 07/28] added Event, EventStream and included Period and RepresentationBase dependencies --- libdash/libdash/include/IEvent.h | 89 +++++++++++++++++ libdash/libdash/include/IEventStream.h | 96 +++++++++++++++++++ libdash/libdash/include/IPeriod.h | 10 +- libdash/libdash/include/IRepresentationBase.h | 10 +- libdash/libdash/source/mpd/Event.cpp | 66 +++++++++++++ libdash/libdash/source/mpd/Event.h | 53 ++++++++++ libdash/libdash/source/mpd/EventStream.cpp | 85 ++++++++++++++++ libdash/libdash/source/mpd/EventStream.h | 59 ++++++++++++ libdash/libdash/source/mpd/Period.cpp | 10 ++ libdash/libdash/source/mpd/Period.h | 4 + .../libdash/source/mpd/RepresentationBase.cpp | 10 ++ .../libdash/source/mpd/RepresentationBase.h | 4 + libdash/libdash/source/xml/Node.cpp | 81 ++++++++++++++++ libdash/libdash/source/xml/Node.h | 5 + 14 files changed, 580 insertions(+), 2 deletions(-) create mode 100644 libdash/libdash/include/IEvent.h create mode 100644 libdash/libdash/include/IEventStream.h create mode 100644 libdash/libdash/source/mpd/Event.cpp create mode 100644 libdash/libdash/source/mpd/Event.h create mode 100644 libdash/libdash/source/mpd/EventStream.cpp create mode 100644 libdash/libdash/source/mpd/EventStream.h diff --git a/libdash/libdash/include/IEvent.h b/libdash/libdash/include/IEvent.h new file mode 100644 index 00000000..e719466e --- /dev/null +++ b/libdash/libdash/include/IEvent.h @@ -0,0 +1,89 @@ +/** + * @class dash::mpd::IEvent + * @brief This interface is needed for accessing the attributes of Event + * as specified in ISO/IEC 23009-1, subclause 5.10.2.2, Table 35. + * @details The Event element specifies an Event and contains the message of the event. The content of this element depends on the event scheme. The contents shall be either: \n + *
    + *
  • A string, optionally encoded as specified by \c @contentEncoding + *
  • XML content using elements external to the MPD namespace + *
+ * For new event schemes, string content should be used, making use of Base 64 encoding if needed. \n + * \b NOTE The schema allows “mixed†content within this element however only string data or XML elements are permitted by the above options, not a combination. \n + * The XML syntax of the Event is provided in subclause 5.10.2.3. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IEvent_H_ +#define IEvent_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IEvent : public virtual IMPDElement + { + public: + virtual ~IEvent(){} + + /** + * Returns an integer that specifies the presentation time of the event relative to the start of the Period taking into account the \c @presentationTimeOffset of the Event Stream, if present. \n + * The value of the presentation time in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. \n + * If not present, the value of the presentation time is 0. + * + * @return an unsigned integer + */ + virtual uint32_t GetPresentationTime () const = 0; + + /** + * Returns a reference to a string that specifies the presentation duration of the Event. \n + * The value of the duration in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. \n + * The interpretation of the value of this attribute is defined by the scheme owner. \n + * If not present, the value of the duration is unknown. + * + * @return a reference to a string + */ + virtual const std::string& GetDuration () const = 0; + + /** + * Returns an integer that specifies an identifier for this instance of the event. \n + * Events with equivalent content and attribute values in the \b Event element shall have the same value for this attribute. \n + * The scope of the \c @id for each Event is with the same \c @schemeIdURI and \c @value pair. + * + * @return an unsigned integer + */ + virtual uint32_t GetId () const = 0; + + /** + * Returns the reference to a string that specifies whether the information in the body and the information in the \c @messageData is encoded. \n + * If present, the following value is possible: + *
    + *
  • \c base64 the content is encoded as described in IETF RFC 4648 prior to adding it to the field. + *
+ * If this attribute is present, the DASH Client is expected to decode the message data and only provide the decoded message to the application. + * + * @return a reference to a string + */ + virtual const std::string& GetContentEncoding () const = 0; + + /** + * Returns the reference to a string that specifies the value for the event stream element. The value space and semantics must be defined by the owners of the scheme identified in the \c @schemeIdUri attribute. \n + * The use of the message data is discouraged by content authors; it is only maintained for the purpose of backward-compatibility. + * Including the message in the Event element is recommended in preference to using this attribute. + * + * @return a reference to a string + */ + virtual const std::string& GetMessageData () const = 0; + }; + } +} + +#endif /* IEvent_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IEventStream.h b/libdash/libdash/include/IEventStream.h new file mode 100644 index 00000000..66f0c78d --- /dev/null +++ b/libdash/libdash/include/IEventStream.h @@ -0,0 +1,96 @@ +/** + * @class dash::mpd::IEventStream + * @brief This interface is needed for accessing the common elements and attributes of EventStream + * as specified in ISO/IEC 23009-1, subclause 5.10.2.2, Table 34 + * @details The EventStream element is structured in a similar way as the descriptor defined in subclause 5.8, namely it contains a \c @schemeIdUri attribute + * that provides a URI to identify the scheme and an optional attribute \c @value. The semantics of the element are specific to the scheme employed. The URI identifying the scheme may be a URN or a URL. \n + * A Period shall contain at most one \b EventStream element with the same value of the \c @schemeIdUri attribute and the value of the \c @value attribute, i.e. all Events of one type shall be clustered in one Event Stream. \n + * As Event Streams contain timed events, also a time scale attribute \c @timescale is provided to assign events to a specific media presentation time within the Period. The timed events themselves are described by the \b Event element. + * ìThe XML syntax of the Event Stream is provided in subclause 5.10.2.3. + * @see dash::mpd::IEventStream dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IEVENTSTREAM_H_ +#define IEVENTSTREAM_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IEvent.h" + +namespace dash +{ + namespace mpd + { + class IEventStream : public virtual IMPDElement + { + public: + virtual ~IEventStream(){} + + /** + * Returns a pointer to a vector of dash::mpd::Event objects, each of which specifies the property of the Event itself. \n + * Events in Event Streams shall be ordered such that their presentation time is non-decreasing. + * + * @return a pointer to a vector of dash::mpd::Event objects + */ + virtual std::vector& GetEvents () const = 0; + + /** + * Returns a reference to a string that specifies a reference to an external EventStream element. + * + * @return a reference to a string + */ + virtual const std::string& GetXlinkHref () const = 0; + + /** + * Returns a reference to a string that specifies the processing instructions, which can be either \c "onLoad" or \c "onRequest". \n + * This attribute shall not be present if the \c @xlink:href attribute is not present. + * + * @return a reference to a string + */ + virtual const std::string& GetXlinkActuate () const = 0; + + /** + * Returns a reference to a string that identifies the message scheme. The string may use URN or URL syntax. + * When a URL is used, it is recommended to also contain a month-date in the form mmyyyy; + * the assignment of the URL must have been authorized by the owner of the domain name in that URL on or very close to that date. + * A URL may resolve to an Internet location, and a location that does resolve may store a specification of the message scheme. + * + * @return a reference to a string + */ + virtual const std::string& GetSchemeIdUri () const = 0; + + /** + * Returns a reference to a string that specifies the value for the event stream element. The value space and semantics must be defined + * by the owners of the scheme identified in the \c @schemeIdUriattribute. + * + * @return a reference to a string + */ + virtual const std::string& GetValue () const = 0; + + /** + * Returns an integer that specifies the timescale in units per seconds to be used for the derivation of different real-time duration values in the \b Event elements. \n + * If not present on any level, it shall be set to 1. + * + * @return an unsigned integer + */ + virtual uint32_t GetTimescale () const = 0; + + /** + * Returns an integer that specifies the presentation time offset of this Event Stream that aligns with the start of the Period. + * Any Event contained in this Event Stream is mapped to the Period timeline by using the Event presentation time adjusted by the value of the presentation time offset. \n + * The value of the presentation time offset in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. + * + * @return an unsigned integer + */ + virtual uint32_t GetPresentationTimeOffset () const = 0; + }; + } +} + +#endif /* IEVENTSTREAM */ \ No newline at end of file diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index affea26c..c4697def 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -28,7 +28,7 @@ * representing an Early Available Period in later updates of the MPD as long as no \em PeriodStart time is associated with the Period. \n\n * To avoid dereferencing of a remote element containing a Period element solely to determine the Period timeline, e.g. in case of seeking, * Period\@start or previous Period's Period\@duration should be present in the MPD. - * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISubset + * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISegmentBase dash::mpd::IEventStream dash::mpd::ISubset * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -52,6 +52,7 @@ #include "ISegmentBase.h" #include "ISegmentList.h" #include "ISegmentTemplate.h" +#include "IEventStream.h" #include "IAdaptationSet.h" #include "ISubset.h" @@ -94,6 +95,13 @@ namespace dash * @return a pointer to a dash::mpd::ISegmentTemplate object */ virtual ISegmentTemplate* GetSegmentTemplate () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n + * For more details see section 5.10.2. of ISO/IEC 23009-1. + * @return a reference to a vector of pointers to dash::mpd::IEventStream objects + */ + virtual const std::vector& GetEventStreams () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IAdaptationSet objects that specify Adapatation Sets.\n diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index f92243e3..57c53458 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -3,7 +3,7 @@ * @brief This interface is needed for accessing the common attributes and elements of the certain MPD element as specified in ISO/IEC 23009-1, Part 1, 2012, section 5.3.7 * @details The elements \c AdaptationSet, \c Representation and \c SubRepresentation have assigned common attributes and elements that are specified in * ISO/IEC 23009-1, Part 1, 2012, section 5.3.7.2, table 9 - * @see dash::mpd::IDescriptor dash::mpd::IMPDElement + * @see dash::mpd::IDescriptor dash::mpd::IEventStream dash::mpd::IMPDElement * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -24,6 +24,7 @@ #include "IMPDElement.h" #include "IDescriptor.h" +#include "IEventStream.h" namespace dash { @@ -55,6 +56,13 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetContentProtection () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n + * For more details see section 5.10.2. of ISO/IEC 23009-1. + * @return a reference to a vector of pointers to dash::mpd::IEventStream objects + */ + virtual const std::vector& GetEventStreams () const = 0; /** * Returns a reference to a vector of strings that specifies the profiles which the associated Representation(s) diff --git a/libdash/libdash/source/mpd/Event.cpp b/libdash/libdash/source/mpd/Event.cpp new file mode 100644 index 00000000..e35e0ef0 --- /dev/null +++ b/libdash/libdash/source/mpd/Event.cpp @@ -0,0 +1,66 @@ +/* + * Event.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "Event.h" + +using namespace dash::mpd; + +Event::Event () : + presentationTime(0), + contentEncoding(""), + messageData("") + +{ +} +Event::~Event () +{ +} + +uint32_t Event::GetPresentationTime () const +{ + return this->presentationTime; +} +void Event::SetPresentationTime (uint32_t presentationTime) +{ + this->presentationTime = presentationTime; +} +const std::string& Event::GetDuration () const +{ + return this->duration; +} +void Event::SetDuration (const std::string& duration) +{ + this->duration = duration; +} +uint32_t Event::GetId () const +{ + return this->id; +} +void Event::SetId (uint32_t id) +{ + this->id = id; +} +const std::string& Event::GetContentEncoding () const +{ + return this->contentEncoding; +} +void Event::SetContentEncoding (const std::string& contentEncoding) +{ + this->contentEncoding = contentEncoding; +} +const std::string& Event::GetMessageData () const +{ + return this->messageData; +} +void Event::SetMessageData (const std::string& messageData) +{ + this->messageData = messageData; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Event.h b/libdash/libdash/source/mpd/Event.h new file mode 100644 index 00000000..d9dd999b --- /dev/null +++ b/libdash/libdash/source/mpd/Event.h @@ -0,0 +1,53 @@ +/* + * Event.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef Event_H_ +#define Event_H_ + +#include "config.h" + +#include "IEvent.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class Event : public IEvent, public AbstractMPDElement + { + public: + Event (); + virtual ~Event (); + + uint32_t GetPresentationTime () const; + const std::string& GetDuration () const; + uint32_t GetId () const; + const std::string& GetContentEncoding () const; + const std::string& GetMessageData () const; + + void SetPresentationTime (uint32_t presentationTime); + void SetDuration (const std::string& duration); + void SetId (uint32_t id); + void SetContentEncoding (const std::string& contentEncoding); + void SetMessageData (const std::string& messageData); + + private: + uint32_t presentationTime; + std::string duration; + uint32_t id; + std::string contentEncoding; + std::string messageData; + + }; + } +} + +#endif /* IEvent_H_ */ diff --git a/libdash/libdash/source/mpd/EventStream.cpp b/libdash/libdash/source/mpd/EventStream.cpp new file mode 100644 index 00000000..fd4bcfb5 --- /dev/null +++ b/libdash/libdash/source/mpd/EventStream.cpp @@ -0,0 +1,85 @@ +/* + * EventStream.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "EventStream.h" + +using namespace dash::mpd; + +EventStream::EventStream () : + xlinkHref(""), + xlinkActuate("onRequest"), + schemeIdUri(""), + value(""), + presentationTimeOffset(0) +{ +} +EventStream::~EventStream () +{ + for (size_t i=0; i < this->events.size(); i++) + delete(this->events.at(i)); +} + +std::vector& EventStream::GetEvents () const +{ + return (std::vector &) this->events; +} +void EventStream::AddEvent (Event *event) +{ + this->events.push_back(event); +} +const std::string& EventStream::GetXlinkHref () const +{ + return this->xlinkHref; +} +void EventStream::SetXlinkHref (const std::string& xlinkHref) +{ + this->xlinkHref = xlinkHref; +} +const std::string& EventStream::GetXlinkActuate () const +{ + return this->xlinkActuate; +} +void EventStream::SetXlinkActuate (const std::string& xlinkActuate) +{ + this->xlinkActuate = xlinkActuate; +} +const std::string& EventStream::GetSchemeIdUri () const +{ + return this->schemeIdUri; +} +void EventStream::SetSchemeIdUri (const std::string& schemeIdUri) +{ + this->schemeIdUri = schemeIdUri; +} +const std::string& EventStream::GetValue () const +{ + return this->value; +} +void EventStream::SetValue (const std::string& value) +{ + this->value = value; +} +uint32_t EventStream::GetTimescale () const +{ + return this->timescale; +} +void EventStream::SetTimescale (uint32_t timescale) +{ + this->timescale = timescale; +} +uint32_t EventStream::GetPresentationTimeOffset () const +{ + return this->presentationTimeOffset; +} +void EventStream::SetPresentationTimeOffset (uint32_t presentationTimeOffset) +{ + this->presentationTimeOffset = presentationTimeOffset; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/EventStream.h b/libdash/libdash/source/mpd/EventStream.h new file mode 100644 index 00000000..b6666248 --- /dev/null +++ b/libdash/libdash/source/mpd/EventStream.h @@ -0,0 +1,59 @@ +/* + * EventStream.h + ***************************************************************************** * + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef EVENTSTREAM_H_ +#define EVENTSTREAM_H_ + +#include "config.h" + +#include "IEventStream.h" +#include "AbstractMPDElement.h" +#include "Event.h" + +namespace dash +{ + namespace mpd + { + class EventStream : public IEventStream, public AbstractMPDElement + { + public: + EventStream (); + virtual ~EventStream (); + + std::vector& GetEvents () const; + const std::string& GetXlinkHref () const; + const std::string& GetXlinkActuate () const; + const std::string& GetSchemeIdUri () const; + const std::string& GetValue () const; + uint32_t GetTimescale () const; + uint32_t GetPresentationTimeOffset () const; + + void AddEvent (Event *event); + void SetXlinkHref (const std::string& xlinkHref); + void SetXlinkActuate (const std::string& xlinkActuate); + void SetSchemeIdUri (const std::string& schemeIdUri); + void SetValue (const std::string& value); + void SetTimescale (uint32_t timescale); + void SetPresentationTimeOffset (uint32_t presentationTimeOffset); + + protected: + std::vector events; + std::string xlinkHref; + std::string xlinkActuate; + std::string schemeIdUri; + std::string value; + uint32_t timescale; + uint32_t presentationTimeOffset; + }; + } +} + +#endif /* EVENTSTREAM_H_ */ diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index a222a150..0a0d6840 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -38,6 +38,8 @@ Period::~Period () delete(this->adaptationSets.at(i)); for(size_t i = 0; i < this->subsets.size(); i++) delete(this->subsets.at(i)); + for(size_t i = 0; i < this->eventStreams.size(); i++) + delete(this->eventStreams.at(i)); delete(segmentBase); delete(segmentList); delete(segmentTemplate); @@ -75,6 +77,14 @@ void Period::SetSegmentTemplate (SegmentTemp { this->segmentTemplate = segmentTemplate; } +const std::vector& Period::GetEventStreams () const +{ + return (std::vector &) this->eventStreams; +} +void Period::AddEventStream (EventStream *eventStream) +{ + this->eventStreams.push_back(eventStream); +} const std::vector& Period::GetAdaptationSets () const { return (std::vector &) this->adaptationSets; diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index 4044a7b6..9f66f73c 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -24,6 +24,7 @@ #include "SegmentBase.h" #include "SegmentList.h" #include "SegmentTemplate.h" +#include "EventStream.h" #include "AbstractMPDElement.h" namespace dash @@ -40,6 +41,7 @@ namespace dash ISegmentBase* GetSegmentBase () const; ISegmentList* GetSegmentList () const; ISegmentTemplate* GetSegmentTemplate () const; + const std::vector& GetEventStreams () const; const std::vector& GetAdaptationSets () const; const std::vector& GetSubsets () const; const std::string& GetXlinkHref () const; @@ -55,6 +57,7 @@ namespace dash void SetSegmentBase (SegmentBase *segmentBase); void SetSegmentList (SegmentList *segmentList); void SetSegmentTemplate (SegmentTemplate *segmentTemplate); + void AddEventStream (EventStream *eventStream); void AddAdaptationSet (AdaptationSet *AdaptationSet); void AddSubset (Subset *subset); void SetXlinkHref (const std::string& xlinkHref); @@ -71,6 +74,7 @@ namespace dash SegmentBase *segmentBase; SegmentList *segmentList; SegmentTemplate *segmentTemplate; + std::vector eventStreams; std::vector adaptationSets; std::vector subsets; std::string xlinkHref; diff --git a/libdash/libdash/source/mpd/RepresentationBase.cpp b/libdash/libdash/source/mpd/RepresentationBase.cpp index 801d517e..6c06d4fb 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.cpp +++ b/libdash/libdash/source/mpd/RepresentationBase.cpp @@ -39,6 +39,8 @@ RepresentationBase::~RepresentationBase () delete(this->audioChannelConfiguration.at(i)); for(size_t i = 0; i < this->contentProtection.size(); i++) delete(this->contentProtection.at(i)); + for(size_t i = 0; i < this->eventStreams.size(); i++) + delete(this->eventStreams.at(i)); } const std::vector& RepresentationBase::GetFramePacking () const @@ -65,6 +67,14 @@ void RepresentationBase::AddContentProtection { this->contentProtection.push_back(contentProtection); } +const std::vector& RepresentationBase::GetEventStreams () const +{ + return (std::vector &) this->eventStreams; +} +void RepresentationBase::AddEventStream (EventStream *eventStream) +{ + this->eventStreams.push_back(eventStream); +} const std::vector& RepresentationBase::GetProfiles () const { return this->profiles; diff --git a/libdash/libdash/source/mpd/RepresentationBase.h b/libdash/libdash/source/mpd/RepresentationBase.h index 47bf24b0..cafbb4a6 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.h +++ b/libdash/libdash/source/mpd/RepresentationBase.h @@ -19,6 +19,7 @@ #include "IRepresentationBase.h" #include "Descriptor.h" +#include "EventStream.h" #include "../helpers/String.h" #include "AbstractMPDElement.h" @@ -35,6 +36,7 @@ namespace dash const std::vector& GetFramePacking () const; const std::vector& GetAudioChannelConfiguration () const; const std::vector& GetContentProtection () const; + const std::vector& GetEventStreams () const; const std::vector& GetProfiles () const; uint32_t GetWidth () const; uint32_t GetHeight () const; @@ -55,6 +57,7 @@ namespace dash void AddFramePacking (Descriptor *framePacking); void AddAudioChannelConfiguration (Descriptor *audioChannelConfiguration); void AddContentProtection (Descriptor *contentProtection); + void AddEventStream (EventStream *eventStream); void SetProfiles (const std::string& profiles); void SetWidth (uint32_t width); void SetHeight (uint32_t height); @@ -76,6 +79,7 @@ namespace dash std::vector framePacking; std::vector audioChannelConfiguration; std::vector contentProtection; + std::vector eventStreams; std::vector profiles; uint32_t width; uint32_t height; diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index fa854e29..e00cebde 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -683,6 +683,77 @@ dash::mpd::Subset* Node::ToSubset () cons subset->AddRawAttributes(this->attributes); return subset; } +dash::mpd::Event* Node::ToEvent () const +{ + dash::mpd::Event *event = new dash::mpd::Event(); + + if (this->HasAttribute("presentationTime")) + { + event->SetPresentationTime(strtoul(this->GetAttributeValue("presentationTime").c_str(), NULL, 10)); + } + if (this->HasAttribute("duration")) + { + event->SetDuration(this->GetAttributeValue("duration")); + } + if (this->HasAttribute("id")) + { + event->SetId(strtoul(this->GetAttributeValue("id").c_str(), NULL, 10)); + } + if (this->HasAttribute("contentEncoding")) + { + event->SetContentEncoding(this->GetAttributeValue("contentEncoding")); + } + if (this->HasAttribute("messageData")) + { + event->SetMessageData(this->GetAttributeValue("messageData")); + } + + event->AddRawAttributes(this->attributes); + return event; +} +dash::mpd::EventStream* Node::ToEventStream () const +{ + dash::mpd::EventStream *eventStream = new dash::mpd::EventStream(); + std::vector subNodes = this->GetSubNodes(); + + if (this->HasAttribute("xlink:href")) + { + eventStream->SetXlinkHref(this->GetAttributeValue("xlink:href")); + } + if (this->HasAttribute("xlink:actuate")) + { + eventStream->SetXlinkActuate(this->GetAttributeValue("xlink:actuate")); + } + if (this->HasAttribute("schemeIdUri")) + { + eventStream->SetSchemeIdUri(this->GetAttributeValue("schemeIdUri")); + } + if (this->HasAttribute("value")) + { + eventStream->SetValue(this->GetAttributeValue("value")); + } + if (this->HasAttribute("timescale")) + { + eventStream->SetTimescale(strtoul(this->GetAttributeValue("timescale").c_str(), NULL, 10)); + } + if (this->HasAttribute("presentationTimeOffset")) + { + eventStream->SetPresentationTimeOffset(strtoul(this->GetAttributeValue("presentationTimeOffset").c_str(), NULL, 10)); + } + + for(size_t i = 0; i < subNodes.size(); i++) + { + if (subNodes.at(i)->GetName() == "Event") + { + eventStream->AddEvent(subNodes.at(i)->ToEvent()); + continue; + } + eventStream->AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); + } + + eventStream->AddRawAttributes(this->attributes); + return eventStream; +} dash::mpd::Period* Node::ToPeriod () const { dash::mpd::Period *period = new dash::mpd::Period(); @@ -737,6 +808,11 @@ dash::mpd::Period* Node::ToPeriod () cons { period->AddSubset(subNodes.at(i)->ToSubset()); continue; + } + if (subNodes.at(i)->GetName() == "EventStream") + { + period->AddEventStream(subNodes.at(i)->ToEventStream()); + continue; } if (subNodes.at(i)->GetName() == "SegmentBase") { @@ -1074,6 +1150,11 @@ void Node::SetCommonValuesForRep (dash::m { object.AddContentProtection(subNodes.at(i)->ToDescriptor()); continue; + } + if (subNodes.at(i)->GetName() == "InbandEventStream") + { + object.AddEventStream(subNodes.at(i)->ToEventStream()); + continue; } } } diff --git a/libdash/libdash/source/xml/Node.h b/libdash/libdash/source/xml/Node.h index c07bd039..72a30ca7 100644 --- a/libdash/libdash/source/xml/Node.h +++ b/libdash/libdash/source/xml/Node.h @@ -23,6 +23,9 @@ #include "../mpd/BaseUrl.h" #include "../mpd/ContentComponent.h" #include "../mpd/Descriptor.h" +#include "../mpd/Event.h" +#include "../mpd/EventStream.h" +#include "../mpd/FCS.h" #include "../mpd/FailoverContent.h" #include "../mpd/FCS.h" #include "../mpd/Metrics.h" @@ -81,6 +84,8 @@ namespace dash dash::mpd::BaseUrl* ToBaseUrl () const; dash::mpd::ContentComponent* ToContentComponent () const; dash::mpd::Descriptor* ToDescriptor () const; + dash::mpd::Event* ToEvent () const; + dash::mpd::EventStream* ToEventStream () const; dash::mpd::FailoverContent* ToFailoverContent () const; dash::mpd::FCS* ToFCS () const; dash::mpd::Metrics* ToMetrics () const; From 9ba35e602aaa1fcc45c529dd1abfa12abd768deb Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Thu, 6 May 2021 08:31:06 +0200 Subject: [PATCH 08/28] fixed minore issues, added ServiceDescription, Latency, UIntPairs, UIntPairsWithID, OperatingBandwidth, OperatingQuality, PlaybackRate, Label, LeapSecondInformation, PatchLocation classes and included their dependencies in respective classes (Node, MPD, Period and RepresentationBase) --- libdash/libdash/include/IAdaptationSet.h | 6 +- libdash/libdash/include/IEvent.h | 6 +- libdash/libdash/include/IEventStream.h | 2 +- libdash/libdash/include/ILabel.h | 60 ++++ libdash/libdash/include/ILatency.h | 72 ++++ .../libdash/include/ILeapSecondInformation.h | 70 ++++ libdash/libdash/include/IMPD.h | 57 +++- libdash/libdash/include/IOperatingBandwidth.h | 71 ++++ libdash/libdash/include/IOperatingQuality.h | 87 +++++ libdash/libdash/include/IPatchLocation.h | 46 +++ libdash/libdash/include/IPeriod.h | 38 ++- libdash/libdash/include/IPlaybackRate.h | 50 +++ libdash/libdash/include/IRepresentationBase.h | 45 ++- libdash/libdash/include/IServiceDescription.h | 91 +++++ libdash/libdash/include/IUIntPairs.h | 47 +++ libdash/libdash/include/IUIntPairsWithID.h | 49 +++ libdash/libdash/source/mpd/AdaptationSet.cpp | 7 +- libdash/libdash/source/mpd/AdaptationSet.h | 4 +- libdash/libdash/source/mpd/Event.h | 6 +- libdash/libdash/source/mpd/EventStream.cpp | 2 +- libdash/libdash/source/mpd/EventStream.h | 2 +- libdash/libdash/source/mpd/Label.cpp | 40 +++ libdash/libdash/source/mpd/Label.h | 45 +++ libdash/libdash/source/mpd/Latency.cpp | 64 ++++ libdash/libdash/source/mpd/Latency.h | 54 +++ .../source/mpd/LeapSecondInformation.cpp | 48 +++ .../source/mpd/LeapSecondInformation.h | 47 +++ libdash/libdash/source/mpd/MPD.cpp | 59 ++++ libdash/libdash/source/mpd/MPD.h | 22 ++ .../libdash/source/mpd/OperatingBandwidth.cpp | 55 ++++ .../libdash/source/mpd/OperatingBandwidth.h | 50 +++ .../libdash/source/mpd/OperatingQuality.cpp | 71 ++++ libdash/libdash/source/mpd/OperatingQuality.h | 56 ++++ libdash/libdash/source/mpd/PatchLocation.cpp | 41 +++ libdash/libdash/source/mpd/PatchLocation.h | 44 +++ libdash/libdash/source/mpd/Period.cpp | 40 +++ libdash/libdash/source/mpd/Period.h | 15 + libdash/libdash/source/mpd/PlaybackRate.cpp | 38 +++ libdash/libdash/source/mpd/PlaybackRate.h | 44 +++ .../libdash/source/mpd/RepresentationBase.cpp | 51 ++- .../libdash/source/mpd/RepresentationBase.h | 16 + .../libdash/source/mpd/ServiceDescription.cpp | 80 +++++ .../libdash/source/mpd/ServiceDescription.h | 61 ++++ libdash/libdash/source/mpd/UIntPairs.cpp | 38 +++ libdash/libdash/source/mpd/UIntPairs.h | 44 +++ .../libdash/source/mpd/UIntPairsWithID.cpp | 46 +++ libdash/libdash/source/mpd/UIntPairsWithID.h | 46 +++ libdash/libdash/source/xml/Node.cpp | 311 ++++++++++++++++++ libdash/libdash/source/xml/Node.h | 19 ++ 49 files changed, 2340 insertions(+), 23 deletions(-) create mode 100644 libdash/libdash/include/ILabel.h create mode 100644 libdash/libdash/include/ILatency.h create mode 100644 libdash/libdash/include/ILeapSecondInformation.h create mode 100644 libdash/libdash/include/IOperatingBandwidth.h create mode 100644 libdash/libdash/include/IOperatingQuality.h create mode 100644 libdash/libdash/include/IPatchLocation.h create mode 100644 libdash/libdash/include/IPlaybackRate.h create mode 100644 libdash/libdash/include/IServiceDescription.h create mode 100644 libdash/libdash/include/IUIntPairs.h create mode 100644 libdash/libdash/include/IUIntPairsWithID.h create mode 100644 libdash/libdash/source/mpd/Label.cpp create mode 100644 libdash/libdash/source/mpd/Label.h create mode 100644 libdash/libdash/source/mpd/Latency.cpp create mode 100644 libdash/libdash/source/mpd/Latency.h create mode 100644 libdash/libdash/source/mpd/LeapSecondInformation.cpp create mode 100644 libdash/libdash/source/mpd/LeapSecondInformation.h create mode 100644 libdash/libdash/source/mpd/OperatingBandwidth.cpp create mode 100644 libdash/libdash/source/mpd/OperatingBandwidth.h create mode 100644 libdash/libdash/source/mpd/OperatingQuality.cpp create mode 100644 libdash/libdash/source/mpd/OperatingQuality.h create mode 100644 libdash/libdash/source/mpd/PatchLocation.cpp create mode 100644 libdash/libdash/source/mpd/PatchLocation.h create mode 100644 libdash/libdash/source/mpd/PlaybackRate.cpp create mode 100644 libdash/libdash/source/mpd/PlaybackRate.h create mode 100644 libdash/libdash/source/mpd/ServiceDescription.cpp create mode 100644 libdash/libdash/source/mpd/ServiceDescription.h create mode 100644 libdash/libdash/source/mpd/UIntPairs.cpp create mode 100644 libdash/libdash/source/mpd/UIntPairs.h create mode 100644 libdash/libdash/source/mpd/UIntPairsWithID.cpp create mode 100644 libdash/libdash/source/mpd/UIntPairsWithID.h diff --git a/libdash/libdash/include/IAdaptationSet.h b/libdash/libdash/include/IAdaptationSet.h index fbed5dd0..8fb3d3e5 100644 --- a/libdash/libdash/include/IAdaptationSet.h +++ b/libdash/libdash/include/IAdaptationSet.h @@ -377,10 +377,10 @@ namespace dash virtual bool GetBitstreamSwitching () const = 0; /** - * Returns a reference to a string that specifies the reference initialization set defined as a whitespace-separated list of unsigned integers. - * @return a reference to a string + * Returns a reference to a vector of unsigned integers that specifies the reference initialization set defined as a whitespace-separated list of unsigned integers. + * @return a reference to a vector of unsigned integers */ - virtual const std::string& GetInitializationSetRef () const = 0; + virtual const std::vector& GetInitializationSetRef () const = 0; }; } diff --git a/libdash/libdash/include/IEvent.h b/libdash/libdash/include/IEvent.h index e719466e..be39a0a2 100644 --- a/libdash/libdash/include/IEvent.h +++ b/libdash/libdash/include/IEvent.h @@ -18,8 +18,8 @@ * @date 2021 */ -#ifndef IEvent_H_ -#define IEvent_H_ +#ifndef IEVENT_H_ +#define IEVENT_H_ #include "config.h" @@ -86,4 +86,4 @@ namespace dash } } -#endif /* IEvent_H_ */ \ No newline at end of file +#endif /* IEVENT_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IEventStream.h b/libdash/libdash/include/IEventStream.h index 66f0c78d..21d73187 100644 --- a/libdash/libdash/include/IEventStream.h +++ b/libdash/libdash/include/IEventStream.h @@ -38,7 +38,7 @@ namespace dash * * @return a pointer to a vector of dash::mpd::Event objects */ - virtual std::vector& GetEvents () const = 0; + virtual const std::vector& GetEvents () const = 0; /** * Returns a reference to a string that specifies a reference to an external EventStream element. diff --git a/libdash/libdash/include/ILabel.h b/libdash/libdash/include/ILabel.h new file mode 100644 index 00000000..dde43288 --- /dev/null +++ b/libdash/libdash/include/ILabel.h @@ -0,0 +1,60 @@ +/** + * @class dash::mpd::ILabel + * @brief This interface is needed for accessing the attributes of Label + * as specified in ISO/IEC 23009-1, subclause 5.3.10.2, Table 23-24. + * @details Labels provide the ability to annotate data structures in a DASH Media Presentation by providing a short textual description of the parent element. + * Labels can be used for the purpose of interaction and configuration settings within a DASH Client or associated application. + * For example, the Label element can be used to provide a selection menu to the user. GroupLabel may be added on a higher level to provide a summary or title of labels collected in a group. + * For example, GroupLabel can be used as the title on a selection menu containing a collection of labels. Labels with the same value for the \c @id attribute belong to a label group. + * All labels with the same \c @id shall be on the same level in the MPD. The \c @lang attribute assigned to a label describes the language of that label. + * For example, the \c @lang attribute can be used by the DASH Client to filter labels according to user language preferences. + * The semantics of the label element and the group label element are provided in Table 23 and Table 24, respectively, in subclause 5.3.10.2, the XML syntax is provided in subclause 5.3.10.3. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ILABEL_H_ +#define ILABEL_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class ILabel : public virtual IMPDElement + { + public: + virtual ~ILabel(){} + + /** + * For Label: + * Returns an integer that specifies an identifier for the label. Labels with the same value for this attribute belong to a label group. + * + * For GroupLabel: + * Returns an integer that specifies an identifier for the group label. The value for this attribute shall be unique for all group labels in the MPD. + * The value of this attribute shall be the same as the id attribute of all Label elements in the label group. + * + * @return an unsigned integer + */ + virtual uint32_t GetId () const = 0; + + /** + * Returns a reference to a string that specifies the language of the label. + * If not present, the language of the label is unknown. + * + * @return a reference to a string + */ + virtual const std::string& GetLang () const = 0; + + }; + } +} + +#endif /* ILABEL_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/ILatency.h b/libdash/libdash/include/ILatency.h new file mode 100644 index 00000000..cdcc43f3 --- /dev/null +++ b/libdash/libdash/include/ILatency.h @@ -0,0 +1,72 @@ +/** + * @class dash::mpd::ILatency + * @brief This interface is needed for accessing the attributes and elements of Latency + * as specified in ISO/IEC 23009-1, subclause K.3.2. + * @details Table K.1 defines the service description parameters for the service latency + * @see dash::mpd::IMPDElement dash::mpd::IUIntPairsWithID + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ILATENCY_H_ +#define ILATENCY_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IUIntPairsWithID.h" + +namespace dash +{ + namespace mpd + { + class ILatency : public virtual IMPDElement + { + public: + virtual ~ILatency(){} + + /** + * Returns a reference to a vector of pointers to dash::mpd::IUIntPairsWithID objects that define a list of latency and quality pairs together with the quality type. + * + * @return a reference to a vector of pointers to dash::mpd::IUIntPairsWithID objects + */ + virtual const std::vector& GetQualityLatencyType () const = 0; + + /** + * Returns an unsigned integer that defines the ID of the Producer Reference Time element in the MPD against which the latency is measured, if more than one is present. + * + * @return an unsigned integer + */ + virtual uint32_t GetReferenceId () const = 0; + + /** + * Returns an unsigned integer that specifies the service provider’s preferred presentation latency in milliseconds compared to the producer reference time. + * Indicates a content provider’s desire for the content to be presented as close to the indicated latency as is possible given the player’s capabilities and observations. \n + * This attribute may express a latency that is only achievable by low-latency players under favourable network conditions. + * + * @return an unsigned integer + */ + virtual uint32_t GetTarget () const = 0; + + /** + * Returns an unsigned integer that specifies the service provider’s indication about the maximum presentation latency in milliseconds. + * Indicates a content provider’s desire for the content not to be presented if the latency exceeds the maximum latency. + * + * @return an unsigned integer + */ + virtual uint32_t GetMax () const = 0; + + /** + * Returns an unsigned integer that specifies the service provider’s indication about minimum presentation latency in milliseconds for example to avoid inconsistencies with second screen applications, overlays, etc. + * + * @return an unsigned integer + */ + virtual uint32_t GetMin () const = 0; + }; + } +} + +#endif /* ILATENCY_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/ILeapSecondInformation.h b/libdash/libdash/include/ILeapSecondInformation.h new file mode 100644 index 00000000..3f2b8421 --- /dev/null +++ b/libdash/libdash/include/ILeapSecondInformation.h @@ -0,0 +1,70 @@ +/** + * @class dash::mpd::ILeapSecondInformation + * @brief This interface is needed for accessing the attributes of LeapSecondInformation + * as specified in ISO/IEC 23009-1, subclause 5.13.2, Table 42. + * @details Information on the occurrence of leap seconds and their relationship with \cMPD\b@availabilityStartTime can be expressed using the \b LeapSecondInformation element.\n + * This information allows a client to perform time calculations accurately without an external source of information on the timing of past and future leap seconds. + * It also allows a service provider to express any correction for leap seconds that has already been made.\n + * With this information, a client may perform timing calculations by assuming a constant day length of 86400 seconds if it first applies the relevant offset from the \b LeapSecondInformation element to the value of the \bMPD\c@availabilityStartTime attribute. + * The client can then correctly play a Media Presentation for which \bMPD\c@type is 'dynamic' when leap seconds have occurred since the time of \bMPD\c@availabilityStartTime and even when leap seconds occur during playback.\n + * The offset specified in \c @availabilityStartLeapOffset applies if the current time is before \c @nextLeapChangeTime. \c @nextAvailabilityStartLeapOffset applies if the current time is equal to or after \c @nextLeapChangeTime, but its use may need to be delayed if the client’s internal wall-clock has not yet processed the leap second.\n + * \b NOTE 1 If a particular client’s wall-clock is synchronized solely by means of a one-shot protocol, e.g. using the scheme \c urn:mpeg:dash:utc:http-xsdate:2014 defined in subclause 5.8.5.7, the value of \c @availabilityStartLeapOffset remains appropriate for that client until its clock is next synchronized after the leap second has occurred. \n + * \b NOTE 2 Leap seconds can occur at any of four possible times each year and can add or remove a second from the UTC timeline. Whilst leap seconds always occur immediately before midnight UTC, they can occur during the day in other time zones. + * Even within the Greenwich Mean Time (GMT) zone, the most common time for a leap second has been 23:59:60 on New Year's Eve, when many people may be watching live video streams. It is therefore important that leap seconds are handled correctly.\n + * Some operating systems allow leap seconds to be handled by "smearing" the leap second over a longer period of time. Care should be taken to ensure that availability times in a published MPD are not affected by this.\n + * The semantics of the attributes within the \b LeapSecondInformation element are provided in subclause 5.13.2, Table 42. The XML syntax of the \b LeapSecondInformation element is provided in subclause 5.13.3. of ISO/IEC 23009-1. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ILEAPSECONDINFORMATION_H_ +#define ILEAPSECONDINFORMATION_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class ILeapSecondInformation : public virtual IMPDElement + { + public: + virtual ~ILeapSecondInformation(){} + + /** + * Returns an integer that specifies the number of seconds applying at the time of MPD publication that a client would need to subtract + * from \bMPD\c@availabilityStartTime in order to perform timing calculations without further consideration of leap seconds.\n + * If a leap second correction has already been applied, the \b LeapSecondInformation element should still be present but this attribute should be set to 0. + * + * @return an integer + */ + virtual int32_t GetAvailabilityStartLeapOffset () const = 0; + + /** + * Returns an integer that specifies the number of seconds that will apply from the time of the next leap second (indicated by the \c @nextLeapChangeTime) + * that a client would need to subtract from \bMPD\c@availabilityStartTime in order to perform timing calculations without further consideration of leap seconds.\n + * If the timing of the next leap second is unknown, this attribute shall be omitted. + * + * @return an integer + */ + virtual int32_t GetNextAvailabilityStartLeapOffset () const = 0; + + /** + * Returns a reference to a string that specifies the UTC time at which a leap second will occur. Before this time, \c @availabilityStartLeapOffset applies. + * On or after this time, \c @nextAvailabilityStartLeapOffset applies for timing calculations made against a wall-clock that has processed the leap second.\n + * If the timing of the next leap second is unknown, this attribute shall be omitted. + * + * @return a reference to a string + */ + virtual const std::string& GetNextLeapChangeTime () const = 0; + }; + } +} + +#endif /* ILEAPSECONDINFORMATION_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IMPD.h b/libdash/libdash/include/IMPD.h index 46428408..440cd0f9 100644 --- a/libdash/libdash/include/IMPD.h +++ b/libdash/libdash/include/IMPD.h @@ -17,8 +17,8 @@ * Representations may also include Sub-Representations as defined in 5.3.6 to describe and extract partial information from a Representation. *
  • Each Segment consists of one or more Subsegments. Subsegments are described in 6.2.3.2. * - * @see dash::mpd::IMPDElement dash::mpd::IProgramInformation dash::mpd::IBaseUrl dash::mpd::IPeriod dash::mpd::IMetrics - * dash::mpd::IRepresentationBase + * @see dash::mpd::IMPDElement dash::mpd::IProgramInformation dash::mpd::IBaseUrl dash::mpd::IDescriptor dash::mpd::IPeriod dash::mpd::IMetrics + * dash::mpd::IRepresentationBase dash::mpd::IServiceDescription dash::mpd::ILeapSecondInformation dash::mpd::IPatchLocation * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -40,9 +40,13 @@ #include "IMPDElement.h" #include "IProgramInformation.h" #include "IBaseUrl.h" +#include "IDescriptor.h" #include "IPeriod.h" #include "IMetrics.h" #include "IDASHMetrics.h" +#include "IServiceDescription.h" +#include "ILeapSecondInformation.h" +#include "IPatchLocation.h" namespace dash { @@ -73,6 +77,20 @@ namespace dash * @return a reference to a vector of strings */ virtual const std::vector& GetLocations () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IPatchLocation objects that specify patches url locations and ttls. \n + * @return a reference to a vector of pointers to dash::mpd::IPatchLocation objects + */ + virtual const std::vector& GetPatchLocations () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IServiceDescription objects that specify the service descriptions. + * For more details refer to the description in section K.4.1 of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects + */ + virtual const std::vector& GetServiceDescriptions () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IPeriod objects that specify the information of a Period.\n @@ -82,11 +100,46 @@ namespace dash virtual const std::vector& GetPeriods () const = 0; /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about the containing element that is considered + * essential by the Media Presentation author for processing the containing element. \n + * For details, see subclause 5.8.4.8. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetEssentialProperties () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify supplemental information about the containing element + * that may be used by the DASH Client optimizing the processing. \n + * For details, see subclause 5.8.4.9. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetSupplementalProperties () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on ways to obtain a synchronization to wall-clock time + * as used in this Media Presentation. The order of the elements expresses a preference of choice by the Media Presentation author. \n + * For more details, refer to subclause 5.8.4.11. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetUTCTimings () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IMetrics objects that specify the DASH Metrics.\n * For more details see section 5.9. of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IPeriod objects */ virtual const std::vector& GetMetrics () const = 0; + + /** + * Returns a reference to a dash::mpd::ILeapSecondInformation object that specifies leap second information affecting MPD timing calculations.\n + * For details, refer to clause 5.13. of ISO/IEC 23009-1. + * + * @return a reference to a dash::mpd::ILeapSecondInformation object + */ + virtual const ILeapSecondInformation * GetLeapSecondInformation () const = 0; /** * Returns a reference to a string that specifies an identifier for the Media Presentation. It is recommended to use an identifier that is unique within diff --git a/libdash/libdash/include/IOperatingBandwidth.h b/libdash/libdash/include/IOperatingBandwidth.h new file mode 100644 index 00000000..0dc88544 --- /dev/null +++ b/libdash/libdash/include/IOperatingBandwidth.h @@ -0,0 +1,71 @@ +/** + * @class dash::mpd::IOperatingBandwidth + * @brief This interface is needed for accessing the attributes of OperatingBandwidth + * as specified in ISO/IEC 23009-1, subclause K.3.5. + * @details Table K.4 defines the service description parameters for operating bandwidth. + * The keys in Table K.4 shall be used to refer to the operating bandwidth as defined in Table K.3. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IOPERATINGBANDWIDTH_H_ +#define IOPERATINGBANDWIDTH_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IOperatingBandwidth : public virtual IMPDElement + { + public: + virtual ~IOperatingBandwidth(){} + + /** + * Returns a reference to a string that defines the media type for which the bandwidth parameters apply. They type can be: + *
      + *
    • \c video: applies to video + *
    • \c audio: applies to audio + *
    • \c any: applies to any media type individually + *
    • \c all: applies to aggregation of all media types + *
    + * + * @return a reference to a string + */ + virtual const std::string& GetMediaType () const = 0; + + /** + * Returns an unsigned integer that specifies the minimum bandwidth value desired through this presentation for the above MediaType. + * This is the smallest desired aggregated value for the \c @bandwidth attribute for all Representations of this media type to be played concurrently by the DASH Client during regular playback. + * + * @return an unsigned integer + */ + virtual uint32_t GetMin () const = 0; + + /** + * Returns an unsigned integer that specifies the maximum bandwidth value desired through this presentation for the above MediaType. + * This is the largest desired aggregated value for the \c @bandwidth attribute for all Representations of this media type to be played concurrently by the DASH Client during regular playback. + * + * @return an unsigned integer + */ + virtual uint32_t GetMax () const = 0; + + /** + * Returns an unsigned integer that specifies the target bandwidth value desired through this presentation for the above MediaType. + * This is the largest desired aggregated value for the \c @bandwidth attribute for all Representations of this media type to be played concurrently by the DASH Client during regular playback. + * + * @return an unsigned integer + */ + virtual uint32_t GetTarget () const = 0; + }; + } +} + +#endif /* IOPERATINGBANDWIDTH_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IOperatingQuality.h b/libdash/libdash/include/IOperatingQuality.h new file mode 100644 index 00000000..79fc1df6 --- /dev/null +++ b/libdash/libdash/include/IOperatingQuality.h @@ -0,0 +1,87 @@ +/** + * @class dash::mpd::IOperatingQuality + * @brief This interface is needed for accessing the attributes of OperatingQuality + * as specified in ISO/IEC 23009-1, subclause K.3.4. + * @details Table K.3 defines the service description parameters for operational quality. + * The keys in Table K.3 shall be used to refer to the operating quality as defined in Table K.3. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IOPERATINGQUALITY_H_ +#define IOPERATINGQUALITY_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IOperatingQuality : public virtual IMPDElement + { + public: + virtual ~IOperatingQuality(){} + + /** + * Returns a reference to a string that defines the media type for which these quality parameters apply. They type can be + *
      + *
    • \c video: applies to video + *
    • \c audio: applies to audio + *
    • \c any: applies to any media type + *
    + * + * @return a reference to a string + */ + virtual const std::string& GetMediaType () const = 0; + + /** + * Returns an unsigned integer that specifies the minimum quality ranking value desired through this presentation for the above MediaType. + * This is the largest desired value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. + * + * @return an unsigned integer + */ + virtual uint32_t GetMin () const = 0; + + /** + * Returns an unsigned integer that specifies the maximum quality ranking value desired through this presentation for the above MediaType. + * This is the largest desired value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. + * + * @return an unsigned integer + */ + virtual uint32_t GetMax () const = 0; + + /** + * Returns an unsigned integer that specifies the quality ranking value desired through this presentation for the above MediaType. + * This is the target value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. + * + * @return an unsigned integer + */ + virtual uint32_t GetTarget () const = 0; + + /** + * Returns a reference to a string that defines the interpretation of the value of \c @qualityRanking attribute. + * If not present, the quality is considered in linear scale. + * + * @return a reference to a string + */ + virtual const std::string& GetType () const = 0; + + /** + * Returns an unsigned integer that specifies the maximum quality difference value recommended by the content author for the presentation for the above MediaType. + * This is the recommended maximum difference between \c @qualityRanking attributes for Representations being played concurrently. + * This is typically applicable for Representations that are picked from Adaptation Sets within one Preselection. + * + * @return an unsigned integer + */ + virtual uint32_t GetMaxDifference () const = 0; + }; + } +} + +#endif /* IOPERATINGQUALITY_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IPatchLocation.h b/libdash/libdash/include/IPatchLocation.h new file mode 100644 index 00000000..7c65f7b4 --- /dev/null +++ b/libdash/libdash/include/IPatchLocation.h @@ -0,0 +1,46 @@ +/** + * @class dash::mpd::IPatchLocation + * @brief This interface is needed for accessing the attributes of PatchLocation. + * @details + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IPATCHLOCATION_H_ +#define IPATCHLOCATION_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IPatchLocation : public virtual IMPDElement + { + public: + virtual ~IPatchLocation(){} + + /** + * Returns a reference to a string that specifies... + * + * @return a reference to a string + */ + virtual const std::string& GetUrl () const = 0; + + /** + * Returns an integer that specifies... + * + * @return an unsigned integer + */ + virtual uint32_t GetTtl () const = 0; + }; + } +} + +#endif /* IPATCHLOCATION_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index c4697def..eacb64a2 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -28,7 +28,7 @@ * representing an Early Available Period in later updates of the MPD as long as no \em PeriodStart time is associated with the Period. \n\n * To avoid dereferencing of a remote element containing a Period element solely to determine the Period timeline, e.g. in case of seeking, * Period\@start or previous Period's Period\@duration should be present in the MPD. - * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISegmentBase dash::mpd::IEventStream dash::mpd::ISubset + * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISegmentBase dash::mpd::IDescriptor dash::mpd::ILabel dash::mpd::IEventStream dash::mpd::ISubset * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -52,7 +52,10 @@ #include "ISegmentBase.h" #include "ISegmentList.h" #include "ISegmentTemplate.h" +#include "IDescriptor.h" +#include "ILabel.h" #include "IEventStream.h" +#include "IServiceDescription.h" #include "IAdaptationSet.h" #include "ISubset.h" @@ -96,12 +99,28 @@ namespace dash */ virtual ISegmentTemplate* GetSegmentTemplate () const = 0; + /** + * Returns a pointer to a dash::mpd::IDescriptor object that specifies that this Period belongs to a certain asset. \n + * For more details, see subclause 5.8.5.7. of ISO/IEC 23009-1. + * + * @return a pointer to a dash::mpd::IDescriptor object + */ + virtual const IDescriptor * GetAssetIdentifier () const = 0; + /** * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n * For more details see section 5.10.2. of ISO/IEC 23009-1. * @return a reference to a vector of pointers to dash::mpd::IEventStream objects */ virtual const std::vector& GetEventStreams () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IServiceDescription objects that specify the service descriptions. + * For more details refer to the description in section K.4.1 of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects + */ + virtual const std::vector& GetServiceDescriptions () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IAdaptationSet objects that specify Adapatation Sets.\n @@ -117,6 +136,23 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::ISubset objects */ virtual const std::vector& GetSubsets () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify supplemental information about the containing element + * that may be used by the DASH Client optimizing the processing. \n + * For details, see subclause 5.8.4.9. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetSupplementalProperties () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify summary labels for a group of Labels. + * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::ILabel objects + */ + virtual const std::vector& GetGroupLabels () const = 0; /** * Returns a reference to a string that specifies a reference to an external Period element. diff --git a/libdash/libdash/include/IPlaybackRate.h b/libdash/libdash/include/IPlaybackRate.h new file mode 100644 index 00000000..d0587cf2 --- /dev/null +++ b/libdash/libdash/include/IPlaybackRate.h @@ -0,0 +1,50 @@ +/** + * @class dash::mpd::IPlaybackRate + * @brief This interface is needed for accessing the attributes of PlaybackRate + * as specified in ISO/IEC 23009-1, subclause K.3.3. + * @details Table K.2 defines the service description parameters for non-nominal playback rate. + * The keys in Table K.2 shall be used to refer to the non-nominal playback rate as defined in Table K.2. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IPLAYBACKRATE_H_ +#define IPLAYBACKRATE_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IPlaybackRate : public virtual IMPDElement + { + public: + virtual ~IPlaybackRate(){} + + /** + * Returns a double that specifies the maximum playback rate that the content provider indicates is appropriate for the purposes of automatically adjusting + * playback latency and buffer occupancy during normal playback, where 1.0 is normal playback speed. + * + * @return a double + */ + virtual double GetMax () const = 0; + + /** + * Returns a double that specifies the minimum playback rate that the content provider indicates is appropriate for the purposes of automatically adjusting + * playback latency and buffer occupancy during normal playback, where 1.0 is normal playback speed. + * + * @return a double + */ + virtual double GetMin () const = 0; + }; + } +} + +#endif /* IPLAYBACKRATE_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index 57c53458..77d6519f 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -3,7 +3,7 @@ * @brief This interface is needed for accessing the common attributes and elements of the certain MPD element as specified in ISO/IEC 23009-1, Part 1, 2012, section 5.3.7 * @details The elements \c AdaptationSet, \c Representation and \c SubRepresentation have assigned common attributes and elements that are specified in * ISO/IEC 23009-1, Part 1, 2012, section 5.3.7.2, table 9 - * @see dash::mpd::IDescriptor dash::mpd::IEventStream dash::mpd::IMPDElement + * @see dash::mpd::IDescriptor dash::mpd::IEventStream dash::mpd::ILabel dash::mpd::IMPDElement * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -25,6 +25,7 @@ #include "IMPDElement.h" #include "IDescriptor.h" #include "IEventStream.h" +#include "ILabel.h" namespace dash { @@ -57,12 +58,54 @@ namespace dash */ virtual const std::vector& GetContentProtection () const = 0; + /** + * Returns a pointer to a dash::mpd::IDescriptor object that specifies information about the output protection schemes used for the associated Representations.\n + * For further details see sections 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1, Part 1, 2012. + * + * @return a pointer to a dash::mpd::IDescriptor object + */ + virtual const IDescriptor * GetOutputProtection () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about the containing element that is considered + * essential by the Media Presentation author for processing the containing element. \n + * For details, see subclause 5.8.4.8. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetEssentialProperties () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify supplemental information about the containing element + * that may be used by the DASH Client optimizing the processing. \n + * For details, see subclause 5.8.4.9. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetSupplementalProperties () const = 0; + /** * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n * For more details see section 5.10.2. of ISO/IEC 23009-1. * @return a reference to a vector of pointers to dash::mpd::IEventStream objects */ virtual const std::vector& GetEventStreams () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify summary labels for a group of Labels. + * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::ILabel objects + */ + virtual const std::vector& GetGroupLabels () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify textual descriptions of the elements that may be used for annotation and selection purposes. + * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::ILabel objects + */ + virtual const std::vector& GetLabels () const = 0; /** * Returns a reference to a vector of strings that specifies the profiles which the associated Representation(s) diff --git a/libdash/libdash/include/IServiceDescription.h b/libdash/libdash/include/IServiceDescription.h new file mode 100644 index 00000000..165c3f4a --- /dev/null +++ b/libdash/libdash/include/IServiceDescription.h @@ -0,0 +1,91 @@ +/** + * @class dash::mpd::IServiceDescription + * @brief This interface is needed for accessing the attributes and elements of ServiceDescription + * as specified in ISO/IEC 23009-1, subclause K.4.2.1, Table K.5. + * @details The service description may be scoped to a specific client or to an operational mode of the client. This can be expressed by using a Scope descriptor that is defined by the application. \n + * It is the service provider's responsibility to ensure that the service description is not contradicting in itself and can be used by clients, for example minimum, target and maximum latency should be in non decreasing order. + * Service descriptions with inconsistent or unachievable settings are expected to be ignored by the client. \n + * The semantics of the attributes and elements within a \b ServiceDescription element are provided in subclause K.4.2.1, Table K.5. The XML syntax of the \b ServiceDescription element is provided in subclause K.4.3. + * @see dash::mpd::IMPDElement dash::mpd::IDescriptor dash::mpd::ILatency dash::mpd::IPlaybackRate dash::mpd::IOperatingQuality dash::mpd::IOperatingBandwidth + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ISERVICEDESCRIPTION_H_ +#define ISERVICEDESCRIPTION_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IDescriptor.h" +#include "ILatency.h" +#include "IPlaybackRate.h" +#include "IOperatingQuality.h" +#include "IOperatingBandwidth.h" + +namespace dash +{ + namespace mpd + { + class IServiceDescription : public virtual IMPDElement + { + public: + virtual ~IServiceDescription(){} + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify the scopes of the Service Description. + * If present, this Service Description only targets DASH Clients identified by this Scope descriptor. + * DASH Clients not in scope, i.e. not recognizing any of the scope descriptor elements, are expected to ignore this service description. + * If no Scope element is present, the Service Description applies to all clients. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetScope () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::ILatency objects that specify the latency targets for the service. + * The details are provided in subclause K.4.2.2, Table K.6. + * + * @return a reference to a vector of pointers to dash::mpd::ILatency objects + */ + virtual const std::vector& GetLatency () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IPlaybackRate objects that specify the playback rate targets for the service. + * The details are provided in subclause K.4.2.3, Table K.7. + * + * @return a reference to a vector of pointers to dash::mpd::IPlaybackRate objects + */ + virtual const std::vector& GetPlaybackRate () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IOperatingQuality objects that specify the operating quality targets for the service. + * The details are provided in subclause K.4.2.4, Table K.8. + * + * @return a reference to a vector of pointers to dash::mpd::IOperatingQuality objects + */ + virtual const std::vector& GetOperatingQuality () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IOperatingBandwidth objects that specify the operating bandwidth targets for the service. + * The details are provided in subclause K.4.2.5, Table K.9. + * + * @return a reference to a vector of pointers to dash::mpd::IOperatingBandwidth objects + */ + virtual const std::vector& GetOperatingBandwidth () const = 0; + + /** + * Returns an unsigned integer that specifies a unique identifier for this Service Description. + * The attribute shall be a unique unsigned integer value amongst \b ServiceDescription elements in the scope of the MPD. + * + * @return an unsigned integer + */ + virtual uint32_t GetId () const = 0; + }; + } +} + +#endif /* ISERVICEDESCRIPTION_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IUIntPairs.h b/libdash/libdash/include/IUIntPairs.h new file mode 100644 index 00000000..d65b34e8 --- /dev/null +++ b/libdash/libdash/include/IUIntPairs.h @@ -0,0 +1,47 @@ +/** + * @class dash::mpd::IUIntPairs + * @brief This interface is needed for accessing the attributes of the utility class UIntPairs + * @details Utility class to define the quality of the latency service, as specified in ISO/IEC 23009-1, subclause K.3.2. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IUINTPAIRS_H_ +#define IUINTPAIRS_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IUIntPairs : public virtual IMPDElement + { + public: + virtual ~IUIntPairs(){} + + /** + * Returns an unsigned integer that specifies a latency value for the service in milliseconds. + * + * @return an unsigned integer + */ + virtual uint32_t GetLatency () const = 0; + + /** + * Returns an unsigned integer that specifies the quality of the service at the above latency with 0 being the lowest and 100 being the highest. + * + * @return an unsigned integer + */ + virtual uint32_t GetQuality () const = 0; + + }; + } +} + +#endif /* IUINTPAIRS_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IUIntPairsWithID.h b/libdash/libdash/include/IUIntPairsWithID.h new file mode 100644 index 00000000..16315d8e --- /dev/null +++ b/libdash/libdash/include/IUIntPairsWithID.h @@ -0,0 +1,49 @@ +/** + * @class dash::mpd::IUIntPairsWithID + * @brief This interface is needed for accessing the attributes of the utility class UIntPairsWithID + * @details Utility class to define the quality of the latency service, as specified in ISO/IEC 23009-1, subclause K.3.2. + * @see dash::mpd::IMPDElement dash::mpd::IUIntPairs + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IUINTPAIRSWITHID_H_ +#define IUINTPAIRSWITHID_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IUIntPairs.h" + +namespace dash +{ + namespace mpd + { + class IUIntPairsWithID : public virtual IMPDElement + { + public: + virtual ~IUIntPairsWithID(){} + + /** + * Returns a reference to a vector of pointers to dash::mpd::IUIntPairs objects that define a list of latency and quality pairs. + * + * @return a reference to a vector of pointers to dash::mpd::IUIntPairs objects + */ + virtual const std::vector& GetQualityLatency () const = 0; + + /** + * Returns a reference to a string that defines defines the interpretation of the value of Quality. + * If not present, the quality is considered in linear scale. + * + * @return a reference to a string + */ + virtual const std::string& GetType () const = 0; + + }; + } +} + +#endif /* IUINTPAIRSWITHID_H_ */ \ No newline at end of file diff --git a/libdash/libdash/source/mpd/AdaptationSet.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index be3c4e57..ba0aa3b0 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -43,8 +43,7 @@ AdaptationSet::AdaptationSet () : usesSubsegmentAlignment(false), segmentAlignment(0), subsegmentAlignment(0), - isBitstreamSwitching(false), - initializationSetRef("") + isBitstreamSwitching(false) { } AdaptationSet::~AdaptationSet () @@ -363,11 +362,11 @@ void AdaptationSet::SetBitstreamSwitching { this->isBitstreamSwitching = value; } -const std::string& AdaptationSet::GetInitializationSetRef () const +const std::vector& AdaptationSet::GetInitializationSetRef () const { return this->initializationSetRef; } void AdaptationSet::SetInitializationSetRef (const std::string& initializationSetRef) { - this->initializationSetRef = initializationSetRef; + dash::helpers::String::Split(initializationSetRef, ' ', this->initializationSetRef); } \ No newline at end of file diff --git a/libdash/libdash/source/mpd/AdaptationSet.h b/libdash/libdash/source/mpd/AdaptationSet.h index 1dcde3e5..87bee894 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -71,7 +71,7 @@ namespace dash uint32_t GetSubsegmentAlignment () const; uint8_t GetSubsegmentStartsWithSAP () const; bool GetBitstreamSwitching () const; - const std::string& GetInitializationSetRef () const; + const std::vector& GetInitializationSetRef () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -142,7 +142,7 @@ namespace dash uint32_t subsegmentAlignment; uint8_t subsegmentStartsWithSAP; bool isBitstreamSwitching; - std::string initializationSetRef; + std::vector initializationSetRef; }; } } diff --git a/libdash/libdash/source/mpd/Event.h b/libdash/libdash/source/mpd/Event.h index d9dd999b..3ca30d78 100644 --- a/libdash/libdash/source/mpd/Event.h +++ b/libdash/libdash/source/mpd/Event.h @@ -9,8 +9,8 @@ * and conditions of the applicable license agreement. *****************************************************************************/ -#ifndef Event_H_ -#define Event_H_ +#ifndef EVENT_H_ +#define EVENT_H_ #include "config.h" @@ -50,4 +50,4 @@ namespace dash } } -#endif /* IEvent_H_ */ +#endif /* IEVENT_H_ */ diff --git a/libdash/libdash/source/mpd/EventStream.cpp b/libdash/libdash/source/mpd/EventStream.cpp index fd4bcfb5..d9fc6df7 100644 --- a/libdash/libdash/source/mpd/EventStream.cpp +++ b/libdash/libdash/source/mpd/EventStream.cpp @@ -27,7 +27,7 @@ EventStream::~EventStream () delete(this->events.at(i)); } -std::vector& EventStream::GetEvents () const +const std::vector& EventStream::GetEvents () const { return (std::vector &) this->events; } diff --git a/libdash/libdash/source/mpd/EventStream.h b/libdash/libdash/source/mpd/EventStream.h index b6666248..c57505e7 100644 --- a/libdash/libdash/source/mpd/EventStream.h +++ b/libdash/libdash/source/mpd/EventStream.h @@ -28,7 +28,7 @@ namespace dash EventStream (); virtual ~EventStream (); - std::vector& GetEvents () const; + const std::vector& GetEvents () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; const std::string& GetSchemeIdUri () const; diff --git a/libdash/libdash/source/mpd/Label.cpp b/libdash/libdash/source/mpd/Label.cpp new file mode 100644 index 00000000..13463514 --- /dev/null +++ b/libdash/libdash/source/mpd/Label.cpp @@ -0,0 +1,40 @@ +/* + * Label.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "Label.h" + +using namespace dash::mpd; + +Label::Label () : + id(0) + +{ +} +Label::~Label () +{ +} + +uint32_t Label::GetId () const +{ + return this->id; +} +void Label::SetId (uint32_t id) +{ + this->id = id; +} +const std::string& Label::GetLang () const +{ + return this->lang; +} +void Label::SetLang (const std::string& lang) +{ + this->lang = lang; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Label.h b/libdash/libdash/source/mpd/Label.h new file mode 100644 index 00000000..afddb3ef --- /dev/null +++ b/libdash/libdash/source/mpd/Label.h @@ -0,0 +1,45 @@ +/* + * Label.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef LABEL_H_ +#define LABEL_H_ + +#include "config.h" + +#include "ILabel.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class Label : public ILabel, public AbstractMPDElement + { + public: + Label (); + virtual ~Label (); + + uint32_t GetId () const; + const std::string& GetLang () const; + + + void SetId (uint32_t id); + void SetLang (const std::string& lang); + + private: + uint32_t id; + std::string lang; + + }; + } +} + +#endif /* ILABEL_H_ */ diff --git a/libdash/libdash/source/mpd/Latency.cpp b/libdash/libdash/source/mpd/Latency.cpp new file mode 100644 index 00000000..6c8d41cc --- /dev/null +++ b/libdash/libdash/source/mpd/Latency.cpp @@ -0,0 +1,64 @@ +/* + * Latency.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "Latency.h" + +using namespace dash::mpd; + +Latency::Latency () +{ +} +Latency::~Latency () +{ + for (size_t i=0; i < this->qltpairs.size(); i++) + delete(this->qltpairs.at(i)); +} + +const std::vector& Latency::GetQualityLatencyType () const +{ + return (std::vector &) this->qltpairs; +} +void Latency::AddQualityLatencyType (UIntPairsWithID* qlt) +{ + this->qltpairs.push_back(qlt); +} +uint32_t Latency::GetReferenceId () const +{ + return this->referenceId; +} +void Latency::SetReferenceId (uint32_t referenceId) +{ + this->referenceId = referenceId; +} +uint32_t Latency::GetTarget () const +{ + return this->target; +} +void Latency::SetTarget (uint32_t target) +{ + this->target = target; +} +uint32_t Latency::GetMax () const +{ + return this->max; +} +void Latency::SetMax (uint32_t max) +{ + this->max = max; +} +uint32_t Latency::GetMin () const +{ + return this->min; +} +void Latency::SetMin (uint32_t min) +{ + this->min = min; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Latency.h b/libdash/libdash/source/mpd/Latency.h new file mode 100644 index 00000000..ec312fb7 --- /dev/null +++ b/libdash/libdash/source/mpd/Latency.h @@ -0,0 +1,54 @@ +/* + * Latency.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef LATENCY_H_ +#define LATENCY_H_ + +#include "config.h" + +#include "ILatency.h" +#include "UIntPairsWithID.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class Latency : public ILatency, public AbstractMPDElement + { + public: + Latency (); + virtual ~Latency (); + + const std::vector& GetQualityLatencyType () const; + uint32_t GetReferenceId () const; + uint32_t GetTarget () const; + uint32_t GetMax () const; + uint32_t GetMin () const; + + void AddQualityLatencyType (UIntPairsWithID* qlt); + void SetReferenceId (uint32_t referenceId); + void SetTarget (uint32_t target); + void SetMax (uint32_t max); + void SetMin (uint32_t min); + + private: + std::vector qltpairs; + uint32_t referenceId; + uint32_t target; + uint32_t max; + uint32_t min; + + }; + } +} + +#endif /* LATENCY_H_ */ diff --git a/libdash/libdash/source/mpd/LeapSecondInformation.cpp b/libdash/libdash/source/mpd/LeapSecondInformation.cpp new file mode 100644 index 00000000..1f931129 --- /dev/null +++ b/libdash/libdash/source/mpd/LeapSecondInformation.cpp @@ -0,0 +1,48 @@ +/* + * LeapSecondInformation.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "LeapSecondInformation.h" + +using namespace dash::mpd; + +LeapSecondInformation::LeapSecondInformation () : + availabilityStartLeapOffset(0) + +{ +} +LeapSecondInformation::~LeapSecondInformation () +{ +} + +int32_t LeapSecondInformation::GetAvailabilityStartLeapOffset () const +{ + return this->availabilityStartLeapOffset; +} +void LeapSecondInformation::SetAvailabilityStartLeapOffset (int32_t availabilityStartLeapOffset) +{ + this->availabilityStartLeapOffset = availabilityStartLeapOffset; +} +int32_t LeapSecondInformation::GetNextAvailabilityStartLeapOffset () const +{ + return this->nextAvailabilityStartLeapOffset; +} +void LeapSecondInformation::SetNextAvailabilityStartLeapOffset (int32_t nextAvailabilityStartLeapOffset) +{ + this->nextAvailabilityStartLeapOffset = nextAvailabilityStartLeapOffset; +} +const std::string& LeapSecondInformation::GetNextLeapChangeTime () const +{ + return this->nextLeapChangeTime; +} +void LeapSecondInformation::SetNextLeapChangeTime (const std::string& nextLeapChangeTime) +{ + this->nextLeapChangeTime = nextLeapChangeTime; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/LeapSecondInformation.h b/libdash/libdash/source/mpd/LeapSecondInformation.h new file mode 100644 index 00000000..2517ce16 --- /dev/null +++ b/libdash/libdash/source/mpd/LeapSecondInformation.h @@ -0,0 +1,47 @@ +/* + * LeapSecondInformation.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef LEAPSECONDINFORMATION_H_ +#define LEAPSECONDINFORMATION_H_ + +#include "config.h" + +#include "ILeapSecondInformation.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class LeapSecondInformation : public ILeapSecondInformation, public AbstractMPDElement + { + public: + LeapSecondInformation (); + virtual ~LeapSecondInformation (); + + int32_t GetAvailabilityStartLeapOffset () const; + int32_t GetNextAvailabilityStartLeapOffset () const; + const std::string& GetNextLeapChangeTime () const; + + void SetAvailabilityStartLeapOffset (int32_t availabilityStartLeapOffset); + void SetNextAvailabilityStartLeapOffset (int32_t nextAvailabilityStartLeapOffset); + void SetNextLeapChangeTime (const std::string& nextLeapChangeTime); + + private: + int32_t availabilityStartLeapOffset; + int32_t nextAvailabilityStartLeapOffset; + std::string nextLeapChangeTime; + + }; + } +} + +#endif /* LEAPSECONDINFORMATION_H_ */ diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index 3417275d..18a88d01 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -18,6 +18,7 @@ using namespace dash::mpd; using namespace dash::metrics; MPD::MPD () : + leapSecondInformation(NULL), id(""), type("static"), availabilityStarttime(""), @@ -39,12 +40,22 @@ MPD::~MPD () 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->essentialProperties.size(); i++) + delete(this->essentialProperties.at(i)); + for(size_t i = 0; i < this->supplementalProperties.size(); i++) + delete(this->supplementalProperties.at(i)); + for(size_t i = 0; i < this->utcTimings.size(); i++) + delete(this->utcTimings.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)); + for(size_t i = 0; i < this->serviceDescriptions.size(); i++) + delete(this->serviceDescriptions.at(i)); if (this->mpdPathBaseUrl) delete(this->mpdPathBaseUrl); + + delete(leapSecondInformation); } const std::vector& MPD::GetProgramInformations () const @@ -71,6 +82,22 @@ void MPD::AddLocation { this->locations.push_back(location); } +const std::vector& MPD::GetPatchLocations () const +{ + return (std::vector &) this->patchLocations; +} +void MPD::AddPatchLocation (PatchLocation *patchLocation) +{ + this->patchLocations.push_back(patchLocation); +} +const std::vector& MPD::GetServiceDescriptions () const +{ + return (std::vector &) this->serviceDescriptions; +} +void MPD::AddServiceDescription (ServiceDescription *serviceDescription) +{ + this->serviceDescriptions.push_back(serviceDescription); +} const std::vector& MPD::GetPeriods () const { return (std::vector &) this->periods; @@ -87,6 +114,38 @@ void MPD::AddMetrics { this->metrics.push_back(metrics); } +const std::vector& MPD::GetEssentialProperties () const +{ + return (std::vector &) this->essentialProperties; +} +void MPD::AddEssentialProperty (Descriptor *essentialProperty) +{ + this->essentialProperties.push_back(essentialProperty); +} +const std::vector& MPD::GetSupplementalProperties () const +{ + return (std::vector &) this->supplementalProperties; +} +void MPD::AddSupplementalProperty (Descriptor *supplementalProperty) +{ + this->supplementalProperties.push_back(supplementalProperty); +} +const std::vector& MPD::GetUTCTimings () const +{ + return (std::vector &) this->utcTimings; +} +void MPD::AddUTCTiming (Descriptor *utcTiming) +{ + this->utcTimings.push_back(utcTiming); +} +const ILeapSecondInformation * MPD::GetLeapSecondInformation () const +{ + return this->leapSecondInformation; +} +void MPD::SetLeapSecondInformation (LeapSecondInformation *leapSecondInformation) +{ + this->leapSecondInformation = leapSecondInformation; +} const std::string& MPD::GetId () const { return this->id; diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index 40791151..9eafc74b 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -20,9 +20,13 @@ #include "IMPD.h" #include "ProgramInformation.h" #include "BaseUrl.h" +#include "Descriptor.h" #include "Period.h" #include "Metrics.h" #include "AbstractMPDElement.h" +#include "ServiceDescription.h" +#include "LeapSecondInformation.h" +#include "PatchLocation.h" #include "../metrics/HTTPTransaction.h" #include "../metrics/TCPConnection.h" @@ -39,8 +43,14 @@ namespace dash const std::vector& GetProgramInformations () const; const std::vector& GetBaseUrls () const; const std::vector& GetLocations () const; + const std::vector& GetPatchLocations () const; + const std::vector& GetServiceDescriptions () const; const std::vector& GetPeriods () const; const std::vector& GetMetrics () const; + const std::vector& GetEssentialProperties () const; + const std::vector& GetSupplementalProperties () const; + const std::vector& GetUTCTimings () const; + const ILeapSecondInformation * GetLeapSecondInformation () const; const std::string& GetId () const; const std::vector& GetProfiles () const; const std::string& GetType () const; @@ -65,8 +75,14 @@ namespace dash void AddProgramInformation (ProgramInformation *programInformation); void AddBaseUrl (BaseUrl *url); void AddLocation (const std::string& location); + void AddPatchLocation (PatchLocation *patchLocation); + void AddServiceDescription (ServiceDescription* serviceDescription); void AddPeriod (Period *period); void AddMetrics (Metrics *metrics); + void AddEssentialProperty (Descriptor *essentialProperty); + void AddSupplementalProperty (Descriptor *supplementalProperty); + void AddUTCTiming (Descriptor *utcTiming); + void SetLeapSecondInformation (LeapSecondInformation *leapSecondInformation); void SetId (const std::string& id); void SetProfiles (const std::string& profiles); void SetType (const std::string& type); @@ -87,8 +103,14 @@ namespace dash std::vector programInformations; std::vector baseUrls; std::vector locations; + std::vector patchLocations; + std::vector serviceDescriptions; std::vector periods; std::vector metrics; + std::vector essentialProperties; + std::vector supplementalProperties; + std::vector utcTimings; + LeapSecondInformation *leapSecondInformation; std::string id; std::vector profiles; std::string type; diff --git a/libdash/libdash/source/mpd/OperatingBandwidth.cpp b/libdash/libdash/source/mpd/OperatingBandwidth.cpp new file mode 100644 index 00000000..d2f4b369 --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingBandwidth.cpp @@ -0,0 +1,55 @@ +/* + * OperatingBandwidth.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "OperatingBandwidth.h" + +using namespace dash::mpd; + +OperatingBandwidth::OperatingBandwidth () : + mediaType("all") +{ +} +OperatingBandwidth::~OperatingBandwidth () +{ +} + +const std::string& OperatingBandwidth::GetMediaType () const +{ + return this->mediaType; +} +void OperatingBandwidth::SetMediaType (const std::string& mediaType) +{ + this->mediaType = mediaType; +} +uint32_t OperatingBandwidth::GetMin () const +{ + return this->min; +} +void OperatingBandwidth::SetMin (uint32_t min) +{ + this->min = min; +} +uint32_t OperatingBandwidth::GetMax () const +{ + return this->max; +} +void OperatingBandwidth::SetMax (uint32_t max) +{ + this->max = max; +} +uint32_t OperatingBandwidth::GetTarget () const +{ + return this->target; +} +void OperatingBandwidth::SetTarget (uint32_t target) +{ + this->target = target; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/OperatingBandwidth.h b/libdash/libdash/source/mpd/OperatingBandwidth.h new file mode 100644 index 00000000..f8a9b9bf --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingBandwidth.h @@ -0,0 +1,50 @@ +/* + * OperatingBandwidth.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef OPERATINGBANDWIDTH_H_ +#define OPERATINGBANDWIDTH_H_ + +#include "config.h" + +#include "IOperatingBandwidth.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class OperatingBandwidth : public IOperatingBandwidth, public AbstractMPDElement + { + public: + OperatingBandwidth (); + virtual ~OperatingBandwidth (); + + const std::string& GetMediaType () const; + uint32_t GetMin () const; + uint32_t GetMax () const; + uint32_t GetTarget () const; + + void SetMediaType (const std::string& mediaType); + void SetMin (uint32_t min); + void SetMax (uint32_t max); + void SetTarget (uint32_t target); + + private: + std::string mediaType; + uint32_t min; + uint32_t max; + uint32_t target; + + }; + } +} + +#endif /* OPERATINGBANDWIDTH_H_ */ diff --git a/libdash/libdash/source/mpd/OperatingQuality.cpp b/libdash/libdash/source/mpd/OperatingQuality.cpp new file mode 100644 index 00000000..3bddb869 --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingQuality.cpp @@ -0,0 +1,71 @@ +/* + * OperatingQuality.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "OperatingQuality.h" + +using namespace dash::mpd; + +OperatingQuality::OperatingQuality () : + mediaType("any") +{ +} +OperatingQuality::~OperatingQuality () +{ +} + +const std::string& OperatingQuality::GetMediaType () const +{ + return this->mediaType; +} +void OperatingQuality::SetMediaType (const std::string& mediaType) +{ + this->mediaType = mediaType; +} +uint32_t OperatingQuality::GetMin () const +{ + return this->min; +} +void OperatingQuality::SetMin (uint32_t min) +{ + this->min = min; +} +uint32_t OperatingQuality::GetMax () const +{ + return this->max; +} +void OperatingQuality::SetMax (uint32_t max) +{ + this->max = max; +} +uint32_t OperatingQuality::GetTarget () const +{ + return this->target; +} +void OperatingQuality::SetTarget (uint32_t target) +{ + this->target = target; +} +const std::string& OperatingQuality::GetType () const +{ + return this->type; +} +void OperatingQuality::SetType (const std::string& type) +{ + this->type = type; +} +uint32_t OperatingQuality::GetMaxDifference () const +{ + return this->maxDifference; +} +void OperatingQuality::SetMaxDifference (uint32_t maxDifference) +{ + this->maxDifference = maxDifference; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/OperatingQuality.h b/libdash/libdash/source/mpd/OperatingQuality.h new file mode 100644 index 00000000..deab2f42 --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingQuality.h @@ -0,0 +1,56 @@ +/* + * OperatingQuality.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef OPERATINGQUALITY_H_ +#define OPERATINGQUALITY_H_ + +#include "config.h" + +#include "IOperatingQuality.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class OperatingQuality : public IOperatingQuality, public AbstractMPDElement + { + public: + OperatingQuality (); + virtual ~OperatingQuality (); + + const std::string& GetMediaType () const; + uint32_t GetMin () const; + uint32_t GetMax () const; + uint32_t GetTarget () const; + const std::string& GetType () const; + uint32_t GetMaxDifference () const; + + void SetMediaType (const std::string& mediaType); + void SetMin (uint32_t min); + void SetMax (uint32_t max); + void SetTarget (uint32_t target); + void SetType (const std::string& type); + void SetMaxDifference (uint32_t maxDifference); + + private: + std::string mediaType; + uint32_t min; + uint32_t max; + uint32_t target; + std::string type; + uint32_t maxDifference; + + }; + } +} + +#endif /* OPERATINGQUALITY_H_ */ diff --git a/libdash/libdash/source/mpd/PatchLocation.cpp b/libdash/libdash/source/mpd/PatchLocation.cpp new file mode 100644 index 00000000..c40ec619 --- /dev/null +++ b/libdash/libdash/source/mpd/PatchLocation.cpp @@ -0,0 +1,41 @@ +/* + * PatchLocation.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "PatchLocation.h" + +using namespace dash::mpd; + +PatchLocation::PatchLocation () : + url(""), + ttl(0) + +{ +} +PatchLocation::~PatchLocation () +{ +} + +const std::string& PatchLocation::GetUrl () const +{ + return this->url; +} +void PatchLocation::SetUrl (const std::string& url) +{ + this->url = url; +} +uint32_t PatchLocation::GetTtl () const +{ + return this->ttl; +} +void PatchLocation::SetTtl (uint32_t ttl) +{ + this->ttl = ttl; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/PatchLocation.h b/libdash/libdash/source/mpd/PatchLocation.h new file mode 100644 index 00000000..fa10c73b --- /dev/null +++ b/libdash/libdash/source/mpd/PatchLocation.h @@ -0,0 +1,44 @@ +/* + * PatchLocation.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef PATCHLOCATION_H_ +#define PATCHLOCATION_H_ + +#include "config.h" + +#include "IPatchLocation.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class PatchLocation : public IPatchLocation, public AbstractMPDElement + { + public: + PatchLocation (); + virtual ~PatchLocation (); + + const std::string& GetUrl () const; + uint32_t GetTtl () const; + + void SetUrl (const std::string& url); + void SetTtl (uint32_t ttl); + + private: + std::string url; + uint32_t ttl; + + }; + } +} + +#endif /* PATCHLOCATION_H_ */ \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index 0a0d6840..e2bd6a7a 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -20,6 +20,7 @@ Period::Period () : segmentBase(NULL), segmentList(NULL), segmentTemplate(NULL), + assetIdentifier(NULL), xlinkActuate("onRequest"), xlinkHref(""), xlinkType("simple"), @@ -38,11 +39,18 @@ Period::~Period () delete(this->adaptationSets.at(i)); for(size_t i = 0; i < this->subsets.size(); i++) delete(this->subsets.at(i)); + for(size_t i = 0; i < this->supplementalProperties.size(); i++) + delete(this->supplementalProperties.at(i)); + for(size_t i = 0; i < this->groupLabels.size(); i++) + delete(this->groupLabels.at(i)); for(size_t i = 0; i < this->eventStreams.size(); i++) delete(this->eventStreams.at(i)); + for(size_t i = 0; i < this->serviceDescriptions.size(); i++) + delete(this->serviceDescriptions.at(i)); delete(segmentBase); delete(segmentList); delete(segmentTemplate); + delete(assetIdentifier); } const std::vector& Period::GetBaseURLs () const @@ -77,6 +85,14 @@ void Period::SetSegmentTemplate (SegmentTemp { this->segmentTemplate = segmentTemplate; } +const IDescriptor* Period::GetAssetIdentifier () const +{ + return this->assetIdentifier; +} +void Period::SetAssetIdentifier (Descriptor *assetIdentifier) +{ + this->assetIdentifier = assetIdentifier; +} const std::vector& Period::GetEventStreams () const { return (std::vector &) this->eventStreams; @@ -85,6 +101,14 @@ void Period::AddEventStream (EventStream { this->eventStreams.push_back(eventStream); } +const std::vector& Period::GetServiceDescriptions () const +{ + return (std::vector &) this->serviceDescriptions; +} +void Period::AddServiceDescription (ServiceDescription *serviceDescription) +{ + this->serviceDescriptions.push_back(serviceDescription); +} const std::vector& Period::GetAdaptationSets () const { return (std::vector &) this->adaptationSets; @@ -102,6 +126,22 @@ void Period::AddSubset (Subset *sub { this->subsets.push_back(subset); } +const std::vector& Period::GetSupplementalProperties () const +{ + return (std::vector &) this->supplementalProperties; +} +void Period::AddSupplementalProperty (Descriptor *supplementalProperty) +{ + this->supplementalProperties.push_back(supplementalProperty); +} +const std::vector& Period::GetGroupLabels () const +{ + return (std::vector &) this->groupLabels; +} +void Period::AddGroupLabel (Label *groupLabel) +{ + this->groupLabels.push_back(groupLabel); +} const std::string& Period::GetXlinkHref () const { return this->xlinkHref; diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index 9f66f73c..d9b6b3ae 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -24,7 +24,10 @@ #include "SegmentBase.h" #include "SegmentList.h" #include "SegmentTemplate.h" +#include "Descriptor.h" +#include "Label.h" #include "EventStream.h" +#include "ServiceDescription.h" #include "AbstractMPDElement.h" namespace dash @@ -41,9 +44,13 @@ namespace dash ISegmentBase* GetSegmentBase () const; ISegmentList* GetSegmentList () const; ISegmentTemplate* GetSegmentTemplate () const; + const IDescriptor * GetAssetIdentifier () const; const std::vector& GetEventStreams () const; + const std::vector& GetServiceDescriptions () const; const std::vector& GetAdaptationSets () const; const std::vector& GetSubsets () const; + const std::vector& GetSupplementalProperties () const; + const std::vector& GetGroupLabels () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; const std::string& GetXlinkType () const; @@ -57,9 +64,13 @@ namespace dash void SetSegmentBase (SegmentBase *segmentBase); void SetSegmentList (SegmentList *segmentList); void SetSegmentTemplate (SegmentTemplate *segmentTemplate); + void SetAssetIdentifier (Descriptor *assetIdentifier); void AddEventStream (EventStream *eventStream); + void AddServiceDescription (ServiceDescription* serviceDescription); void AddAdaptationSet (AdaptationSet *AdaptationSet); void AddSubset (Subset *subset); + void AddSupplementalProperty (Descriptor *supplementalProperty); + void AddGroupLabel (Label *groupLabel); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); void SetXlinkType (const std::string& xlinkType); @@ -74,9 +85,13 @@ namespace dash SegmentBase *segmentBase; SegmentList *segmentList; SegmentTemplate *segmentTemplate; + Descriptor *assetIdentifier; std::vector eventStreams; + std::vector serviceDescriptions; std::vector adaptationSets; std::vector subsets; + std::vector supplementalProperties; + std::vector
  • Each Segment consists of one or more Subsegments. Subsegments are described in 6.2.3.2. * * @see dash::mpd::IMPDElement dash::mpd::IProgramInformation dash::mpd::IBaseUrl dash::mpd::IDescriptor dash::mpd::IPeriod dash::mpd::IMetrics - * dash::mpd::IRepresentationBase dash::mpd::IServiceDescription dash::mpd::ILeapSecondInformation dash::mpd::IPatchLocation + * dash::mpd::IRepresentationBase dash::mpd::IServiceDescription dash::mpd::ILeapSecondInformation dash::mpd::IPatchLocation dash::mpd::IInitializationSet + * dash::mpd::IUIntVWithID * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -47,6 +48,8 @@ #include "IServiceDescription.h" #include "ILeapSecondInformation.h" #include "IPatchLocation.h" +#include "IInitializationSet.h" +#include "IUIntVWithID.h" namespace dash { @@ -79,7 +82,12 @@ namespace dash virtual const std::vector& GetLocations () const = 0; /** - * Returns a reference to a vector of pointers to dash::mpd::IPatchLocation objects that specify patches url locations and ttls. \n + * Returns a reference to a vector of pointers to dash::mpd::IPatchLocation objects that specify a location at which the MPD patch document is available. Details on the MPD patch document, this element, and expected processing models are available in subclause 5.15. of ISO/IEC 23009-1. \n + * If this element is present, the MPD@id attribute and the MPD@publishTime shall be present. \n + * When \c @type is 'static' or the \c @minimumUpdatePeriod attribute is not present, then value of the element is undefined and may be ignored. \n + * If this element is not present, no MPD patch document is available. \n + * If multiple elements are present, any PatchLocation element may be used. + * * @return a reference to a vector of pointers to dash::mpd::IPatchLocation objects */ virtual const std::vector& GetPatchLocations () const = 0; @@ -91,6 +99,32 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects */ virtual const std::vector& GetServiceDescriptions () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IInitializationSet objects that specify suitable initializations for specific media types for the presentation. + * For more details refer to the description in section 5.3.12.2, of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IInitializationSet objects + */ + virtual const std::vector& GetInitializationSets () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IUIntVWithID objects that specify white space separated lists of ids of Initialization Sets of the same content type. + * This indicates that any Period in the Media Presentation has at least one Adaptation Set that conforms to one of the Initialization Sets referenced in this element.\n + * For details, see subclause 5.3.12, of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IUIntVWithID objects + */ + virtual const std::vector& GetInitializationGroups () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IUIntVWithID objects that specify white space separated lists of ids of Initialization Sets and Initialization Groups to indicate a combination which creates a complete presentation.\n + * A client supporting all listed Initialization Sets and Initialization Groups of an Initialization Presentation is expected to be able to play the entire Media Presentation as intended by the service provider.\n + * For details, see subclause 5.3.12, of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IUIntVWithID objects + */ + virtual const std::vector& GetInitializationPresentations () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IPeriod objects that specify the information of a Period.\n @@ -98,6 +132,14 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IPeriod objects */ virtual const std::vector& GetPeriods () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IPeriod objects that specify the information of a Preroll.\n + * For more details refer to the description in section 5.3.2. of ISO/IEC 23009-1, Part 1, 2012. + * + * @return a reference to a vector of pointers to dash::mpd::IPeriod objects + */ + virtual const std::vector& GetPrerolls () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about the containing element that is considered diff --git a/libdash/libdash/include/IPatchLocation.h b/libdash/libdash/include/IPatchLocation.h index 7c65f7b4..7355eaa4 100644 --- a/libdash/libdash/include/IPatchLocation.h +++ b/libdash/libdash/include/IPatchLocation.h @@ -1,7 +1,8 @@ /** * @class dash::mpd::IPatchLocation * @brief This interface is needed for accessing the attributes of PatchLocation. - * @details + * @details An MPD may contain one or several PatchLocation elements to provide a location for an MPD patch document that may apply to the MPD including this element in order to generate an updated MPD.\n + * The semantics of the MPD patch location element are provided in Table 48 and the XML syntax is provided in Table 49 of ISO/IEC 23009-1. * @see dash::mpd::IMPDElement * * @author Daniele Lorenzi \n @@ -27,14 +28,16 @@ namespace dash virtual ~IPatchLocation(){} /** - * Returns a reference to a string that specifies... + * Returns a reference to a string that specifies a location at which the MPD patch is available. The referenced document shall conform to an MPD patch document as defined in subclause 5.15.3. of ISO/IEC 23009-1. * * @return a reference to a string */ virtual const std::string& GetUrl () const = 0; /** - * Returns an integer that specifies... + * Returns an unsigned integer that specifies the time period duration (in seconds) starting from MPD@publishTime until the MPD patch document is at least available at the indicated location above. For details refer to the processing model in subclause 5.14.4. of ISO/IEC 23009-1. \n + * If not present, the value is unknown. + * * @return an unsigned integer */ diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index eacb64a2..d16c0f00 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -28,7 +28,8 @@ * representing an Early Available Period in later updates of the MPD as long as no \em PeriodStart time is associated with the Period. \n\n * To avoid dereferencing of a remote element containing a Period element solely to determine the Period timeline, e.g. in case of seeking, * Period\@start or previous Period's Period\@duration should be present in the MPD. - * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISegmentBase dash::mpd::IDescriptor dash::mpd::ILabel dash::mpd::IEventStream dash::mpd::ISubset + * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISegmentBase + * dash::mpd::IDescriptor dash::mpd::ILabel dash::mpd::IEventStream dash::mpd::ISubset dash::mpd::IPreselection * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -58,6 +59,7 @@ #include "IServiceDescription.h" #include "IAdaptationSet.h" #include "ISubset.h" +#include "IPreselection.h" namespace dash { @@ -153,6 +155,15 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::ILabel objects */ virtual const std::vector& GetGroupLabels () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IPreselection objects that specify preselections, + * i.e. combinations of Adaptation Sets that form a specific experience and can be selected for joint decoding and rendering.\n + * For more details, refer to subclause 5.3.11. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IPreselection objects + */ + virtual const std::vector& GetPreselections () const = 0; /** * Returns a reference to a string that specifies a reference to an external Period element. diff --git a/libdash/libdash/include/IPopularityRate.h b/libdash/libdash/include/IPopularityRate.h new file mode 100644 index 00000000..3576ced5 --- /dev/null +++ b/libdash/libdash/include/IPopularityRate.h @@ -0,0 +1,65 @@ +/** + * @class dash::mpd::IPopularityRate + * @brief This interface is needed for accessing the common attributes of PR of 5.14.2., table 43 of ISO/IEC 23009-1 + * @details In the context of the \b ContentPopularityRate element, one or more PopularityRate elements are used to specify start time and number of segments for a contiguous sequence of segments assigned identical Popularity Rate value. + * For more details, see 5.14.2., table 43 of ISO/IEC 23009-1. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IPOPULARITYRATE_H_ +#define IPOPULARITYRATE_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IPopularityRate : public virtual IMPDElement + { + public: + virtual ~IPopularityRate(){} + + /** + * Returns an unsigned integer that indicates the relative Popularity Rate of the segments of containing entity (i.e. the Preselection or Adaptation Set containing this \b ContentPopularityRate element), + * within the same Media Presentation. No unit. The value shall be in the range of 1 to 100. + * A greater value means higher likelihood of the series of (Sub)Segments being consumed/requested. + * + * @return an unsigned integer + */ + virtual uint8_t GetPopularityRate () const = 0; + + /** + * Returns an unsigned integer that specifies the first Segment from which \c @popularityRate value of this \b PR element is relevant. + * If the addressing scheme for the containing entity is using Segment template with \c $Number$, then \c @popularityRate applies from the earliest presentation time of the Segment with the segment number specified by this attribute. + * For other addressing schemes, the value of \c @popularityRate applies from the Segment which contains the media sample whose presentation time specified by this attribute in unit of \c @timescale on Representation level. + * If not present, then it shall be assumed that \c @popularityRate applies from: + *
      + *
    • the first Segment of the containing Period, for the first \b PR element, + *
    • the Segment after the last Segment of the previous \b PR element, for other PR elements. + *
    + * + * @return an unsigned integer + */ + virtual uint32_t GetStart () const = 0; + + /** + * Returns an integer that specifies the number of segments after the segment indicated by \c @start which are included in this \b PR entry (i.e. the repeat count). + * A negative value indicates that the series continues until the segment before the first segment of the next \b PR element, or if there are no further \b PR elements until the end of the Period or the next MPD update. + * + * @return an integer + */ + virtual int32_t GetR () const = 0; + + }; + } +} + +#endif /* IPOPULARITYRATE_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IPreselection.h b/libdash/libdash/include/IPreselection.h new file mode 100644 index 00000000..802fb1e7 --- /dev/null +++ b/libdash/libdash/include/IPreselection.h @@ -0,0 +1,131 @@ +/** + * @class dash::mpd::IPreselection + * @brief This interface is needed for accessing the attributes of Preselection. + * @details Preselections define user experiences that can be selected by the DASH Client. Each Preselection is uniquely identifiable and distinguishable, e.g. by language. + * A Preselection encompasses a subset of media components such that the media components can be selected and combined into a complete experience.\n + * Preselections can be used to reference a set of Representations from multiple Adaptation Sets in order to produce a complete experience. + * Preselections can also be used to indicate a pre-defined experience at the elementary-stream level, i.e. the DASH Client can select a pre-defined experience and provides the selection to the media engine.\n + * Preselections may be uniquely identified by a Preselection Tag. Users/Codecs using this Tag functionality are encouraged to provide more information on how tags defined in the MPD map to functionality in the specific codec.\n + * Preselections have equivalent annotation parameters to Adaptation Sets and are always assigned exactly one media type.\n + * Media components can be mapped to Adaptation Sets in multiple ways: + *
      + *
    1. by a one-to-one mapping between media components and Adaptation Sets; + *
    2. by the inclusion of multiple media components in a single Adaptation Set where all encoded versions of the media components are multiplexed on the file-container level; + *
    3. by the inclusion of multiple media components in a single Adaptation Set where all encoded versions of the media components are multiplexed on the elementary-stream level. + *
    + * If the Adaptation Set contains a single media component, then the media component can be referenced by the \c @id of the Adaptation Set.\n + * If the Adaptation Set contains multiple media components multiplexed on the file-container level, then each media component is mapped to a Content Component as defined in 5.3.4. + * For example, in the ISO BMFF case, a Representation contains multiple tracks and each track is mapped to a Content Component. Therefore, media components can be referenced by the \b @id of an Adaptation Set or the \b @id of a Content Component. + * When Preselections reference Content Components, the \c @id of Adaptation Sets and Content Components shall be unique within the scope of a Period.\n + * If the Adaptation Set contains multiple media components multiplexed at the elementary-stream level, then a pre-defined experience is referenced by the Preselection. + * For example, in the ISO BMFF case, a Representation contains a single track of multiple media components that is referenced by the \b @id of the Adaptation Set. + * Multiple Preselections can reference the Adaptation Set and select a pre-defined experience by passing the Presentation Tag to the media engine along with the media stream.\n + * The Main Adaptation Set is the Adaptation Set that contains the Initialisation Segment for the complete experience. Each Preselection shall reference a Main Adaptation Set and may reference zero, one or more other Adaptation Sets.\n + * \b NOTE In the context of Preselection, the term "Main Adaptation Set" is used. This term is not to be confused with an Adaptation Set that has assigned the main Role.\n + * Within a Preselection, two types of Adaptation Sets are differentiated: + *
      + *
    • Main Adaptation Set: A Representation of this Adaptation Set is needed for playback of the Preselection. In particular for ISO BMFF, the Initialization Segment of such a Representation is needed for playback of the Preselection. + *
    • Partial Adaptation Set: A Representation of this Adaptation Set is only consumable together with the Main Adaptation Sets within this Preselection. Again, in particular for ISO BMFF, the Initialization Segment of a Representation of the Main Adaptation Set is needed for playback. + *
    + * Preselections, main Adaptation Set and partial Adaptation Sets may be defined by one of the two means: + *
      + *
    • A preselection descriptor as specified in subclause 5.3.11.2. Such a descriptor enables simple configurations and preserves backward compatibility but may not be suitable for advanced use cases. + *
    • A preselection element as specified in 5.3.11.3 and 5.3.11.4. The semantics of the Preselection element is provided in subclause 5.3.11.3 and the XML syntax is provided in 5.3.11.4. + *
    + * + * @see dash::mpd::IDescriptor + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IPRESELECTION_H_ +#define IPRESELECTION_H_ + +#include "config.h" + +#include "IDescriptor.h" +#include "IRepresentationBase.h" + +namespace dash +{ + namespace mpd + { + class IPreselection : public virtual IRepresentationBase + { + public: + virtual ~IPreselection(){} + + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about accessibility scheme.\n + * For more details refer to sections 5.8.1 and 5.8.4.3. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetAccessibility () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on role annotation scheme. + * For more details refer to sections 5.8.1 and 5.8.4.2. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetRole () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on rating scheme.\n + * For more details refer to sections 5.8.1 and 5.8.4.4. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetRating () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on viewpoint annotation scheme.\n + * For more details refer to sections 5.8.1 and 5.8.4.5. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + */ + virtual const std::vector& GetViewpoint () const = 0; + + /** + * Returns a reference to a string that specifies the id of the Preselection. This shall be unique within one Period. + * + * @return a reference to a string + */ + virtual const std::string& GetId () const = 0; + + /** + * Returns a reference to a vector of strings that specifies the ids of the contained Adaptation Sets or Content Components that belong to this Preselection + * as white space separated list in processing order. The first id defines the Main Adaptation Set. + * + * @return a reference to a vector of strings + */ + virtual const std::vector& GetPreselectionComponents () const = 0; + + /** + * Returns a reference to a string that specifies the language of the preselection as specified in in Table 5 for \c @lang attribute. + * + * @return a reference to a string + */ + virtual const std::string& GetLang () const = 0; + + /** + * Returns a reference to a string that specifies the conformance rules for Representations in Adaptation Sets within the Preselection.\n + * When set to 'undefined', the Preselection follows the conformance rules for Multi-Segment Tracks in subclause 5.3.11.5.1.\n + * When set to 'time-ordered', the Preselection follows the conformance rules for Time-Ordered Segment Tracks in subclause 5.3.11.5.2.\n + * When set to 'fully-ordered', the Preselection follows the conformance rules for Fully-Ordered Segment Tracks in subclause 5.3.11.5.3. + * In this case, order in the \c @preselectionComponents attribute specifies the component order. + * + * @return a reference to a string + */ + virtual const std::string& GetOrder () const = 0; + + }; + } +} + +#endif /* IPRESELECTION_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IProducerReferenceTime.h b/libdash/libdash/include/IProducerReferenceTime.h new file mode 100644 index 00000000..26984d68 --- /dev/null +++ b/libdash/libdash/include/IProducerReferenceTime.h @@ -0,0 +1,109 @@ +/** + * @class dash::mpd::IProducerReferenceTime + * @brief This interface is needed for accessing the common elements and attributes of ProducerReferenceTime + * @details The Producer Reference Time supplies media correlation between media timestamps and wall clock production time. + * This information permits the following, among others: + *
      + *
    • it provides media clients with information to enable consumption and production to proceed at equivalent rates, thus avoiding possible buffer overflow or underflow; + *
    • it enables measuring and potentially controlling the latency between the production of the media time and the playout. + *
    + * The definition follows the Producer Reference Time ('prft') as defined in ISO/IEC 14496-12.\n + * The information may be provided inband as part of the Segments in the ('prft'), in the MPD or both.\n + * The semantics of the attributes and elements for producer reference time are provided in subclause 5.12.2, Table 41. + * The XML syntax of the Producer Reference Time is provided in subclause 5.12.3. of ISO/IEC 23009-1. + * @see dash::mpd::IDescriptor dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IPRODUCERREFERENCETIME_H_ +#define IPRODUCERREFERENCETIME_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IDescriptor.h" + +namespace dash +{ + namespace mpd + { + class IProducerReferenceTime : public virtual IMPDElement + { + public: + virtual ~IProducerReferenceTime(){} + + /** + * Returns a pointer to a dash::mpd::IDescriptor object. + * If present, then the wall-clock times provided in this context are synchronized with the timing anchor provided in this descriptor. + * The same UTC Timing descriptor shall also be present in the MPD. + * + * @return a pointer to a dash::mpd::IDescriptor object + */ + virtual const IDescriptor * GetUTCTiming () const = 0; + + /** + * Returns an unsigned integer that identifies the Producer Reference Time documented in the MPD. + * + * @return an unsigned integer + */ + virtual uint32_t GetId () const = 0; + + /** + * Returns a bool value that signals if every segment or subsegment contains a 'prft' of the type below. + * If set to true, every segment or subsegment shall contain the 'prft' as defined in ISO/IEC 14496-12:—, + * subclause 8.16.5 and the flags set according to the \c @type attribute of this element. + * + * @return a bool value + */ + virtual bool IsInband () const = 0; + + /** + * Returns a reference to a string that specifies the type of the Producer Reference Time from the following list: + *
      + *
    • \c encoder provides a reference when the media time was input to an encoder following the exact definition in subclause 8.16.5 of ISO/IEC 14496-12 for flags set to 0. + *
    • \c captured provides a reference when the media time was captured following the exact definition in ISO/IEC 14496-12:—, subclause 8.16.5 for both flag 8 and flag 16 being set. + *
    • \c application provides a reference of the media time related to wall-clock time based on an application defined relation. In this case, following ISO/IEC 14496-12:—, subclause 8.16.5, flag 16 shall be set and flag 8 shall be unset. + *
    + * + * @return a reference to a string + */ + virtual const std::string& GetType () const = 0; + + /** + * Returns a reference to a string that specifies the application scheme to which the time conforms if \c @type is set to \b application.\n + * If the \c @type is set to \b application, this attribute should be present.\n + * If the \c @type is set other than \b application, this attribute shall not be present. + * + * @return a reference to a string + */ + virtual const std::string& GetApplicationScheme () const = 0; + + /** + * Returns a reference to a string that specifies a wall-clock time in the following format: + *
      + *
    • if \b UTCTiming element is absent, the NTP format associated to \c @media as defined in ISO/IEC 14496-12:—, 8.16.5 for \c ntp_timestamp; + *
    • if \b UTCTiming element is present, the format is identical to the format as defined in the UTC Timing scheme. + *
    + * If the MPD Generator extracts the information from the producer reference time box, the value needs to be converted to the correct scheme. + * + * @return a reference to a string + */ + virtual const std::string& GetWallClockTime () const = 0; + + /** + * Returns an unsigned integer that specifies a presentation time in timescale of the Representation that relates to the value of the \c @wallClockTime.\n + * \b NOTE If the data is extracted from the producer reference time box, then this value is derived by the \c media_time field. + * + * @return an unsigned integer + */ + virtual uint32_t GetPresentationTime () const = 0; + + }; + } +} + +#endif /* IPRODUCERREFERENCETIME_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IRandomAccess.h b/libdash/libdash/include/IRandomAccess.h new file mode 100644 index 00000000..ded639f9 --- /dev/null +++ b/libdash/libdash/include/IRandomAccess.h @@ -0,0 +1,72 @@ +/** + * @class dash::mpd::IRandomAccess + * @brief This interface is needed for accessing the common attributes of RandomAccess + * @details Random Access refers to start processing, decoding and presenting the Representation from the random access point at time t onwards by initializing the Representation with the Initialization Segment, if present and decoding and presenting the Representation from the signalled Segment onwards. + * Random Access point may be signalled with the \b RandomAccess element as defined in Table 10 of ISO/IEC 23009-1. Table 11 of ISO/IEC 23009-1 provides different random access point types. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IRANDOMACCESS_H_ +#define IRANDOMACCESS_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IRandomAccess : public virtual IMPDElement + { + public: + virtual ~IRandomAccess(){} + + /** + * Returns an unsigned integer that specifies the position of the random access points in the Representations. The information is specified in the scale of the \c @timescale on Representation level. + * Any Segment for which the MPD start time minus the \c @t value of the \b S element describing the segment is an integer multiple of the product of \c @timescale and \c @interval is a random access opportunity, i.e. it enables randomly access to this Representation with the random access strategy as defined by the \c @type value.\n + * The value should be chosen such that the resulting time matches MPD start time of segments, otherwise no random access will be described. + * + * @return an unsigned integer + */ + virtual uint32_t GetInterval () const = 0; + + /** + * Returns a reference to a string that specifies the random access strategy for the random access points in by the \c @interval attribute.\n + * The value shall use a type present in Table 11 of ISO/IEC 23009-1.\n + * If the value of the type is unknown, the DASH Client is expected to ignore the containing Random Access element. + * + * @return a reference to a string + */ + virtual const std::string& GetType () const = 0; + + /** + * Returns a reference to a string that specifies a common duration used in the definition of the Representation data rate (see \c @bandwidth attribute in subclauses 5.3.5.2 and 5.3.5.4 of ISO/IEC 23009-1).\n + * If not present, then the value of the MPD level is inherited. + * + * @return a reference to a string + */ + virtual const std::string& GetMinBufferTime () const = 0; + + /** + * Returns an unsigned integer that specifies a hypothetical constant bitrate channel of bandwidth with the value of this attribute in bits per second (bps). + * If the Representation is continuously delivered at this bitrate, starting at any RAP indicated in this element a client can be assured of having enough data for continuous playout providing playout begins after \c @minBufferTime * \c @bandwidth bits have been received + * (i.e. at time \c @minBufferTime after the first bit is received). \n + * For dependent Representations, this value specifies the bandwidth according to the above definition for the aggregation of this Representation and all complementary Representations.\n + * For details, see subclause 5.3.5.4. of ISO/IEC 23009-1.\n + * If not present, the value of the Representation is inherited. + * + * @return an unsigned integer + */ + virtual uint32_t GetBandwidth () const = 0; + + }; + } +} + +#endif /* IRANDOMACCESS_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index 77d6519f..3b4f6833 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -3,7 +3,8 @@ * @brief This interface is needed for accessing the common attributes and elements of the certain MPD element as specified in ISO/IEC 23009-1, Part 1, 2012, section 5.3.7 * @details The elements \c AdaptationSet, \c Representation and \c SubRepresentation have assigned common attributes and elements that are specified in * ISO/IEC 23009-1, Part 1, 2012, section 5.3.7.2, table 9 - * @see dash::mpd::IDescriptor dash::mpd::IEventStream dash::mpd::ILabel dash::mpd::IMPDElement + * @see dash::mpd::IDescriptor dash::mpd::IEventStream dash::mpd::ILabel dash::mpd::ISwitching dash::mpd::IContentPopularityRate + * dash::mpd::IProducerReferenceTime dash::mpd::IRandomAccess dash::mpd::IResync dash::mpd::IMPDElement * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -26,6 +27,11 @@ #include "IDescriptor.h" #include "IEventStream.h" #include "ILabel.h" +#include "ISwitching.h" +#include "IContentPopularityRate.h" +#include "IProducerReferenceTime.h" +#include "IRandomAccess.h" +#include "IResync.h" namespace dash { @@ -87,10 +93,29 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n * For more details see section 5.10.2. of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IEventStream objects */ virtual const std::vector& GetEventStreams () const = 0; + /** + * Returns a reference to a vector of pointers to dash::mpd::ISwitching objects, each of which specifies a switch-to times and types for the associated Representations.\n + * For more details, refer to subclause 5.3.3.4. of ISO/IEC 23009-1.\n + * These elements shall only be present if the \c @timescale value is the same for all Representations in one Adaptation Set and if the Segment Timeline is used for segment duration signalling. + * + * @return a reference to a vector of pointers to dash::mpd::ISwitching objects + */ + virtual const std::vector& GetSwitchings () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IRandomAccess objects, each of which specifies a random access times and types for the associated Representations. + * For more details, refer to subclause 5.3.5.5. of ISO/IEC 23009-1.\n + * These elements shall only be present if the \c @timescale value is the same for all Representations in one Adaptation Set and if the Segment Timeline is used for segment duration signalling. + * + * @return a reference to a vector of pointers to dash::mpd::IRandomAccess objects + */ + virtual const std::vector& GetRandomAccesses () const = 0; + /** * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify summary labels for a group of Labels. * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. @@ -106,6 +131,32 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::ILabel objects */ virtual const std::vector& GetLabels () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IContentPopularityRate objects that indicates a level of popularity of the containing entity (i.e., the Adaptation Set, Representation or Preselection) within the Media Presentation. + * For details, see subclause 5.14. of ISO/IEC 23009-1.\n + * \b NOTE This element is primarily introduced for the usage of Pre-Selections and Adaptation Sets but use for Representation and Sub-Representations is not precluded. + * + * @return a reference to a vector of pointers to dash::mpd::IContentPopularityRate objects + */ + virtual const std::vector& GetContentPopularityRates () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IProducerReferenceTime objects that specifies the presence and possibly values of producer reference time in the associated Representations. + * For details, refer to subclause 5.12. of ISO/IEC 23009-1. + * + * @return a reference to a vector of pointers to dash::mpd::IProducerReferenceTime objects + */ + virtual const std::vector& GetProducerReferenceTimes () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IResync objects that specifies information on Segments’ resynchronization points. \n + * For details refer to subclause 5.3.12. of ISO/IEC 23009-1. + + * + * @return a reference to a vector of pointers to dash::mpd::IResync objects + */ + virtual const std::vector& GetResyncs () const = 0; /** * Returns a reference to a vector of strings that specifies the profiles which the associated Representation(s) diff --git a/libdash/libdash/include/IResync.h b/libdash/libdash/include/IResync.h new file mode 100644 index 00000000..c01aa73a --- /dev/null +++ b/libdash/libdash/include/IResync.h @@ -0,0 +1,121 @@ +/** + * @class dash::mpd::IResync + * @brief This interface is needed for accessing the common attributes of Resync as specified in ISO/IEC 23009-1. + * @details In DASH context, in typical cases Segments are treated as a single unit for download, random access to Media Presentations, and they also addressed by a single URL. However, Segments may have internal structures that enable resynchronization on container level and random access to the respective Representation even within a Segment. The resynchronization mechanism is supported and signalled by the \b Resync element. \n + * The \b Resync element signals Resynchronization Points in Segments. A Resynchronization Point marks the start (in byte position) of a well-structured continuous byte range within a Segment that contains media data of certain presentation duration and can be accessed independently on container format level. A Resynchronization Point may provide additional functionalities, such as access on decryption and decoding level. \n + * A container format making use of the Resynchronization feature must define a Resynchronization Point and associated properties. \n + * A Resynchronization Point in a Segment is defined as follows: + *
      + *
    1. A Resynchronization Point enables to start parsing and processing on the container level. + *
    2. A Resync Point has assigned the following properties: + *
        + *
      • It has a byte offset or index \c Index from the start of the Segment, pointing to the Resynchronization Point. + *
      • It has an earliest presentation time \c Time in the Representation, i.e. the smallest presentation time of any sample included in the Representation when starting to process from the Resynchronization Pointer. + *
      • It has assigned a type \c Type, for example, defined by the SAP type in ISO/IEC 14496-12. + *
      • It has assigned a boolean marker property \c Marker whether the Resynchronization Point can be detected while parsing Segment through a specific structure or if the resync point needs to be signalled by external means. + *
      + *
    3. Starting to process the Segment from a Resynchronization Point, together with the information in the Initialization Segment, if present, allows container parsing. Whether and how to access the contained and potentially encrypted elementary stream may be indicated by the resynchronization access point type. + *
    + * Signalling each Resynchronization Point with all properties in the MPD can be done by providing a side-car Segment describing the Resynchronization Points in a Segment. However, not in all cases such side-car Segments may be provided, or at least provided in time. For example, in case of dynamic and live services, Resynchronization Points are added by the Segment packager independent of MPD updates. A Resynchronization Point may be generated by the encoder and packager independently from the MPD. Also, in low-latency cases, the MPD signalling may not be available to the DASH client. \n + * Hence, there are two non-mutually exclusive ways specified to signal Resync Points provided in a Segment in an MPD: + *
      + *
    1. By providing a binary map for each Resynchronization Point in a timed metadata track. This is most easily used for Segments that are fully available on the network. + *
    2. By signalling the existence of Resynchronization Points in a Media Segment with additional information that permits to easily locate the Resynchronization Points in terms of the byte position and the presentation time, as well as providing the type of the Resynchronization Point. + *
    + * In case the \b Resync element is present with \c @dImin and \c @dT attributes included and the adjusted values \c dImin in bytes and \c dT in seconds, respectively, and the \c @availabilityTimeComplete attribute set to false, then following shall hold: + *
      + *
    • At the adjusted availability start time of the Segment, the first chunk is available. + *
    • At the sum of the adjusted availability start time of the Segment and \c i*dT, the \c (i+1)st chunk is available with i=1, …, N and \c N the total amount of chunks in the Segment. + *
    • If the \c @rangeAccess on \b BaseURL attribute associated to the Representation is set to true, available chunks may be accessed with byte ranges. If set to false, the client should not expect a response corresponding to the requested byte range. + *
    + * In order to signal the above properties, a \b Resync element is defined with different attributes, that are explained in more detail in subclause 5.3.13.2, Table 28. The XML Syntax is provided in subclause 5.3.13.3 (of ISO/IEC 23009-1). + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IRESYNC_H_ +#define IRESYNC_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IResync : public virtual IMPDElement + { + public: + virtual ~IResync(){} + + /** + * Returns an unsigned integer that specifies the type of the Resync Point. \n + * If 0, specifies that on Segment format level the Resync Points present allow parsing and decryption to access the Segments, in combination with the Initialization Segment of the corresponding Representation (if present). \n + * For all Segment formats defined in this document, the following holds: \n + * If greater than 0, specifies that one or multiple Resync Points are present with the properties of \c @type=0 and the properties defined in the element in each corresponding Segment with SAP type being equal or smaller than the one indicated in the value. \n + * For details on SAP types, refer to subclause 4.5.2. of ISO/IEC 23009-1. + * + * @return an unsigned integer + */ + virtual uint32_t GetType () const = 0; + + /** + * Returns an unsigned integer that specifies the maximum difference of the Time values of any two consecutive Resynchronization Points that are included in the @type definition above in any Media Segment for this Representation. \n + * The value is expressed in scale of the \c @timescale of the corresponding Representation. \n + * If not present, the value is unknown. + * + * @return an unsigned integer + */ + virtual uint32_t GetDT () const = 0; + + /** + * Returns a float that specifies the maximum difference of the Index values of any two consecutive Resync Points that are included in the \c @type definition above in any Media Segment for this Representation normalized by the \c @bandwidth value of the Representation. \n + * To obtain the maximum difference in octets, the value of \c @dImax is multiplied with the \c @bandwidth value. \n + * If not present, the value is unknown. + * + * @return a float + */ + virtual float GetDIMax () const = 0; + + /** + * Returns a float that specifies the minimum difference of the Index values of any two consecutive Resynchronization Points that are included in the \c @type definition of this element in any Media Segment for this Representation normalized by the \c @bandwidth value of the Representation. \n + * To obtain the minimum difference in octets, the value of \c @dImin is multiplied with the \c @bandwidth value. \n + * If not present, the value is assumed to be 0. + * + * @return a float + */ + virtual float GetDIMin () const = 0; + + /** + * Returns a bool value that, if set to TRUE, specifies that every Resynchronization Point includes a specific marker for Resynchronization Point detection. \n + * If not present or FALSE, the presence of a marker for every signalled Resynchronization Point cannot be expected. \n + * Every Segment format making use of this functionality must specify a Resynchronization Marker. For details refer to the Segment formats in clause 5.15. of of ISO/IEC 23009-1. + * + * @return a bool value + */ + virtual bool HasMarker () const = 0; + + /** + * Returns a bool value that informs about the range access status. + * + * @return a bool value + */ + virtual bool HasRangeAccess () const = 0; + + /** + * Returns a reference to a string that specifies the index URI. + * + * @return a reference to a string + */ + virtual const std::string& GetIndex () const = 0; + + }; + } +} + +#endif /* IRESYNC_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/ISwitching.h b/libdash/libdash/include/ISwitching.h new file mode 100644 index 00000000..64e52a9b --- /dev/null +++ b/libdash/libdash/include/ISwitching.h @@ -0,0 +1,55 @@ +/** + * @class dash::mpd::ISwitching + * @brief This interface is needed for accessing the common attributes of Switching + * @details Switching refers to the presentation of decoded data from one Representation up to a certain time t, and presentation of decoded data of another Representation from time t onwards; + * for details, refer to subclause 4.3.\n + * The \b Switching element as defined in Table 6 provides instructions of switch points within an Adaptation Set and the permitted switching options as defined in Table 7. + * When this element is present, it signals opportunities for simple switching across Representations in one Adaptation Set. This element may be used instead of the attributes \c @segmentAlignment or \c @bitstreamSwitching.\n + * Table 7 defines different switching strategies that provide instructions to the client on the procedures to switch appropriately within an Adaptation Set. + * @see dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ISWITCHING_H_ +#define ISWITCHING_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class ISwitching : public virtual IMPDElement + { + public: + virtual ~ISwitching(){} + + /** + * Returns an unsigned integer that specifies the interval between two switching points in the scale of the \c @timescale on Representation level.\n + * Any Segment for which the earliest presentation time minus the \c @t value of the \b S element describing the segment is an integer multiple of the product of \c @timescale and \c @interval is a switch-to opportunity, + * i.e. it enables to switch to this Representation with the switching strategy as defined by the \c @type value.\n + * The value should be chosen such that the resulting time matches MPD start time of segments, otherwise no switching will be described. + * + * @return an unsigned integer + */ + virtual uint32_t GetInterval () const = 0; + + /** + * Returns a reference to a string that specifies the switching strategy for the switch points identified in by the \c @interval attribute.\n + * Switching strategies are defined in Table 7 of ISO/IEC 23009-1. + * + * @return a reference to a string + */ + virtual const std::string& GetType () const = 0; + + }; + } +} + +#endif /* ISWITCHING_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IUIntVWithID.h b/libdash/libdash/include/IUIntVWithID.h new file mode 100644 index 00000000..66ac435a --- /dev/null +++ b/libdash/libdash/include/IUIntVWithID.h @@ -0,0 +1,72 @@ +/** + * @class dash::mpd::IUIntVWithID + * @brief This interface is needed for accessing the attributes of InitializationGroup and InitializationPresentation. + * @details Initialization Group and Initialization Presentation signal the capabilities required for playback of the content as intended by the service provider.\n + * The \b InitializationGroup element lists the minimum requirements for playback of a media content type in all Periods of the Media Presentation. + * Any Period contained in the Media Presentation shall have at least one Adaptation Set that conforms to one of the Initialization Sets included in this Initialization Group. + * Therefore, a client supporting all listed Initialization Sets in one \c InitializationGroup element is expected to be able to play that media type during the entire Media Presentation.\n + * The \b InitializationPresentation element lists the minimum requirements for playback of a Media Presentation in all Periods. A client supporting all listed Initialization Sets and Groups of one Initialization Presentation is expected to be able to play the entire Media Presentation as intended by the service provider.\n + * An Initialization Group or Presentation may get assigned a specific profile using the \b @profiles parameter in order to express conformance to DASH Profiles or Interoperability Points. + * @see dash::mpd::IDescriptor + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IUINTVWITHID_H_ +#define IUINTVWITHID_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IUIntVWithID : public virtual IMPDElement + { + public: + virtual ~IUIntVWithID(){} + + + /** + * Returns a reference to a vector of unsigned integers that specifies the list of ids relative to the Initialization Set, Group or Presentation as specified in 5.3.12.4. of ISO/IEC 23009-1. + * + * @return a reference to a vector of unsigned integers + */ + virtual const std::vector& GetList () const = 0; + + /** + * Returns an unsigned integer that specifies a unique identifier for this \b InitializationGroup or \b InitializationPresentation element. + * The attribute shall be a unique unsigned integer value amongst all InitializationSet, InitializationGroup and InitializationPresentation ids in the scope of the MPD. + * + * @return an unsigned integer + */ + virtual uint32_t GetId () const = 0; + + /** + * Returns a reference to a vector of strings that specifies the profiles which the associated InitializationGroup(s) or InitializationPresentation(s) + * conform to of the list of Media Presentation profiles as described in section 8 of ISO/IEC 23009-1. + * The value shall be a subset of the respective value in any higher level of the document hierarchy and express conformance to DASH Profiles or Interoperability Points.\n + * The same syntax as defined in 5.3.1.2 shall be used. + * @return a reference to a vector of strings + */ + virtual const std::vector& GetProfiles () const = 0; + + /** + * Returns a reference to a string that specifies the media content component type for this Initialization Set. + * A value of the top-level Content-type 'type' value as defined in IETF RFC 6838:2013, Clause 4 shall be taken. \n + * If not present, the media content component type may be defined for each media component or it may be unknown. + * + * @return a reference to a string + */ + virtual const std::string& GetContentType () const = 0; + + }; + } +} + +#endif /* IUINTVWITHID_H_ */ \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ContentPopularityRate.cpp b/libdash/libdash/source/mpd/ContentPopularityRate.cpp new file mode 100644 index 00000000..ad78bd8e --- /dev/null +++ b/libdash/libdash/source/mpd/ContentPopularityRate.cpp @@ -0,0 +1,50 @@ +/* + * ContentPopularityRate.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "ContentPopularityRate.h" + +using namespace dash::mpd; + +ContentPopularityRate::ContentPopularityRate () : + source(""), + sourceDescription("") +{ +} +ContentPopularityRate::~ContentPopularityRate () +{ + for(size_t i = 0; i < this->popularityRates.size(); i++) + delete(this->popularityRates.at(i)); +} + +const std::vector& ContentPopularityRate::GetPopularityRates () const +{ + return (std::vector &) this->popularityRates; +} +void ContentPopularityRate::AddPopularityRate (PopularityRate *popularityRate) +{ + this->popularityRates.push_back(popularityRate); +} +const std::string& ContentPopularityRate::GetSource () const +{ + return this->source; +} +void ContentPopularityRate::SetSource (const std::string& source) +{ + this->source = source; +} +const std::string& ContentPopularityRate::GetSourceDescription () const +{ + return this->sourceDescription; +} +void ContentPopularityRate::SetSourceDescription (const std::string& sourceDescription) +{ + this->sourceDescription = sourceDescription; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ContentPopularityRate.h b/libdash/libdash/source/mpd/ContentPopularityRate.h new file mode 100644 index 00000000..b11d04c1 --- /dev/null +++ b/libdash/libdash/source/mpd/ContentPopularityRate.h @@ -0,0 +1,47 @@ +/* + * ContentPopularityRate.h + ***************************************************************************** * + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef CONTENTPOPULARITYRATE_H_ +#define CONTENTPOPULARITYRATE_H_ + +#include "config.h" + +#include "IContentPopularityRate.h" +#include "PopularityRate.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class ContentPopularityRate : public IContentPopularityRate, public AbstractMPDElement + { + public: + ContentPopularityRate (); + virtual ~ContentPopularityRate (); + + const std::vector& GetPopularityRates () const; + const std::string& GetSource () const; + const std::string& GetSourceDescription () const; + + void AddPopularityRate (PopularityRate *popularityRate); + void SetSource (const std::string& source); + void SetSourceDescription (const std::string& sourceDescription); + + private: + std::vector popularityRates; + std::string source; + std::string sourceDescription; + }; + } +} + +#endif /* CONTENTPOPULARITYRATE_H_ */ diff --git a/libdash/libdash/source/mpd/InitializationSet.cpp b/libdash/libdash/source/mpd/InitializationSet.cpp new file mode 100644 index 00000000..7ce75197 --- /dev/null +++ b/libdash/libdash/source/mpd/InitializationSet.cpp @@ -0,0 +1,160 @@ +/* + * InitializationSet.cpp + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "InitializationSet.h" + +using namespace dash::mpd; + +InitializationSet::InitializationSet () : + xlinkHref(""), + xlinkActuate("onRequest"), + xlinkType("simple"), + contentType(""), + par(""), + maxWidth(0), + maxHeight(0), + maxFrameRate(""), + inAllPeriods(true), + initialization("") +{ +} +InitializationSet::~InitializationSet () +{ + for(size_t i = 0; i < this->accessibility.size(); i++) + delete(this->accessibility.at(i)); + for(size_t i = 0; i < this->role.size(); i++) + delete(this->role.at(i)); + for(size_t i = 0; i < this->rating.size(); i++) + delete(this->rating.at(i)); + for(size_t i = 0; i < this->viewpoint.size(); i++) + delete(this->viewpoint.at(i)); +} + +const std::vector& InitializationSet::GetAccessibility () const +{ + return (std::vector &) this->accessibility; +} +void InitializationSet::AddAccessibity (Descriptor *accessibility) +{ + this->accessibility.push_back(accessibility); +} +const std::vector& InitializationSet::GetRole () const +{ + return (std::vector &) this->role; +} +void InitializationSet::AddRole (Descriptor *role) +{ + this->role.push_back(role); +} +const std::vector& InitializationSet::GetRating () const +{ + return (std::vector &) this->rating; +} +void InitializationSet::AddRating (Descriptor *rating) +{ + this->rating.push_back(rating); +} +const std::vector& InitializationSet::GetViewpoint () const +{ + return (std::vector &) this->viewpoint; +} +void InitializationSet::AddViewpoint (Descriptor *viewpoint) +{ + this->viewpoint.push_back(viewpoint); +} +const std::string& InitializationSet::GetXlinkHref () const +{ + return this->xlinkHref; +} +void InitializationSet::SetXlinkHref (const std::string& xlinkHref) +{ + this->xlinkHref = xlinkHref; +} +const std::string& InitializationSet::GetXlinkActuate () const +{ + return this->xlinkActuate; +} +void InitializationSet::SetXlinkActuate (const std::string& xlinkActuate) +{ + this->xlinkActuate = xlinkActuate; +} +const std::string& InitializationSet::GetXlinkType () const +{ + return this->xlinkType; +} +void InitializationSet::SetXlinkType (const std::string& xlinkType) +{ + this->xlinkType = xlinkType; +} +uint32_t InitializationSet::GetId () const +{ + return this->id; +} +void InitializationSet::SetId (uint32_t id) +{ + this->id = id; +} +bool InitializationSet::IsInAllPeriods () const +{ + return this->inAllPeriods; +} +void InitializationSet::SetInAllPeriods (bool inAllPeriods) +{ + this->inAllPeriods = inAllPeriods; +} +const std::string& InitializationSet::GetContentType () const +{ + return this->contentType; +} +void InitializationSet::SetContentType (const std::string& contentType) +{ + this->contentType = contentType; +} +const std::string& InitializationSet::GetPar () const +{ + return this->par; +} +void InitializationSet::SetPar (const std::string& par) +{ + this->par = par; +} +uint32_t InitializationSet::GetMaxWidth () const +{ + return this->maxWidth; +} +void InitializationSet::SetMaxWidth (uint32_t maxWidth) +{ + this->maxWidth = maxWidth; +} +uint32_t InitializationSet::GetMaxHeight () const +{ + return this->maxHeight; +} +void InitializationSet::SetMaxHeight (uint32_t maxHeight) +{ + this->maxHeight = maxHeight; +} +const std::string& InitializationSet::GetMaxFrameRate () const +{ + return this->maxFrameRate; +} +void InitializationSet::SetMaxFrameRate (const std::string& maxFrameRate) +{ + this->maxFrameRate = maxFrameRate; +} +const std::string& InitializationSet::GetInitialization () const +{ + return this->initialization; +} +void InitializationSet::SetInitialization (const std::string& initialization) +{ + this->initialization = initialization; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/InitializationSet.h b/libdash/libdash/source/mpd/InitializationSet.h new file mode 100644 index 00000000..e0e3869b --- /dev/null +++ b/libdash/libdash/source/mpd/InitializationSet.h @@ -0,0 +1,83 @@ +/* + * InitializationSet.h + ***************************************************************************** + * Name: Daniele Lorenzi + * + * Email: lorenzidaniele.97@gmail.com + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef INITIALIZATIONSET_H_ +#define INITIALIZATIONSET_H_ + +#include "config.h" + +#include "IInitializationSet.h" +#include "Descriptor.h" +#include "RepresentationBase.h" + +namespace dash +{ + namespace mpd + { + class InitializationSet : public IInitializationSet, public RepresentationBase + { + public: + InitializationSet (); + virtual ~InitializationSet (); + + const std::vector& GetAccessibility () const; + const std::vector& GetRole () const; + const std::vector& GetRating () const; + const std::vector& GetViewpoint () const; + const std::string& GetXlinkHref () const; + const std::string& GetXlinkActuate () const; + const std::string& GetXlinkType () const; + uint32_t GetId () const; + bool IsInAllPeriods () const; + const std::string& GetContentType () const; + const std::string& GetPar () const; + uint32_t GetMaxWidth () const; + uint32_t GetMaxHeight () const; + const std::string& GetMaxFrameRate () const; + const std::string& GetInitialization () const; + + void AddAccessibity (Descriptor *accessibility); + void AddRole (Descriptor *role); + void AddRating (Descriptor *rating); + void AddViewpoint (Descriptor *viewpoint); + void SetXlinkHref (const std::string& xlinkHref); + void SetXlinkActuate (const std::string& xlinkActuate); + void SetXlinkType (const std::string& xlinkType); + void SetId (uint32_t id); + void SetInAllPeriods (bool inAllPeriods); + void SetContentType (const std::string& contentType); + void SetPar (const std::string& par); + void SetMaxWidth (uint32_t maxWidth); + void SetMaxHeight (uint32_t maxHeight); + void SetMaxFrameRate (const std::string& maxFrameRate); + void SetInitialization (const std::string& initialization); + + private: + std::vector accessibility; + std::vector role; + std::vector rating; + std::vector viewpoint; + std::string xlinkHref; + std::string xlinkActuate; + std::string xlinkType; + uint32_t id; + bool inAllPeriods; + std::string contentType; + std::string par; + uint32_t maxWidth; + uint32_t maxHeight; + std::string maxFrameRate; + std::string initialization; + }; + } +} + +#endif /* INITIALIZATIONSET_H_ */ \ No newline at end of file diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index 18a88d01..53c1a932 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -48,10 +48,18 @@ MPD::~MPD () delete(this->utcTimings.at(i)); for(size_t i = 0; i < this->periods.size(); i++) delete(this->periods.at(i)); + for(size_t i = 0; i < this->prerolls.size(); i++) + delete(this->prerolls.at(i)); for(size_t i = 0; i < this->baseUrls.size(); i++) delete(this->baseUrls.at(i)); for(size_t i = 0; i < this->serviceDescriptions.size(); i++) delete(this->serviceDescriptions.at(i)); + for(size_t i = 0; i < this->initializationSets.size(); i++) + delete(this->initializationSets.at(i)); + for(size_t i = 0; i < this->initializationGroups.size(); i++) + delete(this->initializationGroups.at(i)); + for(size_t i = 0; i < this->initializationPresentations.size(); i++) + delete(this->initializationPresentations.at(i)); if (this->mpdPathBaseUrl) delete(this->mpdPathBaseUrl); @@ -98,6 +106,30 @@ void MPD::AddServiceDescription { this->serviceDescriptions.push_back(serviceDescription); } +const std::vector& MPD::GetInitializationSets () const +{ + return (std::vector &) this->initializationSets; +} +void MPD::AddInitializationSet (InitializationSet *initializationSet) +{ + this->initializationSets.push_back(initializationSet); +} +const std::vector& MPD::GetInitializationGroups () const +{ + return (std::vector &) this->initializationGroups; +} +void MPD::AddInitializationGroup (UIntVWithID *initializationGroup) +{ + this->initializationGroups.push_back(initializationGroup); +} +const std::vector& MPD::GetInitializationPresentations () const +{ + return (std::vector &) this->initializationPresentations; +} +void MPD::AddInitializationPresentation (UIntVWithID *initializationPresentation) +{ + this->initializationPresentations.push_back(initializationPresentation); +} const std::vector& MPD::GetPeriods () const { return (std::vector &) this->periods; @@ -106,6 +138,14 @@ void MPD::AddPeriod { this->periods.push_back(period); } +const std::vector& MPD::GetPrerolls () const +{ + return (std::vector &) this->prerolls; +} +void MPD::AddPreroll (Period *preroll) +{ + this->prerolls.push_back(preroll); +} const std::vector& MPD::GetMetrics () const { return (std::vector &) this->metrics; diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index 9eafc74b..e125e9e3 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -27,6 +27,8 @@ #include "ServiceDescription.h" #include "LeapSecondInformation.h" #include "PatchLocation.h" +#include "InitializationSet.h" +#include "UIntVWithID.h" #include "../metrics/HTTPTransaction.h" #include "../metrics/TCPConnection.h" @@ -45,7 +47,11 @@ namespace dash const std::vector& GetLocations () const; const std::vector& GetPatchLocations () const; const std::vector& GetServiceDescriptions () const; + const std::vector& GetInitializationSets () const; + const std::vector& GetInitializationGroups () const; + const std::vector& GetInitializationPresentations () const; const std::vector& GetPeriods () const; + const std::vector& GetPrerolls () const; const std::vector& GetMetrics () const; const std::vector& GetEssentialProperties () const; const std::vector& GetSupplementalProperties () const; @@ -77,7 +83,11 @@ namespace dash void AddLocation (const std::string& location); void AddPatchLocation (PatchLocation *patchLocation); void AddServiceDescription (ServiceDescription* serviceDescription); + void AddInitializationSet (InitializationSet* initializationSet); + void AddInitializationGroup (UIntVWithID* initializationGroup); + void AddInitializationPresentation (UIntVWithID* initializationPresentation); void AddPeriod (Period *period); + void AddPreroll (Period *preroll); void AddMetrics (Metrics *metrics); void AddEssentialProperty (Descriptor *essentialProperty); void AddSupplementalProperty (Descriptor *supplementalProperty); @@ -105,7 +115,11 @@ namespace dash std::vector locations; std::vector patchLocations; std::vector serviceDescriptions; + std::vector initializationSets; + std::vector initializationGroups; + std::vector initializationPresentations; std::vector periods; + std::vector prerolls; std::vector metrics; std::vector essentialProperties; std::vector supplementalProperties; diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index e2bd6a7a..8f7e8c58 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -47,6 +47,8 @@ Period::~Period () delete(this->eventStreams.at(i)); for(size_t i = 0; i < this->serviceDescriptions.size(); i++) delete(this->serviceDescriptions.at(i)); + for(size_t i = 0; i < this->preselections.size(); i++) + delete(this->preselections.at(i)); delete(segmentBase); delete(segmentList); delete(segmentTemplate); @@ -142,6 +144,14 @@ void Period::AddGroupLabel (Label { this->groupLabels.push_back(groupLabel); } +const std::vector& Period::GetPreselections () const +{ + return (std::vector &) this->preselections; +} +void Period::AddPreselection (Preselection *preselection) +{ + this->preselections.push_back(preselection); +} const std::string& Period::GetXlinkHref () const { return this->xlinkHref; diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index d9b6b3ae..50b107eb 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -28,6 +28,7 @@ #include "Label.h" #include "EventStream.h" #include "ServiceDescription.h" +#include "Preselection.h" #include "AbstractMPDElement.h" namespace dash @@ -51,6 +52,7 @@ namespace dash const std::vector& GetSubsets () const; const std::vector& GetSupplementalProperties () const; const std::vector& GetGroupLabels () const; + const std::vector& GetPreselections () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; const std::string& GetXlinkType () const; @@ -71,6 +73,7 @@ namespace dash void AddSubset (Subset *subset); void AddSupplementalProperty (Descriptor *supplementalProperty); void AddGroupLabel (Label *groupLabel); + void AddPreselection (Preselection *preselection); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); void SetXlinkType (const std::string& xlinkType); @@ -92,6 +95,7 @@ namespace dash std::vector subsets; std::vector supplementalProperties; std::vector
  • \c statistics (when the value is specified based on viewing statistics); + *
  • \c other. + * + * When \c "other" is used, \c @source_description should be provided. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetSource () const = 0; - - /** - * Returns a reference to a UTF-8 string that provides a textual description of the source of rating. + + /** + * Returns a reference to a UTF-8 string that provides a textual description of the source of rating. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetSourceDescription () const = 0; - + }; } } diff --git a/libdash/libdash/include/IDescriptor.h b/libdash/libdash/include/IDescriptor.h index 2c08658d..8909a19d 100644 --- a/libdash/libdash/include/IDescriptor.h +++ b/libdash/libdash/include/IDescriptor.h @@ -65,11 +65,11 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetValue () const = 0; - - /** + + /** * Returns a reference to a string that that specifies the identifier for the descriptor. - * Descriptors with identical values for this attribute shall be synonymous, i.e. the processing - * of one of the descriptors with an identical value is sufficient. + * Descriptors with identical values for this attribute shall be synonymous, i.e. the processing + * of one of the descriptors with an identical value is sufficient. * @return a reference to a string */ virtual const std::string& GetId () const = 0; diff --git a/libdash/libdash/include/IEvent.h b/libdash/libdash/include/IEvent.h index bd5bb341..6224b095 100644 --- a/libdash/libdash/include/IEvent.h +++ b/libdash/libdash/include/IEvent.h @@ -2,12 +2,12 @@ * @class dash::mpd::IEvent * @brief This interface is needed for accessing the attributes of Event * as specified in ISO/IEC 23009-1, subclause 5.10.2.2, Table 35. - * @details The Event element specifies an Event and contains the message of the event. The content of this element depends on the event scheme. The contents shall be either: \n + * @details The Event element specifies an Event and contains the message of the event. The content of this element depends on the event scheme. The contents shall be either: \n *
      *
    • A string, optionally encoded as specified by \c @contentEncoding *
    • XML content using elements external to the MPD namespace *
    - * For new event schemes, string content should be used, making use of Base 64 encoding if needed. \n + * For new event schemes, string content should be used, making use of Base 64 encoding if needed. \n * \b NOTE The schema allows “mixed†content within this element however only string data or XML elements are permitted by the above options, not a combination. \n * The XML syntax of the Event is provided in subclause 5.10.2.3. * @see dash::mpd::IMPDElement @@ -35,10 +35,10 @@ namespace dash virtual ~IEvent(){} /** - * Returns an integer that specifies the presentation time of the event relative to the start of the Period taking into account the \c @presentationTimeOffset of the Event Stream, if present. \n + * Returns an integer that specifies the presentation time of the event relative to the start of the Period taking into account the \c @presentationTimeOffset of the Event Stream, if present. \n * The value of the presentation time in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. \n * If not present, the value of the presentation time is 0. - * + * * @return an unsigned integer */ virtual uint64_t GetPresentationTime () const = 0; @@ -47,22 +47,22 @@ namespace dash * Returns a reference to a string that specifies the presentation duration of the Event. \n * The value of the duration in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. \n * The interpretation of the value of this attribute is defined by the scheme owner. \n - * If not present, the value of the duration is unknown. + * If not present, the value of the duration is unknown. * * @return a reference to a string */ - virtual const std::string& GetDuration () const = 0; - - /** + virtual const std::string& GetDuration () const = 0; + + /** * Returns an integer that specifies an identifier for this instance of the event. \n - * Events with equivalent content and attribute values in the \b Event element shall have the same value for this attribute. \n - * The scope of the \c @id for each Event is with the same \c @schemeIdURI and \c @value pair. + * Events with equivalent content and attribute values in the \b Event element shall have the same value for this attribute. \n + * The scope of the \c @id for each Event is with the same \c @schemeIdURI and \c @value pair. * * @return an unsigned integer */ - virtual uint32_t GetId () const = 0; - - /** + virtual uint32_t GetId () const = 0; + + /** * Returns the reference to a string that specifies whether the information in the body and the information in the \c @messageData is encoded. \n * If present, the following value is possible: *
      @@ -72,16 +72,16 @@ namespace dash * * @return a reference to a string */ - virtual const std::string& GetContentEncoding () const = 0; - - /** + virtual const std::string& GetContentEncoding () const = 0; + + /** * Returns the reference to a string that specifies the value for the event stream element. The value space and semantics must be defined by the owners of the scheme identified in the \c @schemeIdUri attribute. \n * The use of the message data is discouraged by content authors; it is only maintained for the purpose of backward-compatibility. - * Including the message in the Event element is recommended in preference to using this attribute. + * Including the message in the Event element is recommended in preference to using this attribute. * * @return a reference to a string */ - virtual const std::string& GetMessageData () const = 0; + virtual const std::string& GetMessageData () const = 0; }; } } diff --git a/libdash/libdash/include/IEventStream.h b/libdash/libdash/include/IEventStream.h index ba1490c1..e54ae2b4 100644 --- a/libdash/libdash/include/IEventStream.h +++ b/libdash/libdash/include/IEventStream.h @@ -2,10 +2,10 @@ * @class dash::mpd::IEventStream * @brief This interface is needed for accessing the common elements and attributes of EventStream * as specified in ISO/IEC 23009-1, subclause 5.10.2.2, Table 34 - * @details The EventStream element is structured in a similar way as the descriptor defined in subclause 5.8, namely it contains a \c @schemeIdUri attribute - * that provides a URI to identify the scheme and an optional attribute \c @value. The semantics of the element are specific to the scheme employed. The URI identifying the scheme may be a URN or a URL. \n + * @details The EventStream element is structured in a similar way as the descriptor defined in subclause 5.8, namely it contains a \c @schemeIdUri attribute + * that provides a URI to identify the scheme and an optional attribute \c @value. The semantics of the element are specific to the scheme employed. The URI identifying the scheme may be a URN or a URL. \n * A Period shall contain at most one \b EventStream element with the same value of the \c @schemeIdUri attribute and the value of the \c @value attribute, i.e. all Events of one type shall be clustered in one Event Stream. \n - * As Event Streams contain timed events, also a time scale attribute \c @timescale is provided to assign events to a specific media presentation time within the Period. The timed events themselves are described by the \b Event element. + * As Event Streams contain timed events, also a time scale attribute \c @timescale is provided to assign events to a specific media presentation time within the Period. The timed events themselves are described by the \b Event element. * ìThe XML syntax of the Event Stream is provided in subclause 5.10.2.3. * @see dash::mpd::IEvent dash::mpd::IMPDElement * @@ -34,58 +34,58 @@ namespace dash /** * Returns a pointer to a vector of dash::mpd::Event objects, each of which specifies the property of the Event itself. \n - * Events in Event Streams shall be ordered such that their presentation time is non-decreasing. - * + * Events in Event Streams shall be ordered such that their presentation time is non-decreasing. + * * @return a pointer to a vector of dash::mpd::Event objects */ virtual const std::vector& GetEvents () const = 0; - - /** + + /** * Returns a reference to a string that specifies a reference to an external EventStream element. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetXlinkHref () const = 0; /** * Returns a reference to a string that specifies the processing instructions, which can be either \c "onLoad" or \c "onRequest". \n - * This attribute shall not be present if the \c @xlink:href attribute is not present. + * This attribute shall not be present if the \c @xlink:href attribute is not present. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetXlinkActuate () const = 0; - - /** + + /** * Returns a reference to a string that identifies the message scheme. The string may use URN or URL syntax. - * When a URL is used, it is recommended to also contain a month-date in the form mmyyyy; + * When a URL is used, it is recommended to also contain a month-date in the form mmyyyy; * the assignment of the URL must have been authorized by the owner of the domain name in that URL on or very close to that date. - * A URL may resolve to an Internet location, and a location that does resolve may store a specification of the message scheme. + * A URL may resolve to an Internet location, and a location that does resolve may store a specification of the message scheme. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetSchemeIdUri () const = 0; - - /** + + /** * Returns a reference to a string that specifies the value for the event stream element. The value space and semantics must be defined - * by the owners of the scheme identified in the \c @schemeIdUriattribute. + * by the owners of the scheme identified in the \c @schemeIdUriattribute. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetValue () const = 0; - - /** + + /** * Returns an integer that specifies the timescale in units per seconds to be used for the derivation of different real-time duration values in the \b Event elements. \n * If not present on any level, it shall be set to 1. - * + * * @return an unsigned integer */ virtual uint32_t GetTimescale () const = 0; - - /** + + /** * Returns an integer that specifies the presentation time offset of this Event Stream that aligns with the start of the Period. - * Any Event contained in this Event Stream is mapped to the Period timeline by using the Event presentation time adjusted by the value of the presentation time offset. \n - * The value of the presentation time offset in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. - * + * Any Event contained in this Event Stream is mapped to the Period timeline by using the Event presentation time adjusted by the value of the presentation time offset. \n + * The value of the presentation time offset in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. + * * @return an unsigned integer */ virtual uint64_t GetPresentationTimeOffset () const = 0; diff --git a/libdash/libdash/include/IFCS.h b/libdash/libdash/include/IFCS.h index 69079ed9..b7733339 100644 --- a/libdash/libdash/include/IFCS.h +++ b/libdash/libdash/include/IFCS.h @@ -2,7 +2,7 @@ * @class dash::mpd::IFCS * @brief This interface is needed for accessing the attributes of FCS * as specified in ISO/IEC 23009-1, section 5.3.9.7.2, table 22 - * @details The FCS element contains an optional \c @d attribute specifying the MPD duration of the alternative content section and a mandatory \c @t time attribute + * @details The FCS element contains an optional \c @d attribute specifying the MPD duration of the alternative content section and a mandatory \c @t time attribute * whereby the value of the \c @t attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time of the alternative content section. \n * The semantics of the attributes for FCS are provided in 5.3.9.7.2, Table 22. The XML syntax of the Failover Content signalling is provided in 5.3.9.7.3. * @see dash::mpd::IMPDElement @@ -31,16 +31,16 @@ namespace dash /** * Returns an integer that specifies the value of the \c PresentationTime which corresponds to the \c @t attribute. - * This attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time, in \c @timescale units, of the first sample in the alternative content section. \n + * This attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time, in \c @timescale units, of the first sample in the alternative content section. \n * The value of this attribute must be equal to or greater than the sum of the previous FCS element earliest presentation time and the sum of the contiguous section duration. - * + * * @return an unsigned integer */ virtual uint64_t GetPresentationTime () const = 0; /** * Returns an integer that specifies the alternative content section duration in units of the value of the \c @timescale. \n - * If not present, the alternative content section lasts until the start of the next FCS element, or until the end of the Period or until the end of MPD duration, whichever occurs first in the timeline. \n\n + * If not present, the alternative content section lasts until the start of the next FCS element, or until the end of the Period or until the end of MPD duration, whichever occurs first in the timeline. \n\n * \em Duration corresponds to the \c \@d attribute. * @return an unsigned integer */ diff --git a/libdash/libdash/include/IFailoverContent.h b/libdash/libdash/include/IFailoverContent.h index a49cf1fd..3e7a4214 100644 --- a/libdash/libdash/include/IFailoverContent.h +++ b/libdash/libdash/include/IFailoverContent.h @@ -5,7 +5,7 @@ * @details The FailoverContent element enables identification of such sections of Representations that include alternative “failover content†and should be avoided by the DASH Client, * for example by switching to a Representation that does not include such failover content. \n * The FailoverContent element contains a list of failover content sections, each expressed by one FCS element. - * The FCS element contains an optional \c @d attribute specifying the MPD duration of the alternative content section and a mandatory \c @t time attribute + * The FCS element contains an optional \c @d attribute specifying the MPD duration of the alternative content section and a mandatory \c @t time attribute * whereby the value of the \c @t attribute minus the value of the \c @presentationTimeOffset specifies the MPD start time of the alternative content section. \n * The semantics of the attributes and elements for failover content are provided in 5.3.9.7.2, Table 22. The XML syntax of the Failover Content signalling is provided in 5.3.9.7.3. * @see dash::mpd::IFCS dash::mpd::IMPDElement @@ -38,10 +38,10 @@ namespace dash * @return a pointer to a vector of dash::mpd::FCS objects */ virtual std::vector& GetFCS () const = 0; - - /** + + /** * Returns a boolean that specifies whether the corresponding data results in a valid HTTP request - * or if the request is invalid and it is expected that a 404 is received when requesting the associated Media Segment. + * or if the request is invalid and it is expected that a 404 is received when requesting the associated Media Segment. * @return a bool value */ virtual bool IsValid () const = 0; diff --git a/libdash/libdash/include/IInitializationSet.h b/libdash/libdash/include/IInitializationSet.h index 60742491..be11bf3b 100644 --- a/libdash/libdash/include/IInitializationSet.h +++ b/libdash/libdash/include/IInitializationSet.h @@ -10,14 +10,14 @@ * An Adaptation Set referring to an Initialization Set that it conforms to may include additional information, for example:\n *
        *
      • There may be an Initialization Set with media type audio and a \c @codecs parameter, but without a \c @lang attribute. - * Then each Period includes at least one Adaptation Set with the same media type, the same \c @codecs parameter, but each of the Adaptation Sets defines a different language for each Period. + * Then each Period includes at least one Adaptation Set with the same media type, the same \c @codecs parameter, but each of the Adaptation Sets defines a different language for each Period. * This ensures that initialization of an audio playback decoder is possible, but over Period boundaries, the language may change, or additional languages may be added. *
      • There may be an Initialization Set with media type video and \c @maxWidth and \c @maxHeight parameter and a \c @codecs parameter. Then at least one Period includes at least one Adaptation Set with the same media type, * but its actual codecs parameters and the \c @maxWidth and \c @maxHeight may be different than the ones in the Initialization Set, but can be decoded and displayed within the Initialization Set constraints. *
      * An Initialization Set may get assigned a specific profile using the \c @profiles parameter in order to express conformance to DASH profiles or Interoperability Points. \n * If an MPD has multiple Periods, there should be at least one Initialization Set be present for each media type. \n - * The semantics of the attributes and elements within an \b InitializationSet element are provided in subclause 5.3.12.2, Table 26. The XML syntax of the \b InitializationSet element is provided in subclause 5.3.12.3. + * The semantics of the attributes and elements within an \b InitializationSet element are provided in subclause 5.3.12.2, Table 26. The XML syntax of the \b InitializationSet element is provided in subclause 5.3.12.3. * @see dash::mpd::IDescriptor * * @author Daniele Lorenzi \n @@ -42,12 +42,12 @@ namespace dash { public: virtual ~IInitializationSet(){} - - - /** + + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about accessibility scheme.\n * For more details refer to sections 5.8.1 and 5.8.4.3. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetAccessibility () const = 0; @@ -55,7 +55,7 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on role annotation scheme. * For more details refer to sections 5.8.1 and 5.8.4.2. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetRole () const = 0; @@ -63,7 +63,7 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on rating scheme.\n * For more details refer to sections 5.8.1 and 5.8.4.4. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetRating () const = 0; @@ -71,100 +71,100 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on viewpoint annotation scheme.\n * For more details refer to sections 5.8.1 and 5.8.4.5. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetViewpoint () const = 0; - - /** + + /** * Returns a reference to a string that specifies a reference to a remote element entity that shall contain exactly one element of type \b InitializationSet. - * + * * @return a reference to a string */ virtual const std::string& GetXlinkHref () const = 0; /** * Returns a reference to a string that specifies the processing instructions, which can be either \c \"onLoad\" or \c \"onRequest\". - * + * * @return a reference to a string */ virtual const std::string& GetXlinkActuate () const = 0; - - /** + + /** * Returns a reference to a string that specifies the the type of link. - * + * * @return a reference to a string */ virtual const std::string& GetXlinkType () const = 0; - - /** + + /** * Returns an unsigned integer that specifies a unique identifier for this Initialization Set. - * The attribute shall be a unique unsigned integer value amongst all InitializationSet and InitializationGroup ids in the scope of the MPD. - * + * The attribute shall be a unique unsigned integer value amongst all InitializationSet and InitializationGroup ids in the scope of the MPD. + * * @return an unsigned integer */ virtual uint32_t GetId () const = 0; - - /** + + /** * If set to \b true, then there is at least one Adaptation Set in each Period of the Media Presentation that conforms to this Initialization Set. - * + * * @return a bool value */ virtual bool IsInAllPeriods () const = 0; - - /** + + /** * Returns a reference to a string that specifies the media content component type for this Initialization Set. - * A value of the top-level Content-type 'type' value as defined in IETF RFC 6838:2013, Clause 4 shall be taken. \n - * If not present, the media content component type may be defined for each media component or it may be unknown. - * + * A value of the top-level Content-type 'type' value as defined in IETF RFC 6838:2013, Clause 4 shall be taken. \n + * If not present, the media content component type may be defined for each media component or it may be unknown. + * * @return a reference to a string */ virtual const std::string& GetContentType () const = 0; - - /** + + /** * Returns a reference to a string that specifies the picture aspect ratio of the video media component type, in the form of a string consisting of two integers separated by ':', e.g.,"16:9". - * When this attribute is present, and the attributes \c @width and \c @height for the Representations of Adaptation Sets conforming to this Initialization Set are also present, - * the picture aspect ratio as specified by this attribute shall be the same as indicated by the values of \c @width, \c @height, and \c @sar, i.e. it shall express the same ratio as (\c@width * sarx): (\c@height * sary), with sarx the first number in \c @sar and sary the second number. \n - * If not present, the picture aspect ratio may be defined for each media component or it may be unknown. - * + * When this attribute is present, and the attributes \c @width and \c @height for the Representations of Adaptation Sets conforming to this Initialization Set are also present, + * the picture aspect ratio as specified by this attribute shall be the same as indicated by the values of \c @width, \c @height, and \c @sar, i.e. it shall express the same ratio as (\c@width * sarx): (\c@height * sary), with sarx the first number in \c @sar and sary the second number. \n + * If not present, the picture aspect ratio may be defined for each media component or it may be unknown. + * * @return a reference to a string */ virtual const std::string& GetPar () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the maximum \c @width value in all Representations in all Adaptation Sets associated to this Initialization Set. - * This value has the same units as the \c @width attribute. \n + * This value has the same units as the \c @width attribute. \n * If not present, the value is unknown. - * + * * @return an unsigned integer */ virtual uint32_t GetMaxWidth () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the maximum \c @height value in all Representations in all Adaptation Sets associated to this Initialization Set. * This value has the same units as the \c @height attribute. \n - * If not present, the value is unknown. - * + * If not present, the value is unknown. + * * @return an unsigned integer */ virtual uint32_t GetMaxHeight () const = 0; - - /** + + /** * Returns a reference to a string that specifies the maximum \c @framerate value in all Representations in all Adaptation Sets associated to this Initialization Set. * This value is encoded in the same format as the \c @frameRate attribute. \n - * If not present, the value is unknown. - * + * If not present, the value is unknown. + * * @return a reference to a string */ virtual const std::string& GetMaxFrameRate () const = 0; - - /** + + /** * Returns a reference to a string that specifies the URL of an Initialization Segment. - * + * * @return a reference to a string */ virtual const std::string& GetInitialization () const = 0; - + }; } } diff --git a/libdash/libdash/include/ILabel.h b/libdash/libdash/include/ILabel.h index dde43288..96485200 100644 --- a/libdash/libdash/include/ILabel.h +++ b/libdash/libdash/include/ILabel.h @@ -35,24 +35,24 @@ namespace dash /** * For Label: - * Returns an integer that specifies an identifier for the label. Labels with the same value for this attribute belong to a label group. - * - * For GroupLabel: - * Returns an integer that specifies an identifier for the group label. The value for this attribute shall be unique for all group labels in the MPD. + * Returns an integer that specifies an identifier for the label. Labels with the same value for this attribute belong to a label group. + * + * For GroupLabel: + * Returns an integer that specifies an identifier for the group label. The value for this attribute shall be unique for all group labels in the MPD. * The value of this attribute shall be the same as the id attribute of all Label elements in the label group. - * + * * @return an unsigned integer */ virtual uint32_t GetId () const = 0; /** * Returns a reference to a string that specifies the language of the label. - * If not present, the language of the label is unknown. + * If not present, the language of the label is unknown. * * @return a reference to a string */ virtual const std::string& GetLang () const = 0; - + }; } } diff --git a/libdash/libdash/include/ILatency.h b/libdash/libdash/include/ILatency.h index cdcc43f3..0950f579 100644 --- a/libdash/libdash/include/ILatency.h +++ b/libdash/libdash/include/ILatency.h @@ -30,37 +30,37 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IUIntPairsWithID objects that define a list of latency and quality pairs together with the quality type. - * + * * @return a reference to a vector of pointers to dash::mpd::IUIntPairsWithID objects */ virtual const std::vector& GetQualityLatencyType () const = 0; - /** - * Returns an unsigned integer that defines the ID of the Producer Reference Time element in the MPD against which the latency is measured, if more than one is present. + /** + * Returns an unsigned integer that defines the ID of the Producer Reference Time element in the MPD against which the latency is measured, if more than one is present. * * @return an unsigned integer */ virtual uint32_t GetReferenceId () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the service provider’s preferred presentation latency in milliseconds compared to the producer reference time. * Indicates a content provider’s desire for the content to be presented as close to the indicated latency as is possible given the player’s capabilities and observations. \n - * This attribute may express a latency that is only achievable by low-latency players under favourable network conditions. + * This attribute may express a latency that is only achievable by low-latency players under favourable network conditions. * * @return an unsigned integer */ virtual uint32_t GetTarget () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the service provider’s indication about the maximum presentation latency in milliseconds. - * Indicates a content provider’s desire for the content not to be presented if the latency exceeds the maximum latency. + * Indicates a content provider’s desire for the content not to be presented if the latency exceeds the maximum latency. * * @return an unsigned integer */ virtual uint32_t GetMax () const = 0; - - /** - * Returns an unsigned integer that specifies the service provider’s indication about minimum presentation latency in milliseconds for example to avoid inconsistencies with second screen applications, overlays, etc. + + /** + * Returns an unsigned integer that specifies the service provider’s indication about minimum presentation latency in milliseconds for example to avoid inconsistencies with second screen applications, overlays, etc. * * @return an unsigned integer */ diff --git a/libdash/libdash/include/ILeapSecondInformation.h b/libdash/libdash/include/ILeapSecondInformation.h index 3f2b8421..f4e02ae1 100644 --- a/libdash/libdash/include/ILeapSecondInformation.h +++ b/libdash/libdash/include/ILeapSecondInformation.h @@ -8,10 +8,10 @@ * With this information, a client may perform timing calculations by assuming a constant day length of 86400 seconds if it first applies the relevant offset from the \b LeapSecondInformation element to the value of the \bMPD\c@availabilityStartTime attribute. * The client can then correctly play a Media Presentation for which \bMPD\c@type is 'dynamic' when leap seconds have occurred since the time of \bMPD\c@availabilityStartTime and even when leap seconds occur during playback.\n * The offset specified in \c @availabilityStartLeapOffset applies if the current time is before \c @nextLeapChangeTime. \c @nextAvailabilityStartLeapOffset applies if the current time is equal to or after \c @nextLeapChangeTime, but its use may need to be delayed if the client’s internal wall-clock has not yet processed the leap second.\n - * \b NOTE 1 If a particular client’s wall-clock is synchronized solely by means of a one-shot protocol, e.g. using the scheme \c urn:mpeg:dash:utc:http-xsdate:2014 defined in subclause 5.8.5.7, the value of \c @availabilityStartLeapOffset remains appropriate for that client until its clock is next synchronized after the leap second has occurred. \n - * \b NOTE 2 Leap seconds can occur at any of four possible times each year and can add or remove a second from the UTC timeline. Whilst leap seconds always occur immediately before midnight UTC, they can occur during the day in other time zones. + * \b NOTE 1 If a particular client’s wall-clock is synchronized solely by means of a one-shot protocol, e.g. using the scheme \c urn:mpeg:dash:utc:http-xsdate:2014 defined in subclause 5.8.5.7, the value of \c @availabilityStartLeapOffset remains appropriate for that client until its clock is next synchronized after the leap second has occurred. \n + * \b NOTE 2 Leap seconds can occur at any of four possible times each year and can add or remove a second from the UTC timeline. Whilst leap seconds always occur immediately before midnight UTC, they can occur during the day in other time zones. * Even within the Greenwich Mean Time (GMT) zone, the most common time for a leap second has been 23:59:60 on New Year's Eve, when many people may be watching live video streams. It is therefore important that leap seconds are handled correctly.\n - * Some operating systems allow leap seconds to be handled by "smearing" the leap second over a longer period of time. Care should be taken to ensure that availability times in a published MPD are not affected by this.\n + * Some operating systems allow leap seconds to be handled by "smearing" the leap second over a longer period of time. Care should be taken to ensure that availability times in a published MPD are not affected by this.\n * The semantics of the attributes within the \b LeapSecondInformation element are provided in subclause 5.13.2, Table 42. The XML syntax of the \b LeapSecondInformation element is provided in subclause 5.13.3. of ISO/IEC 23009-1. * @see dash::mpd::IMPDElement * @@ -39,26 +39,26 @@ namespace dash /** * Returns an integer that specifies the number of seconds applying at the time of MPD publication that a client would need to subtract - * from \bMPD\c@availabilityStartTime in order to perform timing calculations without further consideration of leap seconds.\n - * If a leap second correction has already been applied, the \b LeapSecondInformation element should still be present but this attribute should be set to 0. - * + * from \bMPD\c@availabilityStartTime in order to perform timing calculations without further consideration of leap seconds.\n + * If a leap second correction has already been applied, the \b LeapSecondInformation element should still be present but this attribute should be set to 0. + * * @return an integer */ virtual int32_t GetAvailabilityStartLeapOffset () const = 0; - - /** + + /** * Returns an integer that specifies the number of seconds that will apply from the time of the next leap second (indicated by the \c @nextLeapChangeTime) - * that a client would need to subtract from \bMPD\c@availabilityStartTime in order to perform timing calculations without further consideration of leap seconds.\n - * If the timing of the next leap second is unknown, this attribute shall be omitted. + * that a client would need to subtract from \bMPD\c@availabilityStartTime in order to perform timing calculations without further consideration of leap seconds.\n + * If the timing of the next leap second is unknown, this attribute shall be omitted. * * @return an integer */ virtual int32_t GetNextAvailabilityStartLeapOffset () const = 0; - - /** + + /** * Returns a reference to a string that specifies the UTC time at which a leap second will occur. Before this time, \c @availabilityStartLeapOffset applies. * On or after this time, \c @nextAvailabilityStartLeapOffset applies for timing calculations made against a wall-clock that has processed the leap second.\n - * If the timing of the next leap second is unknown, this attribute shall be omitted. + * If the timing of the next leap second is unknown, this attribute shall be omitted. * * @return a reference to a string */ diff --git a/libdash/libdash/include/IMPD.h b/libdash/libdash/include/IMPD.h index febbc5dd..d06e3aef 100644 --- a/libdash/libdash/include/IMPD.h +++ b/libdash/libdash/include/IMPD.h @@ -81,48 +81,48 @@ namespace dash * @return a reference to a vector of strings */ virtual const std::vector& GetLocations () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IPatchLocation objects that specify a location at which the MPD patch document is available. Details on the MPD patch document, this element, and expected processing models are available in subclause 5.15. of ISO/IEC 23009-1. \n - * If this element is present, the MPD@id attribute and the MPD@publishTime shall be present. \n - * When \c @type is 'static' or the \c @minimumUpdatePeriod attribute is not present, then value of the element is undefined and may be ignored. \n - * If this element is not present, no MPD patch document is available. \n - * If multiple elements are present, any PatchLocation element may be used. - * + * If this element is present, the MPD@id attribute and the MPD@publishTime shall be present. \n + * When \c @type is 'static' or the \c @minimumUpdatePeriod attribute is not present, then value of the element is undefined and may be ignored. \n + * If this element is not present, no MPD patch document is available. \n + * If multiple elements are present, any PatchLocation element may be used. + * * @return a reference to a vector of pointers to dash::mpd::IPatchLocation objects */ virtual const std::vector& GetPatchLocations () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IServiceDescription objects that specify the service descriptions. - * For more details refer to the description in section K.4.1 of ISO/IEC 23009-1. - * + * For more details refer to the description in section K.4.1 of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects */ virtual const std::vector& GetServiceDescriptions () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IInitializationSet objects that specify suitable initializations for specific media types for the presentation. - * For more details refer to the description in section 5.3.12.2, of ISO/IEC 23009-1. - * + * For more details refer to the description in section 5.3.12.2, of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IInitializationSet objects */ virtual const std::vector& GetInitializationSets () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IUIntVWithID objects that specify white space separated lists of ids of Initialization Sets of the same content type. - * This indicates that any Period in the Media Presentation has at least one Adaptation Set that conforms to one of the Initialization Sets referenced in this element.\n + * This indicates that any Period in the Media Presentation has at least one Adaptation Set that conforms to one of the Initialization Sets referenced in this element.\n * For details, see subclause 5.3.12, of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IUIntVWithID objects */ virtual const std::vector& GetInitializationGroups () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IUIntVWithID objects that specify white space separated lists of ids of Initialization Sets and Initialization Groups to indicate a combination which creates a complete presentation.\n * A client supporting all listed Initialization Sets and Initialization Groups of an Initialization Presentation is expected to be able to play the entire Media Presentation as intended by the service provider.\n - * For details, see subclause 5.3.12, of ISO/IEC 23009-1. - * + * For details, see subclause 5.3.12, of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IUIntVWithID objects */ virtual const std::vector& GetInitializationPresentations () const = 0; @@ -133,53 +133,53 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IPeriod objects */ virtual const std::vector& GetPeriods () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IPeriod objects that specify the information of a Preroll.\n * For more details refer to the description in section 5.3.2. of ISO/IEC 23009-1, Part 1, 2012. - * + * * @return a reference to a vector of pointers to dash::mpd::IPeriod objects */ virtual const std::vector& GetPrerolls () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about the containing element that is considered - * essential by the Media Presentation author for processing the containing element. \n - * For details, see subclause 5.8.4.8. of ISO/IEC 23009-1. - * + * essential by the Media Presentation author for processing the containing element. \n + * For details, see subclause 5.8.4.8. of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetEssentialProperties () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify supplemental information about the containing element - * that may be used by the DASH Client optimizing the processing. \n + * that may be used by the DASH Client optimizing the processing. \n * For details, see subclause 5.8.4.9. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetSupplementalProperties () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on ways to obtain a synchronization to wall-clock time * as used in this Media Presentation. The order of the elements expresses a preference of choice by the Media Presentation author. \n - * For more details, refer to subclause 5.8.4.11. of ISO/IEC 23009-1. - * + * For more details, refer to subclause 5.8.4.11. of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetUTCTimings () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IMetrics objects that specify the DASH Metrics.\n * For more details see section 5.9. of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IPeriod objects */ virtual const std::vector& GetMetrics () const = 0; - - /** + + /** * Returns a reference to a dash::mpd::ILeapSecondInformation object that specifies leap second information affecting MPD timing calculations.\n * For details, refer to clause 5.13. of ISO/IEC 23009-1. - * + * * @return a reference to a dash::mpd::ILeapSecondInformation object */ virtual const ILeapSecondInformation * GetLeapSecondInformation () const = 0; @@ -225,8 +225,8 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetAvailabilityEndtime () const = 0; - - /** + + /** * Returns a reference to a string that specifies the time at which the MPD file was published. When not present, the value is unknown. * @return a reference to a string */ diff --git a/libdash/libdash/include/IMultipleSegmentBase.h b/libdash/libdash/include/IMultipleSegmentBase.h index f5d9e663..9f4781fb 100644 --- a/libdash/libdash/include/IMultipleSegmentBase.h +++ b/libdash/libdash/include/IMultipleSegmentBase.h @@ -63,11 +63,11 @@ namespace dash * @return an unsigned integer */ virtual uint32_t GetStartNumber () const = 0; - - /** + + /** * Returns a integer specifying the number of the last Media Segment in this Representation in the Period. \n - * If not present, the number is inferred from the duration of the Period. - * For more details refer to 5.3.9.5.3. of ISO/IEC 23009-1, Part 1, 2012. + * If not present, the number is inferred from the duration of the Period. + * For more details refer to 5.3.9.5.3. of ISO/IEC 23009-1, Part 1, 2012. * @return an unsigned integer */ virtual uint32_t GetEndNumber () const = 0; diff --git a/libdash/libdash/include/IOperatingBandwidth.h b/libdash/libdash/include/IOperatingBandwidth.h index 0dc88544..78f4d9c0 100644 --- a/libdash/libdash/include/IOperatingBandwidth.h +++ b/libdash/libdash/include/IOperatingBandwidth.h @@ -3,7 +3,7 @@ * @brief This interface is needed for accessing the attributes of OperatingBandwidth * as specified in ISO/IEC 23009-1, subclause K.3.5. * @details Table K.4 defines the service description parameters for operating bandwidth. - * The keys in Table K.4 shall be used to refer to the operating bandwidth as defined in Table K.3. + * The keys in Table K.4 shall be used to refer to the operating bandwidth as defined in Table K.3. * @see dash::mpd::IMPDElement * * @author Daniele Lorenzi \n @@ -30,34 +30,34 @@ namespace dash /** * Returns a reference to a string that defines the media type for which the bandwidth parameters apply. They type can be: - *
        - *
      • \c video: applies to video + *
          + *
        • \c video: applies to video *
        • \c audio: applies to audio *
        • \c any: applies to any media type individually - *
        • \c all: applies to aggregation of all media types - *
        - * + *
      • \c all: applies to aggregation of all media types + *
      + * * @return a reference to a string */ virtual const std::string& GetMediaType () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the minimum bandwidth value desired through this presentation for the above MediaType. * This is the smallest desired aggregated value for the \c @bandwidth attribute for all Representations of this media type to be played concurrently by the DASH Client during regular playback. * * @return an unsigned integer */ virtual uint32_t GetMin () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the maximum bandwidth value desired through this presentation for the above MediaType. * This is the largest desired aggregated value for the \c @bandwidth attribute for all Representations of this media type to be played concurrently by the DASH Client during regular playback. * * @return an unsigned integer */ virtual uint32_t GetMax () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the target bandwidth value desired through this presentation for the above MediaType. * This is the largest desired aggregated value for the \c @bandwidth attribute for all Representations of this media type to be played concurrently by the DASH Client during regular playback. * diff --git a/libdash/libdash/include/IOperatingQuality.h b/libdash/libdash/include/IOperatingQuality.h index 79fc1df6..2122df4a 100644 --- a/libdash/libdash/include/IOperatingQuality.h +++ b/libdash/libdash/include/IOperatingQuality.h @@ -30,52 +30,52 @@ namespace dash /** * Returns a reference to a string that defines the media type for which these quality parameters apply. They type can be - *
        - *
      • \c video: applies to video + *
          + *
        • \c video: applies to video *
        • \c audio: applies to audio *
        • \c any: applies to any media type - *
        - * + *
      + * * @return a reference to a string */ virtual const std::string& GetMediaType () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the minimum quality ranking value desired through this presentation for the above MediaType. - * This is the largest desired value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. + * This is the largest desired value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. * * @return an unsigned integer */ virtual uint32_t GetMin () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the maximum quality ranking value desired through this presentation for the above MediaType. - * This is the largest desired value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. + * This is the largest desired value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. * * @return an unsigned integer */ virtual uint32_t GetMax () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the quality ranking value desired through this presentation for the above MediaType. - * This is the target value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. + * This is the target value for the \c @qualityRanking attribute for the Representations to be played by the DASH Client during regular playback. * * @return an unsigned integer */ virtual uint32_t GetTarget () const = 0; - - /** + + /** * Returns a reference to a string that defines the interpretation of the value of \c @qualityRanking attribute. * If not present, the quality is considered in linear scale. * * @return a reference to a string */ virtual const std::string& GetType () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the maximum quality difference value recommended by the content author for the presentation for the above MediaType. - * This is the recommended maximum difference between \c @qualityRanking attributes for Representations being played concurrently. - * This is typically applicable for Representations that are picked from Adaptation Sets within one Preselection. + * This is the recommended maximum difference between \c @qualityRanking attributes for Representations being played concurrently. + * This is typically applicable for Representations that are picked from Adaptation Sets within one Preselection. * * @return an unsigned integer */ diff --git a/libdash/libdash/include/IPatchLocation.h b/libdash/libdash/include/IPatchLocation.h index 2cbdac21..83614bfd 100644 --- a/libdash/libdash/include/IPatchLocation.h +++ b/libdash/libdash/include/IPatchLocation.h @@ -26,8 +26,8 @@ namespace dash { public: virtual ~IPatchLocation(){} - - /** + + /** * Returns a reference to a string that specifies a location at which the MPD patch is available. The referenced document shall conform to an MPD patch document as defined in subclause 5.15.3. of ISO/IEC 23009-1. * * @return a reference to a string @@ -36,12 +36,12 @@ namespace dash /** * Returns an double that specifies the time period duration (in seconds) starting from MPD@publishTime until the MPD patch document is at least available at the indicated location above. For details refer to the processing model in subclause 5.14.4. of ISO/IEC 23009-1. \n - * If not present, the value is unknown. + * If not present, the value is unknown. - * + * * @return a double */ - virtual double GetTtl () const = 0; + virtual double GetTtl () const = 0; }; } } diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index 6f5ebf67..46cdaba5 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -92,7 +92,7 @@ namespace dash * For more details see section 5.3.9. of ISO/IEC 23009-1, Part 1, 2012. * @return a pointer to a dash::mpd::ISegmentList object */ - virtual ISegmentList* GetSegmentList () const = 0; + virtual ISegmentList* GetSegmentList () const = 0; /** * Returns a pointer to a dash::mpd::ISegmentTemplate object that specifies default Segment Template information.\n @@ -100,30 +100,30 @@ namespace dash * For more details see section 5.3.9. of ISO/IEC 23009-1, Part 1, 2012. * @return a pointer to a dash::mpd::ISegmentTemplate object */ - virtual ISegmentTemplate* GetSegmentTemplate () const = 0; - - /** + virtual ISegmentTemplate* GetSegmentTemplate () const = 0; + + /** * Returns a pointer to a dash::mpd::IDescriptor object that specifies that this Period belongs to a certain asset. \n * For more details, see subclause 5.8.5.7. of ISO/IEC 23009-1. - * + * * @return a pointer to a dash::mpd::IDescriptor object */ - virtual const IDescriptor * GetAssetIdentifier () const = 0; - - /** + virtual const IDescriptor * GetAssetIdentifier () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n * For more details see section 5.10.2. of ISO/IEC 23009-1. * @return a reference to a vector of pointers to dash::mpd::IEventStream objects */ - virtual const std::vector& GetEventStreams () const = 0; - - /** + virtual const std::vector& GetEventStreams () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IServiceDescription objects that specify the service descriptions. - * For more details refer to the description in section K.4.1 of ISO/IEC 23009-1. - * + * For more details refer to the description in section K.4.1 of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects */ - virtual const std::vector& GetServiceDescriptions () const = 0; + virtual const std::vector& GetServiceDescriptions () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IAdaptationSet objects that specify Adapatation Sets.\n @@ -131,75 +131,75 @@ namespace dash * For more details see section 5.3.3. of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IAdaptationSet objects */ - virtual const std::vector& GetAdaptationSets () const = 0; + virtual const std::vector& GetAdaptationSets () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::ISubset objects that specify Subsets.\n * For more details see section 5.3.8. of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::ISubset objects */ - virtual const std::vector& GetSubsets () const = 0; - - /** + virtual const std::vector& GetSubsets () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify supplemental information about the containing element - * that may be used by the DASH Client optimizing the processing. \n + * that may be used by the DASH Client optimizing the processing. \n * For details, see subclause 5.8.4.9. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ - virtual const std::vector& GetSupplementalProperties () const = 0; - - /** + virtual const std::vector& GetSupplementalProperties () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify summary labels for a group of Labels. * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::ILabel objects */ - virtual const std::vector& GetGroupLabels () const = 0; - - /** + virtual const std::vector& GetGroupLabels () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IPreselection objects that specify preselections, - * i.e. combinations of Adaptation Sets that form a specific experience and can be selected for joint decoding and rendering.\n + * i.e. combinations of Adaptation Sets that form a specific experience and can be selected for joint decoding and rendering.\n * For more details, refer to subclause 5.3.11. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IPreselection objects */ - virtual const std::vector& GetPreselections () const = 0; + virtual const std::vector& GetPreselections () const = 0; /** * Returns a reference to a string that specifies a reference to an external Period element. * @return a reference to a string */ - virtual const std::string& GetXlinkHref () const = 0; + virtual const std::string& GetXlinkHref () const = 0; /** * Returns a reference to a string that specifies the processing instructions, which can be either \c \"onLoad\" or \c \"onRequest\".\n * This attribute shall not be present if the \c \@xlink:href attribute is not present. * @return a reference to a string */ - virtual const std::string& GetXlinkActuate () const = 0; - - /** + virtual const std::string& GetXlinkActuate () const = 0; + + /** * Returns a reference to a string that specifies the type of W3C XLINK being used. \n - * In the context of this document, all references shall be W3C XLINK simple links. The attribute \c @xlink:type is optional with fixed setting \c @xlink:type="simple". . + * In the context of this document, all references shall be W3C XLINK simple links. The attribute \c @xlink:type is optional with fixed setting \c @xlink:type="simple". . * @return a reference to a string */ - virtual const std::string& GetXlinkType () const = 0; - - /** - * Returns a reference to a string that specifies the desired behaviour of the remote element entity once dereferenced from within an MPD as defined in W3C XLINK. \n - * In the context of this document, the attribute \c @xlink:show is optional with fixed setting \c @xlink:show="embed". \n - * \b NOTE In W3C XLINK, the behaviour of conforming XLink applications when embedding as a remote element entity is not defined. Thus, the actual behaviour for this document is defined in subclause 5.5.3. of ISO/IEC 23009-1. + virtual const std::string& GetXlinkType () const = 0; + + /** + * Returns a reference to a string that specifies the desired behaviour of the remote element entity once dereferenced from within an MPD as defined in W3C XLINK. \n + * In the context of this document, the attribute \c @xlink:show is optional with fixed setting \c @xlink:show="embed". \n + * \b NOTE In W3C XLINK, the behaviour of conforming XLink applications when embedding as a remote element entity is not defined. Thus, the actual behaviour for this document is defined in subclause 5.5.3. of ISO/IEC 23009-1. * @return a reference to a string */ - virtual const std::string& GetXlinkShow () const = 0; + virtual const std::string& GetXlinkShow () const = 0; /** * Returns an reference to a string that specifies an identifier for this Period. * The attribute shall be unique in the scope of the Media Presentation. * @return a reference to a string */ - virtual const std::string& GetId () const = 0; + virtual const std::string& GetId () const = 0; /** * Returns a reference to a string that specifies the \em PeriodStart time of the Period.The \em PeriodStart time is used as an anchor to determine the MPD start @@ -207,21 +207,21 @@ namespace dash * If not present, refer to the details in section 5.3.2.1. of ISO/IEC 23009-1, Part 1, 2012 * @return a reference to a string */ - virtual const std::string& GetStart () const = 0; + virtual const std::string& GetStart () const = 0; /** * Returns a reference to a string that specifies the duration of the Period to determine the \em PeriodStart time of the next Period.\n * If not present, refer to the details in section 5.3.2.1. of ISO/IEC 23009-1, Part 1, 2012 * @return a reference to a string */ - virtual const std::string& GetDuration () const = 0; + virtual const std::string& GetDuration () const = 0; /** * When set to \c 'true', this is equivalent as if the AdaptationSet\@bitstreamSwitching for each Adaptation Set contained in this Period is set to \c 'true'. * In this case, the AdaptationSet\@bitstreamSwitching attribute shall not be set to \c 'false' for any Adaptation Set in this Period. * @return a bool value */ - virtual bool GetBitstreamSwitching () const = 0; + virtual bool GetBitstreamSwitching () const = 0; }; } diff --git a/libdash/libdash/include/IPlaybackRate.h b/libdash/libdash/include/IPlaybackRate.h index d0587cf2..289cfd5c 100644 --- a/libdash/libdash/include/IPlaybackRate.h +++ b/libdash/libdash/include/IPlaybackRate.h @@ -27,18 +27,18 @@ namespace dash { public: virtual ~IPlaybackRate(){} - - /** + + /** * Returns a double that specifies the maximum playback rate that the content provider indicates is appropriate for the purposes of automatically adjusting - * playback latency and buffer occupancy during normal playback, where 1.0 is normal playback speed. + * playback latency and buffer occupancy during normal playback, where 1.0 is normal playback speed. * * @return a double */ virtual double GetMax () const = 0; - - /** + + /** * Returns a double that specifies the minimum playback rate that the content provider indicates is appropriate for the purposes of automatically adjusting - * playback latency and buffer occupancy during normal playback, where 1.0 is normal playback speed. + * playback latency and buffer occupancy during normal playback, where 1.0 is normal playback speed. * * @return a double */ diff --git a/libdash/libdash/include/IPopularityRate.h b/libdash/libdash/include/IPopularityRate.h index a0fa6e7f..89595b82 100644 --- a/libdash/libdash/include/IPopularityRate.h +++ b/libdash/libdash/include/IPopularityRate.h @@ -26,38 +26,38 @@ namespace dash { public: virtual ~IPopularityRate(){} - - /** + + /** * Returns an unsigned integer that indicates the relative Popularity Rate of the segments of containing entity (i.e. the Preselection or Adaptation Set containing this \b ContentPopularityRate element), * within the same Media Presentation. No unit. The value shall be in the range of 1 to 100. - * A greater value means higher likelihood of the series of (Sub)Segments being consumed/requested. - * + * A greater value means higher likelihood of the series of (Sub)Segments being consumed/requested. + * * @return an unsigned integer */ virtual uint8_t GetPopularityRate () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the first Segment from which \c @popularityRate value of this \b PR element is relevant. * If the addressing scheme for the containing entity is using Segment template with \c $Number$, then \c @popularityRate applies from the earliest presentation time of the Segment with the segment number specified by this attribute. * For other addressing schemes, the value of \c @popularityRate applies from the Segment which contains the media sample whose presentation time specified by this attribute in unit of \c @timescale on Representation level. * If not present, then it shall be assumed that \c @popularityRate applies from: *
        *
      • the first Segment of the containing Period, for the first \b PR element, - *
      • the Segment after the last Segment of the previous \b PR element, for other PR elements. - *
      - * + *
    • the Segment after the last Segment of the previous \b PR element, for other PR elements. + *
    + * * @return an unsigned integer */ virtual uint64_t GetStart () const = 0; - - /** + + /** * Returns an integer that specifies the number of segments after the segment indicated by \c @start which are included in this \b PR entry (i.e. the repeat count). * A negative value indicates that the series continues until the segment before the first segment of the next \b PR element, or if there are no further \b PR elements until the end of the Period or the next MPD update. - * + * * @return an integer */ virtual int32_t GetR () const = 0; - + }; } } diff --git a/libdash/libdash/include/IPreselection.h b/libdash/libdash/include/IPreselection.h index 802fb1e7..6a0899b0 100644 --- a/libdash/libdash/include/IPreselection.h +++ b/libdash/libdash/include/IPreselection.h @@ -7,7 +7,7 @@ * Preselections can also be used to indicate a pre-defined experience at the elementary-stream level, i.e. the DASH Client can select a pre-defined experience and provides the selection to the media engine.\n * Preselections may be uniquely identified by a Preselection Tag. Users/Codecs using this Tag functionality are encouraged to provide more information on how tags defined in the MPD map to functionality in the specific codec.\n * Preselections have equivalent annotation parameters to Adaptation Sets and are always assigned exactly one media type.\n - * Media components can be mapped to Adaptation Sets in multiple ways: + * Media components can be mapped to Adaptation Sets in multiple ways: *
      *
    1. by a one-to-one mapping between media components and Adaptation Sets; *
    2. by the inclusion of multiple media components in a single Adaptation Set where all encoded versions of the media components are multiplexed on the file-container level; @@ -57,12 +57,12 @@ namespace dash { public: virtual ~IPreselection(){} - - - /** + + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about accessibility scheme.\n * For more details refer to sections 5.8.1 and 5.8.4.3. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetAccessibility () const = 0; @@ -70,7 +70,7 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on role annotation scheme. * For more details refer to sections 5.8.1 and 5.8.4.2. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetRole () const = 0; @@ -78,7 +78,7 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on rating scheme.\n * For more details refer to sections 5.8.1 and 5.8.4.4. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetRating () const = 0; @@ -86,44 +86,44 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information on viewpoint annotation scheme.\n * For more details refer to sections 5.8.1 and 5.8.4.5. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetViewpoint () const = 0; - - /** + + /** * Returns a reference to a string that specifies the id of the Preselection. This shall be unique within one Period. - * + * * @return a reference to a string */ virtual const std::string& GetId () const = 0; /** * Returns a reference to a vector of strings that specifies the ids of the contained Adaptation Sets or Content Components that belong to this Preselection - * as white space separated list in processing order. The first id defines the Main Adaptation Set. - * + * as white space separated list in processing order. The first id defines the Main Adaptation Set. + * * @return a reference to a vector of strings */ virtual const std::vector& GetPreselectionComponents () const = 0; - - /** + + /** * Returns a reference to a string that specifies the language of the preselection as specified in in Table 5 for \c @lang attribute. - * + * * @return a reference to a string */ virtual const std::string& GetLang () const = 0; - - /** + + /** * Returns a reference to a string that specifies the conformance rules for Representations in Adaptation Sets within the Preselection.\n * When set to 'undefined', the Preselection follows the conformance rules for Multi-Segment Tracks in subclause 5.3.11.5.1.\n - * When set to 'time-ordered', the Preselection follows the conformance rules for Time-Ordered Segment Tracks in subclause 5.3.11.5.2.\n - * When set to 'fully-ordered', the Preselection follows the conformance rules for Fully-Ordered Segment Tracks in subclause 5.3.11.5.3. - * In this case, order in the \c @preselectionComponents attribute specifies the component order. - * + * When set to 'time-ordered', the Preselection follows the conformance rules for Time-Ordered Segment Tracks in subclause 5.3.11.5.2.\n + * When set to 'fully-ordered', the Preselection follows the conformance rules for Fully-Ordered Segment Tracks in subclause 5.3.11.5.3. + * In this case, order in the \c @preselectionComponents attribute specifies the component order. + * * @return a reference to a string */ virtual const std::string& GetOrder () const = 0; - + }; } } diff --git a/libdash/libdash/include/IProducerReferenceTime.h b/libdash/libdash/include/IProducerReferenceTime.h index 2927731a..bc70aa82 100644 --- a/libdash/libdash/include/IProducerReferenceTime.h +++ b/libdash/libdash/include/IProducerReferenceTime.h @@ -10,7 +10,7 @@ * The definition follows the Producer Reference Time ('prft') as defined in ISO/IEC 14496-12.\n * The information may be provided inband as part of the Segments in the ('prft'), in the MPD or both.\n * The semantics of the attributes and elements for producer reference time are provided in subclause 5.12.2, Table 41. - * The XML syntax of the Producer Reference Time is provided in subclause 5.12.3. of ISO/IEC 23009-1. + * The XML syntax of the Producer Reference Time is provided in subclause 5.12.3. of ISO/IEC 23009-1. * @see dash::mpd::IDescriptor dash::mpd::IMPDElement * * @author Daniele Lorenzi \n @@ -35,73 +35,73 @@ namespace dash { public: virtual ~IProducerReferenceTime(){} - - /** + + /** * Returns a pointer to a dash::mpd::IDescriptor object. - * If present, then the wall-clock times provided in this context are synchronized with the timing anchor provided in this descriptor. - * The same UTC Timing descriptor shall also be present in the MPD. + * If present, then the wall-clock times provided in this context are synchronized with the timing anchor provided in this descriptor. + * The same UTC Timing descriptor shall also be present in the MPD. * * @return a pointer to a dash::mpd::IDescriptor object */ virtual const IDescriptor * GetUTCTiming () const = 0; - - /** - * Returns an unsigned integer that identifies the Producer Reference Time documented in the MPD. - * + + /** + * Returns an unsigned integer that identifies the Producer Reference Time documented in the MPD. + * * @return an unsigned integer */ virtual uint32_t GetId () const = 0; - - /** + + /** * Returns a bool value that signals if every segment or subsegment contains a 'prft' of the type below. - * If set to true, every segment or subsegment shall contain the 'prft' as defined in ISO/IEC 14496-12:—, + * If set to true, every segment or subsegment shall contain the 'prft' as defined in ISO/IEC 14496-12:—, * subclause 8.16.5 and the flags set according to the \c @type attribute of this element. * * @return a bool value */ virtual bool IsInband () const = 0; - - /** - * Returns a reference to a string that specifies the type of the Producer Reference Time from the following list: - *
        + + /** + * Returns a reference to a string that specifies the type of the Producer Reference Time from the following list: + *
          *
        • \c encoder provides a reference when the media time was input to an encoder following the exact definition in subclause 8.16.5 of ISO/IEC 14496-12 for flags set to 0. - *
        • \c captured provides a reference when the media time was captured following the exact definition in ISO/IEC 14496-12:—, subclause 8.16.5 for both flag 8 and flag 16 being set. - *
        • \c application provides a reference of the media time related to wall-clock time based on an application defined relation. In this case, following ISO/IEC 14496-12:—, subclause 8.16.5, flag 16 shall be set and flag 8 shall be unset. - *
        + *
      • \c captured provides a reference when the media time was captured following the exact definition in ISO/IEC 14496-12:—, subclause 8.16.5 for both flag 8 and flag 16 being set. + *
      • \c application provides a reference of the media time related to wall-clock time based on an application defined relation. In this case, following ISO/IEC 14496-12:—, subclause 8.16.5, flag 16 shall be set and flag 8 shall be unset. + *
      * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetType () const = 0; - - /** + + /** * Returns a reference to a string that specifies the application scheme to which the time conforms if \c @type is set to \b application.\n * If the \c @type is set to \b application, this attribute should be present.\n - * If the \c @type is set other than \b application, this attribute shall not be present. + * If the \c @type is set other than \b application, this attribute shall not be present. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetApplicationScheme () const = 0; - - /** + + /** * Returns a reference to a string that specifies a wall-clock time in the following format: - *
        - *
      • if \b UTCTiming element is absent, the NTP format associated to \c @media as defined in ISO/IEC 14496-12:—, 8.16.5 for \c ntp_timestamp; - *
      • if \b UTCTiming element is present, the format is identical to the format as defined in the UTC Timing scheme. - *
      - * If the MPD Generator extracts the information from the producer reference time box, the value needs to be converted to the correct scheme. + *
        + *
      • if \b UTCTiming element is absent, the NTP format associated to \c @media as defined in ISO/IEC 14496-12:—, 8.16.5 for \c ntp_timestamp; + *
      • if \b UTCTiming element is present, the format is identical to the format as defined in the UTC Timing scheme. + *
      + * If the MPD Generator extracts the information from the producer reference time box, the value needs to be converted to the correct scheme. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetWallClockTime () const = 0; - - /** + + /** * Returns an unsigned integer that specifies a presentation time in timescale of the Representation that relates to the value of the \c @wallClockTime.\n - * \b NOTE If the data is extracted from the producer reference time box, then this value is derived by the \c media_time field. - * + * \b NOTE If the data is extracted from the producer reference time box, then this value is derived by the \c media_time field. + * * @return an unsigned integer */ virtual uint64_t GetPresentationTime () const = 0; - + }; } } diff --git a/libdash/libdash/include/IRandomAccess.h b/libdash/libdash/include/IRandomAccess.h index ded639f9..c2d27b50 100644 --- a/libdash/libdash/include/IRandomAccess.h +++ b/libdash/libdash/include/IRandomAccess.h @@ -26,45 +26,45 @@ namespace dash { public: virtual ~IRandomAccess(){} - - /** - * Returns an unsigned integer that specifies the position of the random access points in the Representations. The information is specified in the scale of the \c @timescale on Representation level. - * Any Segment for which the MPD start time minus the \c @t value of the \b S element describing the segment is an integer multiple of the product of \c @timescale and \c @interval is a random access opportunity, i.e. it enables randomly access to this Representation with the random access strategy as defined by the \c @type value.\n - * The value should be chosen such that the resulting time matches MPD start time of segments, otherwise no random access will be described. - * + + /** + * Returns an unsigned integer that specifies the position of the random access points in the Representations. The information is specified in the scale of the \c @timescale on Representation level. + * Any Segment for which the MPD start time minus the \c @t value of the \b S element describing the segment is an integer multiple of the product of \c @timescale and \c @interval is a random access opportunity, i.e. it enables randomly access to this Representation with the random access strategy as defined by the \c @type value.\n + * The value should be chosen such that the resulting time matches MPD start time of segments, otherwise no random access will be described. + * * @return an unsigned integer */ virtual uint32_t GetInterval () const = 0; - - /** + + /** * Returns a reference to a string that specifies the random access strategy for the random access points in by the \c @interval attribute.\n - * The value shall use a type present in Table 11 of ISO/IEC 23009-1.\n - * If the value of the type is unknown, the DASH Client is expected to ignore the containing Random Access element. + * The value shall use a type present in Table 11 of ISO/IEC 23009-1.\n + * If the value of the type is unknown, the DASH Client is expected to ignore the containing Random Access element. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetType () const = 0; - - /** + + /** * Returns a reference to a string that specifies a common duration used in the definition of the Representation data rate (see \c @bandwidth attribute in subclauses 5.3.5.2 and 5.3.5.4 of ISO/IEC 23009-1).\n - * If not present, then the value of the MPD level is inherited. + * If not present, then the value of the MPD level is inherited. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetMinBufferTime () const = 0; - - /** - * Returns an unsigned integer that specifies a hypothetical constant bitrate channel of bandwidth with the value of this attribute in bits per second (bps). - * If the Representation is continuously delivered at this bitrate, starting at any RAP indicated in this element a client can be assured of having enough data for continuous playout providing playout begins after \c @minBufferTime * \c @bandwidth bits have been received - * (i.e. at time \c @minBufferTime after the first bit is received). \n - * For dependent Representations, this value specifies the bandwidth according to the above definition for the aggregation of this Representation and all complementary Representations.\n + + /** + * Returns an unsigned integer that specifies a hypothetical constant bitrate channel of bandwidth with the value of this attribute in bits per second (bps). + * If the Representation is continuously delivered at this bitrate, starting at any RAP indicated in this element a client can be assured of having enough data for continuous playout providing playout begins after \c @minBufferTime * \c @bandwidth bits have been received + * (i.e. at time \c @minBufferTime after the first bit is received). \n + * For dependent Representations, this value specifies the bandwidth according to the above definition for the aggregation of this Representation and all complementary Representations.\n * For details, see subclause 5.3.5.4. of ISO/IEC 23009-1.\n * If not present, the value of the Representation is inherited. - * + * * @return an unsigned integer */ virtual uint32_t GetBandwidth () const = 0; - + }; } } diff --git a/libdash/libdash/include/IRepresentation.h b/libdash/libdash/include/IRepresentation.h index 4d0f2ab9..23ab8eb7 100644 --- a/libdash/libdash/include/IRepresentation.h +++ b/libdash/libdash/include/IRepresentation.h @@ -130,24 +130,24 @@ namespace dash * @return a reference to a vector of strings */ virtual const std::vector& GetDependencyId () const = 0; - - /** + + /** * Returns a reference to a vector of strings that specifies all Representations. - * The Representation is associated with in the decoding and/or presentation - * process as a whitespace-separated list of values of \c Representation@id attributes. + * The Representation is associated with in the decoding and/or presentation + * process as a whitespace-separated list of values of \c Representation@id attributes. * @return a reference to a vector of strings */ virtual const std::vector& GetAssociationId () const = 0; - - /** + + /** * Returns a reference to a string that specifies, as a whitespace-separated list of values, - * the kind of association for each Representation the Representation has been associated with through the \c @associationId attribute. - * Values taken by this attribute are 4 character codes (4CCs) for track reference types registered in MP4 registration authority. \n - * This attribute shall not be present when \c @associationId is not present. \n - * When present, this attribute shall have as many values as the number of identifiers declared in the \c @associationId attribute. + * the kind of association for each Representation the Representation has been associated with through the \c @associationId attribute. + * Values taken by this attribute are 4 character codes (4CCs) for track reference types registered in MP4 registration authority. \n + * This attribute shall not be present when \c @associationId is not present. \n + * When present, this attribute shall have as many values as the number of identifiers declared in the \c @associationId attribute. * @return a reference to a string */ - virtual const std::string& GetAssociationType () const = 0; + virtual const std::string& GetAssociationType () const = 0; /** * Returns a reference to a vector of strings that specifies media stream structure identifier values.\n diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index 0126ca93..364dfe0f 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -49,115 +49,115 @@ namespace dash * For further details see sections 5.8.1 and 5.8.4.6 of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ - virtual const std::vector& GetFramePacking () const = 0; + virtual const std::vector& GetFramePacking () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specifies the audio channel configuration of the audio media component type.\n * For further details see sections 5.8.1 and 5.8.4.7 of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ - virtual const std::vector& GetAudioChannelConfiguration () const = 0; + virtual const std::vector& GetAudioChannelConfiguration () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specifies information about content protection schemes used for the associated Representations.\n * For further details see sections 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ - virtual const std::vector& GetContentProtection () const = 0; - - /** + virtual const std::vector& GetContentProtection () const = 0; + + /** * Returns a pointer to a dash::mpd::IDescriptor object that specifies information about the output protection schemes used for the associated Representations.\n * For further details see sections 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1, Part 1, 2012. - * + * * @return a pointer to a dash::mpd::IDescriptor object */ - virtual const IDescriptor * GetOutputProtection () const = 0; - - /** + virtual const IDescriptor * GetOutputProtection () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about the containing element that is considered - * essential by the Media Presentation author for processing the containing element. \n - * For details, see subclause 5.8.4.8. of ISO/IEC 23009-1. - * + * essential by the Media Presentation author for processing the containing element. \n + * For details, see subclause 5.8.4.8. of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ - virtual const std::vector& GetEssentialProperties () const = 0; - - /** + virtual const std::vector& GetEssentialProperties () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify supplemental information about the containing element - * that may be used by the DASH Client optimizing the processing. \n + * that may be used by the DASH Client optimizing the processing. \n * For details, see subclause 5.8.4.9. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ - virtual const std::vector& GetSupplementalProperties () const = 0; - - /** + virtual const std::vector& GetSupplementalProperties () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IEventStream objects, each of which specifies Event Stream information.\n * For more details see section 5.10.2. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IEventStream objects */ - virtual const std::vector& GetEventStreams () const = 0; - - /** + virtual const std::vector& GetEventStreams () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::ISwitching objects, each of which specifies a switch-to times and types for the associated Representations.\n * For more details, refer to subclause 5.3.3.4. of ISO/IEC 23009-1.\n - * These elements shall only be present if the \c @timescale value is the same for all Representations in one Adaptation Set and if the Segment Timeline is used for segment duration signalling. - * + * These elements shall only be present if the \c @timescale value is the same for all Representations in one Adaptation Set and if the Segment Timeline is used for segment duration signalling. + * * @return a reference to a vector of pointers to dash::mpd::ISwitching objects */ - virtual const std::vector& GetSwitchings () const = 0; - - /** + virtual const std::vector& GetSwitchings () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IRandomAccess objects, each of which specifies a random access times and types for the associated Representations. * For more details, refer to subclause 5.3.5.5. of ISO/IEC 23009-1.\n * These elements shall only be present if the \c @timescale value is the same for all Representations in one Adaptation Set and if the Segment Timeline is used for segment duration signalling. - * + * * @return a reference to a vector of pointers to dash::mpd::IRandomAccess objects */ - virtual const std::vector& GetRandomAccesses () const = 0; - - /** + virtual const std::vector& GetRandomAccesses () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify summary labels for a group of Labels. * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::ILabel objects */ - virtual const std::vector& GetGroupLabels () const = 0; - - /** + virtual const std::vector& GetGroupLabels () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::ILabel objects that specify textual descriptions of the elements that may be used for annotation and selection purposes. - * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. - * + * For more details, refer to subclause 5.3.10. of ISO/IEC 23009-1. + * * @return a reference to a vector of pointers to dash::mpd::ILabel objects */ - virtual const std::vector& GetLabels () const = 0; - - /** + virtual const std::vector& GetLabels () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IContentPopularityRate objects that indicates a level of popularity of the containing entity (i.e., the Adaptation Set, Representation or Preselection) within the Media Presentation. - * For details, see subclause 5.14. of ISO/IEC 23009-1.\n - * \b NOTE This element is primarily introduced for the usage of Pre-Selections and Adaptation Sets but use for Representation and Sub-Representations is not precluded. - * + * For details, see subclause 5.14. of ISO/IEC 23009-1.\n + * \b NOTE This element is primarily introduced for the usage of Pre-Selections and Adaptation Sets but use for Representation and Sub-Representations is not precluded. + * * @return a reference to a vector of pointers to dash::mpd::IContentPopularityRate objects */ - virtual const std::vector& GetContentPopularityRates () const = 0; - - /** + virtual const std::vector& GetContentPopularityRates () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IProducerReferenceTime objects that specifies the presence and possibly values of producer reference time in the associated Representations. * For details, refer to subclause 5.12. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IProducerReferenceTime objects */ - virtual const std::vector& GetProducerReferenceTimes () const = 0; - - /** + virtual const std::vector& GetProducerReferenceTimes () const = 0; + + /** * Returns a reference to a vector of pointers to dash::mpd::IResync objects that specifies information on Segments’ resynchronization points. \n - * For details refer to subclause 5.3.12. of ISO/IEC 23009-1. + * For details refer to subclause 5.3.12. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of pointers to dash::mpd::IResync objects */ - virtual const std::vector& GetResyncs () const = 0; + virtual const std::vector& GetResyncs () const = 0; /** * Returns a reference to a vector of strings that specifies the profiles which the associated Representation(s) @@ -168,7 +168,7 @@ namespace dash * The same syntax as defined in 5.3.1.2 shall be used. * @return a reference to a vector of strings */ - virtual const std::vector& GetProfiles () const = 0; + virtual const std::vector& GetProfiles () const = 0; /** * Returns an integer that specifies the horizontal visual presentation size of the video @@ -178,14 +178,14 @@ namespace dash * after encoded samples are cropped in response to encoded cropping parameters, “overscan” signaling, or “pan/scan” display parameters, e.g. SEI messages. * @return an unsigned integer */ - virtual uint32_t GetWidth () const = 0; + virtual uint32_t GetWidth () const = 0; /** * Returns an integer that specifies the vertical visual presentation size of the video * media type, on a grid determined by the \c \@sar attribute. * @return an unsigned integer */ - virtual uint32_t GetHeight () const = 0; + virtual uint32_t GetHeight () const = 0; /** * Returns a string that specifies the sample aspect ratio of the video media component type, @@ -194,7 +194,7 @@ namespace dash * The second number specifies the vertical size of the encoded video pixels (samples) in same units as the horizontal size. * @return a string */ - virtual std::string GetSar () const = 0; + virtual std::string GetSar () const = 0; /** * Returns a string that specifies the output frame rate (or in the case of interlaced, half the output field rate) @@ -204,7 +204,7 @@ namespace dash * The frame rate is the division F/D, or F, respectively, per second (i.e. the default value of D is \"1\"). * @return a string */ - virtual std::string GetFrameRate () const = 0; + virtual std::string GetFrameRate () const = 0; /** * Returns a string that represents an audio sampling rate. \n @@ -212,14 +212,14 @@ namespace dash * values specifying the minimum and maximum sampling rate of the audio media component type. The values are in samples per second. * @return a string */ - virtual std::string GetAudioSamplingRate () const = 0; + virtual std::string GetAudioSamplingRate () const = 0; /** * Returns a string that specifies the MIME type of the concatenation of the Initialization Segment, if present, * and all consecutive Media Segments in the Representation. * @return a string */ - virtual std::string GetMimeType () const = 0; + virtual std::string GetMimeType () const = 0; /** * Returns a reference to a vector of strings that specifies the profiles of Segments that are essential to process the Representation. @@ -230,7 +230,7 @@ namespace dash * If not present on any level, the value may be deducted from the value of the\c \@profiles attribute. * @return a reference to a vector of strings */ - virtual const std::vector& GetSegmentProfiles () const = 0; + virtual const std::vector& GetSegmentProfiles () const = 0; /** * Returns a reference to a vector of strings that specifies the codecs present within the Representation. @@ -240,7 +240,7 @@ namespace dash * mapped into the name space for codecs as specified in RFC6381, Section 3.3, shall be used. * @return a reference to a vector of strings */ - virtual const std::vector& GetCodecs () const = 0; + virtual const std::vector& GetCodecs () const = 0; /** * Returns a double value specifying the maximum SAP interval in seconds of all contained media streams, @@ -248,21 +248,21 @@ namespace dash * inclusive of one media stream in the associated Representations. * @return a double */ - virtual double GetMaximumSAPPeriod () const = 0; + virtual double GetMaximumSAPPeriod () const = 0; /** * Returns an unsigned integer that (when greater than 0) specifies that in the associated Representations, * each Media Segment starts with a SAP of type less than or equal to the value of this attribute value in each media stream. * @return an unsigned integer */ - virtual uint8_t GetStartWithSAP () const = 0; + virtual uint8_t GetStartWithSAP () const = 0; /** * Returns a double that specifies the maximum playout rate as a multiple of the regular playout rate, * which is supported with the same decoder profile and level requirements as the normal playout rate. * @return a double */ - virtual double GetMaxPlayoutRate () const = 0; + virtual double GetMaxPlayoutRate () const = 0; /** * Returns a bool value that informs about coding dependency.\n @@ -271,28 +271,28 @@ namespace dash * If not specified on any level, there may or may not be coding dependency between access units. * @return a bool value */ - virtual bool HasCodingDependency () const = 0; + virtual bool HasCodingDependency () const = 0; /** * Returns a string that specifies the scan type of the source material of the video media component type. * The value may be equal to one of \c \"progressive\", \c \"interlaced\" and \c \"unknown\". * @return a string */ - virtual std::string GetScanType () const = 0; - - /** - * Returns a string that specifies the selection priority for the described data structures, i.e. the one described by the containing element. - * In the absence of other information, higher numbers are the preferred selection over lower numbers. + virtual std::string GetScanType () const = 0; + + /** + * Returns a string that specifies the selection priority for the described data structures, i.e. the one described by the containing element. + * In the absence of other information, higher numbers are the preferred selection over lower numbers. * @return an unsigned integer */ - virtual uint32_t GetSelectionPriority () const = 0; - - /** - * Returns a string that specifies the tag of the Representation, Adaptation Set or Preselection which may be used for selection purposes towards the decoder. \n - * NOTE This attribute is primarily introduced for the usage of Pre-Selections and Adaptation Sets, but future use for Representation and Sub-Representations is not precluded. + virtual uint32_t GetSelectionPriority () const = 0; + + /** + * Returns a string that specifies the tag of the Representation, Adaptation Set or Preselection which may be used for selection purposes towards the decoder. \n + * NOTE This attribute is primarily introduced for the usage of Pre-Selections and Adaptation Sets, but future use for Representation and Sub-Representations is not precluded. * @return a string */ - virtual std::string GetTag () const = 0; + virtual std::string GetTag () const = 0; }; } diff --git a/libdash/libdash/include/IResync.h b/libdash/libdash/include/IResync.h index c01aa73a..a126be7b 100644 --- a/libdash/libdash/include/IResync.h +++ b/libdash/libdash/include/IResync.h @@ -52,68 +52,68 @@ namespace dash { public: virtual ~IResync(){} - - /** + + /** * Returns an unsigned integer that specifies the type of the Resync Point. \n - * If 0, specifies that on Segment format level the Resync Points present allow parsing and decryption to access the Segments, in combination with the Initialization Segment of the corresponding Representation (if present). \n - * For all Segment formats defined in this document, the following holds: \n - * If greater than 0, specifies that one or multiple Resync Points are present with the properties of \c @type=0 and the properties defined in the element in each corresponding Segment with SAP type being equal or smaller than the one indicated in the value. \n - * For details on SAP types, refer to subclause 4.5.2. of ISO/IEC 23009-1. + * If 0, specifies that on Segment format level the Resync Points present allow parsing and decryption to access the Segments, in combination with the Initialization Segment of the corresponding Representation (if present). \n + * For all Segment formats defined in this document, the following holds: \n + * If greater than 0, specifies that one or multiple Resync Points are present with the properties of \c @type=0 and the properties defined in the element in each corresponding Segment with SAP type being equal or smaller than the one indicated in the value. \n + * For details on SAP types, refer to subclause 4.5.2. of ISO/IEC 23009-1. * - * @return an unsigned integer + * @return an unsigned integer */ virtual uint32_t GetType () const = 0; - - /** + + /** * Returns an unsigned integer that specifies the maximum difference of the Time values of any two consecutive Resynchronization Points that are included in the @type definition above in any Media Segment for this Representation. \n - * The value is expressed in scale of the \c @timescale of the corresponding Representation. \n - * If not present, the value is unknown. - * + * The value is expressed in scale of the \c @timescale of the corresponding Representation. \n + * If not present, the value is unknown. + * * @return an unsigned integer */ virtual uint32_t GetDT () const = 0; - - /** + + /** * Returns a float that specifies the maximum difference of the Index values of any two consecutive Resync Points that are included in the \c @type definition above in any Media Segment for this Representation normalized by the \c @bandwidth value of the Representation. \n - * To obtain the maximum difference in octets, the value of \c @dImax is multiplied with the \c @bandwidth value. \n - * If not present, the value is unknown. - * + * To obtain the maximum difference in octets, the value of \c @dImax is multiplied with the \c @bandwidth value. \n + * If not present, the value is unknown. + * * @return a float */ virtual float GetDIMax () const = 0; - - /** + + /** * Returns a float that specifies the minimum difference of the Index values of any two consecutive Resynchronization Points that are included in the \c @type definition of this element in any Media Segment for this Representation normalized by the \c @bandwidth value of the Representation. \n - * To obtain the minimum difference in octets, the value of \c @dImin is multiplied with the \c @bandwidth value. \n - * If not present, the value is assumed to be 0. - * + * To obtain the minimum difference in octets, the value of \c @dImin is multiplied with the \c @bandwidth value. \n + * If not present, the value is assumed to be 0. + * * @return a float */ virtual float GetDIMin () const = 0; - - /** + + /** * Returns a bool value that, if set to TRUE, specifies that every Resynchronization Point includes a specific marker for Resynchronization Point detection. \n - * If not present or FALSE, the presence of a marker for every signalled Resynchronization Point cannot be expected. \n - * Every Segment format making use of this functionality must specify a Resynchronization Marker. For details refer to the Segment formats in clause 5.15. of of ISO/IEC 23009-1. - * + * If not present or FALSE, the presence of a marker for every signalled Resynchronization Point cannot be expected. \n + * Every Segment format making use of this functionality must specify a Resynchronization Marker. For details refer to the Segment formats in clause 5.15. of of ISO/IEC 23009-1. + * * @return a bool value */ virtual bool HasMarker () const = 0; - - /** + + /** * Returns a bool value that informs about the range access status. - * + * * @return a bool value */ virtual bool HasRangeAccess () const = 0; - - /** - * Returns a reference to a string that specifies the index URI. + + /** + * Returns a reference to a string that specifies the index URI. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetIndex () const = 0; - + }; } } diff --git a/libdash/libdash/include/ISegmentBase.h b/libdash/libdash/include/ISegmentBase.h index 62858901..36dccff0 100644 --- a/libdash/libdash/include/ISegmentBase.h +++ b/libdash/libdash/include/ISegmentBase.h @@ -53,8 +53,8 @@ namespace dash * @return a pointer to dash::mpd::IURLType object */ virtual const IURLType* GetRepresentationIndex () const = 0; - - /** + + /** * Returns a pointer to a dash::mpd::IFailoverContent object that specifies the sections that contain failover content. * @return a pointer to dash::mpd::IFailoverContent object */ @@ -67,16 +67,16 @@ namespace dash * @return an unsigned integer */ virtual uint32_t GetTimescale () const = 0; - - /** - * Returns an integer that specifies the difference between the earliest presentation time in the Representation and the value of the @presentationTimeOffset. \n - * The value of the earliest presentation time of the first Media Segment in this Representation in seconds is computed as the sum of the value of this attribute and - * the value of the @presentationTimeOffset in units of the @timescale attribute. \n - * If not present on any level, but the \c SegmentTimeline element is present, then the value is the value of the @t attribute of the first \c S element in the Segment minus the value of the @presentationTimeOffset. \n - * Otherwise, it assumed to be 0. + + /** + * Returns an integer that specifies the difference between the earliest presentation time in the Representation and the value of the @presentationTimeOffset. \n + * The value of the earliest presentation time of the first Media Segment in this Representation in seconds is computed as the sum of the value of this attribute and + * the value of the @presentationTimeOffset in units of the @timescale attribute. \n + * If not present on any level, but the \c SegmentTimeline element is present, then the value is the value of the @t attribute of the first \c S element in the Segment minus the value of the @presentationTimeOffset. \n + * Otherwise, it assumed to be 0. * @return an integer */ - virtual int GetEptDelta () const = 0; + virtual int GetEptDelta () const = 0; /** * Returns an integer that specifies the presentation time offset of the Representation relative to the start of the Period.\n @@ -85,23 +85,23 @@ namespace dash * @return an unsigned integer */ virtual uint64_t GetPresentationTimeOffset () const = 0; - - /** + + /** * Returns an integer that specifies the presentation duration of the Representation in the Period. \n - * The value of the presentation duration in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. - * Specifically, the sum of the value of the \c @presentationTimeOffset, if present, or 0 otherwise and the value of this attribute is the last presentation time to be presented for this Representation. \n - * If not present on any level, the value of this attribute is unknown and the Representation should be presented until the end of the Period, i.e. until the presentation is terminated or until the next Period starts. + * The value of the presentation duration in seconds is the division of the value of this attribute and the value of the \c @timescale attribute. + * Specifically, the sum of the value of the \c @presentationTimeOffset, if present, or 0 otherwise and the value of this attribute is the last presentation time to be presented for this Representation. \n + * If not present on any level, the value of this attribute is unknown and the Representation should be presented until the end of the Period, i.e. until the presentation is terminated or until the next Period starts. * @return an unsigned integer */ - virtual uint64_t GetPresentationDuration () const = 0; - - /** + virtual uint64_t GetPresentationDuration () const = 0; + + /** * Returns a string that specifies the duration of the time shifting buffer for this Representation that is guaranteed to be available for a Media Presentation with type 'dynamic'. When not present, the value is of the \c @timeShiftBufferDepth - * on MPD level applies. If present, this value shall be not smaller than the value on MPD level. This value of the attribute is undefined if the \c @type attribute is equal to 'static'. \n - * \n NOTE When operating in a time-shift buffer on a Representation with value larger than the time-shift buffer signalled on MPD level, not all Representations are necessarily available for switching. + * on MPD level applies. If present, this value shall be not smaller than the value on MPD level. This value of the attribute is undefined if the \c @type attribute is equal to 'static'. \n + * \n NOTE When operating in a time-shift buffer on a Representation with value larger than the time-shift buffer signalled on MPD level, not all Representations are necessarily available for switching. * @return a reference to a string */ - virtual const std::string& GetTimeShiftBufferDepth () const = 0; + virtual const std::string& GetTimeShiftBufferDepth () const = 0; /** * Returns a string that specifies the byte range that contains the Segment Index in all Media Segments of the Representation.\n @@ -117,24 +117,24 @@ namespace dash * @return a bool value */ virtual bool HasIndexRangeExact () const = 0; - - /** + + /** * Returns a double that specifies an offset to define the adjusted segment availability time. The value is specified in seconds, possibly with arbitrary precision. \n - * The offset provides the time how much earlier these segments are available compared to their computed availability start time for all Segments of all associated Representation. \n - * The segment availability start time defined by this value is referred to as adjusted segment availability start time. For details on computing the adjusted segment availability start time, refer to subclause 5.3.9.5. of ISO/IEC 23009-1. \n - * If not present, no adjusted segment availability start time is defined. \n - * \b NOTE The value of \c "INF" implies availability of all segments starts at \c MPD@availabilityStartTime. + * The offset provides the time how much earlier these segments are available compared to their computed availability start time for all Segments of all associated Representation. \n + * The segment availability start time defined by this value is referred to as adjusted segment availability start time. For details on computing the adjusted segment availability start time, refer to subclause 5.3.9.5. of ISO/IEC 23009-1. \n + * If not present, no adjusted segment availability start time is defined. \n + * \b NOTE The value of \c "INF" implies availability of all segments starts at \c MPD@availabilityStartTime. * @return a double */ - virtual double GetAvailabilityTimeOffset () const = 0; - - /** + virtual double GetAvailabilityTimeOffset () const = 0; + + /** * Returns a boolean that specifies if all Segments of all associated Representation are complete at the adjusted availability start time. The attribute shall be ignored if \c @availabilityTimeOffset is not present on any level. \n - * If not present on any level, the value is inferred to true. \n - * \b NOTE If the value is set to false, then it can be inferred by the client that the segment is available at its announced location prior being complete. + * If not present on any level, the value is inferred to true. \n + * \b NOTE If the value is set to false, then it can be inferred by the client that the segment is available at its announced location prior being complete. * @return a bool value */ - virtual bool IsAvailabilityTimeComplete () const = 0; + virtual bool IsAvailabilityTimeComplete () const = 0; }; } } diff --git a/libdash/libdash/include/ISegmentList.h b/libdash/libdash/include/ISegmentList.h index 3bb55afe..582c7e33 100644 --- a/libdash/libdash/include/ISegmentList.h +++ b/libdash/libdash/include/ISegmentList.h @@ -54,21 +54,21 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetXlinkActuate () const = 0; - - /** + + /** * Returns a reference to a string that specifies the type of W3C XLINK being used. \n - * In the context of this document, all references shall be W3C XLINK simple links. The attribute \c @xlink:type is optional with fixed setting \c @xlink:type="simple". . + * In the context of this document, all references shall be W3C XLINK simple links. The attribute \c @xlink:type is optional with fixed setting \c @xlink:type="simple". . * @return a reference to a string */ - virtual const std::string& GetXlinkType () const = 0; - - /** - * Returns a reference to a string that specifies the desired behaviour of the remote element entity once dereferenced from within an MPD as defined in W3C XLINK. \n - * In the context of this document, the attribute \c @xlink:show is optional with fixed setting \c @xlink:show="embed". \n - * \b NOTE In W3C XLINK, the behaviour of conforming XLink applications when embedding as a remote element entity is not defined. Thus, the actual behaviour for this document is defined in subclause 5.5.3. of ISO/IEC 23009-1. + virtual const std::string& GetXlinkType () const = 0; + + /** + * Returns a reference to a string that specifies the desired behaviour of the remote element entity once dereferenced from within an MPD as defined in W3C XLINK. \n + * In the context of this document, the attribute \c @xlink:show is optional with fixed setting \c @xlink:show="embed". \n + * \b NOTE In W3C XLINK, the behaviour of conforming XLink applications when embedding as a remote element entity is not defined. Thus, the actual behaviour for this document is defined in subclause 5.5.3. of ISO/IEC 23009-1. * @return a reference to a string */ - virtual const std::string& GetXlinkShow () const = 0; + virtual const std::string& GetXlinkShow () const = 0; }; } diff --git a/libdash/libdash/include/IServiceDescription.h b/libdash/libdash/include/IServiceDescription.h index 165c3f4a..3799ab2f 100644 --- a/libdash/libdash/include/IServiceDescription.h +++ b/libdash/libdash/include/IServiceDescription.h @@ -2,10 +2,10 @@ * @class dash::mpd::IServiceDescription * @brief This interface is needed for accessing the attributes and elements of ServiceDescription * as specified in ISO/IEC 23009-1, subclause K.4.2.1, Table K.5. - * @details The service description may be scoped to a specific client or to an operational mode of the client. This can be expressed by using a Scope descriptor that is defined by the application. \n + * @details The service description may be scoped to a specific client or to an operational mode of the client. This can be expressed by using a Scope descriptor that is defined by the application. \n * It is the service provider's responsibility to ensure that the service description is not contradicting in itself and can be used by clients, for example minimum, target and maximum latency should be in non decreasing order. * Service descriptions with inconsistent or unachievable settings are expected to be ignored by the client. \n - * The semantics of the attributes and elements within a \b ServiceDescription element are provided in subclause K.4.2.1, Table K.5. The XML syntax of the \b ServiceDescription element is provided in subclause K.4.3. + * The semantics of the attributes and elements within a \b ServiceDescription element are provided in subclause K.4.2.1, Table K.5. The XML syntax of the \b ServiceDescription element is provided in subclause K.4.3. * @see dash::mpd::IMPDElement dash::mpd::IDescriptor dash::mpd::ILatency dash::mpd::IPlaybackRate dash::mpd::IOperatingQuality dash::mpd::IOperatingBandwidth * * @author Daniele Lorenzi \n @@ -37,49 +37,49 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify the scopes of the Service Description. - * If present, this Service Description only targets DASH Clients identified by this Scope descriptor. - * DASH Clients not in scope, i.e. not recognizing any of the scope descriptor elements, are expected to ignore this service description. + * If present, this Service Description only targets DASH Clients identified by this Scope descriptor. + * DASH Clients not in scope, i.e. not recognizing any of the scope descriptor elements, are expected to ignore this service description. * If no Scope element is present, the Service Description applies to all clients. - * + * * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects */ virtual const std::vector& GetScope () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::ILatency objects that specify the latency targets for the service. - * The details are provided in subclause K.4.2.2, Table K.6. + * The details are provided in subclause K.4.2.2, Table K.6. * * @return a reference to a vector of pointers to dash::mpd::ILatency objects */ virtual const std::vector& GetLatency () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IPlaybackRate objects that specify the playback rate targets for the service. - * The details are provided in subclause K.4.2.3, Table K.7. + * The details are provided in subclause K.4.2.3, Table K.7. * * @return a reference to a vector of pointers to dash::mpd::IPlaybackRate objects */ virtual const std::vector& GetPlaybackRate () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IOperatingQuality objects that specify the operating quality targets for the service. - * The details are provided in subclause K.4.2.4, Table K.8. + * The details are provided in subclause K.4.2.4, Table K.8. * * @return a reference to a vector of pointers to dash::mpd::IOperatingQuality objects */ virtual const std::vector& GetOperatingQuality () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IOperatingBandwidth objects that specify the operating bandwidth targets for the service. - * The details are provided in subclause K.4.2.5, Table K.9. + * The details are provided in subclause K.4.2.5, Table K.9. * * @return a reference to a vector of pointers to dash::mpd::IOperatingBandwidth objects */ virtual const std::vector& GetOperatingBandwidth () const = 0; - - /** + + /** * Returns an unsigned integer that specifies a unique identifier for this Service Description. - * The attribute shall be a unique unsigned integer value amongst \b ServiceDescription elements in the scope of the MPD. + * The attribute shall be a unique unsigned integer value amongst \b ServiceDescription elements in the scope of the MPD. * * @return an unsigned integer */ diff --git a/libdash/libdash/include/ISubset.h b/libdash/libdash/include/ISubset.h index cd94e292..ae4164a8 100644 --- a/libdash/libdash/include/ISubset.h +++ b/libdash/libdash/include/ISubset.h @@ -51,12 +51,12 @@ namespace dash * @return a reference to a vector of unsigned integers */ virtual const std::vector& Contains () const = 0; - - /** + + /** * Returns a reference to a string that specifies a unique identifier for the Subset. * @return a reference to a string */ - virtual const std::string& GetId () const = 0; + virtual const std::string& GetId () const = 0; }; } } diff --git a/libdash/libdash/include/ISwitching.h b/libdash/libdash/include/ISwitching.h index 64e52a9b..989b9e9d 100644 --- a/libdash/libdash/include/ISwitching.h +++ b/libdash/libdash/include/ISwitching.h @@ -2,7 +2,7 @@ * @class dash::mpd::ISwitching * @brief This interface is needed for accessing the common attributes of Switching * @details Switching refers to the presentation of decoded data from one Representation up to a certain time t, and presentation of decoded data of another Representation from time t onwards; - * for details, refer to subclause 4.3.\n + * for details, refer to subclause 4.3.\n * The \b Switching element as defined in Table 6 provides instructions of switch points within an Adaptation Set and the permitted switching options as defined in Table 7. * When this element is present, it signals opportunities for simple switching across Representations in one Adaptation Set. This element may be used instead of the attributes \c @segmentAlignment or \c @bitstreamSwitching.\n * Table 7 defines different switching strategies that provide instructions to the client on the procedures to switch appropriately within an Adaptation Set. @@ -29,25 +29,25 @@ namespace dash { public: virtual ~ISwitching(){} - - /** + + /** * Returns an unsigned integer that specifies the interval between two switching points in the scale of the \c @timescale on Representation level.\n * Any Segment for which the earliest presentation time minus the \c @t value of the \b S element describing the segment is an integer multiple of the product of \c @timescale and \c @interval is a switch-to opportunity, * i.e. it enables to switch to this Representation with the switching strategy as defined by the \c @type value.\n - * The value should be chosen such that the resulting time matches MPD start time of segments, otherwise no switching will be described. - * + * The value should be chosen such that the resulting time matches MPD start time of segments, otherwise no switching will be described. + * * @return an unsigned integer */ virtual uint32_t GetInterval () const = 0; - - /** - * Returns a reference to a string that specifies the switching strategy for the switch points identified in by the \c @interval attribute.\n - * Switching strategies are defined in Table 7 of ISO/IEC 23009-1. + + /** + * Returns a reference to a string that specifies the switching strategy for the switch points identified in by the \c @interval attribute.\n + * Switching strategies are defined in Table 7 of ISO/IEC 23009-1. * - * @return a reference to a string + * @return a reference to a string */ virtual const std::string& GetType () const = 0; - + }; } } diff --git a/libdash/libdash/include/IUIntPairs.h b/libdash/libdash/include/IUIntPairs.h index d65b34e8..34ae2dce 100644 --- a/libdash/libdash/include/IUIntPairs.h +++ b/libdash/libdash/include/IUIntPairs.h @@ -25,21 +25,21 @@ namespace dash { public: virtual ~IUIntPairs(){} - - /** - * Returns an unsigned integer that specifies a latency value for the service in milliseconds. + + /** + * Returns an unsigned integer that specifies a latency value for the service in milliseconds. * * @return an unsigned integer */ virtual uint32_t GetLatency () const = 0; - + /** - * Returns an unsigned integer that specifies the quality of the service at the above latency with 0 being the lowest and 100 being the highest. + * Returns an unsigned integer that specifies the quality of the service at the above latency with 0 being the lowest and 100 being the highest. * * @return an unsigned integer */ virtual uint32_t GetQuality () const = 0; - + }; } } diff --git a/libdash/libdash/include/IUIntPairsWithID.h b/libdash/libdash/include/IUIntPairsWithID.h index 16315d8e..e014ca09 100644 --- a/libdash/libdash/include/IUIntPairsWithID.h +++ b/libdash/libdash/include/IUIntPairsWithID.h @@ -29,19 +29,19 @@ namespace dash /** * Returns a reference to a vector of pointers to dash::mpd::IUIntPairs objects that define a list of latency and quality pairs. - * + * * @return a reference to a vector of pointers to dash::mpd::IUIntPairs objects */ virtual const std::vector& GetQualityLatency () const = 0; - /** + /** * Returns a reference to a string that defines defines the interpretation of the value of Quality. - * If not present, the quality is considered in linear scale. + * If not present, the quality is considered in linear scale. * * @return a reference to a string */ virtual const std::string& GetType () const = 0; - + }; } } diff --git a/libdash/libdash/include/IUIntVWithID.h b/libdash/libdash/include/IUIntVWithID.h index 66ac435a..7e879c11 100644 --- a/libdash/libdash/include/IUIntVWithID.h +++ b/libdash/libdash/include/IUIntVWithID.h @@ -30,24 +30,24 @@ namespace dash { public: virtual ~IUIntVWithID(){} - - - /** + + + /** * Returns a reference to a vector of unsigned integers that specifies the list of ids relative to the Initialization Set, Group or Presentation as specified in 5.3.12.4. of ISO/IEC 23009-1. - * + * * @return a reference to a vector of unsigned integers */ virtual const std::vector& GetList () const = 0; - - /** + + /** * Returns an unsigned integer that specifies a unique identifier for this \b InitializationGroup or \b InitializationPresentation element. - * The attribute shall be a unique unsigned integer value amongst all InitializationSet, InitializationGroup and InitializationPresentation ids in the scope of the MPD. - * + * The attribute shall be a unique unsigned integer value amongst all InitializationSet, InitializationGroup and InitializationPresentation ids in the scope of the MPD. + * * @return an unsigned integer */ virtual uint32_t GetId () const = 0; - - /** + + /** * Returns a reference to a vector of strings that specifies the profiles which the associated InitializationGroup(s) or InitializationPresentation(s) * conform to of the list of Media Presentation profiles as described in section 8 of ISO/IEC 23009-1. * The value shall be a subset of the respective value in any higher level of the document hierarchy and express conformance to DASH Profiles or Interoperability Points.\n @@ -55,16 +55,16 @@ namespace dash * @return a reference to a vector of strings */ virtual const std::vector& GetProfiles () const = 0; - - /** + + /** * Returns a reference to a string that specifies the media content component type for this Initialization Set. - * A value of the top-level Content-type 'type' value as defined in IETF RFC 6838:2013, Clause 4 shall be taken. \n - * If not present, the media content component type may be defined for each media component or it may be unknown. - * + * A value of the top-level Content-type 'type' value as defined in IETF RFC 6838:2013, Clause 4 shall be taken. \n + * If not present, the media content component type may be defined for each media component or it may be unknown. + * * @return a reference to a string */ virtual const std::string& GetContentType () const = 0; - + }; } } diff --git a/libdash/libdash/source/mpd/AdaptationSet.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index 2223830f..317acd44 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -24,8 +24,8 @@ AdaptationSet::AdaptationSet () : segmentTemplate(NULL), xlinkHref(""), xlinkActuate("onRequest"), - xlinkType(""), - xlinkShow(""), + xlinkType(""), + xlinkShow(""), id(0), lang(""), contentType(""), diff --git a/libdash/libdash/source/mpd/AdaptationSet.h b/libdash/libdash/source/mpd/AdaptationSet.h index 8b09fb7a..13b4af81 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -49,8 +49,8 @@ namespace dash const std::vector& GetRepresentation () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; - const std::string& GetXlinkType () const; - const std::string& GetXlinkShow () const; + const std::string& GetXlinkType () const; + const std::string& GetXlinkShow () const; uint32_t GetId () const; uint32_t GetGroup () const; const std::string& GetLang () const; @@ -72,7 +72,7 @@ namespace dash uint32_t GetSubsegmentAlignment () const; uint8_t GetSubsegmentStartsWithSAP () const; bool GetBitstreamSwitching () const; - const std::vector& GetInitializationSetRef () const; + const std::vector& GetInitializationSetRef () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -86,7 +86,7 @@ namespace dash void AddRepresentation (Representation* representation); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); - void SetXlinkType (const std::string& xlinkType); + void SetXlinkType (const std::string& xlinkType); void SetXlinkShow (const std::string& xlinkShow); void SetId (uint32_t id); void SetGroup (uint32_t group); @@ -105,7 +105,7 @@ namespace dash void SetSubsegmentAlignment (const std::string& subsegmentAlignment); void SetSubsegmentStartsWithSAP (uint8_t subsegmentStartsWithSAP); void SetBitstreamSwitching (bool value); - void SetInitializationSetRef (const std::string& initializationSetRef); + void SetInitializationSetRef (const std::string& initializationSetRef); private: std::vector accessibility; @@ -120,7 +120,7 @@ namespace dash std::vector representation; std::string xlinkHref; std::string xlinkActuate; - std::string xlinkType; + std::string xlinkType; std::string xlinkShow; uint32_t id; uint32_t group; @@ -143,7 +143,7 @@ namespace dash uint32_t subsegmentAlignment; uint8_t subsegmentStartsWithSAP; bool isBitstreamSwitching; - std::vector initializationSetRef; + std::vector initializationSetRef; }; } } diff --git a/libdash/libdash/source/mpd/BaseUrl.cpp b/libdash/libdash/source/mpd/BaseUrl.cpp index 006e0efc..33b9b267 100644 --- a/libdash/libdash/source/mpd/BaseUrl.cpp +++ b/libdash/libdash/source/mpd/BaseUrl.cpp @@ -21,7 +21,7 @@ BaseUrl::BaseUrl () : url(""), serviceLocation(""), byteRange(""), - timeShiftBufferDepth("") + timeShiftBufferDepth("") { } BaseUrl::~BaseUrl () @@ -60,11 +60,11 @@ void BaseUrl::SetAvailabilityTimeOffset (double availability { this->availabilityTimeOffset = availabilityTimeOffset; } -bool BaseUrl::IsAvailabilityTimeComplete () const +bool BaseUrl::IsAvailabilityTimeComplete () const { return this->availabilityTimeComplete; } -void BaseUrl::SetAvailabilityTimeComplete (bool availabilityTimeComplete) +void BaseUrl::SetAvailabilityTimeComplete (bool availabilityTimeComplete) { this->availabilityTimeComplete = availabilityTimeComplete; } @@ -75,7 +75,7 @@ const std::string& BaseUrl::GetTimeShiftBufferDepth () const void BaseUrl::SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth) { this->timeShiftBufferDepth = timeShiftBufferDepth; -} +} ISegment* BaseUrl::ToMediaSegment (const std::vector& baseurls) const { Segment *seg = new Segment(); diff --git a/libdash/libdash/source/mpd/BaseUrl.h b/libdash/libdash/source/mpd/BaseUrl.h index f4246350..c04d7fba 100644 --- a/libdash/libdash/source/mpd/BaseUrl.h +++ b/libdash/libdash/source/mpd/BaseUrl.h @@ -35,16 +35,16 @@ namespace dash const std::string& GetUrl () const; const std::string& GetServiceLocation () const; const std::string& GetByteRange () const; - double GetAvailabilityTimeOffset () const; - bool IsAvailabilityTimeComplete () const; - const std::string& GetTimeShiftBufferDepth () const; + double GetAvailabilityTimeOffset () const; + bool IsAvailabilityTimeComplete () const; + const std::string& GetTimeShiftBufferDepth () const; void SetUrl (const std::string& url); void SetServiceLocation (const std::string& serviceLocation); void SetByteRange (const std::string& byteRange); - void SetAvailabilityTimeOffset (double availabilityTimeOffset); - void SetAvailabilityTimeComplete (bool availabilityTimeComplete); - void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); + void SetAvailabilityTimeOffset (double availabilityTimeOffset); + void SetAvailabilityTimeComplete (bool availabilityTimeComplete); + void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); virtual ISegment* ToMediaSegment (const std::vector& baseurls) const; @@ -52,9 +52,9 @@ namespace dash std::string url; std::string serviceLocation; std::string byteRange; - double availabilityTimeOffset; - bool availabilityTimeComplete; - std::string timeShiftBufferDepth; + double availabilityTimeOffset; + bool availabilityTimeComplete; + std::string timeShiftBufferDepth; }; } } diff --git a/libdash/libdash/source/mpd/ContentComponent.cpp b/libdash/libdash/source/mpd/ContentComponent.cpp index eafacfcf..c3ec94c1 100644 --- a/libdash/libdash/source/mpd/ContentComponent.cpp +++ b/libdash/libdash/source/mpd/ContentComponent.cpp @@ -22,7 +22,7 @@ ContentComponent::ContentComponent () : lang(""), contentType(""), par(""), - tag("") + tag("") { } ContentComponent::~ContentComponent () diff --git a/libdash/libdash/source/mpd/ContentComponent.h b/libdash/libdash/source/mpd/ContentComponent.h index e0924134..00acde96 100644 --- a/libdash/libdash/source/mpd/ContentComponent.h +++ b/libdash/libdash/source/mpd/ContentComponent.h @@ -40,7 +40,7 @@ namespace dash const std::string& GetLang () const; const std::string& GetContentType () const; const std::string& GetPar () const; - const std::string& GetTag () const; + const std::string& GetTag () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -50,7 +50,7 @@ namespace dash void SetLang (const std::string& lang); void SetContentType (const std::string& contentType); void SetPar (const std::string& par); - void SetTag (const std::string& tag); + void SetTag (const std::string& tag); private: std::vector accessibility; @@ -61,7 +61,7 @@ namespace dash std::string lang; std::string contentType; std::string par; - std::string tag; + std::string tag; }; } } diff --git a/libdash/libdash/source/mpd/ContentPopularityRate.cpp b/libdash/libdash/source/mpd/ContentPopularityRate.cpp index b1541ee8..22309852 100644 --- a/libdash/libdash/source/mpd/ContentPopularityRate.cpp +++ b/libdash/libdash/source/mpd/ContentPopularityRate.cpp @@ -15,12 +15,12 @@ using namespace dash::mpd; ContentPopularityRate::ContentPopularityRate () : source(""), - sourceDescription("") + sourceDescription("") { } ContentPopularityRate::~ContentPopularityRate () { - for(size_t i = 0; i < this->popularityRates.size(); i++) + for(size_t i = 0; i < this->popularityRates.size(); i++) delete(this->popularityRates.at(i)); } @@ -32,7 +32,7 @@ void ContentPopularityRate::AddPopularityRate { this->popularityRates.push_back(popularityRate); } -const std::string& ContentPopularityRate::GetSource () const +const std::string& ContentPopularityRate::GetSource () const { return this->source; } @@ -40,7 +40,7 @@ void ContentPopularityRate::SetSource { this->source = source; } -const std::string& ContentPopularityRate::GetSourceDescription () const +const std::string& ContentPopularityRate::GetSourceDescription () const { return this->sourceDescription; } diff --git a/libdash/libdash/source/mpd/ContentPopularityRate.h b/libdash/libdash/source/mpd/ContentPopularityRate.h index 346d1dbd..3287eb1c 100644 --- a/libdash/libdash/source/mpd/ContentPopularityRate.h +++ b/libdash/libdash/source/mpd/ContentPopularityRate.h @@ -28,18 +28,18 @@ namespace dash ContentPopularityRate (); virtual ~ContentPopularityRate (); - const std::vector& GetPopularityRates () const; - const std::string& GetSource () const; - const std::string& GetSourceDescription () const; + const std::vector& GetPopularityRates () const; + const std::string& GetSource () const; + const std::string& GetSourceDescription () const; - void AddPopularityRate (PopularityRate *popularityRate); - void SetSource (const std::string& source); - void SetSourceDescription (const std::string& sourceDescription); + void AddPopularityRate (PopularityRate *popularityRate); + void SetSource (const std::string& source); + void SetSourceDescription (const std::string& sourceDescription); private: - std::vector popularityRates; - std::string source; - std::string sourceDescription; + std::vector popularityRates; + std::string source; + std::string sourceDescription; }; } } diff --git a/libdash/libdash/source/mpd/Descriptor.cpp b/libdash/libdash/source/mpd/Descriptor.cpp index d4b35e51..2477344c 100644 --- a/libdash/libdash/source/mpd/Descriptor.cpp +++ b/libdash/libdash/source/mpd/Descriptor.cpp @@ -20,7 +20,7 @@ using namespace dash::mpd; Descriptor::Descriptor () : schemeIdUri (""), value (""), - id ("") + id ("") { } Descriptor::~Descriptor () diff --git a/libdash/libdash/source/mpd/Descriptor.h b/libdash/libdash/source/mpd/Descriptor.h index 6505d647..ec300f7b 100644 --- a/libdash/libdash/source/mpd/Descriptor.h +++ b/libdash/libdash/source/mpd/Descriptor.h @@ -33,16 +33,16 @@ namespace dash const std::string& GetSchemeIdUri () const; const std::string& GetValue () const; - const std::string& GetId () const; + const std::string& GetId () const; void SetValue (const std::string& value); void SetSchemeIdUri (const std::string& schemeIdUri); - void SetId (const std::string& id); + void SetId (const std::string& id); private: std::string schemeIdUri; std::string value; - std::string id; + std::string id; }; } } diff --git a/libdash/libdash/source/mpd/Event.cpp b/libdash/libdash/source/mpd/Event.cpp index 6148830e..e8b839fc 100644 --- a/libdash/libdash/source/mpd/Event.cpp +++ b/libdash/libdash/source/mpd/Event.cpp @@ -15,9 +15,9 @@ using namespace dash::mpd; Event::Event () : presentationTime(0), - contentEncoding(""), - messageData("") - + contentEncoding(""), + messageData("") + { } Event::~Event () @@ -40,7 +40,7 @@ void Event::SetDuration (const std::string& duration) { this->duration = duration; } -uint32_t Event::GetId () const +uint32_t Event::GetId () const { return this->id; } diff --git a/libdash/libdash/source/mpd/Event.h b/libdash/libdash/source/mpd/Event.h index f04a43d6..9f6afe93 100644 --- a/libdash/libdash/source/mpd/Event.h +++ b/libdash/libdash/source/mpd/Event.h @@ -29,23 +29,23 @@ namespace dash uint64_t GetPresentationTime () const; const std::string& GetDuration () const; - uint32_t GetId () const; - const std::string& GetContentEncoding () const; - const std::string& GetMessageData () const; + uint32_t GetId () const; + const std::string& GetContentEncoding () const; + const std::string& GetMessageData () const; void SetPresentationTime (uint64_t presentationTime); void SetDuration (const std::string& duration); - void SetId (uint32_t id); - void SetContentEncoding (const std::string& contentEncoding); - void SetMessageData (const std::string& messageData); + void SetId (uint32_t id); + void SetContentEncoding (const std::string& contentEncoding); + void SetMessageData (const std::string& messageData); private: uint64_t presentationTime; std::string duration; - uint32_t id; - std::string contentEncoding; - std::string messageData; - + uint32_t id; + std::string contentEncoding; + std::string messageData; + }; } } diff --git a/libdash/libdash/source/mpd/EventStream.cpp b/libdash/libdash/source/mpd/EventStream.cpp index 6834fbe4..c4468098 100644 --- a/libdash/libdash/source/mpd/EventStream.cpp +++ b/libdash/libdash/source/mpd/EventStream.cpp @@ -15,11 +15,11 @@ using namespace dash::mpd; EventStream::EventStream () : xlinkHref(""), - xlinkActuate("onRequest"), - schemeIdUri(""), - value(""), - presentationTimeOffset(0), - timescale(1) + xlinkActuate("onRequest"), + schemeIdUri(""), + value(""), + presentationTimeOffset(0), + timescale(1) { } EventStream::~EventStream () @@ -28,59 +28,59 @@ EventStream::~EventStream () delete(this->events.at(i)); } -const std::vector& EventStream::GetEvents () const +const std::vector& EventStream::GetEvents () const { return (std::vector &) this->events; } -void EventStream::AddEvent (Event *event) +void EventStream::AddEvent (Event *event) { this->events.push_back(event); } -const std::string& EventStream::GetXlinkHref () const +const std::string& EventStream::GetXlinkHref () const { return this->xlinkHref; } -void EventStream::SetXlinkHref (const std::string& xlinkHref) +void EventStream::SetXlinkHref (const std::string& xlinkHref) { this->xlinkHref = xlinkHref; } -const std::string& EventStream::GetXlinkActuate () const +const std::string& EventStream::GetXlinkActuate () const { return this->xlinkActuate; } -void EventStream::SetXlinkActuate (const std::string& xlinkActuate) +void EventStream::SetXlinkActuate (const std::string& xlinkActuate) { this->xlinkActuate = xlinkActuate; } -const std::string& EventStream::GetSchemeIdUri () const +const std::string& EventStream::GetSchemeIdUri () const { return this->schemeIdUri; } -void EventStream::SetSchemeIdUri (const std::string& schemeIdUri) +void EventStream::SetSchemeIdUri (const std::string& schemeIdUri) { this->schemeIdUri = schemeIdUri; } -const std::string& EventStream::GetValue () const +const std::string& EventStream::GetValue () const { return this->value; } -void EventStream::SetValue (const std::string& value) +void EventStream::SetValue (const std::string& value) { this->value = value; } -uint32_t EventStream::GetTimescale () const +uint32_t EventStream::GetTimescale () const { return this->timescale; } -void EventStream::SetTimescale (uint32_t timescale) +void EventStream::SetTimescale (uint32_t timescale) { this->timescale = timescale; } -uint64_t EventStream::GetPresentationTimeOffset () const +uint64_t EventStream::GetPresentationTimeOffset () const { return this->presentationTimeOffset; } -void EventStream::SetPresentationTimeOffset (uint64_t presentationTimeOffset) +void EventStream::SetPresentationTimeOffset (uint64_t presentationTimeOffset) { this->presentationTimeOffset = presentationTimeOffset; } \ No newline at end of file diff --git a/libdash/libdash/source/mpd/EventStream.h b/libdash/libdash/source/mpd/EventStream.h index 3c3d0b56..9775d94c 100644 --- a/libdash/libdash/source/mpd/EventStream.h +++ b/libdash/libdash/source/mpd/EventStream.h @@ -28,30 +28,30 @@ namespace dash EventStream (); virtual ~EventStream (); - const std::vector& GetEvents () const; - const std::string& GetXlinkHref () const; - const std::string& GetXlinkActuate () const; - const std::string& GetSchemeIdUri () const; - const std::string& GetValue () const; - uint32_t GetTimescale () const; - uint64_t GetPresentationTimeOffset () const; + const std::vector& GetEvents () const; + const std::string& GetXlinkHref () const; + const std::string& GetXlinkActuate () const; + const std::string& GetSchemeIdUri () const; + const std::string& GetValue () const; + uint32_t GetTimescale () const; + uint64_t GetPresentationTimeOffset () const; void AddEvent (Event *event); - void SetXlinkHref (const std::string& xlinkHref); - void SetXlinkActuate (const std::string& xlinkActuate); - void SetSchemeIdUri (const std::string& schemeIdUri); - void SetValue (const std::string& value); - void SetTimescale (uint32_t timescale); - void SetPresentationTimeOffset (uint64_t presentationTimeOffset); + void SetXlinkHref (const std::string& xlinkHref); + void SetXlinkActuate (const std::string& xlinkActuate); + void SetSchemeIdUri (const std::string& schemeIdUri); + void SetValue (const std::string& value); + void SetTimescale (uint32_t timescale); + void SetPresentationTimeOffset (uint64_t presentationTimeOffset); protected: std::vector events; - std::string xlinkHref; - std::string xlinkActuate; - std::string schemeIdUri; - std::string value; - uint32_t timescale; - uint64_t presentationTimeOffset; + std::string xlinkHref; + std::string xlinkActuate; + std::string schemeIdUri; + std::string value; + uint32_t timescale; + uint64_t presentationTimeOffset; }; } } diff --git a/libdash/libdash/source/mpd/FailoverContent.cpp b/libdash/libdash/source/mpd/FailoverContent.cpp index 7caeed83..6d7af009 100644 --- a/libdash/libdash/source/mpd/FailoverContent.cpp +++ b/libdash/libdash/source/mpd/FailoverContent.cpp @@ -31,7 +31,7 @@ void FailoverContent::AddFCS (FCS *fcs_el) { this->fcs.push_back(fcs_el); } -bool FailoverContent::IsValid () const +bool FailoverContent::IsValid () const { return this->valid; } diff --git a/libdash/libdash/source/mpd/FailoverContent.h b/libdash/libdash/source/mpd/FailoverContent.h index 06ff30ca..a0cedf0a 100644 --- a/libdash/libdash/source/mpd/FailoverContent.h +++ b/libdash/libdash/source/mpd/FailoverContent.h @@ -29,14 +29,14 @@ namespace dash virtual ~FailoverContent (); std::vector& GetFCS () const; - bool IsValid () const; + bool IsValid () const; void AddFCS (FCS *fcs_el); - void SetValid (bool valid); + void SetValid (bool valid); protected: std::vector fcs; - bool valid; + bool valid; }; } } diff --git a/libdash/libdash/source/mpd/InitializationSet.cpp b/libdash/libdash/source/mpd/InitializationSet.cpp index 734a7997..6ee2bf94 100644 --- a/libdash/libdash/source/mpd/InitializationSet.cpp +++ b/libdash/libdash/source/mpd/InitializationSet.cpp @@ -16,14 +16,14 @@ using namespace dash::mpd; InitializationSet::InitializationSet () : xlinkHref(""), xlinkActuate("onRequest"), - xlinkType("simple"), + xlinkType("simple"), contentType(""), par(""), maxWidth(0), maxHeight(0), maxFrameRate(""), inAllPeriods(true), - initialization("") + initialization("") { } InitializationSet::~InitializationSet () @@ -108,7 +108,7 @@ bool InitializationSet::IsInAllPeriods } void InitializationSet::SetInAllPeriods (bool inAllPeriods) { - this->inAllPeriods = inAllPeriods; + this->inAllPeriods = inAllPeriods; } const std::string& InitializationSet::GetContentType () const { diff --git a/libdash/libdash/source/mpd/InitializationSet.h b/libdash/libdash/source/mpd/InitializationSet.h index 3d6fa200..c1ffe73a 100644 --- a/libdash/libdash/source/mpd/InitializationSet.h +++ b/libdash/libdash/source/mpd/InitializationSet.h @@ -27,55 +27,55 @@ namespace dash public: InitializationSet (); virtual ~InitializationSet (); - - const std::vector& GetAccessibility () const; + + const std::vector& GetAccessibility () const; const std::vector& GetRole () const; const std::vector& GetRating () const; const std::vector& GetViewpoint () const; const std::string& GetXlinkHref () const; const std::string& GetXlinkActuate () const; - const std::string& GetXlinkType () const; + const std::string& GetXlinkType () const; uint32_t GetId () const; - bool IsInAllPeriods () const; + bool IsInAllPeriods () const; const std::string& GetContentType () const; const std::string& GetPar () const; - uint32_t GetMaxWidth () const; - uint32_t GetMaxHeight () const; - const std::string& GetMaxFrameRate () const; - const std::string& GetInitialization () const; - - void AddAccessibity (Descriptor *accessibility); + uint32_t GetMaxWidth () const; + uint32_t GetMaxHeight () const; + const std::string& GetMaxFrameRate () const; + const std::string& GetInitialization () const; + + void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); void AddRating (Descriptor *rating); void AddViewpoint (Descriptor *viewpoint); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); - void SetXlinkType (const std::string& xlinkType); - void SetId (uint32_t id); - void SetInAllPeriods (bool inAllPeriods); - void SetContentType (const std::string& contentType); - void SetPar (const std::string& par); - void SetMaxWidth (uint32_t maxWidth); - void SetMaxHeight (uint32_t maxHeight); - void SetMaxFrameRate (const std::string& maxFrameRate); - void SetInitialization (const std::string& initialization); - + void SetXlinkType (const std::string& xlinkType); + void SetId (uint32_t id); + void SetInAllPeriods (bool inAllPeriods); + void SetContentType (const std::string& contentType); + void SetPar (const std::string& par); + void SetMaxWidth (uint32_t maxWidth); + void SetMaxHeight (uint32_t maxHeight); + void SetMaxFrameRate (const std::string& maxFrameRate); + void SetInitialization (const std::string& initialization); + private: - std::vector accessibility; + std::vector accessibility; std::vector role; std::vector rating; std::vector viewpoint; - std::string xlinkHref; + std::string xlinkHref; std::string xlinkActuate; - std::string xlinkType; + std::string xlinkType; uint32_t id; - bool inAllPeriods; - std::string contentType; - std::string par; - uint32_t maxWidth; - uint32_t maxHeight; - std::string maxFrameRate; - std::string initialization; + bool inAllPeriods; + std::string contentType; + std::string par; + uint32_t maxWidth; + uint32_t maxHeight; + std::string maxFrameRate; + std::string initialization; }; } } diff --git a/libdash/libdash/source/mpd/Label.cpp b/libdash/libdash/source/mpd/Label.cpp index a82d7e4f..181a6e40 100644 --- a/libdash/libdash/source/mpd/Label.cpp +++ b/libdash/libdash/source/mpd/Label.cpp @@ -15,7 +15,7 @@ using namespace dash::mpd; Label::Label () : id(0) - + { } Label::~Label () diff --git a/libdash/libdash/source/mpd/Label.h b/libdash/libdash/source/mpd/Label.h index 4bd1d049..6440f747 100644 --- a/libdash/libdash/source/mpd/Label.h +++ b/libdash/libdash/source/mpd/Label.h @@ -29,15 +29,15 @@ namespace dash uint32_t GetId () const; const std::string& GetLang () const; - + void SetId (uint32_t id); void SetLang (const std::string& lang); private: - uint32_t id; + uint32_t id; std::string lang; - + }; } } diff --git a/libdash/libdash/source/mpd/Latency.cpp b/libdash/libdash/source/mpd/Latency.cpp index 86ed040a..2697c832 100644 --- a/libdash/libdash/source/mpd/Latency.cpp +++ b/libdash/libdash/source/mpd/Latency.cpp @@ -30,7 +30,7 @@ void Latency::AddQualityLatencyType { this->qltpairs.push_back(qlt); } -uint32_t Latency::GetReferenceId () const +uint32_t Latency::GetReferenceId () const { return this->referenceId; } @@ -38,7 +38,7 @@ void Latency::SetReferenceId { this->referenceId = referenceId; } -uint32_t Latency::GetTarget () const +uint32_t Latency::GetTarget () const { return this->target; } @@ -46,7 +46,7 @@ void Latency::SetTarget { this->target = target; } -uint32_t Latency::GetMax () const +uint32_t Latency::GetMax () const { return this->max; } @@ -54,7 +54,7 @@ void Latency::SetMax { this->max = max; } -uint32_t Latency::GetMin () const +uint32_t Latency::GetMin () const { return this->min; } diff --git a/libdash/libdash/source/mpd/Latency.h b/libdash/libdash/source/mpd/Latency.h index 4ad60dbe..8fe0fc7a 100644 --- a/libdash/libdash/source/mpd/Latency.h +++ b/libdash/libdash/source/mpd/Latency.h @@ -29,24 +29,24 @@ namespace dash virtual ~Latency (); const std::vector& GetQualityLatencyType () const; - uint32_t GetReferenceId () const; - uint32_t GetTarget () const; - uint32_t GetMax () const; - uint32_t GetMin () const; + uint32_t GetReferenceId () const; + uint32_t GetTarget () const; + uint32_t GetMax () const; + uint32_t GetMin () const; void AddQualityLatencyType (UIntPairsWithID* qlt); - void SetReferenceId (uint32_t referenceId); - void SetTarget (uint32_t target); - void SetMax (uint32_t max); - void SetMin (uint32_t min); + void SetReferenceId (uint32_t referenceId); + void SetTarget (uint32_t target); + void SetMax (uint32_t max); + void SetMin (uint32_t min); private: std::vector qltpairs; - uint32_t referenceId; - uint32_t target; - uint32_t max; - uint32_t min; - + uint32_t referenceId; + uint32_t target; + uint32_t max; + uint32_t min; + }; } } diff --git a/libdash/libdash/source/mpd/LeapSecondInformation.cpp b/libdash/libdash/source/mpd/LeapSecondInformation.cpp index 010f739d..b8e90e92 100644 --- a/libdash/libdash/source/mpd/LeapSecondInformation.cpp +++ b/libdash/libdash/source/mpd/LeapSecondInformation.cpp @@ -15,7 +15,7 @@ using namespace dash::mpd; LeapSecondInformation::LeapSecondInformation () : availabilityStartLeapOffset(0) - + { } LeapSecondInformation::~LeapSecondInformation () diff --git a/libdash/libdash/source/mpd/LeapSecondInformation.h b/libdash/libdash/source/mpd/LeapSecondInformation.h index b59996a9..c167c2d1 100644 --- a/libdash/libdash/source/mpd/LeapSecondInformation.h +++ b/libdash/libdash/source/mpd/LeapSecondInformation.h @@ -29,17 +29,17 @@ namespace dash int32_t GetAvailabilityStartLeapOffset () const; int32_t GetNextAvailabilityStartLeapOffset () const; - const std::string& GetNextLeapChangeTime () const; + const std::string& GetNextLeapChangeTime () const; void SetAvailabilityStartLeapOffset (int32_t availabilityStartLeapOffset); void SetNextAvailabilityStartLeapOffset (int32_t nextAvailabilityStartLeapOffset); - void SetNextLeapChangeTime (const std::string& nextLeapChangeTime); + void SetNextLeapChangeTime (const std::string& nextLeapChangeTime); private: int32_t availabilityStartLeapOffset; - int32_t nextAvailabilityStartLeapOffset; + int32_t nextAvailabilityStartLeapOffset; std::string nextLeapChangeTime; - + }; } } diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index 954c3220..301b5911 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -41,30 +41,30 @@ MPD::~MPD () 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->essentialProperties.size(); i++) + for(size_t i = 0; i < this->essentialProperties.size(); i++) delete(this->essentialProperties.at(i)); - for(size_t i = 0; i < this->supplementalProperties.size(); i++) + for(size_t i = 0; i < this->supplementalProperties.size(); i++) delete(this->supplementalProperties.at(i)); - for(size_t i = 0; i < this->utcTimings.size(); i++) + for(size_t i = 0; i < this->utcTimings.size(); i++) delete(this->utcTimings.at(i)); for(size_t i = 0; i < this->periods.size(); i++) delete(this->periods.at(i)); - for(size_t i = 0; i < this->prerolls.size(); i++) + for(size_t i = 0; i < this->prerolls.size(); i++) delete(this->prerolls.at(i)); for(size_t i = 0; i < this->baseUrls.size(); i++) delete(this->baseUrls.at(i)); - for(size_t i = 0; i < this->serviceDescriptions.size(); i++) + for(size_t i = 0; i < this->serviceDescriptions.size(); i++) delete(this->serviceDescriptions.at(i)); - for(size_t i = 0; i < this->initializationSets.size(); i++) + for(size_t i = 0; i < this->initializationSets.size(); i++) delete(this->initializationSets.at(i)); - for(size_t i = 0; i < this->initializationGroups.size(); i++) + for(size_t i = 0; i < this->initializationGroups.size(); i++) delete(this->initializationGroups.at(i)); - for(size_t i = 0; i < this->initializationPresentations.size(); i++) + for(size_t i = 0; i < this->initializationPresentations.size(); i++) delete(this->initializationPresentations.at(i)); if (this->mpdPathBaseUrl) delete(this->mpdPathBaseUrl); - - delete(leapSecondInformation); + + delete(leapSecondInformation); } const std::vector& MPD::GetProgramInformations () const @@ -223,7 +223,7 @@ const std::string& MPD::GetPublishTime { return this->publishTime; } -void MPD::SetPublishTime (const std::string& publishTime) +void MPD::SetPublishTime (const std::string& publishTime) { this->publishTime = publishTime; } diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index 7904b6dd..c7e9f7b0 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -46,18 +46,18 @@ namespace dash const std::vector& GetProgramInformations () const; const std::vector& GetBaseUrls () const; const std::vector& GetLocations () const; - const std::vector& GetPatchLocations () const; - const std::vector& GetServiceDescriptions () const; - const std::vector& GetInitializationSets () const; - const std::vector& GetInitializationGroups () const; - const std::vector& GetInitializationPresentations () const; + const std::vector& GetPatchLocations () const; + const std::vector& GetServiceDescriptions () const; + const std::vector& GetInitializationSets () const; + const std::vector& GetInitializationGroups () const; + const std::vector& GetInitializationPresentations () const; const std::vector& GetPeriods () const; - const std::vector& GetPrerolls () const; + const std::vector& GetPrerolls () const; const std::vector& GetMetrics () const; - const std::vector& GetEssentialProperties () const; - const std::vector& GetSupplementalProperties () const; - const std::vector& GetUTCTimings () const; - const ILeapSecondInformation * GetLeapSecondInformation () const; + const std::vector& GetEssentialProperties () const; + const std::vector& GetSupplementalProperties () const; + const std::vector& GetUTCTimings () const; + const ILeapSecondInformation * GetLeapSecondInformation () const; const std::string& GetId () const; const std::vector& GetProfiles () const; const std::string& GetType () const; @@ -82,18 +82,18 @@ namespace dash void AddProgramInformation (ProgramInformation *programInformation); void AddBaseUrl (BaseUrl *url); void AddLocation (const std::string& location); - void AddPatchLocation (PatchLocation *patchLocation); - void AddServiceDescription (ServiceDescription* serviceDescription); - void AddInitializationSet (InitializationSet* initializationSet); - void AddInitializationGroup (UIntVWithID* initializationGroup); - void AddInitializationPresentation (UIntVWithID* initializationPresentation); + void AddPatchLocation (PatchLocation *patchLocation); + void AddServiceDescription (ServiceDescription* serviceDescription); + void AddInitializationSet (InitializationSet* initializationSet); + void AddInitializationGroup (UIntVWithID* initializationGroup); + void AddInitializationPresentation (UIntVWithID* initializationPresentation); void AddPeriod (Period *period); - void AddPreroll (Period *preroll); + void AddPreroll (Period *preroll); void AddMetrics (Metrics *metrics); - void AddEssentialProperty (Descriptor *essentialProperty); - void AddSupplementalProperty (Descriptor *supplementalProperty); - void AddUTCTiming (Descriptor *utcTiming); - void SetLeapSecondInformation (LeapSecondInformation *leapSecondInformation); + void AddEssentialProperty (Descriptor *essentialProperty); + void AddSupplementalProperty (Descriptor *supplementalProperty); + void AddUTCTiming (Descriptor *utcTiming); + void SetLeapSecondInformation (LeapSecondInformation *leapSecondInformation); void SetId (const std::string& id); void SetProfiles (const std::string& profiles); void SetType (const std::string& type); @@ -114,18 +114,18 @@ namespace dash std::vector programInformations; std::vector baseUrls; std::vector locations; - std::vector patchLocations; - std::vector serviceDescriptions; - std::vector initializationSets; - std::vector initializationGroups; - std::vector initializationPresentations; + std::vector patchLocations; + std::vector serviceDescriptions; + std::vector initializationSets; + std::vector initializationGroups; + std::vector initializationPresentations; std::vector periods; - std::vector prerolls; + std::vector prerolls; std::vector metrics; - std::vector essentialProperties; - std::vector supplementalProperties; - std::vector utcTimings; - LeapSecondInformation *leapSecondInformation; + std::vector essentialProperties; + std::vector supplementalProperties; + std::vector utcTimings; + LeapSecondInformation *leapSecondInformation; std::string id; std::vector profiles; std::string type; diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp index 6d326577..f70ce309 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp @@ -22,7 +22,7 @@ MultipleSegmentBase::MultipleSegmentBase () : segmentTimeline(NULL), duration(0), startNumber(1), - endNumber(1) + endNumber(1) { } MultipleSegmentBase::~MultipleSegmentBase () @@ -67,7 +67,7 @@ uint32_t MultipleSegmentBase::GetEndNumber () cons { return this->endNumber; } -void MultipleSegmentBase::SetEndNumber (uint32_t endNumber) +void MultipleSegmentBase::SetEndNumber (uint32_t endNumber) { this->endNumber = endNumber; } diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.h b/libdash/libdash/source/mpd/MultipleSegmentBase.h index 047df0bc..0ea8c5d1 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.h +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.h @@ -37,20 +37,20 @@ namespace dash const IURLType* GetBitstreamSwitching () const; uint32_t GetDuration () const; uint32_t GetStartNumber () const; - uint32_t GetEndNumber () const; + uint32_t GetEndNumber () const; void SetSegmentTimeline (SegmentTimeline *segmentTimeline); void SetBitstreamSwitching (URLType *bitstreamSwitching); void SetDuration (uint32_t duration); void SetStartNumber (uint32_t startNumber); - void SetEndNumber (uint32_t endNumber); + void SetEndNumber (uint32_t endNumber); protected: SegmentTimeline *segmentTimeline; URLType *bitstreamSwitching; uint32_t duration; uint32_t startNumber; - uint32_t endNumber; + uint32_t endNumber; }; } } diff --git a/libdash/libdash/source/mpd/OperatingBandwidth.cpp b/libdash/libdash/source/mpd/OperatingBandwidth.cpp index 45ce645e..5262261d 100644 --- a/libdash/libdash/source/mpd/OperatingBandwidth.cpp +++ b/libdash/libdash/source/mpd/OperatingBandwidth.cpp @@ -29,7 +29,7 @@ void OperatingBandwidth::SetMediaType { this->mediaType = mediaType; } -uint32_t OperatingBandwidth::GetMin () const +uint32_t OperatingBandwidth::GetMin () const { return this->min; } @@ -37,7 +37,7 @@ void OperatingBandwidth::SetMin { this->min = min; } -uint32_t OperatingBandwidth::GetMax () const +uint32_t OperatingBandwidth::GetMax () const { return this->max; } @@ -45,7 +45,7 @@ void OperatingBandwidth::SetMax { this->max = max; } -uint32_t OperatingBandwidth::GetTarget () const +uint32_t OperatingBandwidth::GetTarget () const { return this->target; } diff --git a/libdash/libdash/source/mpd/OperatingBandwidth.h b/libdash/libdash/source/mpd/OperatingBandwidth.h index 0ad85e7f..6f5d53e0 100644 --- a/libdash/libdash/source/mpd/OperatingBandwidth.h +++ b/libdash/libdash/source/mpd/OperatingBandwidth.h @@ -27,22 +27,22 @@ namespace dash OperatingBandwidth (); virtual ~OperatingBandwidth (); - const std::string& GetMediaType () const; - uint32_t GetMin () const; - uint32_t GetMax () const; - uint32_t GetTarget () const; + const std::string& GetMediaType () const; + uint32_t GetMin () const; + uint32_t GetMax () const; + uint32_t GetTarget () const; - void SetMediaType (const std::string& mediaType); - void SetMin (uint32_t min); - void SetMax (uint32_t max); - void SetTarget (uint32_t target); + void SetMediaType (const std::string& mediaType); + void SetMin (uint32_t min); + void SetMax (uint32_t max); + void SetTarget (uint32_t target); private: - std::string mediaType; - uint32_t min; - uint32_t max; - uint32_t target; - + std::string mediaType; + uint32_t min; + uint32_t max; + uint32_t target; + }; } } diff --git a/libdash/libdash/source/mpd/OperatingQuality.cpp b/libdash/libdash/source/mpd/OperatingQuality.cpp index f464db83..4cceb175 100644 --- a/libdash/libdash/source/mpd/OperatingQuality.cpp +++ b/libdash/libdash/source/mpd/OperatingQuality.cpp @@ -29,7 +29,7 @@ void OperatingQuality::SetMediaType { this->mediaType = mediaType; } -uint32_t OperatingQuality::GetMin () const +uint32_t OperatingQuality::GetMin () const { return this->min; } @@ -37,7 +37,7 @@ void OperatingQuality::SetMin { this->min = min; } -uint32_t OperatingQuality::GetMax () const +uint32_t OperatingQuality::GetMax () const { return this->max; } @@ -45,7 +45,7 @@ void OperatingQuality::SetMax { this->max = max; } -uint32_t OperatingQuality::GetTarget () const +uint32_t OperatingQuality::GetTarget () const { return this->target; } @@ -61,7 +61,7 @@ void OperatingQuality::SetType { this->type = type; } -uint32_t OperatingQuality::GetMaxDifference () const +uint32_t OperatingQuality::GetMaxDifference () const { return this->maxDifference; } diff --git a/libdash/libdash/source/mpd/OperatingQuality.h b/libdash/libdash/source/mpd/OperatingQuality.h index 2325d82b..83e43fce 100644 --- a/libdash/libdash/source/mpd/OperatingQuality.h +++ b/libdash/libdash/source/mpd/OperatingQuality.h @@ -27,28 +27,28 @@ namespace dash OperatingQuality (); virtual ~OperatingQuality (); - const std::string& GetMediaType () const; - uint32_t GetMin () const; - uint32_t GetMax () const; - uint32_t GetTarget () const; - const std::string& GetType () const; - uint32_t GetMaxDifference () const; - - void SetMediaType (const std::string& mediaType); - void SetMin (uint32_t min); - void SetMax (uint32_t max); - void SetTarget (uint32_t target); - void SetType (const std::string& type); - void SetMaxDifference (uint32_t maxDifference); + const std::string& GetMediaType () const; + uint32_t GetMin () const; + uint32_t GetMax () const; + uint32_t GetTarget () const; + const std::string& GetType () const; + uint32_t GetMaxDifference () const; + + void SetMediaType (const std::string& mediaType); + void SetMin (uint32_t min); + void SetMax (uint32_t max); + void SetTarget (uint32_t target); + void SetType (const std::string& type); + void SetMaxDifference (uint32_t maxDifference); private: - std::string mediaType; - uint32_t min; - uint32_t max; - uint32_t target; - std::string type; - uint32_t maxDifference; - + std::string mediaType; + uint32_t min; + uint32_t max; + uint32_t target; + std::string type; + uint32_t maxDifference; + }; } } diff --git a/libdash/libdash/source/mpd/PatchLocation.cpp b/libdash/libdash/source/mpd/PatchLocation.cpp index f2140b6f..805ae771 100644 --- a/libdash/libdash/source/mpd/PatchLocation.cpp +++ b/libdash/libdash/source/mpd/PatchLocation.cpp @@ -15,8 +15,8 @@ using namespace dash::mpd; PatchLocation::PatchLocation () : url(""), - ttl(0.0) - + ttl(0.0) + { } PatchLocation::~PatchLocation () diff --git a/libdash/libdash/source/mpd/PatchLocation.h b/libdash/libdash/source/mpd/PatchLocation.h index 533c853b..6f3aed02 100644 --- a/libdash/libdash/source/mpd/PatchLocation.h +++ b/libdash/libdash/source/mpd/PatchLocation.h @@ -26,17 +26,17 @@ namespace dash public: PatchLocation (); virtual ~PatchLocation (); - - const std::string& GetUrl () const; + + const std::string& GetUrl () const; double GetTtl () const; void SetUrl (const std::string& url); - void SetTtl (double ttl); - + void SetTtl (double ttl); + private: - std::string url; + std::string url; double ttl; - + }; } } diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index d5148505..30230216 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -21,11 +21,11 @@ Period::Period () : segmentBase(NULL), segmentList(NULL), segmentTemplate(NULL), - assetIdentifier(NULL), + assetIdentifier(NULL), xlinkActuate("onRequest"), xlinkHref(""), - xlinkType("simple"), - xlinkShow("embed"), + xlinkType("simple"), + xlinkShow("embed"), id(""), start(""), duration(""), @@ -40,180 +40,180 @@ Period::~Period () delete(this->adaptationSets.at(i)); for(size_t i = 0; i < this->subsets.size(); i++) delete(this->subsets.at(i)); - for(size_t i = 0; i < this->supplementalProperties.size(); i++) + for(size_t i = 0; i < this->supplementalProperties.size(); i++) delete(this->supplementalProperties.at(i)); - for(size_t i = 0; i < this->groupLabels.size(); i++) + for(size_t i = 0; i < this->groupLabels.size(); i++) delete(this->groupLabels.at(i)); - for(size_t i = 0; i < this->eventStreams.size(); i++) + for(size_t i = 0; i < this->eventStreams.size(); i++) delete(this->eventStreams.at(i)); - for(size_t i = 0; i < this->serviceDescriptions.size(); i++) + for(size_t i = 0; i < this->serviceDescriptions.size(); i++) delete(this->serviceDescriptions.at(i)); - for(size_t i = 0; i < this->preselections.size(); i++) + for(size_t i = 0; i < this->preselections.size(); i++) delete(this->preselections.at(i)); delete(segmentBase); delete(segmentList); delete(segmentTemplate); - delete(assetIdentifier); + delete(assetIdentifier); } -const std::vector& Period::GetBaseURLs () const +const std::vector& Period::GetBaseURLs () const { return (std::vector &) this->baseURLs; } -void Period::AddBaseURL (BaseUrl *baseUrl) +void Period::AddBaseURL (BaseUrl *baseUrl) { this->baseURLs.push_back(baseUrl); } -ISegmentBase* Period::GetSegmentBase () const +ISegmentBase* Period::GetSegmentBase () const { return this->segmentBase; } -void Period::SetSegmentBase (SegmentBase *segmentBase) +void Period::SetSegmentBase (SegmentBase *segmentBase) { this->segmentBase = segmentBase; } -ISegmentList* Period::GetSegmentList () const +ISegmentList* Period::GetSegmentList () const { return this->segmentList; } -void Period::SetSegmentList (SegmentList *segmentList) +void Period::SetSegmentList (SegmentList *segmentList) { this->segmentList = segmentList; } -ISegmentTemplate* Period::GetSegmentTemplate () const +ISegmentTemplate* Period::GetSegmentTemplate () const { return this->segmentTemplate; } -void Period::SetSegmentTemplate (SegmentTemplate *segmentTemplate) +void Period::SetSegmentTemplate (SegmentTemplate *segmentTemplate) { this->segmentTemplate = segmentTemplate; } -const IDescriptor* Period::GetAssetIdentifier () const +const IDescriptor* Period::GetAssetIdentifier () const { return this->assetIdentifier; } -void Period::SetAssetIdentifier (Descriptor *assetIdentifier) +void Period::SetAssetIdentifier (Descriptor *assetIdentifier) { this->assetIdentifier = assetIdentifier; } -const std::vector& Period::GetEventStreams () const +const std::vector& Period::GetEventStreams () const { return (std::vector &) this->eventStreams; } -void Period::AddEventStream (EventStream *eventStream) +void Period::AddEventStream (EventStream *eventStream) { this->eventStreams.push_back(eventStream); } -const std::vector& Period::GetServiceDescriptions () const +const std::vector& Period::GetServiceDescriptions () const { return (std::vector &) this->serviceDescriptions; } -void Period::AddServiceDescription (ServiceDescription *serviceDescription) +void Period::AddServiceDescription (ServiceDescription *serviceDescription) { this->serviceDescriptions.push_back(serviceDescription); } -const std::vector& Period::GetAdaptationSets () const +const std::vector& Period::GetAdaptationSets () const { return (std::vector &) this->adaptationSets; } -void Period::AddAdaptationSet (AdaptationSet *adaptationSet) +void Period::AddAdaptationSet (AdaptationSet *adaptationSet) { if(adaptationSet != NULL) this->adaptationSets.push_back(adaptationSet); } -const std::vector& Period::GetSubsets () const +const std::vector& Period::GetSubsets () const { return (std::vector &) this->subsets; } -void Period::AddSubset (Subset *subset) +void Period::AddSubset (Subset *subset) { this->subsets.push_back(subset); } -const std::vector& Period::GetSupplementalProperties () const +const std::vector& Period::GetSupplementalProperties () const { return (std::vector &) this->supplementalProperties; } -void Period::AddSupplementalProperty (Descriptor *supplementalProperty) +void Period::AddSupplementalProperty (Descriptor *supplementalProperty) { this->supplementalProperties.push_back(supplementalProperty); } -const std::vector& Period::GetGroupLabels () const +const std::vector& Period::GetGroupLabels () const { return (std::vector &) this->groupLabels; } -void Period::AddGroupLabel (Label *groupLabel) +void Period::AddGroupLabel (Label *groupLabel) { this->groupLabels.push_back(groupLabel); } -const std::vector& Period::GetPreselections () const +const std::vector& Period::GetPreselections () const { return (std::vector &) this->preselections; } -void Period::AddPreselection (Preselection *preselection) +void Period::AddPreselection (Preselection *preselection) { this->preselections.push_back(preselection); } -const std::string& Period::GetXlinkHref () const +const std::string& Period::GetXlinkHref () const { return this->xlinkHref; } -void Period::SetXlinkHref (const std::string& xlinkHref) +void Period::SetXlinkHref (const std::string& xlinkHref) { this->xlinkHref = xlinkHref; } -const std::string& Period::GetXlinkActuate () const +const std::string& Period::GetXlinkActuate () const { return this->xlinkActuate; } -void Period::SetXlinkActuate (const std::string& xlinkActuate) +void Period::SetXlinkActuate (const std::string& xlinkActuate) { this->xlinkActuate = xlinkActuate; } -const std::string& Period::GetXlinkType () const +const std::string& Period::GetXlinkType () const { return this->xlinkType; } -void Period::SetXlinkType (const std::string& xlinkType) +void Period::SetXlinkType (const std::string& xlinkType) { this->xlinkType = xlinkType; } -const std::string& Period::GetXlinkShow () const +const std::string& Period::GetXlinkShow () const { return this->xlinkShow; } -void Period::SetXlinkShow (const std::string& xlinkShow) +void Period::SetXlinkShow (const std::string& xlinkShow) { this->xlinkShow = xlinkShow; } -const std::string& Period::GetId () const +const std::string& Period::GetId () const { return this->id; } -void Period::SetId (const std::string& id) +void Period::SetId (const std::string& id) { this->id = id; } -const std::string& Period::GetStart () const +const std::string& Period::GetStart () const { return this->start; } -void Period::SetStart (const std::string& start) +void Period::SetStart (const std::string& start) { this->start = start; } -const std::string& Period::GetDuration () const +const std::string& Period::GetDuration () const { return this->duration; } -void Period::SetDuration (const std::string& duration) +void Period::SetDuration (const std::string& duration) { this->duration = duration; } -bool Period::GetBitstreamSwitching () const +bool Period::GetBitstreamSwitching () const { return this->isBitstreamSwitching; } -void Period::SetBitstreamSwitching (bool value) +void Period::SetBitstreamSwitching (bool value) { this->isBitstreamSwitching = value; } diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index ca8dd5ef..9fa1c3e5 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -42,69 +42,69 @@ namespace dash Period (); virtual ~Period (); - const std::vector& GetBaseURLs () const; - ISegmentBase* GetSegmentBase () const; - ISegmentList* GetSegmentList () const; - ISegmentTemplate* GetSegmentTemplate () const; - const IDescriptor * GetAssetIdentifier () const; - const std::vector& GetEventStreams () const; - const std::vector& GetServiceDescriptions () const; - const std::vector& GetAdaptationSets () const; - const std::vector& GetSubsets () const; - const std::vector& GetSupplementalProperties () const; - const std::vector& GetGroupLabels () const; - const std::vector& GetPreselections () const; - const std::string& GetXlinkHref () const; - const std::string& GetXlinkActuate () const; - const std::string& GetXlinkType () const; - const std::string& GetXlinkShow () const; - const std::string& GetId () const; - const std::string& GetStart () const; - const std::string& GetDuration () const; - bool GetBitstreamSwitching () const; + const std::vector& GetBaseURLs () const; + ISegmentBase* GetSegmentBase () const; + ISegmentList* GetSegmentList () const; + ISegmentTemplate* GetSegmentTemplate () const; + const IDescriptor * GetAssetIdentifier () const; + const std::vector& GetEventStreams () const; + const std::vector& GetServiceDescriptions () const; + const std::vector& GetAdaptationSets () const; + const std::vector& GetSubsets () const; + const std::vector& GetSupplementalProperties () const; + const std::vector& GetGroupLabels () const; + const std::vector& GetPreselections () const; + const std::string& GetXlinkHref () const; + const std::string& GetXlinkActuate () const; + const std::string& GetXlinkType () const; + const std::string& GetXlinkShow () const; + const std::string& GetId () const; + const std::string& GetStart () const; + const std::string& GetDuration () const; + bool GetBitstreamSwitching () const; void AddBaseURL (BaseUrl *baseURL); void SetSegmentBase (SegmentBase *segmentBase); void SetSegmentList (SegmentList *segmentList); void SetSegmentTemplate (SegmentTemplate *segmentTemplate); - void SetAssetIdentifier (Descriptor *assetIdentifier); - void AddEventStream (EventStream *eventStream); - void AddServiceDescription (ServiceDescription* serviceDescription); + void SetAssetIdentifier (Descriptor *assetIdentifier); + void AddEventStream (EventStream *eventStream); + void AddServiceDescription (ServiceDescription* serviceDescription); void AddAdaptationSet (AdaptationSet *AdaptationSet); void AddSubset (Subset *subset); - void AddSupplementalProperty (Descriptor *supplementalProperty); - void AddGroupLabel (Label *groupLabel); - void AddPreselection (Preselection *preselection); + void AddSupplementalProperty (Descriptor *supplementalProperty); + void AddGroupLabel (Label *groupLabel); + void AddPreselection (Preselection *preselection); void SetXlinkHref (const std::string& xlinkHref); void SetXlinkActuate (const std::string& xlinkActuate); - void SetXlinkType (const std::string& xlinkType); - void SetXlinkShow (const std::string& xlinkShow); + void SetXlinkType (const std::string& xlinkType); + void SetXlinkShow (const std::string& xlinkShow); void SetId (const std::string& id); void SetStart (const std::string& start); void SetDuration (const std::string& duration); void SetBitstreamSwitching (bool value); private: - std::vector baseURLs; - SegmentBase *segmentBase; - SegmentList *segmentList; - SegmentTemplate *segmentTemplate; - Descriptor *assetIdentifier; - std::vector eventStreams; - std::vector serviceDescriptions; - std::vector adaptationSets; - std::vector subsets; - std::vector supplementalProperties; - std::vector
    3. Each Segment consists of one or more Subsegments. Subsegments are described in 6.2.3.2. * - * @see dash::mpd::IMPDElement dash::mpd::IProgramInformation dash::mpd::IBaseUrl dash::mpd::IDescriptor dash::mpd::IPeriod dash::mpd::IMetrics + * @see dash::mpd::IMPDElement dash::mpd::IProgramInformation dash::mpd::IBaseUrl dash::mpd::IDescriptor dash::mpd::IContentProtection dash::mpd::IPeriod dash::mpd::IMetrics * dash::mpd::IRepresentationBase dash::mpd::IServiceDescription dash::mpd::ILeapSecondInformation dash::mpd::IPatchLocation dash::mpd::IInitializationSet * dash::mpd::IUIntVWithID * @@ -42,6 +42,7 @@ #include "IMPDElement.h" #include "IProgramInformation.h" #include "IBaseUrl.h" +#include "IContentProtection.h" #include "IDescriptor.h" #include "IPeriod.h" #include "IMetrics.h" @@ -126,6 +127,15 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IUIntVWithID objects */ virtual const std::vector& GetInitializationPresentations () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IContentProtection objects that specifies information about content protection + * and encryption schemes used in this Media Presentation. If present on this level, it shall include the \c @refId attribute. \n + * For details, see subclauses 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1. \n + * + * @return a reference to a vector of pointers to dash::mpd::IContentProtection objects + */ + virtual const std::vector& GetContentProtections () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IPeriod objects that specify the information of a Period.\n @@ -133,14 +143,6 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IPeriod objects */ virtual const std::vector& GetPeriods () const = 0; - - /** - * Returns a reference to a vector of pointers to dash::mpd::IPeriod objects that specify the information of a Preroll.\n - * For more details refer to the description in section 5.3.2. of ISO/IEC 23009-1, Part 1, 2012. - * - * @return a reference to a vector of pointers to dash::mpd::IPeriod objects - */ - virtual const std::vector& GetPrerolls () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specify information about the containing element that is considered diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index acda4bb4..a3a247f8 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -29,7 +29,7 @@ * To avoid dereferencing of a remote element containing a Period element solely to determine the Period timeline, e.g. in case of seeking, * Period\@start or previous Period's Period\@duration should be present in the MPD. * @see dash::mpd::IMPDElement dash::mpd::BaseUrl dash::mpd::IAdaptationSet dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::ISegmentBase - * dash::mpd::IDescriptor dash::mpd::ILabel dash::mpd::IEventStream dash::mpd::ISubset dash::mpd::IPreselection + * dash::mpd::IDescriptor dash::mpd::ILabel dash::mpd::IEventStream dash::mpd::ISubset dash::mpd::IPreselection dash::mpd::IContentProtection * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -57,6 +57,7 @@ #include "IDescriptor.h" #include "ILabel.h" #include "IEventStream.h" +#include "IContentProtection.h" #include "IServiceDescription.h" #include "IAdaptationSet.h" #include "ISubset.h" @@ -124,6 +125,15 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects */ virtual const std::vector& GetServiceDescriptions () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IContentProtection objects that specifies information about content protection + * and encryption schemes used in this Media Presentation. If present on this level, it shall include the \c @refId attribute. \n + * For details, see subclauses 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1. \n + * + * @return a reference to a vector of pointers to dash::mpd::IContentProtection objects + */ + virtual const std::vector& GetContentProtections () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::IAdaptationSet objects that specify Adapatation Sets.\n diff --git a/libdash/libdash/include/IRepresentation.h b/libdash/libdash/include/IRepresentation.h index 3fc5a9f5..07044181 100644 --- a/libdash/libdash/include/IRepresentation.h +++ b/libdash/libdash/include/IRepresentation.h @@ -24,6 +24,7 @@ * \b NOTE: When decoding of a dependent Representation is started from a SAP in the (Sub)Segment with number \em i, the decoding process does not need to access * data from the complementary Representation(s) from any earlier (sub)segments than (sub)Segment with number i of the complementary Representation(s). * @see dash::mpd::IRepresentationBase dash::mpd::ISegmentBase dash::mpd::ISegmentList dash::mpd::ISegmentTemplate dash::mpd::IBaseUrl dash::mpd::ISubRepresentation + * dash::mpd::IExtendedBandwidth * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -44,6 +45,7 @@ #include "config.h" #include "IBaseUrl.h" +#include "IExtendedBandwidth.h" #include "ISubRepresentation.h" #include "ISegmentBase.h" #include "ISegmentList.h" @@ -65,6 +67,13 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IBaseUrl objects */ virtual const std::vector& GetBaseURLs () const = 0; + + /** + * Returns a reference to a vector of pointers to dash::mpd::IExtendedBandwidth objects that specifies an extended bandwidth model with more detailed information on the characteristics of the Representation. \n + * For more details, see subclause 5.3.5.6 of ISO/IEC 23009-1, Part 1, 2012. + * @return a reference to a vector of pointers to dash::mpd::IExtendedBandwidth objects + */ + virtual const std::vector& GetExtendedBandwidths () const = 0; /** * Returns a reference to a vector of pointers to dash::mpd::ISubRepresentation objects that specifies information about Sub-Representations diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index 2ac15e73..9bb8d3c7 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -3,7 +3,7 @@ * @brief This interface is needed for accessing the common attributes and elements of the certain MPD element as specified in ISO/IEC 23009-1, Part 1, 2012, section 5.3.7 * @details The elements \c AdaptationSet, \c Representation and \c SubRepresentation have assigned common attributes and elements that are specified in * ISO/IEC 23009-1, Part 1, 2012, section 5.3.7.2, table 9 - * @see dash::mpd::IDescriptor dash::mpd::IEventStream dash::mpd::ILabel dash::mpd::ISwitching dash::mpd::IContentPopularityRate + * @see dash::mpd::IDescriptor dash::mpd::IContentProtection dash::mpd::IEventStream dash::mpd::ILabel dash::mpd::ISwitching dash::mpd::IContentPopularityRate * dash::mpd::IProducerReferenceTime dash::mpd::IRandomAccess dash::mpd::IResync dash::mpd::IMPDElement * * @author bitmovin Softwareentwicklung OG \n @@ -25,6 +25,7 @@ #include "config.h" #include "IMPDElement.h" +#include "IContentProtection.h" #include "IDescriptor.h" #include "IEventStream.h" #include "ILabel.h" @@ -59,11 +60,11 @@ namespace dash virtual const std::vector& GetAudioChannelConfiguration () const = 0; /** - * Returns a reference to a vector of pointers to dash::mpd::IDescriptor objects that specifies information about content protection schemes used for the associated Representations.\n + * Returns a reference to a vector of pointers to dash::mpd::IContentProtection objects that specifies information about content protection schemes used for the associated Representations.\n * For further details see sections 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1, Part 1, 2012. - * @return a reference to a vector of pointers to dash::mpd::IDescriptor objects + * @return a reference to a vector of pointers to dash::mpd::IContentProtection objects */ - virtual const std::vector& GetContentProtection () const = 0; + virtual const std::vector& GetContentProtections () const = 0; /** * Returns a pointer to a dash::mpd::IDescriptor object that specifies information about the output protection schemes used for the associated Representations.\n diff --git a/libdash/libdash/source/mpd/AdaptationSet.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index 317acd44..40c6911e 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -38,12 +38,10 @@ AdaptationSet::AdaptationSet () : maxHeight(0), minFramerate(""), maxFramerate(""), - segmentAlignmentIsBool(true), - subsegmentAlignmentIsBool(true), usesSegmentAlignment(false), usesSubsegmentAlignment(false), - segmentAlignment(0), - subsegmentAlignment(0), + segmentAlignment(false), + subsegmentAlignment(false), isBitstreamSwitching(false) { } @@ -285,14 +283,6 @@ void AdaptationSet::SetMaxFramerate { this->maxFramerate = maxFramerate; } -bool AdaptationSet::SegmentAlignmentIsBoolValue () const -{ - return this->segmentAlignmentIsBool; -} -bool AdaptationSet::SubsegmentAlignmentIsBoolValue () const -{ - return this->subsegmentAlignmentIsBool; -} bool AdaptationSet::HasSegmentAlignment () const { return this->usesSegmentAlignment; @@ -301,52 +291,22 @@ bool AdaptationSet::HasSubsegmentAlignment { return this->usesSubsegmentAlignment; } -uint32_t AdaptationSet::GetSegmentAligment () const +bool AdaptationSet::GetSegmentAligment () const { return this->segmentAlignment; } -void AdaptationSet::SetSegmentAlignment (const std::string& segmentAlignment) -{ - if (segmentAlignment == "true" || segmentAlignment == "True" || segmentAlignment == "TRUE") - { - this->segmentAlignmentIsBool = true; - this->usesSegmentAlignment = true; - return; - } - - if (segmentAlignment == "false" || segmentAlignment == "False" || segmentAlignment == "FALSE") - { - this->segmentAlignmentIsBool = true; - this->usesSegmentAlignment = false; - return; - } - - this->segmentAlignmentIsBool = false; - this->segmentAlignment = strtoul(segmentAlignment.c_str(), NULL, 10); -} -void AdaptationSet::SetSubsegmentAlignment (const std::string& subsegmentAlignment) -{ - if (subsegmentAlignment == "true" || subsegmentAlignment == "True" || subsegmentAlignment == "TRUE") - { - this->subsegmentAlignmentIsBool = true; - this->usesSubsegmentAlignment = true; - return; - } - - if (subsegmentAlignment == "false" || subsegmentAlignment == "False" || subsegmentAlignment == "FALSE") - { - this->subsegmentAlignmentIsBool = true; - this->usesSubsegmentAlignment = false; - return; - } - - this->subsegmentAlignmentIsBool = false; - this->subsegmentAlignment = strtoul(subsegmentAlignment.c_str(), NULL, 10); +void AdaptationSet::SetSegmentAlignment (bool segmentAlignment) +{ + this->segmentAlignment = segmentAlignment; } -uint32_t AdaptationSet::GetSubsegmentAlignment () const +bool AdaptationSet::GetSubsegmentAlignment () const { return this->subsegmentAlignment; } +void AdaptationSet::SetSubsegmentAlignment (bool subsegmentAlignment) +{ + this->subsegmentAlignment = subsegmentAlignment; +} uint8_t AdaptationSet::GetSubsegmentStartsWithSAP () const { return this->subsegmentStartsWithSAP; diff --git a/libdash/libdash/source/mpd/AdaptationSet.h b/libdash/libdash/source/mpd/AdaptationSet.h index 13b4af81..79dd6827 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -64,12 +64,10 @@ namespace dash uint32_t GetMaxHeight () const; const std::string& GetMinFramerate () const; const std::string& GetMaxFramerate () const; - bool SegmentAlignmentIsBoolValue () const; bool HasSegmentAlignment () const; - uint32_t GetSegmentAligment () const; - bool SubsegmentAlignmentIsBoolValue () const; + bool GetSegmentAligment () const; bool HasSubsegmentAlignment () const; - uint32_t GetSubsegmentAlignment () const; + bool GetSubsegmentAlignment () const; uint8_t GetSubsegmentStartsWithSAP () const; bool GetBitstreamSwitching () const; const std::vector& GetInitializationSetRef () const; @@ -101,8 +99,8 @@ namespace dash void SetMaxHeight (uint32_t maxHeight); void SetMinFramerate (const std::string& minFramerate); void SetMaxFramerate (const std::string& maxFramerate); - void SetSegmentAlignment (const std::string& segmentAlignment); - void SetSubsegmentAlignment (const std::string& subsegmentAlignment); + void SetSegmentAlignment (bool segmentAlignment); + void SetSubsegmentAlignment (bool subsegmentAlignment); void SetSubsegmentStartsWithSAP (uint8_t subsegmentStartsWithSAP); void SetBitstreamSwitching (bool value); void SetInitializationSetRef (const std::string& initializationSetRef); @@ -135,12 +133,10 @@ namespace dash uint32_t maxHeight; std::string minFramerate; std::string maxFramerate; - bool segmentAlignmentIsBool; - bool subsegmentAlignmentIsBool; bool usesSegmentAlignment; bool usesSubsegmentAlignment; - uint32_t segmentAlignment; - uint32_t subsegmentAlignment; + bool segmentAlignment; + bool subsegmentAlignment; uint8_t subsegmentStartsWithSAP; bool isBitstreamSwitching; std::vector initializationSetRef; diff --git a/libdash/libdash/source/mpd/Descriptor.h b/libdash/libdash/source/mpd/Descriptor.h index ec300f7b..9b3e61ce 100644 --- a/libdash/libdash/source/mpd/Descriptor.h +++ b/libdash/libdash/source/mpd/Descriptor.h @@ -25,7 +25,7 @@ namespace dash { namespace mpd { - class Descriptor : public IDescriptor, public AbstractMPDElement + class Descriptor : public virtual IDescriptor, public AbstractMPDElement { public: Descriptor (); @@ -39,7 +39,7 @@ namespace dash void SetSchemeIdUri (const std::string& schemeIdUri); void SetId (const std::string& id); - private: + protected: std::string schemeIdUri; std::string value; std::string id; diff --git a/libdash/libdash/source/mpd/EventStream.h b/libdash/libdash/source/mpd/EventStream.h index 9775d94c..329a6708 100644 --- a/libdash/libdash/source/mpd/EventStream.h +++ b/libdash/libdash/source/mpd/EventStream.h @@ -45,7 +45,7 @@ namespace dash void SetPresentationTimeOffset (uint64_t presentationTimeOffset); protected: - std::vector events; + std::vector events; std::string xlinkHref; std::string xlinkActuate; std::string schemeIdUri; diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index 301b5911..4cd02b8a 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -47,10 +47,10 @@ MPD::~MPD () delete(this->supplementalProperties.at(i)); for(size_t i = 0; i < this->utcTimings.size(); i++) delete(this->utcTimings.at(i)); + for(size_t i = 0; i < this->contentProtections.size(); i++) + delete(this->contentProtections.at(i)); for(size_t i = 0; i < this->periods.size(); i++) delete(this->periods.at(i)); - for(size_t i = 0; i < this->prerolls.size(); i++) - delete(this->prerolls.at(i)); for(size_t i = 0; i < this->baseUrls.size(); i++) delete(this->baseUrls.at(i)); for(size_t i = 0; i < this->serviceDescriptions.size(); i++) @@ -131,21 +131,21 @@ void MPD::AddInitializationPresentation { this->initializationPresentations.push_back(initializationPresentation); } -const std::vector& MPD::GetPeriods () const +const std::vector& MPD::GetContentProtections () const { - return (std::vector &) this->periods; + return (std::vector &) this->contentProtections; } -void MPD::AddPeriod (Period *period) +void MPD::AddContentProtection (ContentProtection *contentProtection) { - this->periods.push_back(period); + this->contentProtections.push_back(contentProtection); } -const std::vector& MPD::GetPrerolls () const +const std::vector& MPD::GetPeriods () const { - return (std::vector &) this->prerolls; + return (std::vector &) this->periods; } -void MPD::AddPreroll (Period *preroll) +void MPD::AddPeriod (Period *period) { - this->prerolls.push_back(preroll); + this->periods.push_back(period); } const std::vector& MPD::GetMetrics () const { diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index c7e9f7b0..e6a3b0d2 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -21,6 +21,7 @@ #include "IMPD.h" #include "ProgramInformation.h" #include "BaseUrl.h" +#include "ContentProtection.h" #include "Descriptor.h" #include "Period.h" #include "Metrics.h" @@ -51,8 +52,8 @@ namespace dash const std::vector& GetInitializationSets () const; const std::vector& GetInitializationGroups () const; const std::vector& GetInitializationPresentations () const; + const std::vector& GetContentProtections () const; const std::vector& GetPeriods () const; - const std::vector& GetPrerolls () const; const std::vector& GetMetrics () const; const std::vector& GetEssentialProperties () const; const std::vector& GetSupplementalProperties () const; @@ -87,8 +88,8 @@ namespace dash void AddInitializationSet (InitializationSet* initializationSet); void AddInitializationGroup (UIntVWithID* initializationGroup); void AddInitializationPresentation (UIntVWithID* initializationPresentation); + void AddContentProtection (ContentProtection *contentProtection); void AddPeriod (Period *period); - void AddPreroll (Period *preroll); void AddMetrics (Metrics *metrics); void AddEssentialProperty (Descriptor *essentialProperty); void AddSupplementalProperty (Descriptor *supplementalProperty); @@ -119,8 +120,8 @@ namespace dash std::vector initializationSets; std::vector initializationGroups; std::vector initializationPresentations; + std::vector contentProtections; std::vector periods; - std::vector prerolls; std::vector metrics; std::vector essentialProperties; std::vector supplementalProperties; diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index 30230216..66e70ffe 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -48,6 +48,8 @@ Period::~Period () delete(this->eventStreams.at(i)); for(size_t i = 0; i < this->serviceDescriptions.size(); i++) delete(this->serviceDescriptions.at(i)); + for(size_t i = 0; i < this->contentProtections.size(); i++) + delete(this->contentProtections.at(i)); for(size_t i = 0; i < this->preselections.size(); i++) delete(this->preselections.at(i)); delete(segmentBase); @@ -112,6 +114,14 @@ void Period::AddServiceDescription { this->serviceDescriptions.push_back(serviceDescription); } +const std::vector& Period::GetContentProtections () const +{ + return (std::vector &) this->contentProtections; +} +void Period::AddContentProtection (ContentProtection *contentProtection) +{ + this->contentProtections.push_back(contentProtection); +} const std::vector& Period::GetAdaptationSets () const { return (std::vector &) this->adaptationSets; diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index 9fa1c3e5..f2ea9feb 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -28,6 +28,7 @@ #include "Descriptor.h" #include "Label.h" #include "EventStream.h" +#include "ContentProtection.h" #include "ServiceDescription.h" #include "Preselection.h" #include "AbstractMPDElement.h" @@ -49,6 +50,7 @@ namespace dash const IDescriptor * GetAssetIdentifier () const; const std::vector& GetEventStreams () const; const std::vector& GetServiceDescriptions () const; + const std::vector& GetContentProtections () const; const std::vector& GetAdaptationSets () const; const std::vector& GetSubsets () const; const std::vector& GetSupplementalProperties () const; @@ -70,6 +72,7 @@ namespace dash void SetAssetIdentifier (Descriptor *assetIdentifier); void AddEventStream (EventStream *eventStream); void AddServiceDescription (ServiceDescription* serviceDescription); + void AddContentProtection (ContentProtection *contentProtection); void AddAdaptationSet (AdaptationSet *AdaptationSet); void AddSubset (Subset *subset); void AddSupplementalProperty (Descriptor *supplementalProperty); @@ -92,6 +95,7 @@ namespace dash Descriptor *assetIdentifier; std::vector eventStreams; std::vector serviceDescriptions; + std::vector contentProtections; std::vector adaptationSets; std::vector subsets; std::vector supplementalProperties; diff --git a/libdash/libdash/source/mpd/Representation.cpp b/libdash/libdash/source/mpd/Representation.cpp index f5277bb9..a60b0141 100644 --- a/libdash/libdash/source/mpd/Representation.cpp +++ b/libdash/libdash/source/mpd/Representation.cpp @@ -30,6 +30,8 @@ Representation::~Representation () { for(size_t i = 0; i < this->baseURLs.size(); i++) delete(this->baseURLs.at(i)); + for(size_t i = 0; i < this->extendedBandwidths.size(); i++) + delete(this->extendedBandwidths.at(i)); for(size_t i = 0; i < this->subRepresentations.size(); i++) delete(this->subRepresentations.at(i)); @@ -46,6 +48,14 @@ void Representation::AddBaseURL { this->baseURLs.push_back(baseUrl); } +const std::vector& Representation::GetExtendedBandwidths () const +{ + return (std::vector &) this->extendedBandwidths; +} +void Representation::AddExtendedBandwidth (ExtendedBandwidth *extendedBandwidth) +{ + this->extendedBandwidths.push_back(extendedBandwidth); +} const std::vector& Representation::GetSubRepresentations () const { return (std::vector &) this->subRepresentations; diff --git a/libdash/libdash/source/mpd/Representation.h b/libdash/libdash/source/mpd/Representation.h index 29d5811d..11b7d552 100644 --- a/libdash/libdash/source/mpd/Representation.h +++ b/libdash/libdash/source/mpd/Representation.h @@ -22,6 +22,7 @@ #include "SegmentTemplate.h" #include "RepresentationBase.h" #include "BaseUrl.h" +#include "ExtendedBandwidth.h" #include "SubRepresentation.h" #include "SegmentBase.h" #include "SegmentList.h" @@ -38,7 +39,8 @@ namespace dash virtual ~Representation (); const std::vector& GetBaseURLs () const; - const std::vector& GetSubRepresentations () const; + const std::vector& GetSubRepresentations () const; + const std::vector& GetExtendedBandwidths () const; ISegmentBase* GetSegmentBase () const; ISegmentList* GetSegmentList () const; ISegmentTemplate* GetSegmentTemplate () const; @@ -51,6 +53,7 @@ namespace dash const std::vector& GetMediaStreamStructureId () const; void AddBaseURL (BaseUrl *baseURL); + void AddExtendedBandwidth (ExtendedBandwidth *extendedBandwidth); void AddSubRepresentation (SubRepresentation *subRepresentation); void SetSegmentBase (SegmentBase *segmentBase); void SetSegmentList (SegmentList *segmentList); @@ -65,6 +68,7 @@ namespace dash private: std::vector baseURLs; + std::vector extendedBandwidths; std::vector subRepresentations; SegmentBase *segmentBase; SegmentList *segmentList; diff --git a/libdash/libdash/source/mpd/RepresentationBase.cpp b/libdash/libdash/source/mpd/RepresentationBase.cpp index ac2b2a67..5dfad7b5 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.cpp +++ b/libdash/libdash/source/mpd/RepresentationBase.cpp @@ -39,8 +39,8 @@ RepresentationBase::~RepresentationBase () delete(this->framePacking.at(i)); for(size_t i = 0; i < this->audioChannelConfiguration.size(); i++) delete(this->audioChannelConfiguration.at(i)); - for(size_t i = 0; i < this->contentProtection.size(); i++) - delete(this->contentProtection.at(i)); + for(size_t i = 0; i < this->contentProtections.size(); i++) + delete(this->contentProtections.at(i)); for(size_t i = 0; i < this->essentialProperties.size(); i++) delete(this->essentialProperties.at(i)); for(size_t i = 0; i < this->supplementalProperties.size(); i++) @@ -80,13 +80,13 @@ void RepresentationBase::AddAudioChannelConfigura { this->audioChannelConfiguration.push_back(audioChannelConfiguration); } -const std::vector& RepresentationBase::GetContentProtection () const +const std::vector& RepresentationBase::GetContentProtections () const { - return (std::vector &) this->contentProtection; + return (std::vector &) this->contentProtections; } -void RepresentationBase::AddContentProtection (Descriptor *contentProtection) +void RepresentationBase::AddContentProtection (ContentProtection *contentProtection) { - this->contentProtection.push_back(contentProtection); + this->contentProtections.push_back(contentProtection); } const IDescriptor* RepresentationBase::GetOutputProtection () const { diff --git a/libdash/libdash/source/mpd/RepresentationBase.h b/libdash/libdash/source/mpd/RepresentationBase.h index 7f0021aa..6c0631b4 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.h +++ b/libdash/libdash/source/mpd/RepresentationBase.h @@ -19,6 +19,7 @@ #include "config.h" #include "IRepresentationBase.h" +#include "ContentProtection.h" #include "Descriptor.h" #include "EventStream.h" #include "Label.h" @@ -42,7 +43,7 @@ namespace dash const std::vector& GetFramePacking () const; const std::vector& GetAudioChannelConfiguration () const; - const std::vector& GetContentProtection () const; + const std::vector& GetContentProtections () const; const IDescriptor * GetOutputProtection () const; const std::vector& GetEssentialProperties () const; const std::vector& GetSupplementalProperties () const; @@ -73,7 +74,7 @@ namespace dash void AddFramePacking (Descriptor *framePacking); void AddAudioChannelConfiguration (Descriptor *audioChannelConfiguration); - void AddContentProtection (Descriptor *contentProtection); + void AddContentProtection (ContentProtection *contentProtection); void SetOutputProtection (Descriptor *outputProtection); void AddEssentialProperty (Descriptor *essentialProperty); void AddSupplementalProperty (Descriptor *supplementalProperty); @@ -105,7 +106,7 @@ namespace dash protected: std::vector framePacking; std::vector audioChannelConfiguration; - std::vector contentProtection; + std::vector contentProtections; Descriptor* outputProtection; std::vector essentialProperties; std::vector supplementalProperties; diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index 6ca655bb..a089e6ab 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -135,6 +135,27 @@ dash::mpd::Descriptor* Node::ToDescriptor () cons descriptor->AddRawAttributes(this->attributes); return descriptor; } +dash::mpd::ContentProtection* Node::ToContentProtection () const +{ + dash::mpd::ContentProtection *contentProtection = new dash::mpd::ContentProtection(); + + SetCommonValuesForDesc(*contentProtection); + + if (this->HasAttribute("robustness")) + { + contentProtection->SetRobustness(this->GetAttributeValue("robustness")); + } + if (this->HasAttribute("refId")) + { + contentProtection->SetRefId(this->GetAttributeValue("refId")); + } + if (this->HasAttribute("ref")) + { + contentProtection->SetRef(this->GetAttributeValue("ref")); + } + + return contentProtection; +} dash::mpd::ContentComponent* Node::ToContentComponent () const { dash::mpd::ContentComponent *contentComponent = new dash::mpd::ContentComponent(); @@ -443,6 +464,51 @@ dash::mpd::SubRepresentation* Node::ToSubRepresentation () cons subRepresentation->AddRawAttributes(this->attributes); return subRepresentation; } +dash::mpd::ModelPair* Node::ToModelPair () const +{ + dash::mpd::ModelPair* modelPair = new dash::mpd::ModelPair(); + std::vector subNodes = this->GetSubNodes(); + + if (this->HasAttribute("bufferTime")) + { + modelPair->SetBufferTime(this->GetAttributeValue("bufferTime")); + } + if (this->HasAttribute("bandwidth")) + { + modelPair->SetBandwidth(strtoul(this->GetAttributeValue("bandwidth").c_str(), NULL, 10)); + } + + for(size_t i = 0; i < subNodes.size(); i++) + { + modelPair->AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); + } + + modelPair->AddRawAttributes(this->attributes); + return modelPair; +} +dash::mpd::ExtendedBandwidth* Node::ToExtendedBandwidth () const +{ + dash::mpd::ExtendedBandwidth* extendedBandwidth = new dash::mpd::ExtendedBandwidth(); + std::vector subNodes = this->GetSubNodes(); + + if (this->HasAttribute("vbr")) + { + extendedBandwidth->SetVbr(dash::helpers::String::ToBool(this->GetAttributeValue("vbr"))); + } + + for(size_t i = 0; i < subNodes.size(); i++) + { + if (subNodes.at(i)->GetName() == "ModelPair") + { + extendedBandwidth->AddModelPair(subNodes.at(i)->ToModelPair()); + continue; + } + extendedBandwidth->AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); + } + + extendedBandwidth->AddRawAttributes(this->attributes); + return extendedBandwidth; +} dash::mpd::Representation* Node::ToRepresentation () const { dash::mpd::Representation* representation = new dash::mpd::Representation(); @@ -485,6 +551,11 @@ dash::mpd::Representation* Node::ToRepresentation () cons { representation->AddBaseURL(subNodes.at(i)->ToBaseUrl()); continue; + } + if (subNodes.at(i)->GetName() == "ExtendedBandwidth") + { + representation->AddExtendedBandwidth(subNodes.at(i)->ToExtendedBandwidth()); + continue; } if (subNodes.at(i)->GetName() == "SubRepresentation") { @@ -590,11 +661,11 @@ dash::mpd::AdaptationSet* Node::ToAdaptationSet () cons } if (this->HasAttribute("segmentAlignment")) { - adaptationSet->SetSegmentAlignment(this->GetAttributeValue("segmentAlignment")); + adaptationSet->SetSegmentAlignment(dash::helpers::String::ToBool(this->GetAttributeValue("segmentAlignment"))); } if (this->HasAttribute("subsegmentAlignment")) { - adaptationSet->SetSubsegmentAlignment(this->GetAttributeValue("subsegmentAlignment")); + adaptationSet->SetSubsegmentAlignment(dash::helpers::String::ToBool(this->GetAttributeValue("subsegmentAlignment"))); } if (this->HasAttribute("subsegmentStartsWithSAP")) { @@ -1072,6 +1143,11 @@ dash::mpd::Period* Node::ToPeriod () cons { period->AddServiceDescription(subNodes.at(i)->ToServiceDescription()); continue; + } + if (subNodes.at(i)->GetName() == "ContentProtection") + { + period->AddContentProtection(subNodes.at(i)->ToContentProtection()); + continue; } if (subNodes.at(i)->GetName() == "SegmentBase") { @@ -1558,14 +1634,14 @@ dash::mpd::MPD* Node::ToMPD () cons mpd->AddInitializationPresentation(subNodes.at(i)->ToUIntVWithID()); continue; } - if (subNodes.at(i)->GetName() == "Period") + if (subNodes.at(i)->GetName() == "ContentProtection") { - mpd->AddPeriod(subNodes.at(i)->ToPeriod()); + mpd->AddContentProtection(subNodes.at(i)->ToContentProtection()); continue; } - if (subNodes.at(i)->GetName() == "Preroll") + if (subNodes.at(i)->GetName() == "Period") { - mpd->AddPreroll(subNodes.at(i)->ToPeriod()); + mpd->AddPeriod(subNodes.at(i)->ToPeriod()); continue; } if (subNodes.at(i)->GetName() == "Metrics") @@ -1779,7 +1855,7 @@ void Node::SetCommonValuesForRep (dash::m } if (subNodes.at(i)->GetName() == "ContentProtection") { - object.AddContentProtection(subNodes.at(i)->ToDescriptor()); + object.AddContentProtection(subNodes.at(i)->ToContentProtection()); continue; } if (subNodes.at(i)->GetName() == "OutputProtection") @@ -1839,6 +1915,30 @@ void Node::SetCommonValuesForRep (dash::m } } } +void Node::SetCommonValuesForDesc(dash::mpd::Descriptor& object) const +{ + std::vector subNodes = this->GetSubNodes(); + + if (this->HasAttribute("schemeIdUri")) + { + object.SetSchemeIdUri(this->GetAttributeValue("schemeIdUri")); + } + if (this->HasAttribute("value")) + { + object.SetValue(this->GetAttributeValue("value")); + } + if (this->HasAttribute("id")) + { + object.SetId(this->GetAttributeValue("id")); + } + + for(size_t i = 0; i < subNodes.size(); i++) + { + object.AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); + } + + object.AddRawAttributes(this->attributes); +} void Node::SetCommonValuesForSeg (dash::mpd::SegmentBase& object) const { std::vector subNodes = this->GetSubNodes(); diff --git a/libdash/libdash/source/xml/Node.h b/libdash/libdash/source/xml/Node.h index 4c696e4a..33264f6a 100644 --- a/libdash/libdash/source/xml/Node.h +++ b/libdash/libdash/source/xml/Node.h @@ -24,10 +24,11 @@ #include "../mpd/BaseUrl.h" #include "../mpd/ContentComponent.h" #include "../mpd/ContentPopularityRate.h" +#include "../mpd/ContentProtection.h" #include "../mpd/Descriptor.h" #include "../mpd/Event.h" #include "../mpd/EventStream.h" -#include "../mpd/FCS.h" +#include "../mpd/ExtendedBandwidth.h" #include "../mpd/FailoverContent.h" #include "../mpd/FCS.h" #include "../mpd/InitializationSet.h" @@ -35,6 +36,7 @@ #include "../mpd/Latency.h" #include "../mpd/LeapSecondInformation.h" #include "../mpd/Metrics.h" +#include "../mpd/ModelPair.h" #include "../mpd/MPD.h" #include "../mpd/MultipleSegmentBase.h" #include "../mpd/OperatingQuality.h" @@ -97,16 +99,19 @@ namespace dash void SetMPDPath (std::string path); private: - void SetCommonValuesForRep (dash::mpd::RepresentationBase& object) const; + void SetCommonValuesForDesc (dash::mpd::Descriptor& object) const; + void SetCommonValuesForRep (dash::mpd::RepresentationBase& object) const; void SetCommonValuesForSeg (dash::mpd::SegmentBase& object) const; void SetCommonValuesForMSeg (dash::mpd::MultipleSegmentBase& object) const; dash::mpd::AdaptationSet* ToAdaptationSet () const; dash::mpd::BaseUrl* ToBaseUrl () const; dash::mpd::ContentComponent* ToContentComponent () const; dash::mpd::ContentPopularityRate* ToContentPopularityRate () const; + dash::mpd::ContentProtection* ToContentProtection () const; dash::mpd::Descriptor* ToDescriptor () const; dash::mpd::Event* ToEvent () const; dash::mpd::EventStream* ToEventStream () const; + dash::mpd::ExtendedBandwidth* ToExtendedBandwidth () const; dash::mpd::FailoverContent* ToFailoverContent () const; dash::mpd::FCS* ToFCS () const; dash::mpd::InitializationSet* ToInitializationSet () const; @@ -114,6 +119,7 @@ namespace dash dash::mpd::LeapSecondInformation* ToLeapSecondInformation () const; dash::mpd::Latency* ToLatency () const; dash::mpd::Metrics* ToMetrics () const; + dash::mpd::ModelPair* ToModelPair () const; dash::mpd::OperatingBandwidth* ToOperatingBandwidth () const; dash::mpd::OperatingQuality* ToOperatingQuality () const; dash::mpd::PatchLocation* ToPatchLocation () const; From 9fdc40405b8caf17f5c5a95a3e8e6522ed5c03a6 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Tue, 6 Jul 2021 13:03:04 +0200 Subject: [PATCH 18/28] Added updated classes --- libdash/libdash/include/IContentProtection.h | 64 +++++++++++++++++++ libdash/libdash/include/IExtendedBandwidth.h | 50 +++++++++++++++ libdash/libdash/include/IModelPair.h | 51 +++++++++++++++ .../libdash/source/mpd/ContentProtection.cpp | 49 ++++++++++++++ .../libdash/source/mpd/ContentProtection.h | 46 +++++++++++++ .../libdash/source/mpd/ExtendedBandwidth.cpp | 41 ++++++++++++ .../libdash/source/mpd/ExtendedBandwidth.h | 44 +++++++++++++ libdash/libdash/source/mpd/ModelPair.cpp | 41 ++++++++++++ libdash/libdash/source/mpd/ModelPair.h | 43 +++++++++++++ 9 files changed, 429 insertions(+) create mode 100644 libdash/libdash/include/IContentProtection.h create mode 100644 libdash/libdash/include/IExtendedBandwidth.h create mode 100644 libdash/libdash/include/IModelPair.h create mode 100644 libdash/libdash/source/mpd/ContentProtection.cpp create mode 100644 libdash/libdash/source/mpd/ContentProtection.h create mode 100644 libdash/libdash/source/mpd/ExtendedBandwidth.cpp create mode 100644 libdash/libdash/source/mpd/ExtendedBandwidth.h create mode 100644 libdash/libdash/source/mpd/ModelPair.cpp create mode 100644 libdash/libdash/source/mpd/ModelPair.h diff --git a/libdash/libdash/include/IContentProtection.h b/libdash/libdash/include/IContentProtection.h new file mode 100644 index 00000000..4bb204a9 --- /dev/null +++ b/libdash/libdash/include/IContentProtection.h @@ -0,0 +1,64 @@ +/** + * @class dash::mpd::IContentProtection + * @brief This interface is needed for accessing the common attributes of ContentProtection + * as specified in ISO/IEC 23009-1, section 5.8.4.1 + * @details Content protection descriptors are signalled by the ContentProtection element and are used to provide content protection, encryption, and DRM related information in order to access encrypted and/or DRM-protected content. + * The ContentProtection element is an extended descriptor type.\n + * For the element ContentProtection, the \c @schemeIdUri attribute is used to identify a content protection descriptor scheme. \n + * The ContentProtection descriptors is expected to provide sufficient information, possibly in conjunction with the \c @value and/or extension attributes and elements, such as the DRM system(s), encryption algorithm(s), and key distribution scheme(s) employed, to enable a client to determine whether it can possibly play the protected content. The ContentProtection element can be extended in a separate namespace to provide information specific to a content protection scheme (e.g. particular key management systems or encryption methods). \n + * When no ContentProtection element is present, the content shall not be encrypted. \n + * Subclause 5.8.5.2 exclusively defines schemes indicating the encryption scheme for different MPEG formats. In subclause 5.8.5.2.2, the MP4 protection scheme identified with \c @schemeIdUri set to \c "urn:mpeg:dash:mp4protection:2011" is defined. In subclause 5.8.5.2.3, the MPEG-2 TS protection scheme identified with \c @schemeIdUri set to \c "urn:mpeg:dash:13818:1:CA_descriptor:2011" is defined. These schemes merely indicate the encryption mode used in conjunction with one or more DRMs. Hence, it is recommended to provide the client with additional content protection information about the available DRMs. \n + * Additional ContentProtection elements with the \c @schemeIdURI attribute set to a URN not defined in subclause 5.8.5 must describe a specific key management and protection scheme that is sufficient to access and present the Representation. For such schemes, an optional \c @robustness attribute may be present, for details see subclause 5.8.4.1.2. \n + * The content protection information may be provided explicitly in a ContentProtection element or may be referenced from another ContentProtection element. For details refer to subclause 5.8.4.1.3. \n + * The semantics of the attributes within the ContentProtection element are provided in subclause 5.8.4.1.4, Table 30. The XML syntax of ContentProtection element is provided in subclause 5.8.4.1.5. \n + * Subclause 5.8.4.1.6 provides information on how to define a content protection scheme. + * @see + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ICONTENTPROTECTION_H_ +#define ICONTENTPROTECTION_H_ + +#include "config.h" + +#include "IDescriptor.h" + +namespace dash +{ + namespace mpd + { + class IContentProtection : public virtual IDescriptor + { + public: + virtual ~IContentProtection(){} + + /** + * Returns the reference to a string that specifies the robustness level required for this content protection scheme for accessing content represented by the associated Representation(s). For more details refer to subclause 5.8.4.1.2 and 5.8.4.1.6. \n + * If not present, then the lowest robustness level for the identified content protection scheme applies. + * @return a reference to a string + */ + virtual const std::string& GetRobustness () const = 0; + + /** + * Returns the reference to a string that specifies an identifier of this descriptor. The identifier shall be unique within an MPD. \n + * The attribute shall not be present if the \c @ref attribute is present. + * @return a reference to a string + */ + virtual const std::string& GetRefId () const = 0; + + /** + * Returns the reference to a string that - if present - makes this a referencing content protection descriptor + * that inherits from a “source†content protection descriptor which is identified by the equivalent value of \c @refId attribute. For details, refer to subclause 5.8.4.1.3. \n + * The attribute shall not be present if the \c @refId attribute is present. + * @return a reference to a string + */ + virtual const std::string& GetRef () const = 0; + }; + } +} + +#endif /* ICONTENTPROTECTION_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IExtendedBandwidth.h b/libdash/libdash/include/IExtendedBandwidth.h new file mode 100644 index 00000000..b16efe17 --- /dev/null +++ b/libdash/libdash/include/IExtendedBandwidth.h @@ -0,0 +1,50 @@ +/** + * @class dash::mpd::IExtendedBandwidth + * @brief This interface is needed for accessing the common attributes and elements of ExtendedBandwidth + * as specified in ISO/IEC 23009-1, section 5.3.5.6 + * @details Subclause 5.3.5.4 provides a detailed overview on the usage of \c @minBufferTime and \c @bandwidth for determining the bitrate properties of the associated Representation. However, this model does not expose certain extended bandwidth properties of the Representation, for example the nature of the encoding being variable bitrate, or any bitrate properties over different time windows. \n + * For this purpose, each Represention have assigned an extended bandwidth signalling providing additional properties of the Representation. This information is provided as part of the ExtendedBandwidth element as defined in Table 12. + * @see dash::mpd::IModelPair + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IEXTENDEDBANDWIDTH_H_ +#define IEXTENDEDBANDWIDTH_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IModelPair.h" + +namespace dash +{ + namespace mpd + { + class IExtendedBandwidth : public virtual IMPDElement + { + public: + virtual ~IExtendedBandwidth(){} + + /** + * Returns a pointer to a vector of dash::mpd::IModelPair objects, each of which defines an extended bandwidth model pair that applies for the Representation. + * @return a pointer to a vector of dash::mpd::IModelPair objects + */ + virtual const std::vector& GetModelPairs () const = 0; + + /** + * Returns a boolean that - if set to true - assure that the content is encoded to primarily have a constant or consistent quality, while at the same time when the signal restrictions on MPD@minBufferTime and Representation@bandwidth attributes are reached, the quality of the content may drop. + * In cases where is cap is not reached, the quality of the content is expected to be consistent. \n + * If set to false or not present, no information on the nature of the encoding is present. \n + * \t NOTE: the signalling set to true implies that the actual instantaneous bitrate can frequently be below the maximum. + * @return a boolean + */ + virtual bool GetVbr () const = 0; + }; + } +} + +#endif /* IEXTENDEDBANDWIDTH_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IModelPair.h b/libdash/libdash/include/IModelPair.h new file mode 100644 index 00000000..35f4c0b7 --- /dev/null +++ b/libdash/libdash/include/IModelPair.h @@ -0,0 +1,51 @@ +/** + * @class dash::mpd::IModelPair + * @brief This interface is needed for accessing the common attributes and elements of ModelPair + * as specified in ISO/IEC 23009-1, section 5.3.5.6 + * @details A ModelPair element defines an extended bandwidth model pair that applies for the Representation. + * @see + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IMODELPAIR_H_ +#define IMODELPAIR_H_ + +#include "config.h" + +#include "IMPDElement.h" + +namespace dash +{ + namespace mpd + { + class IModelPair : public virtual IMPDElement + { + public: + virtual ~IModelPair(){} + + /** + * Returns the reference to a string that specifies a duration used in the definition of the Representation data rate together with \c @bandwidth attribute within the same element. \n + * \t NOTE: there are cases for which a real or expected long-term average bitrate may be usefully signaled. Examples include (i) the signaling of the average bitrate of a Representation in On-Demand case. In this case the \c @buffer may be set to the duration of the Period + * and the \c @bandwidth may be set to the size of the Representation. (ii) the signaling of the maximum expected long-term bitrate in Live-Edge Periods: In this case the \c @buffer is set to a large value, for example 1 hour, or 24 hours and the bandwidth expresses the maximum amount of bytes over this period. + * @return a reference to a string + */ + virtual const std::string& GetBufferTime () const = 0; + + /** + * Returns an unsigned integer: \n + * Consider a hypothetical constant bitrate channel of bandwidth with the value of this attribute in bits per second (bps). + * Then, if the Representation is continuously delivered at this bitrate, starting at any signalled SAP of type 1 or 2 included in this Representation element, a client can be assured of having enough data for continuous playout providing playout begins after \c @bufferTime * \c @bandwidth bits have been received (i.e. at time \c @bufferTime after the first bit is received). \n + * For dependent Representations, this value specifies the bandwidth according to the above definition for the aggregation of this Representation and all complementary Representations. \n + * For details, see subclause 5.3.5.4. + * @return an unsigned integer + */ + virtual uint64_t GetBandwidth () const = 0; + }; + } +} + +#endif /* IMODELPAIR_H_ */ \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ContentProtection.cpp b/libdash/libdash/source/mpd/ContentProtection.cpp new file mode 100644 index 00000000..22feb891 --- /dev/null +++ b/libdash/libdash/source/mpd/ContentProtection.cpp @@ -0,0 +1,49 @@ +/* + * ContentProtection.cpp + ***************************************************************************** * + * Name: Daniele Lorenzi + * Email: lorenzidaniele.97@gmail.com + * Date: 2021 + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "ContentProtection.h" + +using namespace dash::mpd; + +ContentProtection::ContentProtection () : + robustness(""), + refId(""), + ref("") +{ +} +ContentProtection::~ContentProtection () +{ +} + +const std::string& ContentProtection::GetRobustness () const +{ + return this->robustness; +} +void ContentProtection::SetRobustness (const std::string& robustness) +{ + this->robustness = robustness; +} +const std::string& ContentProtection::GetRefId () const +{ + return this->refId; +} +void ContentProtection::SetRefId (const std::string& refId) +{ + this->refId = refId; +} +const std::string& ContentProtection::GetRef () const +{ + return this->ref; +} +void ContentProtection::SetRef (const std::string& ref) +{ + this->ref = ref; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ContentProtection.h b/libdash/libdash/source/mpd/ContentProtection.h new file mode 100644 index 00000000..b14299ed --- /dev/null +++ b/libdash/libdash/source/mpd/ContentProtection.h @@ -0,0 +1,46 @@ +/* + * ContentProtection.h + ***************************************************************************** * + * Name: Daniele Lorenzi + * Email: lorenzidaniele.97@gmail.com + * Date: 2021 + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef CONTENTPROTECTION_H_ +#define CONTENTPROTECTION_H_ + +#include "config.h" + +#include "IContentProtection.h" +#include "Descriptor.h" + +namespace dash +{ + namespace mpd + { + class ContentProtection : public IContentProtection, public Descriptor + { + public: + ContentProtection (); + virtual ~ContentProtection (); + + const std::string& GetRobustness () const; + const std::string& GetRefId () const; + const std::string& GetRef () const; + + void SetRobustness (const std::string& robustness); + void SetRefId (const std::string& refId); + void SetRef (const std::string& ref); + + private: + std::string robustness; + std::string refId; + std::string ref; + }; + } +} + +#endif /* CONTENTPROTECTION_H_ */ diff --git a/libdash/libdash/source/mpd/ExtendedBandwidth.cpp b/libdash/libdash/source/mpd/ExtendedBandwidth.cpp new file mode 100644 index 00000000..e1c99464 --- /dev/null +++ b/libdash/libdash/source/mpd/ExtendedBandwidth.cpp @@ -0,0 +1,41 @@ +/* + * ExtendedBandwidth.cpp + ***************************************************************************** * + * Name: Daniele Lorenzi + * Email: lorenzidaniele.97@gmail.com + * Date: 2021 + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "ExtendedBandwidth.h" + +using namespace dash::mpd; + +ExtendedBandwidth::ExtendedBandwidth () : + vbr(false) +{ +} +ExtendedBandwidth::~ExtendedBandwidth () +{ + for (size_t i=0; i < this->modelPairs.size(); i++) + delete(this->modelPairs.at(i)); +} + +const std::vector& ExtendedBandwidth::GetModelPairs () const +{ + return (std::vector &) this->modelPairs; +} +void ExtendedBandwidth::AddModelPair (ModelPair *modelPair) +{ + this->modelPairs.push_back(modelPair); +} +bool ExtendedBandwidth::GetVbr () const +{ + return this->vbr; +} +void ExtendedBandwidth::SetVbr (bool vbr) +{ + this->vbr = vbr; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ExtendedBandwidth.h b/libdash/libdash/source/mpd/ExtendedBandwidth.h new file mode 100644 index 00000000..346fd774 --- /dev/null +++ b/libdash/libdash/source/mpd/ExtendedBandwidth.h @@ -0,0 +1,44 @@ +/* + * ExtendedBandwidth.h + ****************************************************************************** + * Name: Daniele Lorenzi + * Email: lorenzidaniele.97@gmail.com + * Date: 2021 + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef EXTENDEDBANDWIDTH_H_ +#define EXTENDEDBANDWIDTH_H_ + +#include "config.h" + +#include "IExtendedBandwidth.h" +#include "AbstractMPDElement.h" +#include "ModelPair.h" + +namespace dash +{ + namespace mpd + { + class ExtendedBandwidth : public IExtendedBandwidth, public AbstractMPDElement + { + public: + ExtendedBandwidth (); + virtual ~ExtendedBandwidth (); + + const std::vector& GetModelPairs () const; + bool GetVbr () const; + + void AddModelPair (ModelPair *modelPair); + void SetVbr (bool vbr); + + private: + std::vector modelPairs; + bool vbr; + }; + } +} + +#endif /* EXTENDEDBANDWIDTH_H_ */ diff --git a/libdash/libdash/source/mpd/ModelPair.cpp b/libdash/libdash/source/mpd/ModelPair.cpp new file mode 100644 index 00000000..5a9a3b89 --- /dev/null +++ b/libdash/libdash/source/mpd/ModelPair.cpp @@ -0,0 +1,41 @@ +/* + * ModelPair.cpp + ***************************************************************************** * + * Name: Daniele Lorenzi + * Email: lorenzidaniele.97@gmail.com + * Date: 2021 + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#include "ModelPair.h" + +using namespace dash::mpd; + +ModelPair::ModelPair () : + bufferTime(""), + bandwidth(0) +{ +} + +ModelPair::~ModelPair () +{ +} + +const std::string& ModelPair::GetBufferTime () const +{ + return this->bufferTime; +} +void ModelPair::SetBufferTime (const std::string& bufferTime) +{ + this->bufferTime = bufferTime; +} +uint64_t ModelPair::GetBandwidth () const +{ + return this->bandwidth; +} +void ModelPair::SetBandwidth (uint64_t bandwidth) +{ + this->bandwidth = bandwidth; +} \ No newline at end of file diff --git a/libdash/libdash/source/mpd/ModelPair.h b/libdash/libdash/source/mpd/ModelPair.h new file mode 100644 index 00000000..ddec7f08 --- /dev/null +++ b/libdash/libdash/source/mpd/ModelPair.h @@ -0,0 +1,43 @@ +/* + * ModelPair.h + ***************************************************************************** * + * Name: Daniele Lorenzi + * Email: lorenzidaniele.97@gmail.com + * Date: 2021 + * + * This source code and its use and distribution, is subject to the terms + * and conditions of the applicable license agreement. + *****************************************************************************/ + +#ifndef MODELPAIR_H_ +#define MODELPAIR_H_ + +#include "config.h" + +#include "IModelPair.h" +#include "AbstractMPDElement.h" + +namespace dash +{ + namespace mpd + { + class ModelPair : public IModelPair, public AbstractMPDElement + { + public: + ModelPair (); + virtual ~ModelPair (); + + const std::string& GetBufferTime () const; + uint64_t GetBandwidth () const; + + void SetBufferTime (const std::string& bufferTime); + void SetBandwidth (uint64_t bandwidth); + + private: + std::string bufferTime; + uint64_t bandwidth; + }; + } +} + +#endif /* MODELPAIR_H_ */ From 26f94f692168a8d724bb93f9ff7fc0ad921a7595 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 7 Jul 2021 08:16:21 +0200 Subject: [PATCH 19/28] Fixed indentation --- libdash/libdash/include/IContentProtection.h | 6 +++--- libdash/libdash/include/IExtendedBandwidth.h | 6 +++--- libdash/libdash/include/IMPD.h | 6 +++--- libdash/libdash/include/IModelPair.h | 12 ++++++------ libdash/libdash/include/IPeriod.h | 6 +++--- libdash/libdash/include/IRepresentation.h | 4 ++-- .../libdash/source/mpd/ContentProtection.cpp | 4 ++-- libdash/libdash/source/mpd/ContentProtection.h | 2 +- .../libdash/source/mpd/ExtendedBandwidth.cpp | 4 ++-- libdash/libdash/source/mpd/MPD.cpp | 2 +- libdash/libdash/source/mpd/MPD.h | 6 +++--- libdash/libdash/source/mpd/ModelPair.cpp | 2 +- libdash/libdash/source/mpd/Period.cpp | 2 +- libdash/libdash/source/mpd/Period.h | 6 +++--- libdash/libdash/source/mpd/Representation.cpp | 2 +- libdash/libdash/source/mpd/Representation.h | 6 +++--- libdash/libdash/source/xml/Node.cpp | 18 +++++++++--------- libdash/libdash/source/xml/Node.h | 8 ++++---- 18 files changed, 51 insertions(+), 51 deletions(-) diff --git a/libdash/libdash/include/IContentProtection.h b/libdash/libdash/include/IContentProtection.h index 4bb204a9..bc849dcd 100644 --- a/libdash/libdash/include/IContentProtection.h +++ b/libdash/libdash/include/IContentProtection.h @@ -49,10 +49,10 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetRefId () const = 0; - - /** + + /** * Returns the reference to a string that - if present - makes this a referencing content protection descriptor - * that inherits from a “source†content protection descriptor which is identified by the equivalent value of \c @refId attribute. For details, refer to subclause 5.8.4.1.3. \n + * that inherits from a “source†content protection descriptor which is identified by the equivalent value of \c @refId attribute. For details, refer to subclause 5.8.4.1.3. \n * The attribute shall not be present if the \c @refId attribute is present. * @return a reference to a string */ diff --git a/libdash/libdash/include/IExtendedBandwidth.h b/libdash/libdash/include/IExtendedBandwidth.h index b16efe17..d7a9d821 100644 --- a/libdash/libdash/include/IExtendedBandwidth.h +++ b/libdash/libdash/include/IExtendedBandwidth.h @@ -37,9 +37,9 @@ namespace dash /** * Returns a boolean that - if set to true - assure that the content is encoded to primarily have a constant or consistent quality, while at the same time when the signal restrictions on MPD@minBufferTime and Representation@bandwidth attributes are reached, the quality of the content may drop. - * In cases where is cap is not reached, the quality of the content is expected to be consistent. \n - * If set to false or not present, no information on the nature of the encoding is present. \n - * \t NOTE: the signalling set to true implies that the actual instantaneous bitrate can frequently be below the maximum. + * In cases where is cap is not reached, the quality of the content is expected to be consistent. \n + * If set to false or not present, no information on the nature of the encoding is present. \n + * \t NOTE: the signalling set to true implies that the actual instantaneous bitrate can frequently be below the maximum. * @return a boolean */ virtual bool GetVbr () const = 0; diff --git a/libdash/libdash/include/IMPD.h b/libdash/libdash/include/IMPD.h index 04dd4a3c..b5509002 100644 --- a/libdash/libdash/include/IMPD.h +++ b/libdash/libdash/include/IMPD.h @@ -127,11 +127,11 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IUIntVWithID objects */ virtual const std::vector& GetInitializationPresentations () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IContentProtection objects that specifies information about content protection * and encryption schemes used in this Media Presentation. If present on this level, it shall include the \c @refId attribute. \n - * For details, see subclauses 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1. \n + * For details, see subclauses 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1. \n * * @return a reference to a vector of pointers to dash::mpd::IContentProtection objects */ diff --git a/libdash/libdash/include/IModelPair.h b/libdash/libdash/include/IModelPair.h index 35f4c0b7..a730c4d3 100644 --- a/libdash/libdash/include/IModelPair.h +++ b/libdash/libdash/include/IModelPair.h @@ -29,18 +29,18 @@ namespace dash /** * Returns the reference to a string that specifies a duration used in the definition of the Representation data rate together with \c @bandwidth attribute within the same element. \n - * \t NOTE: there are cases for which a real or expected long-term average bitrate may be usefully signaled. Examples include (i) the signaling of the average bitrate of a Representation in On-Demand case. In this case the \c @buffer may be set to the duration of the Period - * and the \c @bandwidth may be set to the size of the Representation. (ii) the signaling of the maximum expected long-term bitrate in Live-Edge Periods: In this case the \c @buffer is set to a large value, for example 1 hour, or 24 hours and the bandwidth expresses the maximum amount of bytes over this period. + * \t NOTE: there are cases for which a real or expected long-term average bitrate may be usefully signaled. Examples include (i) the signaling of the average bitrate of a Representation in On-Demand case. In this case the \c @buffer may be set to the duration of the Period + * and the \c @bandwidth may be set to the size of the Representation. (ii) the signaling of the maximum expected long-term bitrate in Live-Edge Periods: In this case the \c @buffer is set to a large value, for example 1 hour, or 24 hours and the bandwidth expresses the maximum amount of bytes over this period. * @return a reference to a string */ virtual const std::string& GetBufferTime () const = 0; /** * Returns an unsigned integer: \n - * Consider a hypothetical constant bitrate channel of bandwidth with the value of this attribute in bits per second (bps). - * Then, if the Representation is continuously delivered at this bitrate, starting at any signalled SAP of type 1 or 2 included in this Representation element, a client can be assured of having enough data for continuous playout providing playout begins after \c @bufferTime * \c @bandwidth bits have been received (i.e. at time \c @bufferTime after the first bit is received). \n - * For dependent Representations, this value specifies the bandwidth according to the above definition for the aggregation of this Representation and all complementary Representations. \n - * For details, see subclause 5.3.5.4. + * Consider a hypothetical constant bitrate channel of bandwidth with the value of this attribute in bits per second (bps). + * Then, if the Representation is continuously delivered at this bitrate, starting at any signalled SAP of type 1 or 2 included in this Representation element, a client can be assured of having enough data for continuous playout providing playout begins after \c @bufferTime * \c @bandwidth bits have been received (i.e. at time \c @bufferTime after the first bit is received). \n + * For dependent Representations, this value specifies the bandwidth according to the above definition for the aggregation of this Representation and all complementary Representations. \n + * For details, see subclause 5.3.5.4. * @return an unsigned integer */ virtual uint64_t GetBandwidth () const = 0; diff --git a/libdash/libdash/include/IPeriod.h b/libdash/libdash/include/IPeriod.h index a3a247f8..dad75a95 100644 --- a/libdash/libdash/include/IPeriod.h +++ b/libdash/libdash/include/IPeriod.h @@ -125,11 +125,11 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IServiceDescription objects */ virtual const std::vector& GetServiceDescriptions () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IContentProtection objects that specifies information about content protection * and encryption schemes used in this Media Presentation. If present on this level, it shall include the \c @refId attribute. \n - * For details, see subclauses 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1. \n + * For details, see subclauses 5.8.1 and 5.8.4.1 of ISO/IEC 23009-1. \n * * @return a reference to a vector of pointers to dash::mpd::IContentProtection objects */ diff --git a/libdash/libdash/include/IRepresentation.h b/libdash/libdash/include/IRepresentation.h index 07044181..264d4b47 100644 --- a/libdash/libdash/include/IRepresentation.h +++ b/libdash/libdash/include/IRepresentation.h @@ -67,8 +67,8 @@ namespace dash * @return a reference to a vector of pointers to dash::mpd::IBaseUrl objects */ virtual const std::vector& GetBaseURLs () const = 0; - - /** + + /** * Returns a reference to a vector of pointers to dash::mpd::IExtendedBandwidth objects that specifies an extended bandwidth model with more detailed information on the characteristics of the Representation. \n * For more details, see subclause 5.3.5.6 of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IExtendedBandwidth objects diff --git a/libdash/libdash/source/mpd/ContentProtection.cpp b/libdash/libdash/source/mpd/ContentProtection.cpp index 22feb891..c6d677d9 100644 --- a/libdash/libdash/source/mpd/ContentProtection.cpp +++ b/libdash/libdash/source/mpd/ContentProtection.cpp @@ -15,8 +15,8 @@ using namespace dash::mpd; ContentProtection::ContentProtection () : robustness(""), - refId(""), - ref("") + refId(""), + ref("") { } ContentProtection::~ContentProtection () diff --git a/libdash/libdash/source/mpd/ContentProtection.h b/libdash/libdash/source/mpd/ContentProtection.h index b14299ed..35c86607 100644 --- a/libdash/libdash/source/mpd/ContentProtection.h +++ b/libdash/libdash/source/mpd/ContentProtection.h @@ -29,7 +29,7 @@ namespace dash const std::string& GetRobustness () const; const std::string& GetRefId () const; - const std::string& GetRef () const; + const std::string& GetRef () const; void SetRobustness (const std::string& robustness); void SetRefId (const std::string& refId); diff --git a/libdash/libdash/source/mpd/ExtendedBandwidth.cpp b/libdash/libdash/source/mpd/ExtendedBandwidth.cpp index e1c99464..a1c5dbe1 100644 --- a/libdash/libdash/source/mpd/ExtendedBandwidth.cpp +++ b/libdash/libdash/source/mpd/ExtendedBandwidth.cpp @@ -14,12 +14,12 @@ using namespace dash::mpd; ExtendedBandwidth::ExtendedBandwidth () : - vbr(false) + vbr(false) { } ExtendedBandwidth::~ExtendedBandwidth () { - for (size_t i=0; i < this->modelPairs.size(); i++) + for (size_t i=0; i < this->modelPairs.size(); i++) delete(this->modelPairs.at(i)); } diff --git a/libdash/libdash/source/mpd/MPD.cpp b/libdash/libdash/source/mpd/MPD.cpp index 4cd02b8a..0038b47f 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -47,7 +47,7 @@ MPD::~MPD () delete(this->supplementalProperties.at(i)); for(size_t i = 0; i < this->utcTimings.size(); i++) delete(this->utcTimings.at(i)); - for(size_t i = 0; i < this->contentProtections.size(); i++) + for(size_t i = 0; i < this->contentProtections.size(); i++) delete(this->contentProtections.at(i)); for(size_t i = 0; i < this->periods.size(); i++) delete(this->periods.at(i)); diff --git a/libdash/libdash/source/mpd/MPD.h b/libdash/libdash/source/mpd/MPD.h index e6a3b0d2..e0f56708 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -52,7 +52,7 @@ namespace dash const std::vector& GetInitializationSets () const; const std::vector& GetInitializationGroups () const; const std::vector& GetInitializationPresentations () const; - const std::vector& GetContentProtections () const; + const std::vector& GetContentProtections () const; const std::vector& GetPeriods () const; const std::vector& GetMetrics () const; const std::vector& GetEssentialProperties () const; @@ -88,7 +88,7 @@ namespace dash void AddInitializationSet (InitializationSet* initializationSet); void AddInitializationGroup (UIntVWithID* initializationGroup); void AddInitializationPresentation (UIntVWithID* initializationPresentation); - void AddContentProtection (ContentProtection *contentProtection); + void AddContentProtection (ContentProtection *contentProtection); void AddPeriod (Period *period); void AddMetrics (Metrics *metrics); void AddEssentialProperty (Descriptor *essentialProperty); @@ -120,7 +120,7 @@ namespace dash std::vector initializationSets; std::vector initializationGroups; std::vector initializationPresentations; - std::vector contentProtections; + std::vector contentProtections; std::vector periods; std::vector metrics; std::vector essentialProperties; diff --git a/libdash/libdash/source/mpd/ModelPair.cpp b/libdash/libdash/source/mpd/ModelPair.cpp index 5a9a3b89..732fd269 100644 --- a/libdash/libdash/source/mpd/ModelPair.cpp +++ b/libdash/libdash/source/mpd/ModelPair.cpp @@ -15,7 +15,7 @@ using namespace dash::mpd; ModelPair::ModelPair () : bufferTime(""), - bandwidth(0) + bandwidth(0) { } diff --git a/libdash/libdash/source/mpd/Period.cpp b/libdash/libdash/source/mpd/Period.cpp index 66e70ffe..ce250007 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -48,7 +48,7 @@ Period::~Period () delete(this->eventStreams.at(i)); for(size_t i = 0; i < this->serviceDescriptions.size(); i++) delete(this->serviceDescriptions.at(i)); - for(size_t i = 0; i < this->contentProtections.size(); i++) + for(size_t i = 0; i < this->contentProtections.size(); i++) delete(this->contentProtections.at(i)); for(size_t i = 0; i < this->preselections.size(); i++) delete(this->preselections.at(i)); diff --git a/libdash/libdash/source/mpd/Period.h b/libdash/libdash/source/mpd/Period.h index f2ea9feb..ac3ec2a5 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -50,7 +50,7 @@ namespace dash const IDescriptor * GetAssetIdentifier () const; const std::vector& GetEventStreams () const; const std::vector& GetServiceDescriptions () const; - const std::vector& GetContentProtections () const; + const std::vector& GetContentProtections () const; const std::vector& GetAdaptationSets () const; const std::vector& GetSubsets () const; const std::vector& GetSupplementalProperties () const; @@ -72,7 +72,7 @@ namespace dash void SetAssetIdentifier (Descriptor *assetIdentifier); void AddEventStream (EventStream *eventStream); void AddServiceDescription (ServiceDescription* serviceDescription); - void AddContentProtection (ContentProtection *contentProtection); + void AddContentProtection (ContentProtection *contentProtection); void AddAdaptationSet (AdaptationSet *AdaptationSet); void AddSubset (Subset *subset); void AddSupplementalProperty (Descriptor *supplementalProperty); @@ -95,7 +95,7 @@ namespace dash Descriptor *assetIdentifier; std::vector eventStreams; std::vector serviceDescriptions; - std::vector contentProtections; + std::vector contentProtections; std::vector adaptationSets; std::vector subsets; std::vector supplementalProperties; diff --git a/libdash/libdash/source/mpd/Representation.cpp b/libdash/libdash/source/mpd/Representation.cpp index a60b0141..23ba0e7a 100644 --- a/libdash/libdash/source/mpd/Representation.cpp +++ b/libdash/libdash/source/mpd/Representation.cpp @@ -30,7 +30,7 @@ Representation::~Representation () { for(size_t i = 0; i < this->baseURLs.size(); i++) delete(this->baseURLs.at(i)); - for(size_t i = 0; i < this->extendedBandwidths.size(); i++) + for(size_t i = 0; i < this->extendedBandwidths.size(); i++) delete(this->extendedBandwidths.at(i)); for(size_t i = 0; i < this->subRepresentations.size(); i++) delete(this->subRepresentations.at(i)); diff --git a/libdash/libdash/source/mpd/Representation.h b/libdash/libdash/source/mpd/Representation.h index 11b7d552..9329bbe9 100644 --- a/libdash/libdash/source/mpd/Representation.h +++ b/libdash/libdash/source/mpd/Representation.h @@ -39,7 +39,7 @@ namespace dash virtual ~Representation (); const std::vector& GetBaseURLs () const; - const std::vector& GetSubRepresentations () const; + const std::vector& GetSubRepresentations () const; const std::vector& GetExtendedBandwidths () const; ISegmentBase* GetSegmentBase () const; ISegmentList* GetSegmentList () const; @@ -53,7 +53,7 @@ namespace dash const std::vector& GetMediaStreamStructureId () const; void AddBaseURL (BaseUrl *baseURL); - void AddExtendedBandwidth (ExtendedBandwidth *extendedBandwidth); + void AddExtendedBandwidth (ExtendedBandwidth *extendedBandwidth); void AddSubRepresentation (SubRepresentation *subRepresentation); void SetSegmentBase (SegmentBase *segmentBase); void SetSegmentList (SegmentList *segmentList); @@ -68,7 +68,7 @@ namespace dash private: std::vector baseURLs; - std::vector extendedBandwidths; + std::vector extendedBandwidths; std::vector subRepresentations; SegmentBase *segmentBase; SegmentList *segmentList; diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index a089e6ab..a08251be 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -138,8 +138,8 @@ dash::mpd::Descriptor* Node::ToDescriptor () cons dash::mpd::ContentProtection* Node::ToContentProtection () const { dash::mpd::ContentProtection *contentProtection = new dash::mpd::ContentProtection(); - - SetCommonValuesForDesc(*contentProtection); + + SetCommonValuesForDesc(*contentProtection); if (this->HasAttribute("robustness")) { @@ -498,7 +498,7 @@ dash::mpd::ExtendedBandwidth* Node::ToExtendedBandwidth () for(size_t i = 0; i < subNodes.size(); i++) { - if (subNodes.at(i)->GetName() == "ModelPair") + if (subNodes.at(i)->GetName() == "ModelPair") { extendedBandwidth->AddModelPair(subNodes.at(i)->ToModelPair()); continue; @@ -552,7 +552,7 @@ dash::mpd::Representation* Node::ToRepresentation () cons representation->AddBaseURL(subNodes.at(i)->ToBaseUrl()); continue; } - if (subNodes.at(i)->GetName() == "ExtendedBandwidth") + if (subNodes.at(i)->GetName() == "ExtendedBandwidth") { representation->AddExtendedBandwidth(subNodes.at(i)->ToExtendedBandwidth()); continue; @@ -1144,7 +1144,7 @@ dash::mpd::Period* Node::ToPeriod () cons period->AddServiceDescription(subNodes.at(i)->ToServiceDescription()); continue; } - if (subNodes.at(i)->GetName() == "ContentProtection") + if (subNodes.at(i)->GetName() == "ContentProtection") { period->AddContentProtection(subNodes.at(i)->ToContentProtection()); continue; @@ -1634,7 +1634,7 @@ dash::mpd::MPD* Node::ToMPD () cons mpd->AddInitializationPresentation(subNodes.at(i)->ToUIntVWithID()); continue; } - if (subNodes.at(i)->GetName() == "ContentProtection") + if (subNodes.at(i)->GetName() == "ContentProtection") { mpd->AddContentProtection(subNodes.at(i)->ToContentProtection()); continue; @@ -1927,7 +1927,7 @@ void Node::SetCommonValuesForDesc(dash::m { object.SetValue(this->GetAttributeValue("value")); } - if (this->HasAttribute("id")) + if (this->HasAttribute("id")) { object.SetId(this->GetAttributeValue("id")); } @@ -1936,8 +1936,8 @@ void Node::SetCommonValuesForDesc(dash::m { object.AddAdditionalSubNode((xml::INode *) new Node(*(subNodes.at(i)))); } - - object.AddRawAttributes(this->attributes); + + object.AddRawAttributes(this->attributes); } void Node::SetCommonValuesForSeg (dash::mpd::SegmentBase& object) const { diff --git a/libdash/libdash/source/xml/Node.h b/libdash/libdash/source/xml/Node.h index 33264f6a..3de0c4a4 100644 --- a/libdash/libdash/source/xml/Node.h +++ b/libdash/libdash/source/xml/Node.h @@ -100,18 +100,18 @@ namespace dash private: void SetCommonValuesForDesc (dash::mpd::Descriptor& object) const; - void SetCommonValuesForRep (dash::mpd::RepresentationBase& object) const; + void SetCommonValuesForRep (dash::mpd::RepresentationBase& object) const; void SetCommonValuesForSeg (dash::mpd::SegmentBase& object) const; void SetCommonValuesForMSeg (dash::mpd::MultipleSegmentBase& object) const; dash::mpd::AdaptationSet* ToAdaptationSet () const; dash::mpd::BaseUrl* ToBaseUrl () const; dash::mpd::ContentComponent* ToContentComponent () const; dash::mpd::ContentPopularityRate* ToContentPopularityRate () const; - dash::mpd::ContentProtection* ToContentProtection () const; + dash::mpd::ContentProtection* ToContentProtection () const; dash::mpd::Descriptor* ToDescriptor () const; dash::mpd::Event* ToEvent () const; dash::mpd::EventStream* ToEventStream () const; - dash::mpd::ExtendedBandwidth* ToExtendedBandwidth () const; + dash::mpd::ExtendedBandwidth* ToExtendedBandwidth () const; dash::mpd::FailoverContent* ToFailoverContent () const; dash::mpd::FCS* ToFCS () const; dash::mpd::InitializationSet* ToInitializationSet () const; @@ -119,7 +119,7 @@ namespace dash dash::mpd::LeapSecondInformation* ToLeapSecondInformation () const; dash::mpd::Latency* ToLatency () const; dash::mpd::Metrics* ToMetrics () const; - dash::mpd::ModelPair* ToModelPair () const; + dash::mpd::ModelPair* ToModelPair () const; dash::mpd::OperatingBandwidth* ToOperatingBandwidth () const; dash::mpd::OperatingQuality* ToOperatingQuality () const; dash::mpd::PatchLocation* ToPatchLocation () const; From 4371ca05a075932d9ddafc874aea6a4f441cfce8 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 7 Jul 2021 09:45:54 +0200 Subject: [PATCH 20/28] Added RepresentationBase@containerProfiles --- libdash/libdash/include/IRepresentationBase.h | 8 ++++++++ libdash/libdash/source/mpd/RepresentationBase.cpp | 8 ++++++++ libdash/libdash/source/mpd/RepresentationBase.h | 3 +++ libdash/libdash/source/xml/Node.cpp | 4 ++++ 4 files changed, 23 insertions(+) diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index 9bb8d3c7..cf49d14e 100644 --- a/libdash/libdash/include/IRepresentationBase.h +++ b/libdash/libdash/include/IRepresentationBase.h @@ -242,6 +242,14 @@ namespace dash * @return a reference to a vector of strings */ virtual const std::vector& GetCodecs () const = 0; + + /** + * Returns a reference to a vector of strings that specifies the container profiles of Representations that are essential to process it. The detailed semantics depend on the value of the \c @mimeType attribute. \n + * The contents of this attribute shall conform to either the pro-simple or pro-fancy productions of IETF RFC 6381:2011, subclause 4.5, without the enclosing DQUOTE characters, i.e. including only the unencodedv or encodedv elements respectively. \n + * 4CC may contain characters that must be escaped in XML. 4CC strings shall be escaped according to W3C XML:2008, Section 2.4. + * @return a reference to a vector of strings + */ + virtual const std::vector& GetContainerProfiles () const = 0; /** * Returns a double value specifying the maximum SAP interval in seconds of all contained media streams, diff --git a/libdash/libdash/source/mpd/RepresentationBase.cpp b/libdash/libdash/source/mpd/RepresentationBase.cpp index 5dfad7b5..82155863 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.cpp +++ b/libdash/libdash/source/mpd/RepresentationBase.cpp @@ -248,6 +248,14 @@ void RepresentationBase::SetCodecs { dash::helpers::String::Split(codecs, ',', this->codecs); } +const std::vector& RepresentationBase::GetContainerProfiles () const +{ + return this->containerProfiles; +} +void RepresentationBase::SetContainerProfiles (const std::string& containerProfiles) +{ + dash::helpers::String::Split(containerProfiles, ',', this->containerProfiles); +} double RepresentationBase::GetMaximumSAPPeriod () const { return this->maximumSAPPeriod; diff --git a/libdash/libdash/source/mpd/RepresentationBase.h b/libdash/libdash/source/mpd/RepresentationBase.h index 6c0631b4..3015cdcc 100644 --- a/libdash/libdash/source/mpd/RepresentationBase.h +++ b/libdash/libdash/source/mpd/RepresentationBase.h @@ -64,6 +64,7 @@ namespace dash std::string GetMimeType () const; const std::vector& GetSegmentProfiles () const; const std::vector& GetCodecs () const; + const std::vector& GetContainerProfiles () const; double GetMaximumSAPPeriod () const; uint8_t GetStartWithSAP () const; double GetMaxPlayoutRate () const; @@ -95,6 +96,7 @@ namespace dash void SetMimeType (const std::string& mimeType); void SetSegmentProfiles (const std::string& segmentProfiles); void SetCodecs (const std::string& codecs); + void SetContainerProfiles (const std::string& containerProfiles); void SetMaximumSAPPeriod (double maximumSAPPeroid); void SetStartWithSAP (uint8_t startWithSAP); void SetMaxPlayoutRate (double maxPlayoutRate); @@ -127,6 +129,7 @@ namespace dash std::string mimeType; std::vector segmentProfiles; std::vector codecs; + std::vector containerProfiles; double maximumSAPPeriod; uint8_t startWithSAP; double maxPlayoutRate; diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index a08251be..301b1003 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -1812,6 +1812,10 @@ void Node::SetCommonValuesForRep (dash::m { object.SetCodecs(this->GetAttributeValue("codecs")); } + if (this->HasAttribute("containerProfiles")) + { + object.SetContainerProfiles(this->GetAttributeValue("containerProfiles")); + } if (this->HasAttribute("maximumSAPPeriod")) { object.SetMaximumSAPPeriod(strtod(this->GetAttributeValue("maximumSAPPeriod").c_str(), NULL)); From 8dffc9437a296e0231b80d13bc619515b0a5e32f Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 7 Jul 2021 09:55:23 +0200 Subject: [PATCH 21/28] Added SegmentBase@pdDelta --- libdash/libdash/include/ISegmentBase.h | 9 +++++++++ libdash/libdash/source/mpd/SegmentBase.cpp | 9 +++++++++ libdash/libdash/source/mpd/SegmentBase.h | 3 +++ libdash/libdash/source/xml/Node.cpp | 4 ++++ 4 files changed, 25 insertions(+) diff --git a/libdash/libdash/include/ISegmentBase.h b/libdash/libdash/include/ISegmentBase.h index 3c1376ab..c91dd48b 100644 --- a/libdash/libdash/include/ISegmentBase.h +++ b/libdash/libdash/include/ISegmentBase.h @@ -77,6 +77,15 @@ namespace dash * @return an integer */ virtual int GetEptDelta () const = 0; + + /** + * Returns an integer that specifies the difference between the presentation duration of this Representation in units of \c @timescale and the Period duration. \n + * If the media is contained in a Self-Initializing Media Segment, the sum of the value of \c @presentationTimeOffset and the Period duration is used to identify the Subsegment, that is the last one of the Representation. In this case, \c @pdDelta shall be set according to the presentation duration of this last Subsegment. \n + * If not present, the value is unknown. \n + * \t Note: if the value if \c @pdDelta is smaller than zero then this results in a gap at the end of the Period. If the value is positive, it results in an overlap. + * @return an integer + */ + virtual int GetPdDelta () const = 0; /** * Returns an integer that specifies the presentation time offset of the Representation relative to the start of the Period.\n diff --git a/libdash/libdash/source/mpd/SegmentBase.cpp b/libdash/libdash/source/mpd/SegmentBase.cpp index 018d6467..46b4f261 100644 --- a/libdash/libdash/source/mpd/SegmentBase.cpp +++ b/libdash/libdash/source/mpd/SegmentBase.cpp @@ -23,6 +23,7 @@ SegmentBase::SegmentBase () : failoverContent(NULL), timescale(1), eptDelta(0), + pdDelta(0), presentationTimeOffset(0), indexRange(""), indexRangeExact(false), @@ -75,6 +76,14 @@ void SegmentBase::SetEptDelta (int eptDel { this->eptDelta = eptDelta; } +int SegmentBase::GetPdDelta () const +{ + return this->pdDelta; +} +void SegmentBase::SetPdDelta (int pdDelta) +{ + this->pdDelta = pdDelta; +} uint64_t SegmentBase::GetPresentationTimeOffset () const { return this->presentationTimeOffset; diff --git a/libdash/libdash/source/mpd/SegmentBase.h b/libdash/libdash/source/mpd/SegmentBase.h index 7993d641..f6e7c1cf 100644 --- a/libdash/libdash/source/mpd/SegmentBase.h +++ b/libdash/libdash/source/mpd/SegmentBase.h @@ -38,6 +38,7 @@ namespace dash const IFailoverContent* GetFailoverContent () const; uint32_t GetTimescale () const; int GetEptDelta () const; + int GetPdDelta () const; uint64_t GetPresentationTimeOffset () const; uint64_t GetPresentationDuration () const; const std::string& GetTimeShiftBufferDepth () const; @@ -51,6 +52,7 @@ namespace dash void SetFailoverContent (FailoverContent *failoverContent); void SetTimescale (uint32_t timescale); void SetEptDelta (int eptDelta); + void SetPdDelta (int eptDelta); void SetPresentationTimeOffset (uint64_t presentationTimeOffset); void SetPresentationDuration (uint64_t presentationDuration); void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); @@ -65,6 +67,7 @@ namespace dash FailoverContent *failoverContent; uint32_t timescale; int eptDelta; + int pdDelta; uint64_t presentationTimeOffset; uint64_t presentationDuration; std::string timeShiftBufferDepth; diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index 301b1003..d3c8068a 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -1954,6 +1954,10 @@ void Node::SetCommonValuesForSeg (dash::m if (this->HasAttribute("eptDelta")) { object.SetEptDelta((int) strtol(this->GetAttributeValue("eptDelta").c_str(), NULL, 10)); + } + if (this->HasAttribute("pdDelta")) + { + object.SetPdDelta((int) strtol(this->GetAttributeValue("pdDelta").c_str(), NULL, 10)); } if (this->HasAttribute("presentationTimeOffset")) { From c8bb278a0efaad24224610aeb7770c1ef05bae8d Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 7 Jul 2021 10:12:01 +0200 Subject: [PATCH 22/28] Added AdaptationSet@initializationPrincipal --- libdash/libdash/include/IAdaptationSet.h | 6 ++++++ libdash/libdash/source/mpd/AdaptationSet.cpp | 11 ++++++++++- libdash/libdash/source/mpd/AdaptationSet.h | 3 +++ libdash/libdash/source/xml/Node.cpp | 6 +++++- 4 files changed, 24 insertions(+), 2 deletions(-) diff --git a/libdash/libdash/include/IAdaptationSet.h b/libdash/libdash/include/IAdaptationSet.h index a00f6fec..a4a0cb0f 100644 --- a/libdash/libdash/include/IAdaptationSet.h +++ b/libdash/libdash/include/IAdaptationSet.h @@ -364,6 +364,12 @@ namespace dash * @return a reference to a vector of unsigned integers */ virtual const std::vector& GetInitializationSetRef () const = 0; + + /** + * Returns a reference to a string that specifies specifies the URL of an Initialization Segment that is sufficient to initialize the Adaptation Set. If not present, an Initialization Segment from one of the Representations is sufficent. + * @return a reference to a string + */ + virtual const std::string& GetInitializationPrincipal () const = 0; }; } diff --git a/libdash/libdash/source/mpd/AdaptationSet.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index 40c6911e..55f9b08f 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -42,7 +42,8 @@ AdaptationSet::AdaptationSet () : usesSubsegmentAlignment(false), segmentAlignment(false), subsegmentAlignment(false), - isBitstreamSwitching(false) + isBitstreamSwitching(false), + initializationPrincipal("") { } AdaptationSet::~AdaptationSet () @@ -330,4 +331,12 @@ const std::vector& AdaptationSet::GetInitializationSetRef void AdaptationSet::SetInitializationSetRef (const std::string& initializationSetRef) { dash::helpers::String::Split(initializationSetRef, ' ', this->initializationSetRef); +} +const std::string& AdaptationSet::GetInitializationPrincipal () const +{ + return this->initializationPrincipal; +} +void AdaptationSet::SetInitializationPrincipal (const std::string& initializationPrincipal) +{ + this->initializationPrincipal = initializationPrincipal; } \ No newline at end of file diff --git a/libdash/libdash/source/mpd/AdaptationSet.h b/libdash/libdash/source/mpd/AdaptationSet.h index 79dd6827..ffe2278e 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -71,6 +71,7 @@ namespace dash uint8_t GetSubsegmentStartsWithSAP () const; bool GetBitstreamSwitching () const; const std::vector& GetInitializationSetRef () const; + const std::string& GetInitializationPrincipal () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -104,6 +105,7 @@ namespace dash void SetSubsegmentStartsWithSAP (uint8_t subsegmentStartsWithSAP); void SetBitstreamSwitching (bool value); void SetInitializationSetRef (const std::string& initializationSetRef); + void SetInitializationPrincipal (const std::string& initializationPrincipal); private: std::vector accessibility; @@ -140,6 +142,7 @@ namespace dash uint8_t subsegmentStartsWithSAP; bool isBitstreamSwitching; std::vector initializationSetRef; + std::string initializationPrincipal; }; } } diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index d3c8068a..5a4aec44 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -679,6 +679,10 @@ dash::mpd::AdaptationSet* Node::ToAdaptationSet () cons { adaptationSet->SetInitializationSetRef(this->GetAttributeValue("initializationSetRef")); } + if (this->HasAttribute("initializationPrincipal")) + { + adaptationSet->SetInitializationPrincipal(this->GetAttributeValue("initializationPrincipal")); + } for(size_t i = 0; i < subNodes.size(); i++) { @@ -1955,7 +1959,7 @@ void Node::SetCommonValuesForSeg (dash::m { object.SetEptDelta((int) strtol(this->GetAttributeValue("eptDelta").c_str(), NULL, 10)); } - if (this->HasAttribute("pdDelta")) + if (this->HasAttribute("pdDelta")) { object.SetPdDelta((int) strtol(this->GetAttributeValue("pdDelta").c_str(), NULL, 10)); } From 8f0150c1ac4cf852d7c321111f20153316c98698 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 7 Jul 2021 10:18:55 +0200 Subject: [PATCH 23/28] Removed @rangeAccess and @index from ResyncType --- libdash/libdash/include/IResync.h | 14 -------------- libdash/libdash/source/mpd/Resync.cpp | 19 +------------------ libdash/libdash/source/mpd/Resync.h | 6 ------ libdash/libdash/source/xml/Node.cpp | 8 -------- 4 files changed, 1 insertion(+), 46 deletions(-) diff --git a/libdash/libdash/include/IResync.h b/libdash/libdash/include/IResync.h index a126be7b..5ef7d4dd 100644 --- a/libdash/libdash/include/IResync.h +++ b/libdash/libdash/include/IResync.h @@ -100,20 +100,6 @@ namespace dash */ virtual bool HasMarker () const = 0; - /** - * Returns a bool value that informs about the range access status. - * - * @return a bool value - */ - virtual bool HasRangeAccess () const = 0; - - /** - * Returns a reference to a string that specifies the index URI. - * - * @return a reference to a string - */ - virtual const std::string& GetIndex () const = 0; - }; } } diff --git a/libdash/libdash/source/mpd/Resync.cpp b/libdash/libdash/source/mpd/Resync.cpp index c1933039..f3c442dc 100644 --- a/libdash/libdash/source/mpd/Resync.cpp +++ b/libdash/libdash/source/mpd/Resync.cpp @@ -16,8 +16,7 @@ using namespace dash::mpd; Resync::Resync () : type(0), dIMin(0), - marker(false), - rangeAccess(false) + marker(false) { } Resync::~Resync () @@ -63,20 +62,4 @@ bool Resync::HasMarker () cons void Resync::SetMarker (bool marker) { this->marker = marker; -} -bool Resync::HasRangeAccess () const -{ - return this->rangeAccess; -} -void Resync::SetRangeAccess (bool rangeAccess) -{ - this->rangeAccess = rangeAccess; -} -const std::string& Resync::GetIndex () const -{ - return this->index; -} -void Resync::SetIndex (const std::string& index) -{ - this->index = index; } \ No newline at end of file diff --git a/libdash/libdash/source/mpd/Resync.h b/libdash/libdash/source/mpd/Resync.h index 9ae26137..464f2644 100644 --- a/libdash/libdash/source/mpd/Resync.h +++ b/libdash/libdash/source/mpd/Resync.h @@ -32,16 +32,12 @@ namespace dash float GetDIMax () const; float GetDIMin () const; bool HasMarker () const; - bool HasRangeAccess () const; - const std::string& GetIndex () const; void SetType (uint32_t type); void SetDT (uint32_t dT); void SetDIMax (float dIMax); void SetDIMin (float dIMin); void SetMarker (bool marker); - void SetRangeAccess (bool rangeAccess); - void SetIndex (const std::string& index); private: uint32_t type; @@ -49,8 +45,6 @@ namespace dash float dIMax; float dIMin; bool marker; - bool rangeAccess; - std::string index; }; } } diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index 5a4aec44..e87b2dc3 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -1526,14 +1526,6 @@ dash::mpd::Resync* Node::ToResync () const { resync->SetMarker(dash::helpers::String::ToBool(this->GetAttributeValue("marker"))); } - if (this->HasAttribute("rangeAccess")) - { - resync->SetRangeAccess(dash::helpers::String::ToBool(this->GetAttributeValue("rangeAccess"))); - } - if (this->HasAttribute("index")) - { - resync->SetIndex(this->GetAttributeValue("index")); - } resync->AddRawAttributes(this->attributes); return resync; From 00ae2d5c4119d539322ba07e7486080303a323ed Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Wed, 7 Jul 2021 10:26:05 +0200 Subject: [PATCH 24/28] Added BaseURL@rangeAccess --- libdash/libdash/include/IBaseUrl.h | 7 +++++++ libdash/libdash/source/mpd/BaseUrl.cpp | 11 ++++++++++- libdash/libdash/source/mpd/BaseUrl.h | 3 +++ libdash/libdash/source/xml/Node.cpp | 4 ++++ 4 files changed, 24 insertions(+), 1 deletion(-) diff --git a/libdash/libdash/include/IBaseUrl.h b/libdash/libdash/include/IBaseUrl.h index 9c5ce3ce..8124e598 100644 --- a/libdash/libdash/include/IBaseUrl.h +++ b/libdash/libdash/include/IBaseUrl.h @@ -79,6 +79,13 @@ namespace dash * @return a reference to a string */ virtual const std::string& GetTimeShiftBufferDepth () const = 0; + + /** + * Returns a boolean that specifies: if set to true, partially available may be accessed with byte range request. If a client is making a byte-range request against a partially available Segment and the first-byte position of that range request is non-zero and the client is expecting an aggregating response, then the client should signal that expectation by following the convention of IETF RFC 8673. Specifically, it should use a last-byte value of 9007199254740991. This will signal the server to respond with a 206 aggregating response instead of waiting for the end of the segment and responding with a 200 response code and a content-length response header. \n + * If set to false, the client should not expect a response corresponding to the requested byte range. + * @return a boolean + */ + virtual bool HasRangeAccess () const = 0; /** * Returns a pointer to a dash::mpd::ISegment object which represents a media segment that can be downloaded. Should be used for single base urls inside diff --git a/libdash/libdash/source/mpd/BaseUrl.cpp b/libdash/libdash/source/mpd/BaseUrl.cpp index 33b9b267..563602e2 100644 --- a/libdash/libdash/source/mpd/BaseUrl.cpp +++ b/libdash/libdash/source/mpd/BaseUrl.cpp @@ -21,7 +21,8 @@ BaseUrl::BaseUrl () : url(""), serviceLocation(""), byteRange(""), - timeShiftBufferDepth("") + timeShiftBufferDepth(""), + rangeAccess(false) { } BaseUrl::~BaseUrl () @@ -75,6 +76,14 @@ const std::string& BaseUrl::GetTimeShiftBufferDepth () const void BaseUrl::SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth) { this->timeShiftBufferDepth = timeShiftBufferDepth; +} +bool BaseUrl::HasRangeAccess () const +{ + return this->rangeAccess; +} +void BaseUrl::SetRangeAccess (bool rangeAccess) +{ + this->rangeAccess = rangeAccess; } ISegment* BaseUrl::ToMediaSegment (const std::vector& baseurls) const { diff --git a/libdash/libdash/source/mpd/BaseUrl.h b/libdash/libdash/source/mpd/BaseUrl.h index c04d7fba..c9149bdb 100644 --- a/libdash/libdash/source/mpd/BaseUrl.h +++ b/libdash/libdash/source/mpd/BaseUrl.h @@ -38,6 +38,7 @@ namespace dash double GetAvailabilityTimeOffset () const; bool IsAvailabilityTimeComplete () const; const std::string& GetTimeShiftBufferDepth () const; + bool HasRangeAccess () const; void SetUrl (const std::string& url); void SetServiceLocation (const std::string& serviceLocation); @@ -45,6 +46,7 @@ namespace dash void SetAvailabilityTimeOffset (double availabilityTimeOffset); void SetAvailabilityTimeComplete (bool availabilityTimeComplete); void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); + void SetRangeAccess (bool rangeAccess); virtual ISegment* ToMediaSegment (const std::vector& baseurls) const; @@ -55,6 +57,7 @@ namespace dash double availabilityTimeOffset; bool availabilityTimeComplete; std::string timeShiftBufferDepth; + bool rangeAccess; }; } } diff --git a/libdash/libdash/source/xml/Node.cpp b/libdash/libdash/source/xml/Node.cpp index e87b2dc3..c79d25ff 100644 --- a/libdash/libdash/source/xml/Node.cpp +++ b/libdash/libdash/source/xml/Node.cpp @@ -97,6 +97,10 @@ dash::mpd::BaseUrl* Node::ToBaseUrl () cons { baseUrl->SetTimeShiftBufferDepth(this->GetAttributeValue("timeShiftBufferDepth")); } + if (this->HasAttribute("rangeAccess")) + { + baseUrl->SetRangeAccess(dash::helpers::String::ToBool(this->GetAttributeValue("rangeAccess"))); + } if (this->GetText() == "./") { baseUrl->SetUrl(this->mpdPath); From e0c83fad65fe34f2dea973cd65d3a1f49d398376 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Thu, 8 Jul 2021 08:19:58 +0200 Subject: [PATCH 25/28] Fixed SegmentBase indentation --- libdash/libdash/include/ISegmentBase.h | 10 +++++----- libdash/libdash/source/mpd/SegmentBase.cpp | 2 +- libdash/libdash/source/mpd/SegmentBase.h | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/libdash/libdash/include/ISegmentBase.h b/libdash/libdash/include/ISegmentBase.h index c91dd48b..7e8d0fc0 100644 --- a/libdash/libdash/include/ISegmentBase.h +++ b/libdash/libdash/include/ISegmentBase.h @@ -77,12 +77,12 @@ namespace dash * @return an integer */ virtual int GetEptDelta () const = 0; - - /** + + /** * Returns an integer that specifies the difference between the presentation duration of this Representation in units of \c @timescale and the Period duration. \n - * If the media is contained in a Self-Initializing Media Segment, the sum of the value of \c @presentationTimeOffset and the Period duration is used to identify the Subsegment, that is the last one of the Representation. In this case, \c @pdDelta shall be set according to the presentation duration of this last Subsegment. \n - * If not present, the value is unknown. \n - * \t Note: if the value if \c @pdDelta is smaller than zero then this results in a gap at the end of the Period. If the value is positive, it results in an overlap. + * If the media is contained in a Self-Initializing Media Segment, the sum of the value of \c @presentationTimeOffset and the Period duration is used to identify the Subsegment, that is the last one of the Representation. In this case, \c @pdDelta shall be set according to the presentation duration of this last Subsegment. \n + * If not present, the value is unknown. \n + * \t Note: if the value if \c @pdDelta is smaller than zero then this results in a gap at the end of the Period. If the value is positive, it results in an overlap. * @return an integer */ virtual int GetPdDelta () const = 0; diff --git a/libdash/libdash/source/mpd/SegmentBase.cpp b/libdash/libdash/source/mpd/SegmentBase.cpp index 46b4f261..9e17236f 100644 --- a/libdash/libdash/source/mpd/SegmentBase.cpp +++ b/libdash/libdash/source/mpd/SegmentBase.cpp @@ -23,7 +23,7 @@ SegmentBase::SegmentBase () : failoverContent(NULL), timescale(1), eptDelta(0), - pdDelta(0), + pdDelta(0), presentationTimeOffset(0), indexRange(""), indexRangeExact(false), diff --git a/libdash/libdash/source/mpd/SegmentBase.h b/libdash/libdash/source/mpd/SegmentBase.h index f6e7c1cf..37219677 100644 --- a/libdash/libdash/source/mpd/SegmentBase.h +++ b/libdash/libdash/source/mpd/SegmentBase.h @@ -38,7 +38,7 @@ namespace dash const IFailoverContent* GetFailoverContent () const; uint32_t GetTimescale () const; int GetEptDelta () const; - int GetPdDelta () const; + int GetPdDelta () const; uint64_t GetPresentationTimeOffset () const; uint64_t GetPresentationDuration () const; const std::string& GetTimeShiftBufferDepth () const; @@ -52,7 +52,7 @@ namespace dash void SetFailoverContent (FailoverContent *failoverContent); void SetTimescale (uint32_t timescale); void SetEptDelta (int eptDelta); - void SetPdDelta (int eptDelta); + void SetPdDelta (int eptDelta); void SetPresentationTimeOffset (uint64_t presentationTimeOffset); void SetPresentationDuration (uint64_t presentationDuration); void SetTimeShiftBufferDepth (const std::string& timeShiftBufferDepth); @@ -67,7 +67,7 @@ namespace dash FailoverContent *failoverContent; uint32_t timescale; int eptDelta; - int pdDelta; + int pdDelta; uint64_t presentationTimeOffset; uint64_t presentationDuration; std::string timeShiftBufferDepth; From 1a9fc7f0253eb61c5fc6a8f7c179880edaa62c18 Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Thu, 8 Jul 2021 10:41:44 +0200 Subject: [PATCH 26/28] Deleted README_mpd.txt and removed 'variables check' --- libdash/libdash/README_mpd.txt | 12 -- .../libdash/source/manager/DASHManager.cpp | 197 ------------------ 2 files changed, 209 deletions(-) delete mode 100644 libdash/libdash/README_mpd.txt diff --git a/libdash/libdash/README_mpd.txt b/libdash/libdash/README_mpd.txt deleted file mode 100644 index d9482e41..00000000 --- a/libdash/libdash/README_mpd.txt +++ /dev/null @@ -1,12 +0,0 @@ -DASH-IF/Github repository - New Elements Test: -- AssetIdentifier at https://dash.akamaized.net/dash264/TestCasesIOP33/multiplePeriods/2/manifest_multiple_Periods_Add_Remove_AdaptationSet.mpd: working; -- Switching, SupplementalProperty at https://dash.akamaized.net/dash264/TestCasesIOP33/adapatationSetSwitching/5/manifest.mpd: working; -- Label at https://dash.akamaized.net/dash264/TestCasesIOP41/MultiTrack/alternative_content/6/manifest_alternative_lang.mpd: working; -- EssentialProperty at https://dash.akamaized.net/dash264/TestCasesIOP41/MultiTrack/alternative_content/4/manifest_alternative_Essentialproperty_live.mpd: working; -- InbandEventStream at https://livesim.dashif.org/livesim/scte35_2/testpic_2s/Manifest.mpd: working; -- InbandEventStream, EventStream, Event at https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G9.mpd: working; -- ProducerReferenceTime, ServiceDescription, Latency, PlaybackRate, UTCTiming at https://livesim.dashif.org/livesim/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd: working; -- LeapSecondInformation at https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G14.mpd: working; -- Preselection at https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G16.mpd: working; -- Resync at https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G20.mpd: working; -- FailoverContent, FCS at https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G22.mpd: working; \ No newline at end of file diff --git a/libdash/libdash/source/manager/DASHManager.cpp b/libdash/libdash/source/manager/DASHManager.cpp index e9441c5a..db526e2e 100644 --- a/libdash/libdash/source/manager/DASHManager.cpp +++ b/libdash/libdash/source/manager/DASHManager.cpp @@ -38,203 +38,6 @@ IMPD* DASHManager::Open (char *path) MPD* mpd = parser.GetRootNode()->ToMPD(); - std::cout << "Variables check:" << std::endl; - - /* - * EssentialProperty in https://dash.akamaized.net/dash264/TestCasesIOP41/MultiTrack/alternative_content/4/manifest_alternative_Essentialproperty_live.mpd - */ - - /* - const Descriptor* ep = (Descriptor*) mpd->GetPeriods()[0]->GetAdaptationSets()[2]->GetEssentialProperties()[0]; - std::cout << "EssentialProperty: " << std::endl; - std::cout << " SchemeIdUri: " << ep->GetSchemeIdUri() << std::endl; - std::cout << " Value: " << ep->GetValue() << std::endl; - std::cout << " Id: " << ep->GetId() << std::endl; - */ - - /* - * AssetIdentifier in https://dash.akamaized.net/dash264/TestCasesIOP33/multiplePeriods/2/manifest_multiple_Periods_Add_Remove_AdaptationSet.mpd - */ - - /* - const Descriptor* ai = (Descriptor*) mpd->GetPeriods()[0]->GetAssetIdentifier(); - std::cout << "AssetIdentifier: " << std::endl; - std::cout << " SchemeIdUri: " << ai->GetSchemeIdUri() << std::endl; - std::cout << " Value: " << ai->GetValue() << std::endl; - std::cout << " Id: " << ai->GetId() << std::endl; - */ - - /* - * SupplementalProperty in https://dash.akamaized.net/dash264/TestCasesIOP33/adapatationSetSwitching/5/manifest.mpd - */ - - /* - const Descriptor* sp = (Descriptor*) mpd->GetPeriods()[0]->GetAdaptationSets()[0]->GetSupplementalProperties()[0]; - //std::cout << "SupplementalProperty: " << std::endl; - std::cout << " SchemeIdUri: " << sp->GetSchemeIdUri() << std::endl; - std::cout << " Value: " << sp->GetValue() << std::endl; - std::cout << " Id: " << sp->GetId() << std::endl; - */ - - /* - * Switching in https://dash.akamaized.net/dash264/TestCasesIOP33/adapatationSetSwitching/5/manifest.mpd - */ - - /* - const Switching* sw = (Switching*) mpd->GetPeriods()[0]->GetAdaptationSets()[0]->GetSwitchings()[0]; - std::cout << "Switching: " << std::endl; - std::cout << " Interval: " << sw->GetInterval() << std::endl; - std::cout << " Type: " << sw->GetType() << std::endl; - */ - - /* - * Label in https://dash.akamaized.net/dash264/TestCasesIOP41/MultiTrack/alternative_content/6/manifest_alternative_lang.mpd - */ - - /* - const Label* label = (Label*) mpd->GetPeriods()[0]->GetAdaptationSets()[1]->GetLabels()[0]; - std::cout << "Label: " << std::endl; - std::cout << " Id: " << label->GetId() << std::endl; - std::cout << " Lang: " << label->GetLang() << std::endl; - */ - - /* - * InbandEventStream in https://livesim.dashif.org/livesim/scte35_2/testpic_2s/Manifest.mpd - */ - - /* - const EventStream* es = (EventStream*) mpd->GetPeriods()[0]->GetAdaptationSets()[1]->GetEventStreams()[0]; - std::cout << "InbandEventStream: " << std::endl; - std::cout << " XlinkHref: " << es->GetXlinkHref() << std::endl; - std::cout << " XlinkActuate: " << es->GetXlinkActuate() << std::endl; - std::cout << " SchemeIdUri: " << es->GetSchemeIdUri() << std::endl; - std::cout << " Value: " << es->GetValue() << std::endl; - std::cout << " Timescale: " << es->GetTimescale() << std::endl; - std::cout << " PresentationTimeOffset: " << es->GetPresentationTimeOffset() << std::endl; - */ - - /* - * EventStream, Event in https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G9.mpd - */ - - /* - const EventStream* es = (EventStream*) mpd->GetPeriods()[0]->GetEventStreams()[0]; - std::cout << "EventStream: " << std::endl; - std::cout << " XlinkHref: " << es->GetXlinkHref() << std::endl; - std::cout << " XlinkActuate: " << es->GetXlinkActuate() << std::endl; - std::cout << " SchemeIdUri: " << es->GetSchemeIdUri() << std::endl; - std::cout << " Value: " << es->GetValue() << std::endl; - std::cout << " Timescale: " << es->GetTimescale() << std::endl; - std::cout << " PresentationTimeOffset: " << es->GetPresentationTimeOffset() << std::endl; - for (size_t i=0; i < es->GetEvents().size(); i++){ - std::cout << " Event: " << std::endl; - std::cout << " presentationTime: " << es->GetEvents().at(i)->GetPresentationTime() << std::endl; - std::cout << " duration: " << es->GetEvents().at(i)->GetDuration() << std::endl; - std::cout << " id: " << es->GetEvents().at(i)->GetId() << std::endl; - std::cout << " contentEncoding: " << es->GetEvents().at(i)->GetContentEncoding() << std::endl; - std::cout << " messageData: " << es->GetEvents().at(i)->GetMessageData() << std::endl; - } - */ - - /* - * ServiceDescription, Latency, PlaybackRate, UTCTiming, ProducerReferenceTime in https://livesim.dashif.org/livesim/chunkdur_1/ato_7/testpic4_8s/Manifest300.mpd - */ - - /* - const ServiceDescription* sd = (ServiceDescription*) mpd->GetServiceDescriptions()[0]; - std::cout << "ServiceDescription: " << std::endl; - std::cout << " id: " << sd->GetId() << std::endl; - const Latency* lat = (Latency*) sd->GetLatency()[0]; - std::cout << " Latency: " << std::endl; - std::cout << " referenceId: " << lat->GetReferenceId() << std::endl; - std::cout << " target: " << lat->GetTarget() << std::endl; - std::cout << " max: " << lat->GetMax() << std::endl; - std::cout << " min: " << lat->GetMin() << std::endl; - const PlaybackRate* pbr = (PlaybackRate*) sd->GetPlaybackRate()[0]; - std::cout << " PlaybackRate: " << std::endl; - std::cout << " max: " << pbr->GetMax() << std::endl; - std::cout << " min: " << pbr->GetMin() << std::endl; - - const ProducerReferenceTime* prt = (ProducerReferenceTime*) mpd->GetPeriods()[0]->GetAdaptationSets()[0]->GetProducerReferenceTimes()[0]; - std::cout << " ProducerReferenceTime: " << std::endl; - std::cout << " id: " << prt->GetId() << std::endl; - std::cout << " IsInband: " << prt->IsInband() << std::endl; - std::cout << " type: " << prt->GetType() << std::endl; - std::cout << " applicationScheme: " << prt->GetApplicationScheme() << std::endl; - std::cout << " wallClockTime: " << prt->GetWallClockTime() << std::endl; - std::cout << " presentationTime: " << prt->GetPresentationTime() << std::endl; - - const Descriptor* utcTiming = (Descriptor*) prt->GetUTCTiming(); - if(utcTiming != NULL){ - std::cout << " UTCTiming: " << std::endl; - std::cout << " SchemeIdUri: " << utcTiming->GetSchemeIdUri() << std::endl; - std::cout << " Value: " << utcTiming->GetValue() << std::endl; - std::cout << " Id: " << utcTiming->GetId() << std::endl; - } - */ - - /* - * LeapSecondInformation in https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G14.mpd - */ - - /* - const LeapSecondInformation* lsi = (LeapSecondInformation*) mpd->GetLeapSecondInformation(); - if(lsi != NULL){ - std::cout << "LeapSecondInformation: " << std::endl; - std::cout << " availabilityStartLeapOffset: " << lsi->GetAvailabilityStartLeapOffset() << std::endl; - std::cout << " nextAvailabilityStartLeapOffset: " << lsi->GetNextAvailabilityStartLeapOffset() << std::endl; - std::cout << " nextLeapChangeTime: " << lsi->GetNextLeapChangeTime() << std::endl; - } - */ - - /* - * Preselection in https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G16.mpd - */ - - /* - const Preselection* pres = (Preselection*) mpd->GetPeriods()[0]->GetPreselections()[0]; - std::cout << "Preselection: " << std::endl; - std::cout << " id: " << pres->GetId() << std::endl; - std::cout << " PreselectionComponents: "; - for (size_t i=0; i < pres->GetPreselectionComponents().size(); i++){ - std::cout << pres->GetPreselectionComponents().at(i) << " "; - } - std::cout << std::endl; - std::cout << " lang: " << pres->GetLang() << std::endl; - std::cout << " order: " << pres->GetOrder() << std::endl; - */ - - /* - * Resync in https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G20.mpd - */ - - /* - const Resync* res = (Resync*) mpd->GetPeriods()[0]->GetAdaptationSets()[0]->GetRepresentation()[2]->GetResyncs()[0]; - std::cout << "Resync: " << std::endl; - std::cout << " type: " << res->GetType() << std::endl; - std::cout << " dT: " << res->GetDT() << std::endl; - std::cout << " dIMax: " << res->GetDIMax() << std::endl; - std::cout << " dIMin: " << res->GetDIMin() << std::endl; - std::cout << " marker: " << res->HasMarker() << std::endl; - std::cout << " rangeAccess: " << res->HasRangeAccess() << std::endl; - std::cout << " index: " << res->GetIndex() << std::endl; - */ - - /* - * FailoverContent, FCS in https://github.com/MPEGGroup/DASHSchema/blob/5th-Ed/example_G20.mpd - */ - - /* - const FailoverContent* fc = (FailoverContent*) mpd->GetPeriods()[0]->GetAdaptationSets()[0]->GetRepresentation()[2]->GetSegmentBase()->GetFailoverContent(); - std::cout << "FailoverContent: " << std::endl; - std::cout << " isValid: " << fc->IsValid() << std::endl; - for (size_t i=0; i < fc->GetFCS().size(); i++){ - std::cout << "FCS: " << std::endl; - std::cout << " presentationTime: " << fc->GetFCS().at(i)->GetPresentationTime() << std::endl; - std::cout << " duration: " << fc->GetFCS().at(i)->GetDuration() << std::endl; - } - */ - if (mpd) mpd->SetFetchTime(fetchTime); From 6b3dee245d7e0d85ef7dcfb18ba2061e4e63cf8b Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Thu, 8 Jul 2021 14:47:46 +0200 Subject: [PATCH 27/28] Removed 'contributors' in README.md --- README.md | 5 ----- 1 file changed, 5 deletions(-) diff --git a/README.md b/README.md index 7aa72b4c..c647af4d 100644 --- a/README.md +++ b/README.md @@ -89,11 +89,6 @@ Furthermore we want to thank the [Netidee](http://www.netidee.at) initiative fro ![netidee logo](http://www.bitmovin.com/files/bitmovin/img/logos/netidee.png "netidee") -## Contributors - -Daniele Lorenzi, lorenzidaniele.97@gmail.com -Minh Nguyen, minhnguyenkstn@gmail.com - ## Citation of libdash We kindly ask you to refer the following paper in any publication mentioning libdash: From 9e3f1417a83a9ae5e102f7d490558f788184360d Mon Sep 17 00:00:00 2001 From: Daniele Lorenzi Date: Fri, 9 Jul 2021 12:52:10 +0200 Subject: [PATCH 28/28] Trigger Build