MythTV master
mythv4l2m2mcontext.h
Go to the documentation of this file.
1#ifndef MYTHV4L2M2MCONTEXT_H
2#define MYTHV4L2M2MCONTEXT_H
3
4// MythTV
6
7using V4L2Profiles = QList<MythCodecContext::CodecProfile>;
8using V4L2Mapping = QPair<const uint32_t, const MythCodecContext::CodecProfile>;
9
11{
12 public:
14 ~MythV4L2M2MContext() override = default;
15 static MythCodecID GetSupportedCodec (AVCodecContext **Context,
16 const AVCodec **Codec,
17 const QString &Decoder,
18 AVStream *Stream,
19 uint StreamType);
20 void InitVideoCodec (AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override;
21 bool RetrieveFrame (AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override;
22 void SetDecoderOptions (AVCodecContext* Context, const AVCodec* Codec) override;
23 int HwDecoderInit (AVCodecContext *Context) override;
24 bool DecoderWillResetOnFlush () override;
25 static bool GetBuffer (AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int/*Flags*/);
26 static bool HaveV4L2Codecs (bool Reinit = false);
27 static void GetDecoderList (QStringList &Decoders);
28
29 static enum AVPixelFormat GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt);
30 static int InitialiseV4L2RequestContext(AVCodecContext *Context);
31
32 protected:
33 static const V4L2Profiles& GetStandardProfiles();
34 static const V4L2Profiles& GetRequestProfiles();
35
36 private:
37 static V4L2Profiles GetProfiles(const std::vector<V4L2Mapping> &Profiles);
38
39 bool m_request { false };
40};
41
42#endif
AVFrame AVFrame
A generic context handler for codecs that return AV_PIX_FMT_DRM_PRIME frames.
A handler for V4L2 Memory2Memory codecs.
static MythCodecID GetSupportedCodec(AVCodecContext **Context, const AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
static int InitialiseV4L2RequestContext(AVCodecContext *Context)
void SetDecoderOptions(AVCodecContext *Context, const AVCodec *Codec) override
Reduce the number of capture buffers.
static const V4L2Profiles & GetRequestProfiles()
static V4L2Profiles GetProfiles(const std::vector< V4L2Mapping > &Profiles)
static enum AVPixelFormat GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
static bool HaveV4L2Codecs(bool Reinit=false)
static void GetDecoderList(QStringList &Decoders)
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
~MythV4L2M2MContext() override=default
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
static const V4L2Profiles & GetStandardProfiles()
bool DecoderWillResetOnFlush() override
static bool GetBuffer(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int)
Retrieve a frame from CPU memory.
MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID)
int HwDecoderInit(AVCodecContext *Context) override
unsigned int uint
Definition: freesurround.h:24
MythCodecID
Definition: mythcodecid.h:14
QPair< const uint32_t, const MythCodecContext::CodecProfile > V4L2Mapping
QList< MythCodecContext::CodecProfile > V4L2Profiles