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)
 
base::Optional< xml::XmlNodeGetXml (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.
 
const std::map< std::string, std::list< AdaptationSet * > > & trickplay_cache () const
 

Protected Member Functions

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

Friends

class MpdBuilder
 
class PeriodTest
 

Detailed Description

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

Definition at line 26 of file period.h.

Constructor & Destructor Documentation

◆ Period()

shaka::Period::Period ( uint32_t  period_id,
double  start_time_in_seconds,
const MpdOptions mpd_options,
uint32_t *  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 65 of file period.cc.

Member Function Documentation

◆ duration_seconds()

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

Definition at line 58 of file period.h.

◆ GetAdaptationSets()

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

Definition at line 160 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 74 of file period.cc.

◆ GetXml()

base::Optional< xml::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 123 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 55 of file period.h.

◆ trickplay_cache()

const std::map<std::string, std::list<AdaptationSet*> >& shaka::Period::trickplay_cache ( ) const
inline
Returns
trickplay_cache.

Definition at line 66 of file period.h.


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