#include <libmpd++/Period.hh>
Public Types | |
using | time_type = std::chrono::system_clock::time_point |
Date-time type used in this class. | |
using | duration_type = std::chrono::microseconds |
Time duration type used in this class. | |
Public Member Functions | |
Period () | |
Period (const Period &to_copy) | |
Period (Period &&to_move) | |
virtual | ~Period () |
Period & | operator= (const Period &to_copy) |
Period & | operator= (Period &&to_move) |
bool | operator== (const Period &to_compare) const |
bool | hasId () const |
const std::optional< std::string > & | id () const |
Period & | id (const std::nullopt_t &) |
Period & | id (const std::string &id) |
Period & | id (std::string &&id) |
Period & | id (const std::optional< std::string > &id) |
Period & | id (std::optional< std::string > &&id) |
bool | hasStart () const |
const std::optional< duration_type > & | start () const |
Period & | start (const std::nullopt_t &) |
Period & | start (const duration_type &start) |
Period & | start (const std::optional< duration_type > &start) |
bool | hasDuration () const |
const std::optional< duration_type > & | duration () const |
Period & | duration (const std::nullopt_t &) |
Period & | duration (const duration_type &durn) |
Period & | duration (const std::optional< duration_type > &durn) |
bool | bitstreamSwitching () const |
Period & | bitstreamSwitching (bool bitstream_switching) |
const std::list< BaseURL > & | baseURLs () const |
std::list< BaseURL >::const_iterator | baseURLsBegin () const |
std::list< BaseURL >::const_iterator | baseURLsEnd () const |
std::list< BaseURL >::iterator | baseURLsBegin () |
std::list< BaseURL >::iterator | baseURLsEnd () |
Period & | baseURLAdd (const BaseURL &base_url) |
Period & | baseURLAdd (BaseURL &&base_url) |
Period & | baseURLRemove (const BaseURL &base_url) |
Period & | baseURLRemove (const std::list< BaseURL >::const_iterator &) |
Period & | baseURLRemove (const std::list< BaseURL >::iterator &) |
std::list< BaseURL > | getBaseURLs () const |
bool | hasSegmentBase () const |
const std::optional< SegmentBase > & | segmentBase () const |
Period & | segmentBase (const std::nullopt_t &) |
Period & | segmentBase (const SegmentBase &seg_base) |
Period & | segmentBase (SegmentBase &&seg_base) |
Period & | segmentBase (const std::optional< SegmentBase > &seg_base) |
Period & | segmentBase (std::optional< SegmentBase > &&seg_base) |
bool | hasSegmentList () const |
const std::optional< SegmentList > & | segmentList () const |
Period & | segmentList (const std::nullopt_t &) |
Period & | segmentList (const SegmentList &seg_list) |
Period & | segmentList (SegmentList &&seg_list) |
Period & | segmentList (const std::optional< SegmentList > &seg_list) |
Period & | segmentList (std::optional< SegmentList > &&seg_list) |
bool | hasSegmentTemplate () const |
const std::optional< SegmentTemplate > & | segmentTemplate () const |
Period & | segmentTemplate (const std::nullopt_t &) |
Period & | segmentTemplate (const SegmentTemplate &seg_template) |
Period & | segmentTemplate (SegmentTemplate &&seg_template) |
Period & | segmentTemplate (const std::optional< SegmentTemplate > &seg_template) |
Period & | segmentTemplate (std::optional< SegmentTemplate > &&seg_template) |
bool | hasAssetIdentifier () const |
const std::optional< Descriptor > & | assetIdentifier () const |
Period & | assetIdentifier (const std::nullopt_t &) |
Period & | assetIdentifier (const Descriptor &asset_id) |
Period & | assetIdentifier (Descriptor &&asset_id) |
Period & | assetIdentifier (const std::optional< Descriptor > &asset_id) |
Period & | assetIdentifier (std::optional< Descriptor > &&asset_id) |
const std::list< EventStream > & | eventStreams () const |
std::list< EventStream >::const_iterator | eventStreamsBegin () const |
std::list< EventStream >::const_iterator | eventStreamsEnd () const |
std::list< EventStream >::iterator | eventStreamsBegin () |
std::list< EventStream >::iterator | eventStreamsEnd () |
Period & | eventStreamAdd (const EventStream &event_stream) |
Period & | eventStreamAdd (EventStream &&event_stream) |
Period & | eventStreamRemove (const EventStream &event_stream) |
Period & | eventStreamRemove (const std::list< EventStream >::const_iterator &) |
Period & | eventStreamRemove (const std::list< EventStream >::iterator &) |
const std::list< ServiceDescription > & | serviceDescriptions () const |
std::list< ServiceDescription >::const_iterator | serviceDescriptionsBegin () const |
std::list< ServiceDescription >::const_iterator | serviceDescriptionsEnd () const |
std::list< ServiceDescription >::iterator | serviceDescriptionsBegin () |
std::list< ServiceDescription >::iterator | serviceDescriptionsEnd () |
Period & | serviceDescriptionAdd (const ServiceDescription &service_desc) |
Period & | serviceDescriptionAdd (ServiceDescription &&service_desc) |
Period & | serviceDescriptionRemove (const ServiceDescription &service_desc) |
Period & | serviceDescriptionRemove (const std::list< ServiceDescription >::const_iterator &) |
Period & | serviceDescriptionRemove (const std::list< ServiceDescription >::iterator &) |
const std::list< ContentProtection > & | contentProtections () const |
std::list< ContentProtection >::const_iterator | contentProtectionsBegin () const |
std::list< ContentProtection >::const_iterator | contentProtectionsEnd () const |
std::list< ContentProtection >::iterator | contentProtectionsBegin () |
std::list< ContentProtection >::iterator | contentProtectionsEnd () |
Period & | contentProtectionAdd (const ContentProtection &content_prot) |
Period & | contentProtectionAdd (ContentProtection &&content_prot) |
Period & | contentProtectionRemove (const ContentProtection &content_prot) |
Period & | contentProtectionRemove (const std::list< ContentProtection >::const_iterator &) |
Period & | contentProtectionRemove (const std::list< ContentProtection >::iterator &) |
const std::list< AdaptationSet > & | adaptationSets () const |
std::list< AdaptationSet >::const_iterator | adaptationSetsBegin () const |
std::list< AdaptationSet >::const_iterator | adaptationSetsEnd () const |
std::list< AdaptationSet >::iterator | adaptationSetsBegin () |
std::list< AdaptationSet >::iterator | adaptationSetsEnd () |
Period & | adaptationSetAdd (const AdaptationSet &adapt_set) |
Period & | adaptationSetAdd (AdaptationSet &&adapt_set) |
Period & | adaptationSetRemove (const AdaptationSet &adapt_set) |
Period & | adaptationSetRemove (const std::list< AdaptationSet >::const_iterator &) |
Period & | adaptationSetRemove (const std::list< AdaptationSet >::iterator &) |
const std::list< Subset > & | subsets () const |
std::list< Subset >::const_iterator | subsetsBegin () const |
std::list< Subset >::const_iterator | subsetsEnd () const |
std::list< Subset >::iterator | subsetsBegin () |
std::list< Subset >::iterator | subsetsEnd () |
Period & | subsetAdd (const Subset &subset) |
Period & | subsetAdd (Subset &&subset) |
Period & | subsetRemove (const Subset &subset) |
Period & | subsetRemove (const std::list< Subset >::const_iterator &) |
Period & | subsetRemove (const std::list< Subset >::iterator &) |
const std::list< Descriptor > & | supplementalProperties () const |
std::list< Descriptor >::const_iterator | supplementalPropertiesBegin () const |
std::list< Descriptor >::const_iterator | supplementalPropertiesEnd () const |
std::list< Descriptor >::iterator | supplementalPropertiesBegin () |
std::list< Descriptor >::iterator | supplementalPropertiesEnd () |
Period & | supplementalPropertyAdd (const Descriptor &supp_prop) |
Period & | supplementalPropertyAdd (Descriptor &&supp_prop) |
Period & | supplementalPropertyRemove (const Descriptor &supp_prop) |
Period & | supplementalPropertyRemove (const std::list< Descriptor >::const_iterator &) |
Period & | supplementalPropertyRemove (const std::list< Descriptor >::iterator &) |
const std::list< AdaptationSet > & | emptyAdaptationSets () const |
std::list< AdaptationSet >::const_iterator | emptyAdaptationSetsBegin () const |
std::list< AdaptationSet >::const_iterator | emptyAdaptationSetsEnd () const |
std::list< AdaptationSet >::iterator | emptyAdaptationSetsBegin () |
std::list< AdaptationSet >::iterator | emptyAdaptationSetsEnd () |
Period & | emptyAdaptationSetAdd (const AdaptationSet &adapt_set) |
Period & | emptyAdaptationSetAdd (AdaptationSet &&adapt_set) |
Period & | emptyAdaptationSetRemove (const AdaptationSet &adapt_set) |
Period & | emptyAdaptationSetRemove (const std::list< AdaptationSet >::const_iterator &) |
Period & | emptyAdaptationSetRemove (const std::list< AdaptationSet >::iterator &) |
const std::list< Label > & | groupLabels () const |
std::list< Label >::const_iterator | groupLabelsBegin () const |
std::list< Label >::const_iterator | groupLabelsEnd () const |
std::list< Label >::iterator | groupLabelsBegin () |
std::list< Label >::iterator | groupLabelsEnd () |
Period & | groupLabelAdd (const Label &label) |
Period & | groupLabelAdd (Label &&label) |
Period & | groupLabelRemove (const Label &label) |
Period & | groupLabelRemove (const std::list< Label >::const_iterator &) |
Period & | groupLabelRemove (const std::list< Label >::iterator &) |
const std::list< Preselection > & | preselections () const |
std::list< Preselection >::const_iterator | preselectionsBegin () const |
std::list< Preselection >::const_iterator | preselectionsEnd () const |
std::list< Preselection >::iterator | preselectionsBegin () |
std::list< Preselection >::iterator | preselectionsEnd () |
Period & | preselectionAdd (const Preselection &preselection) |
Period & | preselectionAdd (Preselection &&preselection) |
Period & | preselectionRemove (const Preselection &preselection) |
Period & | preselectionRemove (const std::list< Preselection >::const_iterator &) |
Period & | preselectionRemove (const std::list< Preselection >::iterator &) |
void | selectAllRepresentations () |
void | deselectAllRepresentations () |
std::unordered_set< const Representation * > | selectedRepresentations () const |
std::list< SegmentAvailability > | selectedSegmentAvailability (const time_type &query_time=std::chrono::system_clock::now()) const |
std::list< SegmentAvailability > | selectedInitializationSegments () const |
Period & | setMPD (MPD *mpd) |
const std::optional< duration_type > & | calcStart () const |
const std::optional< duration_type > & | calcDuration () const |
MPD * | getMPD () |
const MPD * | getMPD () const |
Period element class
This is the container class for Period elements from an MPD as described in ISO 23009-1:2022 Clause 5.3.2.3.
using com::bbc::libmpdpp::Period::duration_type = std::chrono::microseconds |
Time duration type used in this class.
using com::bbc::libmpdpp::Period::time_type = std::chrono::system_clock::time_point |
Date-time type used in this class.
com::bbc::libmpdpp::Period::Period | ( | ) |
com::bbc::libmpdpp::Period::Period | ( | const Period & | to_copy | ) |
com::bbc::libmpdpp::Period::Period | ( | Period && | to_move | ) |
|
virtual |
Destructor
Period & com::bbc::libmpdpp::Period::adaptationSetAdd | ( | AdaptationSet && | adapt_set | ) |
Period & com::bbc::libmpdpp::Period::adaptationSetAdd | ( | const AdaptationSet & | adapt_set | ) |
Period & com::bbc::libmpdpp::Period::adaptationSetRemove | ( | const AdaptationSet & | adapt_set | ) |
Period & com::bbc::libmpdpp::Period::adaptationSetRemove | ( | const std::list< AdaptationSet >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::adaptationSetRemove | ( | const std::list< AdaptationSet >::iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
const std::optional< duration_type > & com::bbc::libmpdpp::Period::calcDuration | ( | ) | const |
Calculate the duration of this Period
If the @duration attribute is set then the calculated duration time will be the same as @duration. If not set then Periods of the same MPD from before and after this Period are checked to see if the duration of this period can be derived from their calculated start times and calculated durations.
If the duration cannot be assertained then a std::nullopt will be returned.
const std::optional< duration_type > & com::bbc::libmpdpp::Period::calcStart | ( | ) | const |
Calculate the start time of this Period
If the @start attribute is set then the calculated start time will be the same as @start. If not set then Periods of the same MPD from before and after this Period are checked to see if the start time of this period can be derived from their calculated start times and calculated durations.
If the start time cannot be assertained then a std::nullopt will be returned.
Period & com::bbc::libmpdpp::Period::contentProtectionAdd | ( | const ContentProtection & | content_prot | ) |
Period & com::bbc::libmpdpp::Period::contentProtectionAdd | ( | ContentProtection && | content_prot | ) |
Period & com::bbc::libmpdpp::Period::contentProtectionRemove | ( | const ContentProtection & | content_prot | ) |
Period & com::bbc::libmpdpp::Period::contentProtectionRemove | ( | const std::list< ContentProtection >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::contentProtectionRemove | ( | const std::list< ContentProtection >::iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void com::bbc::libmpdpp::Period::deselectAllRepresentations | ( | ) |
Deselect all Represtations
This will remove every Representation in every child AdaptationSet from the set of selected Representations.
|
inline |
|
inline |
|
inline |
|
inline |
Period & com::bbc::libmpdpp::Period::emptyAdaptationSetAdd | ( | AdaptationSet && | adapt_set | ) |
Period & com::bbc::libmpdpp::Period::emptyAdaptationSetAdd | ( | const AdaptationSet & | adapt_set | ) |
Period & com::bbc::libmpdpp::Period::emptyAdaptationSetRemove | ( | const AdaptationSet & | adapt_set | ) |
Period & com::bbc::libmpdpp::Period::emptyAdaptationSetRemove | ( | const std::list< AdaptationSet >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::emptyAdaptationSetRemove | ( | const std::list< AdaptationSet >::iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Period & com::bbc::libmpdpp::Period::eventStreamAdd | ( | const EventStream & | event_stream | ) |
Period & com::bbc::libmpdpp::Period::eventStreamAdd | ( | EventStream && | event_stream | ) |
Period & com::bbc::libmpdpp::Period::eventStreamRemove | ( | const EventStream & | event_stream | ) |
Period & com::bbc::libmpdpp::Period::eventStreamRemove | ( | const std::list< EventStream >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::eventStreamRemove | ( | const std::list< EventStream >::iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
std::list< BaseURL > com::bbc::libmpdpp::Period::getBaseURLs | ( | ) | const |
Get the combined BaseURLs
This will get the list of BaseURL elements, which are children of the Period, with their URLs resolved using the MPD::getBaseURLs() URLs, i.e. any relative BaseURL entries will be resolved using the getMPD()->getBaseURLs() list if available.
If there are no BaseURLs set, then the return value is equivalent to getMPD()->getBaseURLs(). If the Period has not been added to an MPD then an empty list will be returned.
|
inline |
|
inline |
Period & com::bbc::libmpdpp::Period::groupLabelRemove | ( | const std::list< Label >::const_iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
bool com::bbc::libmpdpp::Period::operator== | ( | const Period & | to_compare | ) | const |
Period & com::bbc::libmpdpp::Period::preselectionAdd | ( | const Preselection & | preselection | ) |
Period & com::bbc::libmpdpp::Period::preselectionAdd | ( | Preselection && | preselection | ) |
Period & com::bbc::libmpdpp::Period::preselectionRemove | ( | const Preselection & | preselection | ) |
Period & com::bbc::libmpdpp::Period::preselectionRemove | ( | const std::list< Preselection >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::preselectionRemove | ( | const std::list< Preselection >::iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void com::bbc::libmpdpp::Period::selectAllRepresentations | ( | ) |
Select all Representations
This will mark every Representation in every child AdaptationSet as selected.
std::list< SegmentAvailability > com::bbc::libmpdpp::Period::selectedInitializationSegments | ( | ) | const |
Get the initialization segment availability
Gets the list of the initialization segment URLs from the selected Representations and their availability for the Period.
std::unordered_set< const Representation * > com::bbc::libmpdpp::Period::selectedRepresentations | ( | ) | const |
Get the list of all selected Representation objects
std::list< SegmentAvailability > com::bbc::libmpdpp::Period::selectedSegmentAvailability | ( | const time_type & | query_time = std::chrono::system_clock::now() | ) | const |
Get the media segment availability
Gets the list of the segment URLs and their availability for the next segments available on or after query_time
. If an empty list is returned then the query_time
represents a time after the last segment is available in this Period.
query_time | The time to perform the query for, for live MPDs this is the wallclock time, for on-demand MPDs this is the stream offset assuming the stream starts from the epoch. |
Period & com::bbc::libmpdpp::Period::serviceDescriptionAdd | ( | const ServiceDescription & | service_desc | ) |
Period & com::bbc::libmpdpp::Period::serviceDescriptionAdd | ( | ServiceDescription && | service_desc | ) |
Period & com::bbc::libmpdpp::Period::serviceDescriptionRemove | ( | const ServiceDescription & | service_desc | ) |
Period & com::bbc::libmpdpp::Period::serviceDescriptionRemove | ( | const std::list< ServiceDescription >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::serviceDescriptionRemove | ( | const std::list< ServiceDescription >::iterator & | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Period & com::bbc::libmpdpp::Period::supplementalPropertyAdd | ( | const Descriptor & | supp_prop | ) |
Period & com::bbc::libmpdpp::Period::supplementalPropertyAdd | ( | Descriptor && | supp_prop | ) |
Period & com::bbc::libmpdpp::Period::supplementalPropertyRemove | ( | const Descriptor & | supp_prop | ) |
Period & com::bbc::libmpdpp::Period::supplementalPropertyRemove | ( | const std::list< Descriptor >::const_iterator & | ) |
Period & com::bbc::libmpdpp::Period::supplementalPropertyRemove | ( | const std::list< Descriptor >::iterator & | ) |