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 using V4L2Mapping = QPair<const uint32_t, const MythCodecContext::CodecProfile>;
9 
11 {
12  public:
13  MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID);
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
MythV4L2M2MContext::DecoderWillResetOnFlush
bool DecoderWillResetOnFlush() override
Definition: mythv4l2m2mcontext.cpp:44
MythV4L2M2MContext::HwDecoderInit
int HwDecoderInit(AVCodecContext *Context) override
Definition: mythv4l2m2mcontext.cpp:123
MythCodecID
MythCodecID
Definition: mythcodecid.h:11
Frame
Definition: zmdefines.h:102
MythV4L2M2MContext::InitVideoCodec
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
Definition: mythv4l2m2mcontext.cpp:134
MythV4L2M2MContext::HaveV4L2Codecs
static bool HaveV4L2Codecs(bool Reinit=false)
Definition: mythv4l2m2mcontext.cpp:411
MythV4L2M2MContext::GetDecoderList
static void GetDecoderList(QStringList &Decoders)
Definition: mythv4l2m2mcontext.cpp:389
MythV4L2M2MContext::SetDecoderOptions
void SetDecoderOptions(AVCodecContext *Context, const AVCodec *Codec) override
Reduce the number of capture buffers.
Definition: mythv4l2m2mcontext.cpp:185
V4L2Profiles
QList< MythCodecContext::CodecProfile > V4L2Profiles
Definition: mythv4l2m2mcontext.h:7
MythV4L2M2MContext::GetStandardProfiles
static const V4L2Profiles & GetStandardProfiles()
Definition: mythv4l2m2mcontext.cpp:258
MythV4L2M2MContext::~MythV4L2M2MContext
~MythV4L2M2MContext() override=default
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
Decoder
Definition: decoder.h:70
MythV4L2M2MContext::RetrieveFrame
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
Definition: mythv4l2m2mcontext.cpp:169
MythV4L2M2MContext::GetRequestProfiles
static const V4L2Profiles & GetRequestProfiles()
Definition: mythv4l2m2mcontext.cpp:460
V4L2Mapping
QPair< const uint32_t, const MythCodecContext::CodecProfile > V4L2Mapping
Definition: mythv4l2m2mcontext.h:8
MythV4L2M2MContext::GetSupportedCodec
static MythCodecID GetSupportedCodec(AVCodecContext **Context, const AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
Definition: mythv4l2m2mcontext.cpp:49
MythV4L2M2MContext::GetProfiles
static V4L2Profiles GetProfiles(const std::vector< V4L2Mapping > &Profiles)
Definition: mythv4l2m2mcontext.cpp:284
MythDRMPRIMEContext
A generic context handler for codecs that return AV_PIX_FMT_DRM_PRIME frames.
Definition: mythdrmprimecontext.h:14
MythV4L2M2MContext::GetV4L2RequestFormat
static enum AVPixelFormat GetV4L2RequestFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
Definition: mythv4l2m2mcontext.cpp:482
MythV4L2M2MContext
A handler for V4L2 Memory2Memory codecs.
Definition: mythv4l2m2mcontext.h:10
MythV4L2M2MContext::MythV4L2M2MContext
MythV4L2M2MContext(DecoderBase *Parent, MythCodecID CodecID)
Definition: mythv4l2m2mcontext.cpp:39
MythV4L2M2MContext::InitialiseV4L2RequestContext
static int InitialiseV4L2RequestContext(AVCodecContext *Context)
Definition: mythv4l2m2mcontext.cpp:499
MythV4L2M2MContext::m_request
bool m_request
Definition: mythv4l2m2mcontext.h:39
MythV4L2M2MContext::GetBuffer
static bool GetBuffer(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int)
Retrieve a frame from CPU memory.
Definition: mythv4l2m2mcontext.cpp:209
MythVideoFrame
Definition: mythframe.h:87
mythdrmprimecontext.h
DecoderBase
Definition: decoderbase.h:121
uint
unsigned int uint
Definition: freesurround.h:24