Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
CBitstreamConverter Class Reference

#include <BitstreamConverter.h>

Classes

struct  omx_bitstream_ctx
 

Public Member Functions

 CBitstreamConverter ()
 
 ~CBitstreamConverter ()
 
bool Open (enum AVCodecID codec, uint8_t *in_extradata, int in_extrasize, bool to_annexb)
 
void Close (void)
 
bool NeedConvert (void) const
 
bool Convert (uint8_t *pData, int iSize)
 
uint8_tGetConvertBuffer (void) const
 
int GetConvertSize () const
 
uint8_tGetExtraData ()
 
const uint8_tGetExtraData () const
 
int GetExtraSize () const
 
void ResetStartDecode (void)
 
bool CanStartDecode () const
 
void SetConvertDovi (bool value)
 
void SetRemoveDovi (bool value)
 
void SetRemoveHdr10Plus (bool value)
 

Static Public Member Functions

static bool mpeg2_sequence_header (const uint8_t *data, const uint32_t size, mpeg2_sequence *sequence)
 

Protected Types

typedef struct CBitstreamConverter::omx_bitstream_ctx omx_bitstream_ctx
 

Protected Member Functions

int isom_write_avcc (AVIOContext *pb, const uint8_t *data, int len)
 
bool IsIDR (uint8_t unit_type)
 
bool IsSlice (uint8_t unit_type)
 
bool BitstreamConvertInitAVC (void *in_extradata, int in_extrasize)
 
bool BitstreamConvertInitHEVC (void *in_extradata, int in_extrasize)
 
bool BitstreamConvert (uint8_t *pData, int iSize, uint8_t **poutbuf, int *poutbuf_size)
 

Static Protected Member Functions

static int avc_parse_nal_units (AVIOContext *pb, const uint8_t *buf_in, int size)
 
static int avc_parse_nal_units_buf (const uint8_t *buf_in, uint8_t **buf, int *size)
 
static void BitstreamAllocAndCopy (uint8_t **poutbuf, int *poutbuf_size, const uint8_t *sps_pps, uint32_t sps_pps_size, const uint8_t *in, uint32_t in_size, uint8_t nal_type)
 

Protected Attributes

uint8_tm_convertBuffer
 
int m_convertSize
 
uint8_tm_inputBuffer
 
int m_inputSize
 
uint32_t m_sps_pps_size
 
omx_bitstream_ctx m_sps_pps_context
 
bool m_convert_bitstream
 
bool m_to_annexb
 
FFmpegExtraData m_extraData
 
bool m_convert_3byteTo4byteNALSize
 
bool m_convert_bytestream
 
AVCodecID m_codec
 
bool m_start_decode
 
bool m_convert_dovi
 
bool m_removeDovi
 
bool m_removeHdr10Plus
 

Member Typedef Documentation

◆ omx_bitstream_ctx

struct CBitstreamConverter::omx_bitstream_ctx CBitstreamConverter::omx_bitstream_ctx
protected

Constructor & Destructor Documentation

◆ CBitstreamConverter()

CBitstreamConverter::CBitstreamConverter ( )

◆ ~CBitstreamConverter()

CBitstreamConverter::~CBitstreamConverter ( )

Member Function Documentation

◆ avc_parse_nal_units()

int CBitstreamConverter::avc_parse_nal_units ( AVIOContext * pb,
const uint8_t * buf_in,
int size )
staticprotected

◆ avc_parse_nal_units_buf()

int CBitstreamConverter::avc_parse_nal_units_buf ( const uint8_t * buf_in,
uint8_t ** buf,
int * size )
staticprotected

◆ BitstreamAllocAndCopy()

void CBitstreamConverter::BitstreamAllocAndCopy ( uint8_t ** poutbuf,
int * poutbuf_size,
const uint8_t * sps_pps,
uint32_t sps_pps_size,
const uint8_t * in,
uint32_t in_size,
uint8_t nal_type )
staticprotected

◆ BitstreamConvert()

bool CBitstreamConverter::BitstreamConvert ( uint8_t * pData,
int iSize,
uint8_t ** poutbuf,
int * poutbuf_size )
protected

◆ BitstreamConvertInitAVC()

