Shaka Packager SDK
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
shaka::media::mp4::Fragmenter Class Reference

#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
 
BufferWriterdata ()
 
const std::vector< KeyFrameInfo > & key_frame_infos () const
 

Protected Member Functions

TrackFragmenttraf ()
 
template<typename T >
bool OptimizeSampleEntries (std::vector< T > *entries, T *default_value)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ Fragmenter()

shaka::media::mp4::Fragmenter::Fragmenter ( std::shared_ptr< const StreamInfo info,
TrackFragment traf,
int64_t  edit_list_offset 
)
Parameters
infocontains stream information.
trafpoints to a TrackFragment box.
edit_list_offsetis 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.

◆ ~Fragmenter()

shaka::media::mp4::Fragmenter::~Fragmenter ( )

Definition at line 65 of file fragmenter.cc.

Member Function Documentation

◆ AddSample()

Status shaka::media::mp4::Fragmenter::AddSample ( const MediaSample sample)

Add a sample to the fragmenter.

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

Definition at line 67 of file fragmenter.cc.

◆ ClearFragmentFinalized()

void shaka::media::mp4::Fragmenter::ClearFragmentFinalized ( )
inline

Definition at line 63 of file fragmenter.h.

◆ data()

BufferWriter * shaka::media::mp4::Fragmenter::data ( )
inline

Definition at line 72 of file fragmenter.h.

◆ earliest_presentation_time()

int64_t shaka::media::mp4::Fragmenter::earliest_presentation_time ( ) const
inline

Definition at line 67 of file fragmenter.h.

◆ FinalizeFragment()

Status shaka::media::mp4::Fragmenter::FinalizeFragment ( )

Finalize and optimize the fragment.

Definition at line 161 of file fragmenter.cc.

◆ first_sap_time()

int64_t shaka::media::mp4::Fragmenter::first_sap_time ( ) const
inline

Definition at line 66 of file fragmenter.h.

◆ fragment_duration()

int64_t shaka::media::mp4::Fragmenter::fragment_duration ( ) const
inline

Definition at line 65 of file fragmenter.h.

◆ fragment_finalized()

bool shaka::media::mp4::Fragmenter::fragment_finalized ( ) const
inline

Definition at line 71 of file fragmenter.h.

◆ fragment_initialized()

bool shaka::media::mp4::Fragmenter::fragment_initialized ( ) const
inline

Definition at line 70 of file fragmenter.h.

◆ GenerateSegmentReference()

void shaka::media::mp4::Fragmenter::GenerateSegmentReference ( SegmentReference reference) const

Fill reference with current fragment information.

Definition at line 229 of file fragmenter.cc.

◆ InitializeFragment()

Status shaka::media::mp4::Fragmenter::InitializeFragment ( int64_t  first_sample_dts)

Initialize the fragment with default data.

Parameters
first_sample_dtsspecifies the decoding timestamp for the first sample for this fragment.
Returns
OK on success, an error status otherwise.

Definition at line 131 of file fragmenter.cc.

◆ key_frame_infos()

const std::vector< KeyFrameInfo > & shaka::media::mp4::Fragmenter::key_frame_infos ( ) const
inline

Definition at line 73 of file fragmenter.h.

◆ OptimizeSampleEntries()

template<typename T >
bool shaka::media::mp4::Fragmenter::OptimizeSampleEntries ( std::vector< T > *  entries,
T *  default_value 
)
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.

◆ traf()

TrackFragment * shaka::media::mp4::Fragmenter::traf ( )
inlineprotected

Definition at line 78 of file fragmenter.h.


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