Shaka Packager SDK
|
A base class that is used to convert H.26x byte streams to NAL unit streams. More...
#include <h26x_byte_to_unit_stream_converter.h>
Public Member Functions | |
H26xByteToUnitStreamConverter (Nalu::CodecType type) | |
H26xByteToUnitStreamConverter (Nalu::CodecType type, H26xStreamFormat stream_format) | |
bool | ConvertByteStreamToNalUnitStream (const uint8_t *input_frame, size_t input_frame_size, std::vector< uint8_t > *output_frame) |
virtual bool | GetDecoderConfigurationRecord (std::vector< uint8_t > *decoder_config) const =0 |
H26xStreamFormat | stream_format () const |
Static Public Attributes | |
static constexpr size_t | kUnitStreamNaluLengthSize = 4 |
Protected Member Functions | |
bool | strip_parameter_set_nalus () const |
void | WarnIfNotMatch (int nalu_type, const uint8_t *nalu_ptr, size_t nalu_size, const std::vector< uint8_t > &vector) |
A base class that is used to convert H.26x byte streams to NAL unit streams.
Definition at line 23 of file h26x_byte_to_unit_stream_converter.h.
|
explicit |
Create a byte to unit stream converter with specified codec type. The setting of KeepParameterSetNalus is defined by a gflag.
Definition at line 40 of file h26x_byte_to_unit_stream_converter.cc.
shaka::media::H26xByteToUnitStreamConverter::H26xByteToUnitStreamConverter | ( | Nalu::CodecType | type, |
H26xStreamFormat | stream_format | ||
) |
Create a byte to unit stream converter with specified codec type and desired output stream format (whether to include parameter set nal units).
Definition at line 48 of file h26x_byte_to_unit_stream_converter.cc.
bool shaka::media::H26xByteToUnitStreamConverter::ConvertByteStreamToNalUnitStream | ( | const uint8_t * | input_frame, |
size_t | input_frame_size, | ||
std::vector< uint8_t > * | output_frame | ||
) |
Converts a whole byte stream encoded video frame to NAL unit stream format.
input_frame | is a buffer containing a whole H.26x frame in byte stream format. |
input_frame_size | is the size of the H.26x frame, in bytes. |
output_frame | is a pointer to a vector which will receive the converted frame. |
Definition at line 55 of file h26x_byte_to_unit_stream_converter.cc.
|
pure virtual |
Creates either an AVCDecoderConfigurationRecord or a HEVCDecoderConfigurationRecord from the units extracted from the byte stream.
decoder_config | is a pointer to a vector, which on successful return will contain the computed record. |
Implemented in shaka::media::H265ByteToUnitStreamConverter, and shaka::media::H264ByteToUnitStreamConverter.