vdr-plugin-softhddevice-drm-gles 1.6.2
codec_video.h
Go to the documentation of this file.
1// SPDX-License-Identifier: AGPL-3.0-or-later
2
13#ifndef __CODEC_VIDEO_H
14#define __CODEC_VIDEO_H
15
16#include <vdr/thread.h>
17
18extern "C" {
19#include <libavcodec/avcodec.h>
20}
21
33public:
34 cVideoDecoder(int, const char *);
35 int Open(enum AVCodecID, AVCodecParameters *, AVRational, bool, int, int);
36 void Close(void);
37 int SendPacket(const AVPacket *);
38 int ReceiveFrame(AVFrame **);
39 void FlushBuffers(void);
42 bool IsHardwareDecoder(void) { return m_isHardwareDecoder; };
43 const char *Name(void) { return m_pCodecString; };
44 int GetPacketsSent(void) { return m_cntPacketsSent; };
46
47private:
49 const char *m_identifier;
50 const char *m_pCodecString = "unknown";
60 bool m_isHardwareDecoder = false;
61
62 int GetExtraData(const AVPacket *);
63 bool IsKeyFrame(AVFrame *);
64};
65
68#endif
Video Decoder.
Definition codec_video.h:32
int m_lastCodedHeight
save coded height while closing for a directly reopen
Definition codec_video.h:58
bool m_isHardwareDecoder
true, if this is a hardware decoder
Definition codec_video.h:60
AVCodecContext * GetContext(void)
Definition codec_video.h:41
int m_cntFramesReceived
number of decoded frames received from decoder
Definition codec_video.h:53
int m_cntStartKeyFrames
number of keyframes arrived while starting the coded (needed for amlogic h264 decoder in order to dro...
Definition codec_video.h:54
bool IsHardwareDecoder(void)
Definition codec_video.h:42
int GetFramesReceived(void)
Definition codec_video.h:45
cMutex m_mutex
mutex to lock codec context (TODO: is this needed?)
Definition codec_video.h:51
AVCodecContext * m_pVideoCtx
video codec context
Definition codec_video.h:48
int m_cntPacketsSent
number of packets sent to decoder
Definition codec_video.h:52
int m_lastCodedWidth
save coded width while closing for a directly reopen
Definition codec_video.h:57
const char * m_pCodecString
codec (long) name string
Definition codec_video.h:50
const char * m_identifier
identifier for logging
Definition codec_video.h:49
int GetPacketsSent(void)
Definition codec_video.h:44
const char * Name(void)
Definition codec_video.h:43
int m_hardwareQuirks
hardware specific quirks needed for decoder
Definition codec_video.h:59
int ReopenCodec(enum AVCodecID, AVCodecParameters *, AVRational, int)
Reopen the video decoder.
int SendPacket(const AVPacket *)
Send a video packet to be decoded.
int Open(enum AVCodecID, AVCodecParameters *, AVRational, bool, int, int)
Open the video decoder.
int GetExtraData(const AVPacket *)
Get extradata from avpkt.
void FlushBuffers(void)
Flush the video decoder buffers.
bool IsKeyFrame(AVFrame *)
Check, if this is a key frame.
int ReceiveFrame(AVFrame **)
Receive a decoded a video frame.
void Close(void)
Close video decoder.