vdr-plugin-softhddevice-drm-gles 1.6.4-d0291bb
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 <mutex>
17
18extern "C" {
19#include <libavcodec/avcodec.h>
20}
21
38public:
39 cVideoDecoder(const char *);
40 int Open(enum AVCodecID, AVCodecParameters *, AVRational, bool, int, int);
41 void Close(void);
42 int SendPacket(const AVPacket *);
43 int ReceiveFrame(AVFrame **);
44 void FlushBuffers(void);
47 bool IsHardwareDecoder(void) { return m_isHardwareDecoder; };
48 const char *Name(void) { return m_pCodecString; };
49 int GetPacketsSent(void) { return m_cntPacketsSent; };
52
53private:
55 const char *m_identifier;
56 const char *m_pCodecString = "unknown";
57 std::mutex m_mutex;
66 bool m_isHardwareDecoder = false;
67
68 int GetExtraData(const AVPacket *);
69 bool IsKeyFrame(AVFrame *);
70};
71
72#endif
Video Decoder.
Definition codec_video.h:37
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:64
int m_skipKeyFramesNum
number of Keyframes (= I-Frames in VDR) to be skipped at stream start (hardware specific quirk)
Definition codec_video.h:65
bool m_isHardwareDecoder
true, if this is a hardware decoder
Definition codec_video.h:66
AVCodecContext * GetContext(void)
Definition codec_video.h:46
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 m_cntFramesReceived
number of decoded frames received from decoder
Definition codec_video.h:59
int GetExtraData(const AVPacket *)
Get extradata from avpkt.
void SetSkipKeyFramesNum(int num)
Definition codec_video.h:51
int m_cntStartKeyFrames
number of keyframes arrived while starting the coded (needed for amlogic h264 decoder in order to dro...
Definition codec_video.h:60
bool IsHardwareDecoder(void)
Definition codec_video.h:47
int GetFramesReceived(void)
Definition codec_video.h:50
void FlushBuffers(void)
Flush the video decoder buffers.
std::mutex m_mutex
mutex to lock codec context
Definition codec_video.h:57
AVCodecContext * m_pVideoCtx
video codec context
Definition codec_video.h:54
int m_cntPacketsSent
number of packets sent to decoder
Definition codec_video.h:58
int m_lastCodedWidth
save coded width while closing for a directly reopen
Definition codec_video.h:63
const char * m_pCodecString
codec (long) name string
Definition codec_video.h:56
bool IsKeyFrame(AVFrame *)
Check, if this is a key frame.
const char * m_identifier
identifier for logging
Definition codec_video.h:55
int ReceiveFrame(AVFrame **)
Receive a decoded a video frame.
int GetPacketsSent(void)
Definition codec_video.h:49
const char * Name(void)
Definition codec_video.h:48
void Close(void)
Close video decoder.