Shaka Packager SDK
Public Member Functions | Friends | List of all members
shaka::media::NalUnitToByteStreamConverter Class Reference

Public Member Functions

virtual bool Initialize (const uint8_t *decoder_configuration_data, size_t decoder_configuration_data_size)
 
virtual bool ConvertUnitToByteStream (const uint8_t *sample, size_t sample_size, bool is_key_frame, std::vector< uint8_t > *output)
 
virtual bool ConvertUnitToByteStreamWithSubsamples (const uint8_t *sample, size_t sample_size, bool is_key_frame, bool escape_encrypted_nalu, std::vector< uint8_t > *output, std::vector< SubsampleEntry > *subsamples)
 

Friends

class NalUnitToByteStreamConverterTest
 

Detailed Description

Definition at line 35 of file nal_unit_to_byte_stream_converter.h.

Member Function Documentation

◆ ConvertUnitToByteStream()

bool shaka::media::NalUnitToByteStreamConverter::ConvertUnitToByteStream ( const uint8_t *  sample,
size_t  sample_size,
bool  is_key_frame,
std::vector< uint8_t > *  output 
)
virtual

Converts unit stream to byte stream using the data passed to Initialize(). The method will function correctly even if sample is encrypted using SAMPLE-AES encryption.

Parameters
sampleis the sample to be converted.
sample_sizeis the size of sample.
is_key_frameindicates if the sample is a key frame.
[out]outputis set to the the converted sample, on success.
Returns
true on success, false otherwise.

Definition at line 261 of file nal_unit_to_byte_stream_converter.cc.

◆ ConvertUnitToByteStreamWithSubsamples()

bool shaka::media::NalUnitToByteStreamConverter::ConvertUnitToByteStreamWithSubsamples ( const uint8_t *  sample,
size_t  sample_size,
bool  is_key_frame,
bool  escape_encrypted_nalu,
std::vector< uint8_t > *  output,
std::vector< SubsampleEntry > *  subsamples 
)
virtual

Converts unit stream to byte stream using the data passed to Initialize() and update the corresponding subsamples of the media sample. The method will function correctly even if sample is encrypted using SAMPLE-AES encryption.

Parameters
sampleis the sample to be converted.
sample_sizeis the size of sample.
is_key_frameindicates if the sample is a key frame.
escape_encrypted_naluindicates whether an encrypted nalu should be escaped. This is needed for Apple Sample AES. Note that |subsamples| on return contains the sizes before escaping.
[out]outputis set to the the converted sample, on success.
[in,out]subsampleshas the input subsamples and output updated subsamples, on success.
Returns
true on success, false otherwise.

Definition at line 274 of file nal_unit_to_byte_stream_converter.cc.

◆ Initialize()

bool shaka::media::NalUnitToByteStreamConverter::Initialize ( const uint8_t *  decoder_configuration_data,
size_t  decoder_configuration_data_size 
)
virtual

This must be called before calling other methods.

Parameters
decoder_configuration_datais the pointer to a decoder config data.
decoder_configuration_data_sizeis the size of decoder_configuration_data.
Returns
true on success, false otherwise.

Definition at line 213 of file nal_unit_to_byte_stream_converter.cc.


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