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

#include <DVDVideoCodecAndroidMediaCodec.h>

Inheritance diagram for CDVDVideoCodecAndroidMediaCodec:
CDVDVideoCodec

Public Member Functions

 CDVDVideoCodecAndroidMediaCodec (CProcessInfo &processInfo, bool surface_render=false)
 
 ~CDVDVideoCodecAndroidMediaCodec () override
 
bool Open (CDVDStreamInfo &hints, CDVDCodecOptions &options) override
 
bool AddData (const DemuxPacket &packet) override
 
void Reset () override
 
bool Reconfigure (CDVDStreamInfo &hints) override
 
VCReturn GetPicture (VideoPicture *pVideoPicture) override
 
const char * GetName () override
 
void SetCodecControl (int flags) override
 
unsigned GetAllowedReferences () override
 
void surfaceChanged (CJNISurfaceHolder holder, int format, int width, int height) override
 
void surfaceCreated (CJNISurfaceHolder holder) override
 
void surfaceDestroyed (CJNISurfaceHolder holder) override
 
- Public Member Functions inherited from CDVDVideoCodec
 CDVDVideoCodec (CProcessInfo &processInfo)
 
virtual ~CDVDVideoCodec ()=default
 
virtual void SetSpeed (int iSpeed)
 
virtual unsigned GetConvergeCount ()
 
virtual bool GetCodecStats (double &pts, int &droppedFrames, int &skippedPics)
 
virtual void Reopen ()
 

Static Public Member Functions

static std::unique_ptr< CDVDVideoCodecCreate (CProcessInfo &processInfo)
 
static bool Register ()
 

Protected Member Functions

void Dispose ()
 
void FlushInternal (void)
 
void SignalEndOfStream ()
 
void InjectExtraData (CJNIMediaFormat &mediaformat)
 
std::vector< uint8_tGetHDRStaticMetadata ()
 
bool ConfigureMediaCodec (void)
 
int GetOutputPicture (void)
 
void ConfigureOutputFormat (CJNIMediaFormat &mediaformat)
 
void UpdateFpsDuration ()
 
void InitSurfaceTexture (void)
 
void ReleaseSurfaceTexture (void)
 

Static Protected Member Functions

static void CallbackInitSurfaceTexture (void *)
 

Protected Attributes

CDVDStreamInfo m_hints
 
std::string m_mime
 
std::string m_codecname
 
std::string m_formatname
 
bool m_opened = false
 
bool m_needSecureDecoder = false
 
int m_codecControlFlags
 
int m_state
 
std::shared_ptr< jni::CJNIXBMCVideoViewm_jnivideoview
 
CJNISurface m_jnivideosurface
 
unsigned int m_textureId = 0
 
std::shared_ptr< CJNIMediaCodec > m_codec
 
CJNIMediaCrypto * m_crypto = nullptr
 
std::shared_ptr< CJNISurfaceTexture > m_surfaceTexture
 
std::shared_ptr< CDVDMediaCodecOnFrameAvailablem_frameAvailable
 
amc_demux m_demux_pkt
 
std::shared_ptr< CMediaCodecVideoBufferPoolm_videoBufferPool
 
uint32_t m_OutputDuration = 0
 
uint32_t m_fpsDuration = 0
 
int64_t m_lastPTS = -1
 
int64_t m_invalidPTSValue = 0
 
double m_dtsShift = DVD_NOPTS_VALUE
 
std::unique_ptr< CBitstreamConverterm_bitstream
 
VideoPicture m_videobuffer
 
int m_indexInputBuffer
 
bool m_render_surface
 
mpeg2_sequencem_mpeg2_sequence = nullptr
 
int m_src_offset [4]
 
int m_src_stride [4]
 
bool m_useDTSforPTS = false
 
- Protected Attributes inherited from CDVDVideoCodec
CProcessInfom_processInfo
 

Static Protected Attributes

static std::atomic< boolm_InstanceGuard
 

Additional Inherited Members

- Public Types inherited from CDVDVideoCodec
enum  VCReturn {
  VC_NONE = 0 , VC_ERROR , VC_FATAL , VC_BUFFER ,
  VC_PICTURE , VC_FLUSHED , VC_NOBUFFER , VC_REOPEN ,
  VC_EOF
}
 

Constructor & Destructor Documentation

◆ CDVDVideoCodecAndroidMediaCodec()

CDVDVideoCodecAndroidMediaCodec::CDVDVideoCodecAndroidMediaCodec ( CProcessInfo & processInfo,
bool surface_render = false )

◆ ~CDVDVideoCodecAndroidMediaCodec()

CDVDVideoCodecAndroidMediaCodec::~CDVDVideoCodecAndroidMediaCodec ( )
override

Member Function Documentation

