kodi
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
CDVDVideoCodecAndroidMediaCodec Class Reference
Inheritance diagram for CDVDVideoCodecAndroidMediaCodec:
Inheritance graph
[legend]
Collaboration diagram for CDVDVideoCodecAndroidMediaCodec:
Collaboration graph
[legend]

Public Member Functions

 CDVDVideoCodecAndroidMediaCodec (CProcessInfo &processInfo, bool surface_render=false)
 
bool Open (CDVDStreamInfo &hints, CDVDCodecOptions &options) override
 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.
 
bool AddData (const DemuxPacket &packet) override
 add data, decoder has to consume the entire packet returns true if the packet was consumed or if resubmitting it is useless
 
void Reset () override
 Reset the decoder. More...
 
bool Reconfigure (CDVDStreamInfo &hints) override
 Reconfigure the decoder, returns true on success Decoders not capable of running multiple instances may be capable of reconfiguring the running instance. More...
 
VCReturn GetPicture (VideoPicture *pVideoPicture) override
 GetPicture controls decoding. More...
 
const char * GetName () override
 should return codecs name
 
void SetCodecControl (int flags) override
 Codec can be informed by player with the following flags: More...
 
unsigned GetAllowedReferences () override
 Number of references to old pictures that are allowed to be retained when calling decode on the next demux packet.
 
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 void SetSpeed (int iSpeed)
 will be called by video player indicating the playback speed. More...
 
virtual unsigned GetConvergeCount ()
 How many packets should player remember, so codec can recover should something cause it to flush outside of players control.
 
virtual bool GetCodecStats (double &pts, int &droppedFrames, int &skippedPics)
 For calculation of dropping requirements player asks for some information. More...
 
virtual void Reopen ()
 Re-open the decoder. More...
 

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_t > GetHDRStaticMetadata ()
 
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< bool > m_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
}
 

Member Function Documentation

◆ 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.

◆ 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.

◆ 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.


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