#include <segmenter.h>
This class defines the Segmenter which is responsible for organizing fragments into segments/subsegments and package them into a MP4 file. Inherited by MultiSegmentSegmenter and SingleSegmentSegmenter. SingleSegmentSegmenter defines the Segmenter for DASH Video-On-Demand with a single segment for each media presentation while MultiSegmentSegmenter handles all other cases including DASH live profile.
Definition at line 45 of file segmenter.h.
◆ AddSample()
Status shaka::media::mp4::Segmenter::AddSample |
( |
size_t |
stream_id, |
|
|
const MediaSample & |
sample |
|
) |
| |
Add sample to the indicated stream.
- Parameters
-
stream_id | is the zero-based stream index. |
sample | points to the sample to be added. |
- Returns
- OK on success, an error status otherwise.
Definition at line 126 of file segmenter.cc.
◆ Finalize()
Status shaka::media::mp4::Segmenter::Finalize |
( |
| ) |
|
Finalize the segmenter.
- Returns
- OK on success, an error status otherwise.
Definition at line 110 of file segmenter.cc.
◆ FinalizeSegment()
Status shaka::media::mp4::Segmenter::FinalizeSegment |
( |
size_t |
stream_id, |
|
|
const SegmentInfo & |
segment_info |
|
) |
| |
Finalize the segment / subsegment.
- Parameters
-
stream_id | is the zero-based stream index. |
is_subsegment | indicates if it is a subsegment (fragment). |
- Returns
- OK on success, an error status otherwise.
Definition at line 154 of file segmenter.cc.
◆ GetDuration()
double shaka::media::mp4::Segmenter::GetDuration |
( |
| ) |
const |
- Returns
- The total length, in seconds, of segmented media files.
Definition at line 258 of file segmenter.cc.
◆ GetIndexRange()
virtual bool shaka::media::mp4::Segmenter::GetIndexRange |
( |
size_t * |
offset, |
|
|
size_t * |
size |
|
) |
| |
|
pure virtual |
◆ GetInitRange()
virtual bool shaka::media::mp4::Segmenter::GetInitRange |
( |
size_t * |
offset, |
|
|
size_t * |
size |
|
) |
| |
|
pure virtual |
◆ Initialize()
Initialize the segmenter. Calling other public methods of this class without this method returning Status::OK results in an undefined behavior.
- Parameters
-
streams | contains the vector of StreamInfos for initialization. |
muxer_listener | receives muxer events. Can be NULL. |
progress_listener | receives progress updates. Can be NULL. |
- Returns
- OK on success, an error status otherwise.
Definition at line 53 of file segmenter.cc.
◆ sample_duration()
int64_t shaka::media::mp4::Segmenter::sample_duration |
( |
| ) |
const |
|
inline |
- Returns
- The sample duration in the timescale of the media. Returns 0 if no samples are added yet.
Definition at line 102 of file segmenter.h.
The documentation for this class was generated from the following files: