MythTV  master
mythdrmprimecontext.h
Go to the documentation of this file.
1 #ifndef MYTHDRMPRIMECONTEXT_H
2 #define MYTHDRMPRIMECONTEXT_H
3 
4 // MythTV
5 #ifdef USING_EGL
6 #include "mythdrmprimeinterop.h"
7 #else
8 #include "mythopenglinterop.h"
9 #endif
10 #include "mythcodeccontext.h"
11 
13 
15 {
16  public:
18  ~MythDRMPRIMEContext() override;
19 
20  static MythCodecID GetSupportedCodec (AVCodecContext **Context,
21  AVCodec **Codec,
22  const QString &Decoder,
23  AVStream *Stream,
24  uint StreamType);
25  int HwDecoderInit (AVCodecContext *Context) override;
26  void InitVideoCodec (AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override;
27  bool RetrieveFrame (AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame) override;
28  bool DecoderWillResetOnFlush (void) override;
29  static bool HavePrimeDecoders (AVCodecID Codec = AV_CODEC_ID_NONE);
30  static enum AVPixelFormat GetFormat (AVCodecContext *Context, const AVPixelFormat *PixFmt);
31  bool GetDRMBuffer (AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame, int /*unused*/);
32 
33  protected:
34  static MythCodecID GetPrimeCodec (AVCodecContext **Context,
35  AVCodec **Codec,
36  AVStream *Stream,
37  MythCodecID Successs, // Xlib conflict
38  MythCodecID Failure,
39  const QString &CodecName,
40  AVPixelFormat Format);
41  static QMutex s_drmPrimeLock;
42  static QStringList s_drmPrimeDecoders;
44 };
45 
46 #endif // MYTHDRMPRIMECONTEXT_H
QHash< QString, Action * > Context
Definition: action.h:77
static QStringList s_drmPrimeDecoders
MythCodecID
Definition: mythcodecid.h:10
struct AVFrame AVFrame
MythDRMPRIMEContext(DecoderBase *Parent, MythCodecID CodecID)
bool RetrieveFrame(AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame) override
static bool HavePrimeDecoders(AVCodecID Codec=AV_CODEC_ID_NONE)
A generic context handler for codecs that return AV_PIX_FMT_DRM_PRIME frames.
static QMutex s_drmPrimeLock
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
bool GetDRMBuffer(AVCodecContext *Context, VideoFrame *Frame, AVFrame *AvFrame, int)
unsigned int uint
Definition: compat.h:140
bool DecoderWillResetOnFlush(void) override
MythOpenGLInterop * m_interop
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
static MythCodecID GetPrimeCodec(AVCodecContext **Context, AVCodec **Codec, AVStream *Stream, MythCodecID Successs, MythCodecID Failure, const QString &CodecName, AVPixelFormat Format)
static MythCodecID GetSupportedCodec(AVCodecContext **Context, AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
int HwDecoderInit(AVCodecContext *Context) override