Shaka Packager SDK
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
shaka::media::H26xByteToUnitStreamConverter Class Referenceabstract

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>

Inheritance diagram for shaka::media::H26xByteToUnitStreamConverter:
shaka::media::H264ByteToUnitStreamConverter shaka::media::H265ByteToUnitStreamConverter

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)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ H26xByteToUnitStreamConverter() [1/2]

shaka::media::H26xByteToUnitStreamConverter::H26xByteToUnitStreamConverter ( Nalu::CodecType  type)
explicit

Create a byte to unit stream converter with specified codec type. The setting of KeepParameterSetNalus is defined by a gflag.

Definition at line 35 of file h26x_byte_to_unit_stream_converter.cc.

◆ H26xByteToUnitStreamConverter() [2/2]

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 43 of file h26x_byte_to_unit_stream_converter.cc.

Member Function Documentation

◆ ConvertByteStreamToNalUnitStream()

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.

Parameters
input_frameis a buffer containing a whole H.26x frame in byte stream format.
input_frame_sizeis the size of the H.26x frame, in bytes.
output_frameis a pointer to a vector which will receive the converted frame.
Returns
true if successful, false otherwise.

Definition at line 50 of file h26x_byte_to_unit_stream_converter.cc.

◆ GetDecoderConfigurationRecord()

virtual bool shaka::media::H26xByteToUnitStreamConverter::GetDecoderConfigurationRecord ( std::vector< uint8_t > *  decoder_config) const
pure virtual

Creates either an AVCDecoderConfigurationRecord or a HEVCDecoderConfigurationRecord from the units extracted from the byte stream.

Parameters
decoder_configis a pointer to a vector, which on successful return will contain the computed record.
Returns
true if successful, or false otherwise.

Implemented in shaka::media::H265ByteToUnitStreamConverter, and shaka::media::H264ByteToUnitStreamConverter.


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