◆ AddData()

bool CDVDVideoCodecAndroidMediaCodec::AddData ( const DemuxPacket & packet)
overridevirtual

add data, decoder has to consume the entire packet returns true if the packet was consumed or if resubmitting it is useless

Implements CDVDVideoCodec.

◆ CallbackInitSurfaceTexture()

void CDVDVideoCodecAndroidMediaCodec::CallbackInitSurfaceTexture ( void * userdata)
staticprotected

◆ ConfigureMediaCodec()

bool CDVDVideoCodecAndroidMediaCodec::ConfigureMediaCodec ( void )
protected

◆ ConfigureOutputFormat()

void CDVDVideoCodecAndroidMediaCodec::ConfigureOutputFormat ( CJNIMediaFormat & mediaformat)
protected

◆ Create()

std::unique_ptr< CDVDVideoCodec > CDVDVideoCodecAndroidMediaCodec::Create ( CProcessInfo & processInfo)
static

◆ Dispose()

void CDVDVideoCodecAndroidMediaCodec::Dispose ( )
protected

◆ FlushInternal()

void CDVDVideoCodecAndroidMediaCodec::FlushInternal ( void )
protected

◆ GetAllowedReferences()

unsigned CDVDVideoCodecAndroidMediaCodec::GetAllowedReferences ( )
overridevirtual

Number of references to old pictures that are allowed to be retained when calling decode on the next demux packet

Reimplemented from CDVDVideoCodec.

◆ GetHDRStaticMetadata()

std::vector< uint8_t > CDVDVideoCodecAndroidMediaCodec::GetHDRStaticMetadata ( )
protected

◆ GetName()

const char * CDVDVideoCodecAndroidMediaCodec::GetName ( )
inlineoverridevirtual

should return codecs name

Implements CDVDVideoCodec.

◆ GetOutputPicture()

int CDVDVideoCodecAndroidMediaCodec::GetOutputPicture ( void )
protected

◆ GetPicture()

CDVDVideoCodec::VCReturn CDVDVideoCodecAndroidMediaCodec::GetPicture ( VideoPicture * pVideoPicture)
overridevirtual

GetPicture controls decoding. Player calls it on every cycle it can signal a picture, request a buffer, or return none, if nothing applies the data is valid until the next GetPicture return VC_PICTURE

Implements CDVDVideoCodec.

◆ InitSurfaceTexture()

void CDVDVideoCodecAndroidMediaCodec::InitSurfaceTexture ( void )
protected

◆ InjectExtraData()

void CDVDVideoCodecAndroidMediaCodec::InjectExtraData ( CJNIMediaFormat & mediaformat)
protected

◆ Open()

bool CDVDVideoCodecAndroidMediaCodec::Open ( CDVDStreamInfo & hints,
CDVDCodecOptions & options )
overridevirtual

Open the decoder, returns true on success Decoders not capable of running multiple instances should return false in case there is already a instance open

Implements CDVDVideoCodec.

◆ Reconfigure()

bool CDVDVideoCodecAndroidMediaCodec::Reconfigure ( CDVDStreamInfo & hints)
overridevirtual

Reconfigure the decoder, returns true on success Decoders not capable of running multiple instances may be capable of reconfiguring the running instance. If Reconfigure returns false, player will close / open the decoder

Reimplemented from CDVDVideoCodec.

◆ Register()

bool CDVDVideoCodecAndroidMediaCodec::Register ( )
static

◆ ReleaseSurfaceTexture()

void CDVDVideoCodecAndroidMediaCodec::ReleaseSurfaceTexture ( void )
protected

◆ Reset()

void CDVDVideoCodecAndroidMediaCodec::Reset ( )
overridevirtual

Reset the decoder. Should be the same as calling Dispose and Open after each other

Implements CDVDVideoCodec.

◆ SetCodecControl()

void CDVDVideoCodecAndroidMediaCodec::SetCodecControl ( int flags)
overridevirtual

Codec can be informed by player with the following flags:

DVD_CODEC_CTRL_NO_POSTPROC : if speed is not normal the codec can switch off postprocessing and de-interlacing

DVD_CODEC_CTRL_HURRY : codecs may do postprocessing and de-interlacing. If video buffers in RenderManager are about to run dry, this is signaled to codec. Codec can wait for post-proc to be finished instead of returning empty and getting another packet.

DVD_CODEC_CTRL_DRAIN : instruct decoder to deliver last pictures without requesting new packets

DVD_CODEC_CTRL_DROP : this packet is going to be dropped. decoder is free to use it for decoding

Reimplemented from CDVDVideoCodec.

◆ SignalEndOfStream()

void CDVDVideoCodecAndroidMediaCodec::SignalEndOfStream ( )
protected

◆ surfaceChanged()

