DASH Media Packaging SDK
 All Classes Namespaces Functions Variables Typedefs
Public Member Functions | List of all members
edash_packager::Representation Class Reference

#include <mpd_builder.h>

Inheritance diagram for edash_packager::Representation:
edash_packager::MockRepresentation

Public Member Functions

bool Init ()
 
virtual void AddContentProtectionElement (const ContentProtectionElement &element)
 
virtual void UpdateContentProtectionPssh (const std::string &drm_uuid, const std::string &pssh)
 
class AdaptationSet
 
virtual void AddNewSegment (uint64_t start_time, uint64_t duration, uint64_t size)
 
virtual void SetSampleDuration (uint32_t sample_duration)
 
xml::ScopedXmlPtr< xmlNode >::type GetXml ()
 
uint32_t id () const
 
 Representation (const MediaInfo &media_info, const MpdOptions &mpd_options, uint32_t representation_id, scoped_ptr< RepresentationStateChangeListener > state_change_listener)
 

Detailed Description

Representation class contains references to a single media stream, as well as optional ContentProtection elements for that stream.

Definition at line 431 of file mpd_builder.h.

Constructor & Destructor Documentation

edash_packager::Representation::Representation ( const MediaInfo &  media_info,
const MpdOptions mpd_options,
uint32_t  representation_id,
scoped_ptr< RepresentationStateChangeListener state_change_listener 
)
protected
Parameters
media_infois a MediaInfo containing information on the media. media_info.bandwidth is required for 'static' profile. If media_info.bandwidth is not present in 'dynamic' profile, this tries to estimate it using the info passed to AddNewSegment().
mpd_optionsis options for the entire MPD.
representation_idis the numeric ID for the <Representation>.
state_change_listeneris an event handler for state changes to the representation. If null, no event handler registered.

Definition at line 986 of file mpd_builder.cc.

Member Function Documentation

void edash_packager::Representation::AddContentProtectionElement ( const ContentProtectionElement element)
virtual

Add a ContenProtection element to the representation. Representation does not add <ContentProtection> elements automatically to itself even if media_info passed to AdaptationSet::AddRepresentation() has media_info.protected_content populated. This is because some MPDs should have the elements at AdaptationSet level and some at Representation level.

Parameters
elementcontains the ContentProtection element contents. If element has {value, schemeIdUri} set and has {“value”, “schemeIdUri”} as key for additional_attributes, then the former is used.

Definition at line 1038 of file mpd_builder.cc.

void edash_packager::Representation::AddNewSegment ( uint64_t  start_time,
uint64_t  duration,
uint64_t  size 
)
virtual

Add a media (sub)segment to the representation. AdaptationSetsubSegmentAlignment,segmentAlignment} cannot be set if this is not called for all Representations.

Parameters
start_timeis the start time for the (sub)segment, in units of the stream's time scale.
durationis the duration of the segment, in units of the stream's time scale.
sizeof the segment in bytes.

Definition at line 1052 of file mpd_builder.cc.

xml::ScopedXmlPtr< xmlNode >::type edash_packager::Representation::GetXml ( )
Returns
Copy of <Representation>.

Definition at line 1095 of file mpd_builder.cc.

uint32_t edash_packager::Representation::id ( ) const
inline
Returns
ID number for <Representation>.

Definition at line 490 of file mpd_builder.h.

bool edash_packager::Representation::Init ( )

Tries to initialize the instance. If this does not succeed, the instance should not be used.

Returns
true on success, false otherwise.

Definition at line 1000 of file mpd_builder.cc.

void edash_packager::Representation::SetSampleDuration ( uint32_t  sample_duration)
virtual

Set the sample duration of this Representation. Sample duration is not available right away especially for live. This allows setting the sample duration after the Representation has been initialized.

Parameters
sample_durationis the duration of a sample.

Definition at line 1077 of file mpd_builder.cc.

void edash_packager::Representation::UpdateContentProtectionPssh ( const std::string &  drm_uuid,
const std::string &  pssh 
)
virtual

Update the 'cenc:pssh' element for drm_uuid ContentProtection element. If the element does not exist, this will add one.

Parameters
drm_uuidis the UUID of the DRM for encryption.
psshis the content of <cenc:pssh> element. Note that DASH IF IOP mentions that this should be base64 encoded string of the whole pssh box.
Attention
This might get removed once DASH IF IOP specification makes a a clear guideline on how to handle key rotation. Also to get this working with shaka-player, this method DOES NOT update the PSSH element. Instead, it removes the element regardless of the content of pssh.

Definition at line 1045 of file mpd_builder.cc.


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