Shaka Packager SDK
Public Member Functions | Protected Member Functions | List of all members
shaka::media::webm::Segmenter Class Referenceabstract
Inheritance diagram for shaka::media::webm::Segmenter:
shaka::media::webm::MultiSegmentSegmenter shaka::media::webm::SingleSegmentSegmenter shaka::media::webm::TwoPassSingleSegmentSegmenter

Public Member Functions

 Segmenter (const MuxerOptions &options)
 
Status Initialize (const StreamInfo &info, ProgressListener *progress_listener, MuxerListener *muxer_listener)
 
Status Finalize ()
 
Status AddSample (const MediaSample &sample)
 
virtual Status FinalizeSegment (int64_t start_timestamp, int64_t duration_timestamp, bool is_subsegment, int64_t segment_number)=0
 Finalize the (sub)segment.
 
virtual bool GetInitRangeStartAndEnd (uint64_t *start, uint64_t *end)=0
 
virtual bool GetIndexRangeStartAndEnd (uint64_t *start, uint64_t *end)=0
 
virtual std::vector< RangeGetSegmentRanges ()=0
 
float GetDurationInSeconds () const
 

Protected Member Functions

int64_t FromBmffTimestamp (int64_t bmff_timestamp)
 Converts the given time in ISO BMFF timestamp to WebM timecode.
 
int64_t FromWebMTimecode (int64_t webm_timecode)
 Converts the given time in WebM timecode to ISO BMFF timestamp.
 
Status WriteSegmentHeader (uint64_t file_size, MkvWriter *writer)
 Writes the Segment header to writer.
 
Status SetCluster (int64_t start_webm_timecode, uint64_t position, MkvWriter *writer)
 Creates a Cluster object with the given parameters.
 
void UpdateProgress (uint64_t progress)
 Update segmentation progress using ProgressListener.
 
void set_progress_target (uint64_t target)
 
const MuxerOptionsoptions () const
 
mkvmuxer::Cluster * cluster ()
 
mkvmuxer::Cues * cues ()
 
MuxerListenermuxer_listener ()
 
SeekHeadseek_head ()
 
int track_id () const
 
uint64_t segment_payload_pos () const
 
int64_t duration () const
 
virtual Status DoInitialize ()=0
 
virtual Status DoFinalize ()=0
 

Detailed Description

Definition at line 34 of file segmenter.h.

Member Function Documentation

◆ AddSample()

Status shaka::media::webm::Segmenter::AddSample ( const MediaSample sample)

Add sample to the indicated stream.

Parameters
samplepoints to the sample to be added.
Returns
OK on success, an error status otherwise.

Definition at line 159 of file segmenter.cc.

◆ Finalize()

Status shaka::media::webm::Segmenter::Finalize ( )

Finalize the segmenter.

Returns
OK on success, an error status otherwise.

Definition at line 150 of file segmenter.cc.

◆ GetDurationInSeconds()

float shaka::media::webm::Segmenter::GetDurationInSeconds ( ) const
Returns
The total length, in seconds, of segmented media files.

Definition at line 210 of file segmenter.cc.

◆ GetIndexRangeStartAndEnd()

virtual bool shaka::media::webm::Segmenter::GetIndexRangeStartAndEnd ( uint64_t *  start,
uint64_t *  end 
)
pure virtual
Returns
true if there is an index byte range, while setting start and end; or false if index byte range does not apply.

Implemented in shaka::media::webm::SingleSegmentSegmenter, and shaka::media::webm::MultiSegmentSegmenter.

◆ GetInitRangeStartAndEnd()

virtual bool shaka::media::webm::Segmenter::GetInitRangeStartAndEnd ( uint64_t *  start,
uint64_t *  end 
)
pure virtual
Returns
true if there is an initialization range, while setting start and end; or false if initialization range does not apply.

Implemented in shaka::media::webm::SingleSegmentSegmenter, and shaka::media::webm::MultiSegmentSegmenter.

◆ Initialize()

Status shaka::media::webm::Segmenter::Initialize ( const StreamInfo info,
ProgressListener progress_listener,
MuxerListener muxer_listener 
)

Initialize the segmenter. Calling other public methods of this class without this method returning Status::OK results in an undefined behavior.

Parameters
infoThe stream info for the stream being segmented.
muxer_listenerreceives muxer events. Can be NULL.
Returns
OK on success, an error status otherwise.

Definition at line 76 of file segmenter.cc.


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