vdr-plugin-softhddevice-drm-gles 1.4.0
codec_video.h
Go to the documentation of this file.
1
21#ifndef __CODEC_VIDEO_H
22#define __CODEC_VIDEO_H
23
24#include <pthread.h>
25#include <vdr/thread.h>
26
27extern "C" {
28#include <libavcodec/avcodec.h>
29}
30
35public:
36 cVideoDecoder(int, const char *);
37 virtual ~cVideoDecoder(void);
38 int Open(enum AVCodecID, AVCodecParameters *, AVRational, int, int, int);
39 void Close(void);
40 int SendPacket(const AVPacket *);
41 int ReceiveFrame(AVFrame **);
42 void FlushBuffers(void);
43 int ReopenCodec(enum AVCodecID, AVCodecParameters *, AVRational, int);
44 AVCodecContext *GetContext(void) { return m_pVideoCtx; };
45
46private:
47 AVCodecContext *m_pVideoCtx = nullptr;
48 const char *m_identifier;
49 cMutex m_mutex;
58
59 int GetExtraData(const AVPacket *);
60 bool IsKeyFrame(AVFrame *);
61};
62
63#endif
cVideoDecoder - VideoDecoder class
Definition: codec_video.h:34
int ReopenCodec(enum AVCodecID, AVCodecParameters *, AVRational, int)
Reopen the video decoder.
int m_lastCodedHeight
save coded height while closing for a directly reopen
Definition: codec_video.h:56
AVCodecContext * GetContext(void)
Definition: codec_video.h:44
int SendPacket(const AVPacket *)
Send a video packet to be decoded.
int m_cntFramesReceived
number of decoded frames received from decoder
Definition: codec_video.h:51
int GetExtraData(const AVPacket *)
Get extradata from avpkt.
int m_cntStartKeyFrames
number of keyframes arrived while starting the coded (needed for amlogic h264 decoder in order to dro...
Definition: codec_video.h:52
void FlushBuffers(void)
Flush the video decoder.
cMutex m_mutex
mutex to lock codec context (TODO: is this needed?)
Definition: codec_video.h:49
AVCodecContext * m_pVideoCtx
video codec context
Definition: codec_video.h:47
int m_cntPacketsSent
number of packets sent to decoder
Definition: codec_video.h:50
int m_lastCodedWidth
save coded width while closing for a directly reopen
Definition: codec_video.h:55
bool IsKeyFrame(AVFrame *)
Check, if this is a key frame.
const char * m_identifier
identifier for logging
Definition: codec_video.h:48
int ReceiveFrame(AVFrame **)
Receive a decoded a video frame.
void Close(void)
Close video decoder.
int Open(enum AVCodecID, AVCodecParameters *, AVRational, int, int, int)
Open the video decoder.
int m_hardwareQuirks
hardware specific quirks needed for decoder
Definition: codec_video.h:57
virtual ~cVideoDecoder(void)
cVideoDecoder destructor
cVideoDecoder(int, const char *)
cVideoDecoder constructor