bool CBitstreamConverter::BitstreamConvertInitAVC ( void * in_extradata,
int in_extrasize )
protected

◆ BitstreamConvertInitHEVC()

bool CBitstreamConverter::BitstreamConvertInitHEVC ( void * in_extradata,
int in_extrasize )
protected

◆ CanStartDecode()

bool CBitstreamConverter::CanStartDecode ( ) const

◆ Close()

void CBitstreamConverter::Close ( void )

◆ Convert()

bool CBitstreamConverter::Convert ( uint8_t * pData,
int iSize )

◆ GetConvertBuffer()

uint8_t * CBitstreamConverter::GetConvertBuffer ( void ) const

◆ GetConvertSize()

int CBitstreamConverter::GetConvertSize ( ) const

◆ GetExtraData() [1/2]

uint8_t * CBitstreamConverter::GetExtraData ( )

◆ GetExtraData() [2/2]

const uint8_t * CBitstreamConverter::GetExtraData ( ) const

◆ GetExtraSize()

int CBitstreamConverter::GetExtraSize ( ) const

◆ IsIDR()

bool CBitstreamConverter::IsIDR ( uint8_t unit_type)
protected

◆ isom_write_avcc()

int CBitstreamConverter::isom_write_avcc ( AVIOContext * pb,
const uint8_t * data,
int len )
protected

◆ IsSlice()

bool CBitstreamConverter::IsSlice ( uint8_t unit_type)
protected

◆ mpeg2_sequence_header()

bool CBitstreamConverter::mpeg2_sequence_header ( const uint8_t * data,
const uint32_t size,
mpeg2_sequence * sequence )
static

◆ NeedConvert()

bool CBitstreamConverter::NeedConvert ( void ) const
inline

◆ Open()

bool CBitstreamConverter::Open ( enum AVCodecID codec,
uint8_t * in_extradata,
int in_extrasize,
bool to_annexb )

It seems the extradata is encoded as hvcC format. Temporarily, we support configurationVersion==0 until 14496-15 3rd is finalized. When finalized, configurationVersion will be 1 and we can recognize hvcC by checking if extradata[0]==1 or not.

Todo
convert annexb to bitstream format

◆ ResetStartDecode()

void CBitstreamConverter::ResetStartDecode ( void )

◆ SetConvertDovi()

void CBitstreamConverter::SetConvertDovi ( bool value)
inline

◆ SetRemoveDovi()

void CBitstreamConverter::SetRemoveDovi ( bool value)
inline

◆ SetRemoveHdr10Plus()

void CBitstreamConverter::SetRemoveHdr10Plus ( bool value)
inline

Member Data Documentation

◆ m_codec

AVCodecID CBitstreamConverter::m_codec
protected

◆ m_convert_3byteTo4byteNALSize

bool CBitstreamConverter::m_convert_3byteTo4byteNALSize
protected

◆ m_convert_bitstream

bool CBitstreamConverter::m_convert_bitstream
protected

◆ m_convert_bytestream

bool CBitstreamConverter::m_convert_bytestream
protected

◆ m_convert_dovi

bool CBitstreamConverter::m_convert_dovi
protected

◆ m_convertBuffer

uint8_t* CBitstreamConverter::m_convertBuffer
protected

◆ m_convertSize

int CBitstreamConverter::m_convertSize
protected

◆ m_extraData

FFmpegExtraData CBitstreamConverter::m_extraData
protected

◆ m_inputBuffer

uint8_t* CBitstreamConverter::m_inputBuffer
protected

◆ m_inputSize

int CBitstreamConverter::m_inputSize
protected

◆ m_removeDovi

bool CBitstreamConverter::m_removeDovi
protected

◆ m_removeHdr10Plus

bool CBitstreamConverter::m_removeHdr10Plus
protected

◆ m_sps_pps_context

omx_bitstream_ctx CBitstreamConverter::m_sps_pps_context
protected

◆ m_sps_pps_size

uint32_t CBitstreamConverter::m_sps_pps_size
protected

◆ m_start_decode

bool CBitstreamConverter::m_start_decode
protected

◆ m_to_annexb

bool CBitstreamConverter::m_to_annexb
protected

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