vdr-plugin-softhddevice-drm-gles 1.7.3-98a2ef7
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);
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; };
51
52private:
54 const char *m_identifier;
55 const char *m_pCodecString = "unknown";
56 std::mutex m_mutex;
59 bool m_isHardwareDecoder = false;
60
61 int GetExtraData(const AVPacket *);
63};
64
65#endif
Video Decoder.
Definition codec_video.h:37
int ReopenCodec(enum AVCodecID, AVCodecParameters *, AVRational, int)
Reopen the video decoder.
bool m_isHardwareDecoder
true, if this is a hardware decoder
Definition codec_video.h:59
AVCodecContext * GetContext(void)
Definition codec_video.h:46
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:58
int GetExtraData(const AVPacket *)
Get extradata from avpkt.
bool IsHardwareDecoder(void)
Definition codec_video.h:47
int Open(enum AVCodecID, AVCodecParameters *, AVRational, bool)
Open the video decoder.
int GetFramesReceived(void)
Definition codec_video.h:50
void FlushBuffers(void)
Flush the video decoder buffers.
void ResetPacketCounter(void)
Definition codec_video.h:62
std::mutex m_mutex
mutex to lock codec context
Definition codec_video.h:56
AVCodecContext * m_pVideoCtx
video codec context
Definition codec_video.h:53
int m_cntPacketsSent
number of packets sent to decoder
Definition codec_video.h:57
const char * m_pCodecString
codec (long) name string
Definition codec_video.h:55
const char * m_identifier
identifier for logging
Definition codec_video.h:54
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.