vdr-plugin-softhddevice-drm-gles 1.6.2
cVideoDecoder Class Reference

Video Decoder. More...

#include <codec_video.h>

Public Member Functions

 cVideoDecoder (int, const char *)
 Create a new video decoder.
 
int Open (enum AVCodecID, AVCodecParameters *, AVRational, bool, int, int)
 Open the video decoder.
 
void Close (void)
 Close video decoder.
 
int SendPacket (const AVPacket *)
 Send a video packet to be decoded.
 
int ReceiveFrame (AVFrame **)
 Receive a decoded a video frame.
 
void FlushBuffers (void)
 Flush the video decoder buffers.
 
int ReopenCodec (enum AVCodecID, AVCodecParameters *, AVRational, int)
 Reopen the video decoder.
 
AVCodecContextGetContext (void)
 
bool IsHardwareDecoder (void)
 
const charName (void)
 
int GetPacketsSent (void)
 
int GetFramesReceived (void)
 

Private Member Functions

int GetExtraData (const AVPacket *)
 Get extradata from avpkt.
 
bool IsKeyFrame (AVFrame *)
 Check, if this is a key frame.
 

Private Attributes

AVCodecContextm_pVideoCtx = nullptr
 video codec context
 
const charm_identifier
 identifier for logging
 
const charm_pCodecString = "unknown"
 codec (long) name string
 
cMutex m_mutex
 mutex to lock codec context (TODO: is this needed?)
 
int m_cntPacketsSent
 number of packets sent to decoder
 
int m_cntFramesReceived
 number of decoded frames received from decoder
 
int m_cntStartKeyFrames
 number of keyframes arrived while starting the coded (needed for amlogic h264 decoder in order to drop some frames in ReceiveFrame() before sending them to the renderer)
 
int m_lastCodedWidth
 save coded width while closing for a directly reopen
 
int m_lastCodedHeight
 save coded height while closing for a directly reopen
 
int m_hardwareQuirks
 hardware specific quirks needed for decoder
 
bool m_isHardwareDecoder = false
 true, if this is a hardware decoder
 

Detailed Description

Video Decoder.

Definition at line 32 of file codec_video.h.

Member Function Documentation

◆ GetContext()

AVCodecContext * cVideoDecoder::GetContext ( void  )
inline

Definition at line 41 of file codec_video.h.

References m_pVideoCtx.

Referenced by cVideoStream::GetVideoSize(), and cVideoStream::RenderFrame().

◆ GetFramesReceived()

int cVideoDecoder::GetFramesReceived ( void  )
inline

Definition at line 45 of file codec_video.h.

References m_cntFramesReceived.

Referenced by cVideoStream::DecodeInput().

◆ GetPacketsSent()

int cVideoDecoder::GetPacketsSent ( void  )
inline

Definition at line 44 of file codec_video.h.

References m_cntPacketsSent.

Referenced by cVideoStream::DecodeInput().

◆ IsHardwareDecoder()

bool cVideoDecoder::IsHardwareDecoder ( void  )
inline

◆ Name()

const char * cVideoDecoder::Name ( void  )
inline

Definition at line 43 of file codec_video.h.

References m_pCodecString.

Referenced by cVideoStream::OpenDecoder().

Member Data Documentation

◆ m_cntFramesReceived

int cVideoDecoder::m_cntFramesReceived
private

number of decoded frames received from decoder

Definition at line 53 of file codec_video.h.

Referenced by Close(), FlushBuffers(), GetFramesReceived(), Open(), ReceiveFrame(), and ReopenCodec().

◆ m_cntPacketsSent

int cVideoDecoder::m_cntPacketsSent
private

number of packets sent to decoder

Definition at line 52 of file codec_video.h.

Referenced by Close(), FlushBuffers(), GetPacketsSent(), Open(), ReceiveFrame(), ReopenCodec(), and SendPacket().

◆ m_cntStartKeyFrames

int cVideoDecoder::m_cntStartKeyFrames
private

number of keyframes arrived while starting the coded (needed for amlogic h264 decoder in order to drop some frames in ReceiveFrame() before sending them to the renderer)

Definition at line 54 of file codec_video.h.

Referenced by Open(), ReceiveFrame(), and ReopenCodec().

◆ m_hardwareQuirks

int cVideoDecoder::m_hardwareQuirks
private

hardware specific quirks needed for decoder

Definition at line 59 of file codec_video.h.

Referenced by Open(), and ReceiveFrame().

◆ m_identifier

const char* cVideoDecoder::m_identifier
private

identifier for logging

Definition at line 49 of file codec_video.h.

Referenced by Close(), FlushBuffers(), GetExtraData(), Open(), ReceiveFrame(), ReopenCodec(), and SendPacket().

◆ m_isHardwareDecoder

bool cVideoDecoder::m_isHardwareDecoder = false
private

true, if this is a hardware decoder

Definition at line 60 of file codec_video.h.

Referenced by IsHardwareDecoder(), and Open().

◆ m_lastCodedHeight

int cVideoDecoder::m_lastCodedHeight
private

save coded height while closing for a directly reopen

Definition at line 58 of file codec_video.h.

Referenced by Close(), and ReopenCodec().

◆ m_lastCodedWidth

int cVideoDecoder::m_lastCodedWidth
private

save coded width while closing for a directly reopen

Definition at line 57 of file codec_video.h.

Referenced by Close(), and ReopenCodec().

◆ m_mutex

cMutex cVideoDecoder::m_mutex
private

mutex to lock codec context (TODO: is this needed?)

Definition at line 51 of file codec_video.h.

Referenced by Close(), FlushBuffers(), Open(), ReceiveFrame(), and SendPacket().

◆ m_pCodecString

const char* cVideoDecoder::m_pCodecString = "unknown"
private

codec (long) name string

Definition at line 50 of file codec_video.h.

Referenced by Name(), and Open().

◆ m_pVideoCtx

AVCodecContext* cVideoDecoder::m_pVideoCtx = nullptr
private

video codec context

Definition at line 48 of file codec_video.h.

Referenced by Close(), FlushBuffers(), GetContext(), GetExtraData(), Open(), ReceiveFrame(), ReopenCodec(), and SendPacket().


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