Shaka Packager SDK
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
shaka::Period Class Reference

#include <period.h>

Inheritance diagram for shaka::Period:
shaka::MockPeriod

Public Member Functions

virtual AdaptationSetGetOrCreateAdaptationSet (const MediaInfo &media_info, bool content_protection_in_adaptation_set)
 
xml::scoped_xml_ptr< xmlNode > GetXml (bool output_period_duration)
 
const std::list< AdaptationSet * > GetAdaptationSets () const
 
double start_time_in_seconds () const
 
double duration_seconds () const
 
void set_duration_seconds (double duration_seconds)
 Set period duration.
 

Protected Member Functions

 Period (uint32_t period_id, double start_time_in_seconds, const MpdOptions &mpd_options, base::AtomicSequenceNumber *representation_counter)
 

Friends

class MpdBuilder
 
class PeriodTest
 

Detailed Description

Period class maps to <Period> element and provides methods to add AdaptationSets.

Definition at line 31 of file period.h.

Constructor & Destructor Documentation

◆ Period()

shaka::Period::Period ( uint32_t  period_id,
double  start_time_in_seconds,
const MpdOptions mpd_options,
base::AtomicSequenceNumber *  representation_counter 
)
protected
Parameters
period_idis an ID number for this Period.
start_time_in_secondsis the start time for this Period.
mpd_optionsis the options for this MPD.
representation_counteris a counter for assigning ID numbers to Representation. It can not be NULL.

Definition at line 37 of file period.cc.

Member Function Documentation

◆ duration_seconds()

double shaka::Period::duration_seconds ( ) const
inline
Returns
period duration in seconds.

Definition at line 63 of file period.h.

◆ GetAdaptationSets()

const std::list< AdaptationSet * > shaka::Period::GetAdaptationSets ( ) const
Returns
The list of AdaptationSets in this Period.

Definition at line 131 of file period.cc.

◆ GetOrCreateAdaptationSet()

AdaptationSet * shaka::Period::GetOrCreateAdaptationSet ( const MediaInfo &  media_info,
bool  content_protection_in_adaptation_set 
)
virtual

Check the existing AdaptationSets, if there is one matching the provided media_info, return it; otherwise a new AdaptationSet is created and returned.

Parameters
media_infocontains media information, which is used to match AdaptationSets.
content_protection_in_adaptation_setdetermines if the ContentProtection is placed in AdaptationSet or Representation element. This affects how MediaInfo in AdaptationSets are matched.
Returns
the AdaptationSet matching media_info if found; otherwise return a new AdaptationSet.

Definition at line 46 of file period.cc.

◆ GetXml()

xml::scoped_xml_ptr< xmlNode > shaka::Period::GetXml ( bool  output_period_duration)

Generates <Period> xml element with its child AdaptationSet elements.

Returns
On success returns a non-NULL scoped_xml_ptr. Otherwise returns a NULL scoped_xml_ptr.

Definition at line 99 of file period.cc.

◆ start_time_in_seconds()

double shaka::Period::start_time_in_seconds ( ) const
inline
Returns
The start time of this Period.

Definition at line 60 of file period.h.


The documentation for this class was generated from the following files: