Shaka Packager SDK
Public Member Functions | List of all members
shaka::MpdNotifier Class Referenceabstract

#include <mpd_notifier.h>

Inheritance diagram for shaka::MpdNotifier:
shaka::MockMpdNotifier shaka::SimpleMpdNotifier

Public Member Functions

 MpdNotifier (const MpdOptions &mpd_options)
 
virtual bool Init ()=0
 
virtual bool NotifyNewContainer (const MediaInfo &media_info, uint32_t *container_id)=0
 
virtual bool NotifyAvailabilityTimeOffset (uint32_t container_id)
 
virtual bool NotifySampleDuration (uint32_t container_id, int32_t sample_duration)=0
 
virtual bool NotifySegmentDuration (uint32_t container_id)
 
virtual bool NotifyNewSegment (uint32_t container_id, int64_t start_time, int64_t duration, uint64_t size, int64_t segment_number)=0
 
virtual bool NotifyCompletedSegment (uint32_t container_id, int64_t duration, uint64_t size)
 
virtual bool NotifyCueEvent (uint32_t container_id, int64_t timestamp)=0
 
virtual bool NotifyEncryptionUpdate (uint32_t container_id, const std::string &drm_uuid, const std::vector< uint8_t > &new_key_id, const std::vector< uint8_t > &new_pssh)=0
 
virtual bool NotifyMediaInfoUpdate (uint32_t container_id, const MediaInfo &media_info)=0
 
virtual bool Flush ()=0
 
bool include_mspr_pro () const
 
DashProfile dash_profile () const
 
MpdType mpd_type () const
 
bool use_segment_list () const
 

Detailed Description

Interface for publish/subscribe publisher class which notifies MpdBuilder of media-related events.

Definition at line 28 of file mpd_notifier.h.

Member Function Documentation

◆ dash_profile()

DashProfile shaka::MpdNotifier::dash_profile ( ) const
inline
Returns
The dash profile for this object.

Definition at line 155 of file mpd_notifier.h.

◆ Flush()

virtual bool shaka::MpdNotifier::Flush ( )
pure virtual

Call this method to force a flush. Implementations might not write out the MPD to a stream (file, stdout, etc.) when the MPD is updated, this forces a flush.

Implemented in shaka::SimpleMpdNotifier.

◆ include_mspr_pro()

bool shaka::MpdNotifier::include_mspr_pro ( ) const
inline
Returns
include_mspr_pro option flag

Definition at line 152 of file mpd_notifier.h.

◆ Init()

virtual bool shaka::MpdNotifier::Init ( )
pure virtual

Initializes the notifier. For example, if this notifier uses a network for notification, then this would set up the connection with the remote host.

Returns
true on success, false otherwise.

Implemented in shaka::SimpleMpdNotifier.

◆ mpd_type()

MpdType shaka::MpdNotifier::mpd_type ( ) const
inline
Returns
The mpd type for this object.

Definition at line 158 of file mpd_notifier.h.

◆ NotifyAvailabilityTimeOffset()

virtual bool shaka::MpdNotifier::NotifyAvailabilityTimeOffset ( uint32_t  container_id)
inlinevirtual

Record the availailityTimeOffset for Low Latency DASH streaming.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
Returns
true on success, false otherwise. This may fail if the container specified by container_id does not exist.

Reimplemented in shaka::SimpleMpdNotifier.

Definition at line 55 of file mpd_notifier.h.

◆ NotifyCompletedSegment()

virtual bool shaka::MpdNotifier::NotifyCompletedSegment ( uint32_t  container_id,
int64_t  duration,
uint64_t  size 
)
inlinevirtual

Notifies MpdBuilder that a segment is fully written and provides the segment's complete duration and size. For Low Latency only. Note, size and duration are not known when the low latency segment is first registered with the MPD, so we must update these values after the segment is complete.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
durationis the duration of the complete segment, in units of the stream's time scale.
sizeis the complete segment size in bytes.
Returns
true on success, false otherwise.

