From 6209c25eb005e576c35c3a27ad971512524f6d7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julian=20Mu=C3=B1oz?= Date: Mon, 22 Nov 2021 12:36:43 +0100 Subject: [PATCH] Fixed Qt Sample --- README.md | 16 +- libdash/libdash/include/IAdaptationSet.h | 55 +- libdash/libdash/include/IBaseUrl.h | 40 +- libdash/libdash/include/IContentComponent.h | 11 + .../libdash/include/IContentPopularityRate.h | 76 + libdash/libdash/include/IContentProtection.h | 64 + libdash/libdash/include/IDescriptor.h | 12 + libdash/libdash/include/IEvent.h | 89 ++ libdash/libdash/include/IEventStream.h | 96 ++ libdash/libdash/include/IExtendedBandwidth.h | 50 + libdash/libdash/include/IFCS.h | 52 + libdash/libdash/include/IFailoverContent.h | 52 + libdash/libdash/include/IInitializationSet.h | 172 +++ libdash/libdash/include/ILabel.h | 60 + libdash/libdash/include/ILatency.h | 72 + .../libdash/include/ILeapSecondInformation.h | 70 + libdash/libdash/include/IMPD.h | 111 +- libdash/libdash/include/IModelPair.h | 51 + .../libdash/include/IMultipleSegmentBase.h | 12 + libdash/libdash/include/IOperatingBandwidth.h | 71 + libdash/libdash/include/IOperatingQuality.h | 87 ++ libdash/libdash/include/IPatchLocation.h | 49 + libdash/libdash/include/IPeriod.h | 112 +- libdash/libdash/include/IPlaybackRate.h | 50 + libdash/libdash/include/IPopularityRate.h | 65 + libdash/libdash/include/IPreselection.h | 131 ++ .../libdash/include/IProducerReferenceTime.h | 109 ++ libdash/libdash/include/IRandomAccess.h | 72 + libdash/libdash/include/IRepresentation.h | 51 +- libdash/libdash/include/IRepresentationBase.h | 167 ++- libdash/libdash/include/IResync.h | 107 ++ libdash/libdash/include/ISegmentBase.h | 81 +- libdash/libdash/include/ISegmentList.h | 19 + libdash/libdash/include/IServiceDescription.h | 91 ++ libdash/libdash/include/ISubset.h | 10 + libdash/libdash/include/ISwitching.h | 55 + libdash/libdash/include/IUIntPairs.h | 47 + libdash/libdash/include/IUIntPairsWithID.h | 49 + libdash/libdash/include/IUIntVWithID.h | 72 + .../libdash/source/manager/DASHManager.cpp | 4 + libdash/libdash/source/mpd/AdaptationSet.cpp | 103 +- libdash/libdash/source/mpd/AdaptationSet.h | 32 +- libdash/libdash/source/mpd/BaseUrl.cpp | 54 +- libdash/libdash/source/mpd/BaseUrl.h | 28 +- .../libdash/source/mpd/ContentComponent.cpp | 15 +- libdash/libdash/source/mpd/ContentComponent.h | 7 + .../source/mpd/ContentPopularityRate.cpp | 50 + .../source/mpd/ContentPopularityRate.h | 47 + .../libdash/source/mpd/ContentProtection.cpp | 49 + .../libdash/source/mpd/ContentProtection.h | 46 + libdash/libdash/source/mpd/Descriptor.cpp | 15 +- libdash/libdash/source/mpd/Descriptor.h | 11 +- libdash/libdash/source/mpd/Event.cpp | 66 + libdash/libdash/source/mpd/Event.h | 53 + libdash/libdash/source/mpd/EventStream.cpp | 86 ++ libdash/libdash/source/mpd/EventStream.h | 59 + .../libdash/source/mpd/ExtendedBandwidth.cpp | 41 + .../libdash/source/mpd/ExtendedBandwidth.h | 44 + 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/source/mpd/InitializationSet.cpp | 160 +++ .../libdash/source/mpd/InitializationSet.h | 83 ++ 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 | 112 ++ libdash/libdash/source/mpd/MPD.h | 44 + libdash/libdash/source/mpd/ModelPair.cpp | 41 + libdash/libdash/source/mpd/ModelPair.h | 43 + .../source/mpd/MultipleSegmentBase.cpp | 15 +- .../libdash/source/mpd/MultipleSegmentBase.h | 7 + .../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 | 140 +- libdash/libdash/source/mpd/Period.h | 85 +- libdash/libdash/source/mpd/PlaybackRate.cpp | 38 + libdash/libdash/source/mpd/PlaybackRate.h | 44 + libdash/libdash/source/mpd/PopularityRate.cpp | 47 + libdash/libdash/source/mpd/PopularityRate.h | 46 + libdash/libdash/source/mpd/Preselection.cpp | 97 ++ libdash/libdash/source/mpd/Preselection.h | 62 + .../source/mpd/ProducerReferenceTime.cpp | 82 ++ .../source/mpd/ProducerReferenceTime.h | 59 + libdash/libdash/source/mpd/RandomAccess.cpp | 55 + libdash/libdash/source/mpd/RandomAccess.h | 49 + libdash/libdash/source/mpd/Representation.cpp | 30 + libdash/libdash/source/mpd/Representation.h | 14 + .../libdash/source/mpd/RepresentationBase.cpp | 153 +- .../libdash/source/mpd/RepresentationBase.h | 124 +- libdash/libdash/source/mpd/Resync.cpp | 65 + libdash/libdash/source/mpd/Resync.h | 52 + libdash/libdash/source/mpd/SegmentBase.cpp | 90 +- libdash/libdash/source/mpd/SegmentBase.h | 52 +- libdash/libdash/source/mpd/SegmentList.cpp | 24 +- libdash/libdash/source/mpd/SegmentList.h | 14 +- .../libdash/source/mpd/ServiceDescription.cpp | 80 ++ .../libdash/source/mpd/ServiceDescription.h | 61 + libdash/libdash/source/mpd/Subset.cpp | 20 +- libdash/libdash/source/mpd/Subset.h | 11 +- libdash/libdash/source/mpd/Switching.cpp | 39 + libdash/libdash/source/mpd/Switching.h | 43 + 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/mpd/UIntVWithID.cpp | 55 + libdash/libdash/source/mpd/UIntVWithID.h | 49 + libdash/libdash/source/xml/DOMParser.cpp | 5 + libdash/libdash/source/xml/Node.cpp | 1233 +++++++++++++++-- libdash/libdash/source/xml/Node.h | 56 + .../qtsampleplayer/Decoder/LibavDecoder.cpp | 6 +- .../libdashframework/Input/DASHManager.cpp | 8 +- 121 files changed, 7607 insertions(+), 409 deletions(-) create mode 100644 libdash/libdash/include/IContentPopularityRate.h create mode 100644 libdash/libdash/include/IContentProtection.h create mode 100644 libdash/libdash/include/IEvent.h create mode 100644 libdash/libdash/include/IEventStream.h create mode 100644 libdash/libdash/include/IExtendedBandwidth.h create mode 100644 libdash/libdash/include/IFCS.h create mode 100644 libdash/libdash/include/IFailoverContent.h create mode 100644 libdash/libdash/include/IInitializationSet.h 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/IModelPair.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/IPopularityRate.h create mode 100644 libdash/libdash/include/IPreselection.h create mode 100644 libdash/libdash/include/IProducerReferenceTime.h create mode 100644 libdash/libdash/include/IRandomAccess.h create mode 100644 libdash/libdash/include/IResync.h create mode 100644 libdash/libdash/include/IServiceDescription.h create mode 100644 libdash/libdash/include/ISwitching.h create mode 100644 libdash/libdash/include/IUIntPairs.h create mode 100644 libdash/libdash/include/IUIntPairsWithID.h create mode 100644 libdash/libdash/include/IUIntVWithID.h create mode 100644 libdash/libdash/source/mpd/ContentPopularityRate.cpp create mode 100644 libdash/libdash/source/mpd/ContentPopularityRate.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/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 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/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 create mode 100644 libdash/libdash/source/mpd/InitializationSet.cpp create mode 100644 libdash/libdash/source/mpd/InitializationSet.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/ModelPair.cpp create mode 100644 libdash/libdash/source/mpd/ModelPair.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/PopularityRate.cpp create mode 100644 libdash/libdash/source/mpd/PopularityRate.h create mode 100644 libdash/libdash/source/mpd/Preselection.cpp create mode 100644 libdash/libdash/source/mpd/Preselection.h create mode 100644 libdash/libdash/source/mpd/ProducerReferenceTime.cpp create mode 100644 libdash/libdash/source/mpd/ProducerReferenceTime.h create mode 100644 libdash/libdash/source/mpd/RandomAccess.cpp create mode 100644 libdash/libdash/source/mpd/RandomAccess.h create mode 100644 libdash/libdash/source/mpd/Resync.cpp create mode 100644 libdash/libdash/source/mpd/Resync.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/Switching.cpp create mode 100644 libdash/libdash/source/mpd/Switching.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 create mode 100644 libdash/libdash/source/mpd/UIntVWithID.cpp create mode 100644 libdash/libdash/source/mpd/UIntVWithID.h diff --git a/README.md b/README.md index b7b334ac..c647af4d 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ You can find the latest sources and binaries on github. 4. After that all files will be provided in the bin folder 5. You can test the library with the sampleplayer.exe. This application simply downloads the lowest representation of one of our dataset MPDs. -### Ubuntu 12.04 +### Ubuntu 14.04 (Kernel 3.19.0-71-generic) 1. sudo apt-get install git-core build-essential cmake libxml2-dev libcurl4-openssl-dev 2. git clone git://github.com/bitmovin/libdash.git 3. cd libdash/libdash @@ -56,20 +56,20 @@ You can find the latest sources and binaries on github. #### QTSamplePlayer Prerequisite: libdash must be built as described in the previous section. +Tested using **cmake** version **2.8.12.2**. 1. sudo apt-add-repository ppa:ubuntu-sdk-team/ppa 2. sudo apt-add-repository ppa:canonical-qt5-edgers/qt5-proper 3. sudo apt-get update -4. sudo apt-get install qtmultimedia5-dev qtbase5-dev libqt5widgets5 libqt5core5 libqt5gui5 libqt5multimedia5 libqt5multimediawidgets5 libqt5opengl5 libav-tools libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev +4. sudo apt-get install qtmultimedia5-dev qtbase5-dev libqt5widgets5 libqt5core5a libqt5gui5 libqt5multimedia5 libqt5multimedia5-plugins libqt5multimediawidgets5 libqt5opengl5 libav-tools libavcodec-dev libavdevice-dev libavfilter-dev libavformat-dev libavutil-dev libpostproc-dev libswscale-dev 5. cd libdash/libdash/qtsampleplayer 6. mkdir build 7. cd build -8. wget http://www.cmake.org/files/v2.8/cmake-2.8.11.2-Linux-i386.sh -9. chmod a+x cmake-2.8.11.2-Linux-i386.sh -10. ./cmake-2.8.11.2-Linux-i386.sh -11. ./cmake-2.8.11.2-Linux-i386/bin/cmake ../ -12. make -13. ./qtsampleplayer +8. cmake ../ +9. make +10. ./qtsampleplayer + +If some issues arise regarding the *make* installation, please make sure to be using the right kernel and *cmake version*. It is important to run *cmake* with the appropriate version in order to avoid linking problems that can fail the *make* process. ## License diff --git a/libdash/libdash/include/IAdaptationSet.h b/libdash/libdash/include/IAdaptationSet.h index eff9c7ec..a4a0cb0f 100644 --- a/libdash/libdash/include/IAdaptationSet.h +++ b/libdash/libdash/include/IAdaptationSet.h @@ -45,6 +45,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IADAPTATIONSET_H_ @@ -156,7 +160,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 @@ -255,15 +271,6 @@ namespace dash */ virtual const std::string& GetMaxFramerate () const = 0; - /** - * Because of the fact that the type of the attribute \em segmentAlignment is a union of \c xs:unsignedInt and \c xs:boolean this method is needed to determine - * whether its value is of type bool or integer.\n - * If and only if \c 'true' is returned, an invocation of HasSegmentAlignment() is neccessary to retrieve the bool value.\n - * If and only if \c 'false' is returned, an invocation of GetSegmentAlignment() is neccessary to retrieve the integer value. - * @return a bool value - */ - virtual bool SegmentAlignmentIsBoolValue () const = 0; - /** * If the return value of SegmentAlignmentIsBoolValue() equals \c 'true' the bool value returned by this method * specifies whether Segment Alignment is used or not. This is only valid for Adaptation Sets containing Representations with multiple media content components. @@ -284,16 +291,7 @@ namespace dash * whenever \em m is not equal to \em n. * @return an unsigned integer */ - virtual uint32_t GetSegmentAligment () const = 0; - - /** - * Because of the fact that the type of the attribute \em subsegmentAlignment is a union of \c xs:unsignedInt and \c xs:boolean this method is needed to determine - * whether its value is of type bool or integer.\n - * If and only if \c 'true' is returned, an invocation of HasSubsegmentAlignment() is neccessary to retrieve the bool value.\n - * If and only if \c 'false' is returned, an invocation of GetSubsegmentAlignment() is neccessary to retrieve the integer value. - * @return a bool value - */ - virtual bool SubsegmentAlignmentIsBoolValue () const = 0; + virtual bool GetSegmentAligment () const = 0; /** * If and only if the return value of SubsegmentAlignmentIsBoolValue() equals \c 'true' the bool value returned by this method @@ -319,9 +317,9 @@ namespace dash * within the union of the two Adaptation Sets, the m-th Subsegment of X and the n-th Subsegment of Y are non-overlapping * (as defined in section 4.5.2 of ISO/IEC 23009-1, Part 1, 2012) whenever m is not equal to n. * - * @return an unsigned integer + * @return a bool value */ - virtual uint32_t GetSubsegmentAlignment () const = 0; + virtual bool GetSubsegmentAlignment () const = 0; /** * Returns a unsigned integer that when greater than 0, specifies that each Subsegment with \c SAP_type greater than 0 starts with a SAP of type @@ -360,6 +358,19 @@ namespace dash * @return a bool value */ virtual bool GetBitstreamSwitching () const = 0; + + /** + * 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::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/include/IBaseUrl.h b/libdash/libdash/include/IBaseUrl.h index 206ad14b..8124e598 100644 --- a/libdash/libdash/include/IBaseUrl.h +++ b/libdash/libdash/include/IBaseUrl.h @@ -13,6 +13,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IBASEURL_H_ @@ -36,14 +40,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 +57,35 @@ 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 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'. + * 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 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 @@ -61,7 +93,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/IContentComponent.h b/libdash/libdash/include/IContentComponent.h index 9f3be97f..6cd693a4 100644 --- a/libdash/libdash/include/IContentComponent.h +++ b/libdash/libdash/include/IContentComponent.h @@ -14,6 +14,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef ICONTENTCOMPONENT_H_ @@ -75,6 +79,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/IContentPopularityRate.h b/libdash/libdash/include/IContentPopularityRate.h new file mode 100644 index 00000000..f95d7f0b --- /dev/null +++ b/libdash/libdash/include/IContentPopularityRate.h @@ -0,0 +1,76 @@ +/** + * @class dash::mpd::IContentPopularityRate + * @brief This interface is needed for accessing the common elements and attributes of ContentPopularityRate + * @details Content Popularity Rate is a method for signalling information on which content items amongst the different Preselections and Adaptation Sets are expected to be more popular than others. + * Example use cases for different content streams in a Media Presentation include: + *
    + *
  • content streams from different viewpoints: in this case, an Adaptation Set containing recommended viewpoint is expected to be more popular than other Adaptation Sets; + *
  • sub-picture streams in a 360 video: in this case, a set of Adaptation Sets containing the sub-picture streams that compose "recommended viewport" can be signalled as more popular than others. + *
