Shaka Packager SDK
|
#include <fragmenter.h>
Public Member Functions | |
Fragmenter (std::shared_ptr< const StreamInfo > info, TrackFragment *traf, int64_t edit_list_offset) | |
Status | AddSample (const MediaSample &sample) |
Status | InitializeFragment (int64_t first_sample_dts) |
Status | FinalizeFragment () |
Finalize and optimize the fragment. | |
void | GenerateSegmentReference (SegmentReference *reference) const |
Fill reference with current fragment information. | |
void | ClearFragmentFinalized () |
int64_t | fragment_duration () const |
int64_t | first_sap_time () const |
int64_t | earliest_presentation_time () const |
bool | fragment_initialized () const |
bool | fragment_finalized () const |
BufferWriter * | data () |
const std::vector< KeyFrameInfo > & | key_frame_infos () const |
Protected Member Functions | |
TrackFragment * | traf () |
template<typename T > | |
bool | OptimizeSampleEntries (std::vector< T > *entries, T *default_value) |
Fragmenter is responsible for the generation of MP4 fragments, i.e. 'traf' box and corresponding 'mdat' box.
Definition at line 34 of file fragmenter.h.
shaka::media::mp4::Fragmenter::Fragmenter | ( | std::shared_ptr< const StreamInfo > | info, |
TrackFragment * | traf, | ||
int64_t | edit_list_offset | ||
) |
info | contains stream information. |
traf | points to a TrackFragment box. |
edit_list_offset | is the edit list offset that is encoded in Edit List. It should be 0 if there is no EditList. |
Definition at line 52 of file fragmenter.cc.
Status shaka::media::mp4::Fragmenter::AddSample | ( | const MediaSample & | sample | ) |
Add a sample to the fragmenter.
sample | points to the sample to be added. |
Definition at line 67 of file fragmenter.cc.
Status shaka::media::mp4::Fragmenter::InitializeFragment | ( | int64_t | first_sample_dts | ) |
Initialize the fragment with default data.
first_sample_dts | specifies the decoding timestamp for the first sample for this fragment. |
Definition at line 131 of file fragmenter.cc.
|
protected |
Optimize sample entries table. If all values in entries are identical, then entries is cleared and the value is assigned to default_value; otherwise it is a NOP. Return true if the table is optimized.
Definition at line 108 of file fragmenter.h.