MythTV  master
mythv4l2m2mcontext.h
Go to the documentation of this file.
1 #ifndef MYTHV4L2M2MCONTEXT_H
2 #define MYTHV4L2M2MCONTEXT_H
3 
4 // MythTV
5 #include "mythdrmprimecontext.h"
6 
7 using V4L2Profiles = QList<MythCodecContext::CodecProfile>;
8 
10 {
11  public:
12  MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID);
13  ~MythV4L2M2MContext() override = default;
14  static MythCodecID GetSupportedCodec (AVCodecContext **Context,
15  AVCodec **Codec,
16  const QString &Decoder,
17  AVStream *Stream,
18  uint StreamType);
19  void InitVideoCodec (AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override;
20  bool RetrieveFrame (AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame) override;
21  void SetDecoderOptions (AVCodecContext* Context, AVCodec* Codec) override;
22  int HwDecoderInit (AVCodecContext *Context) override;
23  bool DecoderWillResetOnFlush (void) override;
24  static bool GetBuffer (AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame, int/*Flags*/);
25  static bool HaveV4L2Codecs (void);
26  static void GetDecoderList (QStringList &Decoders);
27 
28  static enum AVPixelFormat GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt);
29  static int InitialiseV4L2RequestContext(AVCodecContext *Context);
30 
31  protected:
32  static const V4L2Profiles& GetProfiles(void);
33 };
34 
35 #endif // MYTHV4L2M2MCONTEXT_H
QHash< QString, Action * > Context
Definition: action.h:77
MythCodecID
Definition: mythcodecid.h:10
static int InitialiseV4L2RequestContext(AVCodecContext *Context)
QList< MythCodecContext::CodecProfile > V4L2Profiles
static MythCodecID GetSupportedCodec(AVCodecContext **Context, AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
bool DecoderWillResetOnFlush(void) override
struct AVFrame AVFrame
A generic context handler for codecs that return AV_PIX_FMT_DRM_PRIME frames.
~MythV4L2M2MContext() override=default
int HwDecoderInit(AVCodecContext *Context) override
unsigned int uint
Definition: compat.h:140
A handler for V4L2 Memory2Memory codecs.
static void GetDecoderList(QStringList &Decoders)
static bool HaveV4L2Codecs(void)
static const V4L2Profiles & GetProfiles(void)
static enum AVPixelFormat GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID)
static bool GetBuffer(AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame, int)
Retrieve a frame from CPU memory.
bool RetrieveFrame(AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame) override
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
void SetDecoderOptions(AVCodecContext *Context, AVCodec *Codec) override
Reduce the number of capture buffers.