void CDVDVideoCodecAndroidMediaCodec::surfaceChanged ( CJNISurfaceHolder holder,
int format,
int width,
int height )
override

◆ surfaceCreated()

void CDVDVideoCodecAndroidMediaCodec::surfaceCreated ( CJNISurfaceHolder holder)
override

◆ surfaceDestroyed()

void CDVDVideoCodecAndroidMediaCodec::surfaceDestroyed ( CJNISurfaceHolder holder)
override

◆ UpdateFpsDuration()

void CDVDVideoCodecAndroidMediaCodec::UpdateFpsDuration ( )
protected

Member Data Documentation

◆ m_bitstream

std::unique_ptr<CBitstreamConverter> CDVDVideoCodecAndroidMediaCodec::m_bitstream
protected

◆ m_codec

std::shared_ptr<CJNIMediaCodec> CDVDVideoCodecAndroidMediaCodec::m_codec
protected

◆ m_codecControlFlags

int CDVDVideoCodecAndroidMediaCodec::m_codecControlFlags
protected

◆ m_codecname

std::string CDVDVideoCodecAndroidMediaCodec::m_codecname
protected

◆ m_crypto

CJNIMediaCrypto* CDVDVideoCodecAndroidMediaCodec::m_crypto = nullptr
protected

◆ m_demux_pkt

amc_demux CDVDVideoCodecAndroidMediaCodec::m_demux_pkt
protected

◆ m_dtsShift

double CDVDVideoCodecAndroidMediaCodec::m_dtsShift = DVD_NOPTS_VALUE
protected

◆ m_formatname

std::string CDVDVideoCodecAndroidMediaCodec::m_formatname
protected

◆ m_fpsDuration

uint32_t CDVDVideoCodecAndroidMediaCodec::m_fpsDuration = 0
protected

◆ m_frameAvailable

std::shared_ptr<CDVDMediaCodecOnFrameAvailable> CDVDVideoCodecAndroidMediaCodec::m_frameAvailable
protected

◆ m_hints

CDVDStreamInfo CDVDVideoCodecAndroidMediaCodec::m_hints
protected

◆ m_indexInputBuffer

int CDVDVideoCodecAndroidMediaCodec::m_indexInputBuffer
protected

◆ m_InstanceGuard

std::atomic< bool > CDVDVideoCodecAndroidMediaCodec::m_InstanceGuard
staticprotected

◆ m_invalidPTSValue

int64_t CDVDVideoCodecAndroidMediaCodec::m_invalidPTSValue = 0
protected

◆ m_jnivideosurface

CJNISurface CDVDVideoCodecAndroidMediaCodec::m_jnivideosurface
protected

◆ m_jnivideoview

std::shared_ptr<jni::CJNIXBMCVideoView> CDVDVideoCodecAndroidMediaCodec::m_jnivideoview
protected

◆ m_lastPTS

int64_t CDVDVideoCodecAndroidMediaCodec::m_lastPTS = -1
protected

◆ m_mime

std::string CDVDVideoCodecAndroidMediaCodec::m_mime
protected

◆ m_mpeg2_sequence

mpeg2_sequence* CDVDVideoCodecAndroidMediaCodec::m_mpeg2_sequence = nullptr
protected

◆ m_needSecureDecoder

bool CDVDVideoCodecAndroidMediaCodec::m_needSecureDecoder = false
protected

◆ m_opened

bool CDVDVideoCodecAndroidMediaCodec::m_opened = false
protected

◆ m_OutputDuration

uint32_t CDVDVideoCodecAndroidMediaCodec::m_OutputDuration = 0
protected

◆ m_render_surface

bool CDVDVideoCodecAndroidMediaCodec::m_render_surface
protected

◆ m_src_offset

int CDVDVideoCodecAndroidMediaCodec::m_src_offset[4]
protected

◆ m_src_stride

int CDVDVideoCodecAndroidMediaCodec::m_src_stride[4]
protected

◆ m_state

int CDVDVideoCodecAndroidMediaCodec::m_state
protected

◆ m_surfaceTexture

std::shared_ptr<CJNISurfaceTexture> CDVDVideoCodecAndroidMediaCodec::m_surfaceTexture
protected

◆ m_textureId

unsigned int CDVDVideoCodecAndroidMediaCodec::m_textureId = 0
protected

◆ m_useDTSforPTS

bool CDVDVideoCodecAndroidMediaCodec::m_useDTSforPTS = false
protected

◆ m_videobuffer

VideoPicture CDVDVideoCodecAndroidMediaCodec::m_videobuffer
protected

◆ m_videoBufferPool

std::shared_ptr<CMediaCodecVideoBufferPool> CDVDVideoCodecAndroidMediaCodec::m_videoBufferPool
protected

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