Reimplemented in shaka::SimpleMpdNotifier.

Definition at line 109 of file mpd_notifier.h.

◆ NotifyCueEvent()

virtual bool shaka::MpdNotifier::NotifyCueEvent ( uint32_t  container_id,
int64_t  timestamp 
)
pure virtual

Notifies MpdBuilder that there is a new CueEvent.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
timestampis the timestamp of the CueEvent.
Returns
true on success, false otherwise.

Implemented in shaka::SimpleMpdNotifier.

◆ NotifyEncryptionUpdate()

virtual bool shaka::MpdNotifier::NotifyEncryptionUpdate ( uint32_t  container_id,
const std::string &  drm_uuid,
const std::vector< uint8_t > &  new_key_id,
const std::vector< uint8_t > &  new_pssh 
)
pure virtual

Notifiers MpdBuilder that there is a new PSSH for the container. This may be called whenever the key has to change, e.g. key rotation.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
drm_uuidis the UUID of the DRM for encryption.
new_key_idis the new key ID for the key.
new_psshis the new pssh box (including the header).
Attention
This might change or get removed once DASH IF IOP specification writes a clear guideline on how to handle key rotation.

Implemented in shaka::SimpleMpdNotifier.

◆ NotifyMediaInfoUpdate()

virtual bool shaka::MpdNotifier::NotifyMediaInfoUpdate ( uint32_t  container_id,
const MediaInfo &  media_info 
)
pure virtual
Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
media_infois the new MediaInfo. Note that codec related information cannot be updated.

Implemented in shaka::SimpleMpdNotifier.

◆ NotifyNewContainer()

virtual bool shaka::MpdNotifier::NotifyNewContainer ( const MediaInfo &  media_info,
uint32_t *  container_id 
)
pure virtual

Notifies the MpdBuilder that there is a new container along with media_info. Live may have multiple files (segments) but those should be notified via NotifyNewSegment().

Parameters
media_infois the MediaInfo that will be passed to MpdBuilder.
[out]container_idis the numeric ID of the container, possibly for NotifyNewSegment() and AddContentProtectionElement(). Only populated on success.
Returns
true on success, false otherwise.

Implemented in shaka::SimpleMpdNotifier.

◆ NotifyNewSegment()

virtual bool shaka::MpdNotifier::NotifyNewSegment ( uint32_t  container_id,
int64_t  start_time,
int64_t  duration,
uint64_t  size,
int64_t  segment_number 
)
pure virtual

Notifies MpdBuilder that there is a new segment ready. For live, this is usually a new segment, for VOD this is usually a subsegment, for low latency this is the first chunk.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
start_timeis the start time of the new segment, in units of the stream's time scale.
durationis the duration of the new segment, in units of the stream's time scale.
sizeis the new segment size in bytes.
segment_numberis the segment number.
Returns
true on success, false otherwise.

Implemented in shaka::SimpleMpdNotifier.

◆ NotifySampleDuration()

virtual bool shaka::MpdNotifier::NotifySampleDuration ( uint32_t  container_id,
int32_t  sample_duration 
)
pure virtual

Change the sample duration of container with container_id.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
sample_durationis the duration of a sample in timescale of the media.
Returns
true on success, false otherwise. This may fail if the container specified by container_id does not exist.

Implemented in shaka::SimpleMpdNotifier.

◆ NotifySegmentDuration()

virtual bool shaka::MpdNotifier::NotifySegmentDuration ( uint32_t  container_id)
inlinevirtual

Record the duration of a segment for Low Latency DASH streaming.

Parameters
container_idContainer ID obtained from calling NotifyNewContainer().
Returns
true on success, false otherwise. This may fail if the container specified by container_id does not exist.

Reimplemented in shaka::SimpleMpdNotifier.

Definition at line 75 of file mpd_notifier.h.

◆ use_segment_list()

bool shaka::MpdNotifier::use_segment_list ( ) const
inline
Returns
The value of dash_force_segment_list flag

Definition at line 161 of file mpd_notifier.h.


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