+ * Content Popularity Rate information is expected to be provided by the content provider based on the author’s intent, expected consumption rate by users, + * or actual viewing statistics that could have been measured by using DASH metrics, such as Play list as defined in Annex D.4.6. of ISO/IEC 23009-1.\n + * If provided, the information can be used for data prefetching by clients or network elements, e.g. CDN servers. + * It can also be used for example to deliver the data that is considered most relevant on a preferred data link, for example on multicast or broadcast, whereas less popular data is only provided in unicast. + * Expected-to-be-popular data can also be prefetched in higher quality in order to ensure that such data is available in good quality.\n + * To indicate the popularity of a Pre-selection or Adaptation Set, the \b ContentPopularityRate element may be present within that element. + * The \b ContentPopularityRate element contains one or more \b PR elements giving the rating for different parts of the content. + * The semantics of the \b ContentPopularityRate element are provided in 5.14.2, Table 43, the syntax is provided in 5.14.3 (of ISO/IEC 23009-1). + * @see dash::mpd::IPopularityRate dash::mpd::IMPDElement + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef ICONTENTPOPULARITYRATE_H_ +#define ICONTENTPOPULARITYRATE_H_ + +#include "config.h" + +#include "IMPDElement.h" +#include "IPopularityRate.h" + +namespace dash +{ + namespace mpd + { + class IContentPopularityRate : public virtual IMPDElement + { + public: + virtual ~IContentPopularityRate(){} + + /** + * Returns a reference to a vector of pointers to dash::mpd::IPopularityRate objects that specifies + * start time and number of segments for a contiguous sequence of segments assigned identical Popularity Rate value. + * + * @return a reference to a vector of pointers to dash::mpd::IPopularityRate objects + */ + virtual const std::vector& GetPopularityRates () const = 0; + + /** + * Returns a reference to a string that indicates the source of rating by this element. + * The value can be one of the following: + *
    + *
  • \c content (when the value is specified by the content author or content provider); + *
  • \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 + */ + 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. + * + * @return a reference to a string + */ + virtual const std::string& GetSourceDescription () const = 0; + + }; + } +} + +#endif /* ICONTENTPOPULARITYRATE_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/IContentProtection.h b/libdash/libdash/include/IContentProtection.h new file mode 100644 index 00000000..bc849dcd --- /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/IDescriptor.h b/libdash/libdash/include/IDescriptor.h index 3983e41e..a57cbcd9 100644 --- a/libdash/libdash/include/IDescriptor.h +++ b/libdash/libdash/include/IDescriptor.h @@ -27,6 +27,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IDESCRIPTOR_H_ @@ -61,6 +65,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/IEvent.h b/libdash/libdash/include/IEvent.h new file mode 100644 index 00000000..5646d0fd --- /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 uint64_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..b0e4699b --- /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::IEvent 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 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 + */ + 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 uint64_t GetPresentationTimeOffset () const = 0; + }; + } +} + +#endif /* IEVENTSTREAM */ \ 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..d7a9d821 --- /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/IFCS.h b/libdash/libdash/include/IFCS.h new file mode 100644 index 00000000..f6ab4dec --- /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 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 + * \em Duration corresponds to the \c \@d attribute. + * @return an unsigned integer + */ + virtual uint64_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..2f4e927d --- /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/IInitializationSet.h b/libdash/libdash/include/IInitializationSet.h new file mode 100644 index 00000000..c4fa9d12 --- /dev/null +++ b/libdash/libdash/include/IInitializationSet.h @@ -0,0 +1,172 @@ +/** + * @class dash::mpd::IInitializationSet + * @brief This interface is needed for accessing the attributes of InitializationSet. + * @details An Initialization Set provides a common set of media properties across Periods in a Media Presentation. + * If an Initialization Set with certain properties is provided in an MPD, there shall be at least one Adaptation Set in at least one Period with these properties. + * More importantly, it can also be indicated that all Periods in the Media Presentations include at least one Adaptation Set that follows the properties of the Initialization Set. + * Especially in the latter case an Initialization Set can be selected at the start of a Media Presentation in order to establish the relevant decryption, decoding and rendering environment. + * This provides expected consistent playback behaviour for the DASH Client if it selects only Adaptation Sets that are included in the selected Initialization Set.\n + * The semantical definition of Initialization Sets shares all parameters of Adaptation Sets, but an Initialization Set may only include a subset of those parameters. + * 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. + * 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. + * @see dash::mpd::IDescriptor + * + * @author Daniele Lorenzi \n + * Email: lorenzidaniele.97@gmail.com + * @version 2.1 + * @date 2021 + */ + +#ifndef IINITIALIZATIONSET_H_ +#define IINITIALIZATIONSET_H_ + +#include "config.h" + +#include "IDescriptor.h" +#include "IRepresentationBase.h" + +namespace dash +{ + namespace mpd + { + class IInitializationSet : public virtual IRepresentationBase + { + 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; + + /** + * 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 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. + * + * @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. + * + * @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. + * + * @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 + * 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. + * + * @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. + * + * @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; + + }; + } +} + +#endif /* IINITIALIZATIONSET_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/ILabel.h b/libdash/libdash/include/ILabel.h new file mode 100644 index 00000000..96485200 --- /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..f9ea4d6a --- /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..f4e02ae1 --- /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 7e69eecf..b5509002 100644 --- a/libdash/libdash/include/IMPD.h +++ b/libdash/libdash/include/IMPD.h @@ -17,8 +17,9 @@ * 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::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 * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -27,6 +28,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IMPD_H_ @@ -37,9 +42,16 @@ #include "IMPDElement.h" #include "IProgramInformation.h" #include "IBaseUrl.h" +#include "IContentProtection.h" +#include "IDescriptor.h" #include "IPeriod.h" #include "IMetrics.h" #include "IDASHMetrics.h" +#include "IServiceDescription.h" +#include "ILeapSecondInformation.h" +#include "IPatchLocation.h" +#include "IInitializationSet.h" +#include "IUIntVWithID.h" namespace dash { @@ -70,6 +82,60 @@ 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. + * + * @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::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::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 @@ -78,12 +144,47 @@ 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 @@ -126,6 +227,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/IModelPair.h b/libdash/libdash/include/IModelPair.h new file mode 100644 index 00000000..a730c4d3 --- /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/include/IMultipleSegmentBase.h b/libdash/libdash/include/IMultipleSegmentBase.h index 06d0dff3..c83bb02c 100644 --- a/libdash/libdash/include/IMultipleSegmentBase.h +++ b/libdash/libdash/include/IMultipleSegmentBase.h @@ -12,6 +12,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IMULTIPLESEGMENTBASE_H_ @@ -59,6 +63,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/IOperatingBandwidth.h b/libdash/libdash/include/IOperatingBandwidth.h new file mode 100644 index 00000000..78f4d9c0 --- /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..4d4a02f2 --- /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..83614bfd --- /dev/null +++ b/libdash/libdash/include/IPatchLocation.h @@ -0,0 +1,49 @@ +/** + * @class dash::mpd::IPatchLocation + * @brief This interface is needed for accessing the attributes of PatchLocation. + * @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 + * 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 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 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. + + * + * @return a double + */ + virtual double 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 10ec9244..dad75a95 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::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 dash::mpd::IContentProtection * * @author bitmovin Softwareentwicklung OG \n * Email: libdash-dev@vicky.bitmovin.net @@ -37,6 +38,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IPERIOD_H_ @@ -49,8 +54,14 @@ #include "ISegmentBase.h" #include "ISegmentList.h" #include "ISegmentTemplate.h" +#include "IDescriptor.h" +#include "ILabel.h" +#include "IEventStream.h" +#include "IContentProtection.h" +#include "IServiceDescription.h" #include "IAdaptationSet.h" #include "ISubset.h" +#include "IPreselection.h" namespace dash { @@ -66,7 +77,7 @@ namespace dash * For more details refer to the description in section 5.6. of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IBaseUrl objects */ - virtual const std::vector& GetBaseURLs () const = 0; + virtual const std::vector& GetBaseURLs () const = 0; /** * Returns a pointer to a dash::mpd::ISegmentBase object that specifies default Segment Base information.\n @@ -74,7 +85,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::ISegmentBase object */ - virtual ISegmentBase* GetSegmentBase () const = 0; + virtual ISegmentBase* GetSegmentBase () const = 0; /** * Returns a pointer to a dash::mpd::ISegmentList object that specifies default Segment List information.\n @@ -82,7 +93,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 @@ -90,7 +101,39 @@ 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; + + /** + * 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::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 @@ -98,34 +141,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 + * 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 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. * @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". + * @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; /** * 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 @@ -133,21 +217,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 + * 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 new file mode 100644 index 00000000..289cfd5c --- /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/IPopularityRate.h b/libdash/libdash/include/IPopularityRate.h new file mode 100644 index 00000000..89595b82 --- /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 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; + + }; + } +} + +#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..9f3cd4a7 --- /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..bc70aa82 --- /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 uint64_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..9212ed62 --- /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/IRepresentation.h b/libdash/libdash/include/IRepresentation.h index bdc03abd..264d4b47 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 @@ -32,6 +33,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IREPRESENTATION_H_ @@ -40,6 +45,7 @@ #include "config.h" #include "IBaseUrl.h" +#include "IExtendedBandwidth.h" #include "ISubRepresentation.h" #include "ISegmentBase.h" #include "ISegmentList.h" @@ -60,7 +66,14 @@ namespace dash * For more details refer to the description in section 5.6. of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::IBaseUrl objects */ - virtual const std::vector& GetBaseURLs () const = 0; + 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 @@ -68,28 +81,28 @@ namespace dash * For more detail see section 5.3.6 of ISO/IEC 23009-1, Part 1, 2012. * @return a reference to a vector of pointers to dash::mpd::ISubRepresentation objects */ - virtual const std::vector& GetSubRepresentations () const = 0; + virtual const std::vector& GetSubRepresentations () const = 0; /** * Returns a pointer to a dash::mpd::ISegmentBase object that specifies default Segment Base information. * For more detail see section 5.3.9 of ISO/IEC 23009-1, Part 1, 2012. * @return a pointer to a dash::mpd::ISegmentBase object */ - virtual ISegmentBase* GetSegmentBase () const = 0; + virtual ISegmentBase* GetSegmentBase () const = 0; /** * Returns a pointer to a dash::mpd::ISegmentList object that specifies the Segment List information. * For more detail 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 the Segment Template information. * For more detail 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 reference to a string that specifies an identifier for this Representation. The identifier shall be unique within a Period @@ -99,7 +112,7 @@ namespace dash * the string shall only contain characters that are permitted within an HTTP-URL according to RFC 1738. * @return a reference to a string */ - virtual const std::string& GetId () const = 0; + virtual const std::string& GetId () const = 0; /** * Returns an integer that specifies a bandwidth in bits per seconds (bps).\n @@ -109,14 +122,14 @@ namespace dash * For dependent Representations this value shall specify the minimum bandwidth as defined above of this Representation and all complementary Representations. * @return an unsigned integer */ - virtual uint32_t GetBandwidth () const = 0; + virtual uint32_t GetBandwidth () const = 0; /** * Returns an integer that specifies a quality ranking of the Representation relative to other Representations in the same Adaptation Set. * Lower values represent higher quality content. * @return an unsigned integer */ - virtual uint32_t GetQualityRanking () const = 0; + virtual uint32_t GetQualityRanking () const = 0; /** * Returns a reference to a vector of strings that specifies all complementary Representations the Representation depends on in the decoding and/or @@ -125,7 +138,25 @@ namespace dash * This attribute shall not be present where there are no dependencies. * @return a reference to a vector of strings */ - virtual const std::vector& GetDependencyId () const = 0; + 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 @@ -151,7 +182,7 @@ namespace dash * and Representation C would contain \c \@mediaStreamStructureId equal to \"2\". * @return a reference to a vector of strings */ - virtual const std::vector& GetMediaStreamStructureId () const = 0; + virtual const std::vector& GetMediaStreamStructureId () const = 0; }; } } diff --git a/libdash/libdash/include/IRepresentationBase.h b/libdash/libdash/include/IRepresentationBase.h index e7b7e688..cf49d14e 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::IMPDElement + * @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 * Email: libdash-dev@vicky.bitmovin.net @@ -12,6 +13,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef IREPRESENTATIONBASE_H_ @@ -20,7 +25,15 @@ #include "config.h" #include "IMPDElement.h" +#include "IContentProtection.h" #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 { @@ -37,21 +50,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 + * 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::IContentProtection objects + */ + 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 + * 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& GetContentProtection () 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; + + /** + * 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. + * + * @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 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) @@ -62,7 +169,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 @@ -72,14 +179,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, @@ -88,7 +195,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) @@ -98,7 +205,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 @@ -106,14 +213,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. @@ -124,7 +231,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. @@ -134,7 +241,15 @@ 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 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, @@ -142,21 +257,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 @@ -165,14 +280,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; + 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/IResync.h b/libdash/libdash/include/IResync.h new file mode 100644 index 00000000..5ef7d4dd --- /dev/null +++ b/libdash/libdash/include/IResync.h @@ -0,0 +1,107 @@ +/** + * @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; + + }; + } +} + +#endif /* IRESYNC_H_ */ \ No newline at end of file diff --git a/libdash/libdash/include/ISegmentBase.h b/libdash/libdash/include/ISegmentBase.h index a29a4eab..7e8d0fc0 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,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef ISEGMENTBASE_H_ @@ -27,6 +31,7 @@ #include "IMPDElement.h" #include "IURLType.h" +#include "IFailoverContent.h" namespace dash { @@ -41,21 +46,46 @@ namespace dash * Returns a pointer to a dash::mpd::IURLType object that specifies the URL including a possible byte range for the Initialization Segment. * @return a pointer to dash::mpd::IURLType object */ - virtual const IURLType* GetInitialization () const = 0; + virtual const IURLType* GetInitialization () const = 0; /** * Returns a pointer to a dash::mpd::IURLType object that specifies the URL including a possible byte range for the Representation Index Segment. * @return a pointer to dash::mpd::IURLType object */ - virtual const IURLType* GetRepresentationIndex () const = 0; + 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 * to be used for the derivation of different real-time duration values in the Segment Information.\n - * \b NOTE: This may be any frequency but typically is the media clock frequency of one of the media streams (or a positive integer multiple thereof). + * \b NOTE: This may be any frequency but typically is the media clock frequency of one of the media streams (or a positive integer multiple thereof). * @return an unsigned integer */ - virtual uint32_t GetTimescale () const = 0; + 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 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 @@ -63,7 +93,24 @@ namespace dash * If not present on any level, the value of the presentation time offset is 0. * @return an unsigned integer */ - virtual uint32_t GetPresentationTimeOffset () const = 0; + 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. + * @return an unsigned integer + */ + 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. + * @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 @@ -71,14 +118,32 @@ namespace dash * It is restricted to a single expression identifying a contiguous range of bytes. * @return a reference to a string */ - virtual const std::string& GetIndexRange () const = 0; + virtual const std::string& GetIndexRange () const = 0; /** * When set to \c 'true' specifies that for all Segments in the Representation, the data outside the prefix defined by \c \@indexRange contains the data * needed to access all access units of all media streams syntactically and semantically. * @return a bool value */ - virtual bool HasIndexRangeExact () const = 0; + 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..21f067de 100644 --- a/libdash/libdash/include/ISegmentList.h +++ b/libdash/libdash/include/ISegmentList.h @@ -14,6 +14,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef ISEGMENTLIST_H_ @@ -50,6 +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". . + * @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/IServiceDescription.h b/libdash/libdash/include/IServiceDescription.h new file mode 100644 index 00000000..bcc0edb5 --- /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/ISubset.h b/libdash/libdash/include/ISubset.h index 6d5c8566..ae4164a8 100644 --- a/libdash/libdash/include/ISubset.h +++ b/libdash/libdash/include/ISubset.h @@ -23,6 +23,10 @@ * @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 + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 */ #ifndef ISUBSET_H_ @@ -47,6 +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; }; } } diff --git a/libdash/libdash/include/ISwitching.h b/libdash/libdash/include/ISwitching.h new file mode 100644 index 00000000..00e4b1fd --- /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/IUIntPairs.h b/libdash/libdash/include/IUIntPairs.h new file mode 100644 index 00000000..34ae2dce --- /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..e014ca09 --- /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/include/IUIntVWithID.h b/libdash/libdash/include/IUIntVWithID.h new file mode 100644 index 00000000..7e879c11 --- /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/manager/DASHManager.cpp b/libdash/libdash/source/manager/DASHManager.cpp index 51812336..db526e2e 100644 --- a/libdash/libdash/source/manager/DASHManager.cpp +++ b/libdash/libdash/source/manager/DASHManager.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @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.cpp b/libdash/libdash/source/mpd/AdaptationSet.cpp index b1a0331f..55f9b08f 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.cpp +++ b/libdash/libdash/source/mpd/AdaptationSet.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -20,6 +24,8 @@ AdaptationSet::AdaptationSet () : segmentTemplate(NULL), xlinkHref(""), xlinkActuate("onRequest"), + xlinkType(""), + xlinkShow(""), id(0), lang(""), contentType(""), @@ -32,13 +38,12 @@ AdaptationSet::AdaptationSet () : maxHeight(0), minFramerate(""), maxFramerate(""), - segmentAlignmentIsBool(true), - subsegmentAlignmentIsBool(true), usesSegmentAlignment(false), usesSubsegmentAlignment(false), - segmentAlignment(0), - subsegmentAlignment(0), - isBitstreamSwitching(false) + segmentAlignment(false), + subsegmentAlignment(false), + isBitstreamSwitching(false), + initializationPrincipal("") { } AdaptationSet::~AdaptationSet () @@ -159,6 +164,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; @@ -263,14 +284,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; @@ -279,52 +292,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; @@ -341,3 +324,19 @@ void AdaptationSet::SetBitstreamSwitching { this->isBitstreamSwitching = value; } +const std::vector& AdaptationSet::GetInitializationSetRef () const +{ + return this->initializationSetRef; +} +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 5a17cf4a..ffe2278e 100644 --- a/libdash/libdash/source/mpd/AdaptationSet.h +++ b/libdash/libdash/source/mpd/AdaptationSet.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -45,6 +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; uint32_t GetId () const; uint32_t GetGroup () const; const std::string& GetLang () const; @@ -58,14 +64,14 @@ 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; + const std::string& GetInitializationPrincipal () const; void AddAccessibity (Descriptor *accessibility); void AddRole (Descriptor *role); @@ -79,6 +85,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); @@ -92,10 +100,12 @@ 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); + void SetInitializationPrincipal (const std::string& initializationPrincipal); private: std::vector accessibility; @@ -110,6 +120,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; @@ -123,14 +135,14 @@ 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; + std::string initializationPrincipal; }; } } diff --git a/libdash/libdash/source/mpd/BaseUrl.cpp b/libdash/libdash/source/mpd/BaseUrl.cpp index 7bafe794..563602e2 100644 --- a/libdash/libdash/source/mpd/BaseUrl.cpp +++ b/libdash/libdash/source/mpd/BaseUrl.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -16,38 +20,72 @@ using namespace dash::mpd; BaseUrl::BaseUrl () : url(""), serviceLocation(""), - byteRange("") + byteRange(""), + timeShiftBufferDepth(""), + rangeAccess(false) { } 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::IsAvailabilityTimeComplete () 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; +} +bool BaseUrl::HasRangeAccess () const +{ + return this->rangeAccess; +} +void BaseUrl::SetRangeAccess (bool rangeAccess) +{ + this->rangeAccess = rangeAccess; +} +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..c9149bdb 100644 --- a/libdash/libdash/source/mpd/BaseUrl.h +++ b/libdash/libdash/source/mpd/BaseUrl.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -28,13 +32,21 @@ namespace dash BaseUrl (); virtual ~BaseUrl(); - const std::string& GetUrl () const; - const std::string& GetServiceLocation () const; - const std::string& GetByteRange () const; + 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; + bool HasRangeAccess () const; - void SetUrl (const std::string& url); - void SetServiceLocation (const std::string& serviceLocation); - void SetByteRange (const std::string& byteRange); + 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 SetRangeAccess (bool rangeAccess); virtual ISegment* ToMediaSegment (const std::vector& baseurls) const; @@ -42,6 +54,10 @@ namespace dash std::string url; std::string serviceLocation; std::string byteRange; + double availabilityTimeOffset; + bool availabilityTimeComplete; + std::string timeShiftBufferDepth; + bool rangeAccess; }; } } diff --git a/libdash/libdash/source/mpd/ContentComponent.cpp b/libdash/libdash/source/mpd/ContentComponent.cpp index ce3de857..c3ec94c1 100644 --- a/libdash/libdash/source/mpd/ContentComponent.cpp +++ b/libdash/libdash/source/mpd/ContentComponent.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -17,7 +21,8 @@ ContentComponent::ContentComponent () : id(0), lang(""), contentType(""), - par("") + par(""), + tag("") { } ContentComponent::~ContentComponent () @@ -96,3 +101,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..00acde96 100644 --- a/libdash/libdash/source/mpd/ContentComponent.h +++ b/libdash/libdash/source/mpd/ContentComponent.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -36,6 +40,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 +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); private: std::vector accessibility; @@ -55,6 +61,7 @@ namespace dash std::string lang; std::string contentType; std::string par; + std::string tag; }; } } diff --git a/libdash/libdash/source/mpd/ContentPopularityRate.cpp b/libdash/libdash/source/mpd/ContentPopularityRate.cpp new file mode 100644 index 00000000..22309852 --- /dev/null +++ b/libdash/libdash/source/mpd/ContentPopularityRate.cpp @@ -0,0 +1,50 @@ +/* + * ContentPopularityRate.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 "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..3287eb1c --- /dev/null +++ b/libdash/libdash/source/mpd/ContentPopularityRate.h @@ -0,0 +1,47 @@ +/* + * ContentPopularityRate.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 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/ContentProtection.cpp b/libdash/libdash/source/mpd/ContentProtection.cpp new file mode 100644 index 00000000..c6d677d9 --- /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..35c86607 --- /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/Descriptor.cpp b/libdash/libdash/source/mpd/Descriptor.cpp index c6eb787b..2477344c 100644 --- a/libdash/libdash/source/mpd/Descriptor.cpp +++ b/libdash/libdash/source/mpd/Descriptor.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -15,7 +19,8 @@ using namespace dash::mpd; Descriptor::Descriptor () : schemeIdUri (""), - value ("") + value (""), + id ("") { } Descriptor::~Descriptor () @@ -37,3 +42,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..9b3e61ce 100644 --- a/libdash/libdash/source/mpd/Descriptor.h +++ b/libdash/libdash/source/mpd/Descriptor.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -21,7 +25,7 @@ namespace dash { namespace mpd { - class Descriptor : public IDescriptor, public AbstractMPDElement + class Descriptor : public virtual IDescriptor, public AbstractMPDElement { public: Descriptor (); @@ -29,13 +33,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: + protected: std::string schemeIdUri; std::string value; + std::string id; }; } } diff --git a/libdash/libdash/source/mpd/Event.cpp b/libdash/libdash/source/mpd/Event.cpp new file mode 100644 index 00000000..e8b839fc --- /dev/null +++ b/libdash/libdash/source/mpd/Event.cpp @@ -0,0 +1,66 @@ +/* + * Event.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 "Event.h" + +using namespace dash::mpd; + +Event::Event () : + presentationTime(0), + contentEncoding(""), + messageData("") + +{ +} +Event::~Event () +{ +} + +uint64_t Event::GetPresentationTime () const +{ + return this->presentationTime; +} +void Event::SetPresentationTime (uint64_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..9f6afe93 --- /dev/null +++ b/libdash/libdash/source/mpd/Event.h @@ -0,0 +1,53 @@ +/* + * Event.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 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 (); + + uint64_t GetPresentationTime () const; + const std::string& GetDuration () 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); + + private: + uint64_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..c4468098 --- /dev/null +++ b/libdash/libdash/source/mpd/EventStream.cpp @@ -0,0 +1,86 @@ +/* + * EventStream.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 "EventStream.h" + +using namespace dash::mpd; + +EventStream::EventStream () : + xlinkHref(""), + xlinkActuate("onRequest"), + schemeIdUri(""), + value(""), + presentationTimeOffset(0), + timescale(1) +{ +} +EventStream::~EventStream () +{ + for (size_t i=0; i < this->events.size(); i++) + delete(this->events.at(i)); +} + +const 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; +} +uint64_t EventStream::GetPresentationTimeOffset () const +{ + return this->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 new file mode 100644 index 00000000..329a6708 --- /dev/null +++ b/libdash/libdash/source/mpd/EventStream.h @@ -0,0 +1,59 @@ +/* + * EventStream.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 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 (); + + 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); + + protected: + std::vector events; + std::string xlinkHref; + std::string xlinkActuate; + std::string schemeIdUri; + std::string value; + uint32_t timescale; + uint64_t presentationTimeOffset; + }; + } +} + +#endif /* EVENTSTREAM_H_ */ diff --git a/libdash/libdash/source/mpd/ExtendedBandwidth.cpp b/libdash/libdash/source/mpd/ExtendedBandwidth.cpp new file mode 100644 index 00000000..a1c5dbe1 --- /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/FCS.cpp b/libdash/libdash/source/mpd/FCS.cpp new file mode 100644 index 00000000..5da3fbb4 --- /dev/null +++ b/libdash/libdash/source/mpd/FCS.cpp @@ -0,0 +1,40 @@ +/* + * FCS.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 "FCS.h" + +using namespace dash::mpd; + +FCS::FCS () : + presentationTime(0), + duration(0) +{ +} +FCS::~FCS () +{ +} + +uint64_t FCS::GetPresentationTime () const +{ + return this->presentationTime; +} +void FCS::SetPresentationTime (uint64_t presentationTime) +{ + this->presentationTime = presentationTime; +} +uint64_t FCS::GetDuration () const +{ + return this->duration; +} +void FCS::SetDuration (uint64_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..29f63470 --- /dev/null +++ b/libdash/libdash/source/mpd/FCS.h @@ -0,0 +1,43 @@ +/* + * FCS.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 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 (); + + uint64_t GetPresentationTime () const; + uint64_t GetDuration () const; + + void SetPresentationTime (uint64_t presentationTime); + void SetDuration (uint64_t duration); + + private: + uint64_t presentationTime; + uint64_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..6d7af009 --- /dev/null +++ b/libdash/libdash/source/mpd/FailoverContent.cpp @@ -0,0 +1,41 @@ +/* + * FailoverContent.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 "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..a0cedf0a --- /dev/null +++ b/libdash/libdash/source/mpd/FailoverContent.h @@ -0,0 +1,44 @@ +/* + * FailoverContent.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 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/InitializationSet.cpp b/libdash/libdash/source/mpd/InitializationSet.cpp new file mode 100644 index 00000000..6ee2bf94 --- /dev/null +++ b/libdash/libdash/source/mpd/InitializationSet.cpp @@ -0,0 +1,160 @@ +/* + * InitializationSet.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 "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..c1ffe73a --- /dev/null +++ b/libdash/libdash/source/mpd/InitializationSet.h @@ -0,0 +1,83 @@ +/* + * InitializationSet.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 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/Label.cpp b/libdash/libdash/source/mpd/Label.cpp new file mode 100644 index 00000000..181a6e40 --- /dev/null +++ b/libdash/libdash/source/mpd/Label.cpp @@ -0,0 +1,40 @@ +/* + * Label.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 "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..6440f747 --- /dev/null +++ b/libdash/libdash/source/mpd/Label.h @@ -0,0 +1,45 @@ +/* + * Label.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 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..2697c832 --- /dev/null +++ b/libdash/libdash/source/mpd/Latency.cpp @@ -0,0 +1,64 @@ +/* + * Latency.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 "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..8fe0fc7a --- /dev/null +++ b/libdash/libdash/source/mpd/Latency.h @@ -0,0 +1,54 @@ +/* + * Latency.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 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..b8e90e92 --- /dev/null +++ b/libdash/libdash/source/mpd/LeapSecondInformation.cpp @@ -0,0 +1,48 @@ +/* + * LeapSecondInformation.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 "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..c167c2d1 --- /dev/null +++ b/libdash/libdash/source/mpd/LeapSecondInformation.h @@ -0,0 +1,47 @@ +/* + * LeapSecondInformation.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 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 e949d7ea..0038b47f 100644 --- a/libdash/libdash/source/mpd/MPD.cpp +++ b/libdash/libdash/source/mpd/MPD.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -15,10 +19,12 @@ using namespace dash::mpd; using namespace dash::metrics; MPD::MPD () : + leapSecondInformation(NULL), id(""), type("static"), availabilityStarttime(""), availabilityEndtime(""), + publishTime(""), mediaPresentationDuration(""), minimumUpdatePeriod(""), minBufferTime(""), @@ -35,12 +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++) + 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->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->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); + + delete(leapSecondInformation); } const std::vector& MPD::GetProgramInformations () const @@ -67,6 +91,54 @@ 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::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::GetContentProtections () const +{ + return (std::vector &) this->contentProtections; +} +void MPD::AddContentProtection (ContentProtection *contentProtection) +{ + this->contentProtections.push_back(contentProtection); +} const std::vector& MPD::GetPeriods () const { return (std::vector &) this->periods; @@ -83,6 +155,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; @@ -115,6 +219,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..e0f56708 100644 --- a/libdash/libdash/source/mpd/MPD.h +++ b/libdash/libdash/source/mpd/MPD.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -17,9 +21,16 @@ #include "IMPD.h" #include "ProgramInformation.h" #include "BaseUrl.h" +#include "ContentProtection.h" +#include "Descriptor.h" #include "Period.h" #include "Metrics.h" #include "AbstractMPDElement.h" +#include "ServiceDescription.h" +#include "LeapSecondInformation.h" +#include "PatchLocation.h" +#include "InitializationSet.h" +#include "UIntVWithID.h" #include "../metrics/HTTPTransaction.h" #include "../metrics/TCPConnection.h" @@ -36,13 +47,24 @@ 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& GetContentProtections () 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; 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; @@ -61,13 +83,24 @@ 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 AddContentProtection (ContentProtection *contentProtection); 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); 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); @@ -82,13 +115,24 @@ 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 contentProtections; 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; 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/ModelPair.cpp b/libdash/libdash/source/mpd/ModelPair.cpp new file mode 100644 index 00000000..732fd269 --- /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_ */ diff --git a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp index ccfba515..f70ce309 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.cpp +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -17,7 +21,8 @@ MultipleSegmentBase::MultipleSegmentBase () : bitstreamSwitching(NULL), segmentTimeline(NULL), duration(0), - startNumber(1) + startNumber(1), + endNumber(1) { } MultipleSegmentBase::~MultipleSegmentBase () @@ -58,3 +63,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..0ea8c5d1 100644 --- a/libdash/libdash/source/mpd/MultipleSegmentBase.h +++ b/libdash/libdash/source/mpd/MultipleSegmentBase.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -33,17 +37,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/OperatingBandwidth.cpp b/libdash/libdash/source/mpd/OperatingBandwidth.cpp new file mode 100644 index 00000000..5262261d --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingBandwidth.cpp @@ -0,0 +1,55 @@ +/* + * OperatingBandwidth.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 "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..6f5d53e0 --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingBandwidth.h @@ -0,0 +1,50 @@ +/* + * OperatingBandwidth.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 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..4cceb175 --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingQuality.cpp @@ -0,0 +1,71 @@ +/* + * OperatingQuality.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 "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..83e43fce --- /dev/null +++ b/libdash/libdash/source/mpd/OperatingQuality.h @@ -0,0 +1,56 @@ +/* + * OperatingQuality.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 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..805ae771 --- /dev/null +++ b/libdash/libdash/source/mpd/PatchLocation.cpp @@ -0,0 +1,41 @@ +/* + * PatchLocation.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 "PatchLocation.h" + +using namespace dash::mpd; + +PatchLocation::PatchLocation () : + url(""), + ttl(0.0) + +{ +} +PatchLocation::~PatchLocation () +{ +} + +const std::string& PatchLocation::GetUrl () const +{ + return this->url; +} +void PatchLocation::SetUrl (const std::string& url) +{ + this->url = url; +} +double PatchLocation::GetTtl () const +{ + return this->ttl; +} +void PatchLocation::SetTtl (double 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..6f3aed02 --- /dev/null +++ b/libdash/libdash/source/mpd/PatchLocation.h @@ -0,0 +1,44 @@ +/* + * PatchLocation.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 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; + double GetTtl () const; + + void SetUrl (const std::string& url); + void SetTtl (double ttl); + + private: + std::string url; + double 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 291677ea..ce250007 100644 --- a/libdash/libdash/source/mpd/Period.cpp +++ b/libdash/libdash/source/mpd/Period.cpp @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -17,8 +21,11 @@ Period::Period () : segmentBase(NULL), segmentList(NULL), segmentTemplate(NULL), + assetIdentifier(NULL), xlinkActuate("onRequest"), xlinkHref(""), + xlinkType("simple"), + xlinkShow("embed"), id(""), start(""), duration(""), @@ -33,105 +40,190 @@ 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)); + 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); delete(segmentList); delete(segmentTemplate); + 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 std::vector& Period::GetAdaptationSets () const +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; +} +void Period::AddEventStream (EventStream *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::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; } -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::string& Period::GetXlinkHref () const +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::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; } -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::GetId () const +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; } -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 9e97f0cb..ac3ec2a5 100644 --- a/libdash/libdash/source/mpd/Period.h +++ b/libdash/libdash/source/mpd/Period.h @@ -5,6 +5,10 @@ * * Email: libdash-dev@vicky.bitmovin.net * + * @contributor Daniele Lorenzi + * @contributoremail lorenzidaniele.97@gmail.com + * @contributiondate 2021 + * * This source code and its use and distribution, is subject to the terms * and conditions of the applicable license agreement. *****************************************************************************/ @@ -21,6 +25,12 @@ #include "SegmentBase.h" #include "SegmentList.h" #include "SegmentTemplate.h" +#include "Descriptor.h" +#include "Label.h" +#include "EventStream.h" +#include "ContentProtection.h" +#include "ServiceDescription.h" +#include "Preselection.h" #include "AbstractMPDElement.h" namespace dash @@ -33,45 +43,72 @@ namespace dash Period (); virtual ~Period (); - const std::vector& GetBaseURLs () const; - ISegmentBase* GetSegmentBase () const; - ISegmentList* GetSegmentList () const; - ISegmentTemplate* GetSegmentTemplate () const; - const std::vector& GetAdaptationSets () const; - const std::vector& GetSubsets () const; - const std::string& GetXlinkHref () const; - const std::string& GetXlinkActuate () 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& GetContentProtections () 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 AddContentProtection (ContentProtection *contentProtection); void AddAdaptationSet (AdaptationSet *AdaptationSet); 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); + 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; - std::vector adaptationSets; - std::vector subsets; - std::string xlinkHref; - std::string xlinkActuate; - std::string id; - std::string start; - std::string duration; - bool isBitstreamSwitching; + std::vector baseURLs; + SegmentBase *segmentBase; + SegmentList *segmentList; + SegmentTemplate *segmentTemplate; + Descriptor *assetIdentifier; + std::vector eventStreams; + std::vector serviceDescriptions; + std::vector contentProtections; + std::vector adaptationSets; + std::vector subsets; + std::vector supplementalProperties; + std::vector