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
7 #else
9 #endif
11 
13 
15 {
16  public:
18  ~MythDRMPRIMEContext() override;
19 
20  static MythCodecID GetSupportedCodec (AVCodecContext **Context,
21  const 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, MythVideoFrame *Frame, AVFrame *AvFrame) override;
28  bool DecoderWillResetOnFlush (void) override;
29  static bool HavePrimeDecoders (bool Reinit = false, AVCodecID Codec = AV_CODEC_ID_NONE);
30  static enum AVPixelFormat GetFormat (AVCodecContext *Context, const AVPixelFormat *PixFmt);
31  bool GetDRMBuffer (AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int /*unused*/);
32 
33  protected:
34  static MythCodecID GetPrimeCodec (AVCodecContext **Context,
35  const AVCodec **Codec,
36  AVStream *Stream,
37  MythCodecID Successs, // Xlib conflict
38  MythCodecID Failure,
39  const QString &CodecName,
40  AVPixelFormat Format);
41 #if QT_VERSION < QT_VERSION_CHECK(5,14,0)
42  static QMutex s_drmPrimeLock;
43 #else
44  static QRecursiveMutex s_drmPrimeLock;
45 #endif
46  static QStringList s_drmPrimeDecoders;
48 };
49 
50 #endif // MYTHDRMPRIMECONTEXT_H
MythDRMPRIMEContext::HavePrimeDecoders
static bool HavePrimeDecoders(bool Reinit=false, AVCodecID Codec=AV_CODEC_ID_NONE)
Definition: mythdrmprimecontext.cpp:192
MythDRMPRIMEContext::s_drmPrimeDecoders
static QStringList s_drmPrimeDecoders
Definition: mythdrmprimecontext.h:46
MythDRMPRIMEInterop
Definition: mythdrmprimeinterop.h:14
MythDRMPRIMEContext::InitVideoCodec
void InitVideoCodec(AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override
Definition: mythdrmprimecontext.cpp:125
mythopenglinterop.h
Frame
Definition: zmdefines.h:93
MythDate::Format
Format
Definition: mythdate.h:15
MythDRMPRIMEContext::GetSupportedCodec
static MythCodecID GetSupportedCodec(AVCodecContext **Context, const AVCodec **Codec, const QString &Decoder, AVStream *Stream, uint StreamType)
Definition: mythdrmprimecontext.cpp:74
MythDRMPRIMEContext::GetPrimeCodec
static MythCodecID GetPrimeCodec(AVCodecContext **Context, const AVCodec **Codec, AVStream *Stream, MythCodecID Successs, MythCodecID Failure, const QString &CodecName, AVPixelFormat Format)
Definition: mythdrmprimecontext.cpp:45
MythDRMPRIMEContext::HwDecoderInit
int HwDecoderInit(AVCodecContext *Context) override
Definition: mythdrmprimecontext.cpp:110
MythCodecID
MythCodecID
Definition: mythcodecid.h:10
AVFrame
struct AVFrame AVFrame
Definition: BorderDetector.h:15
Decoder
Definition: decoder.h:70
MythOpenGLInterop
Definition: mythopenglinterop.h:17
MythDRMPRIMEContext::RetrieveFrame
bool RetrieveFrame(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override
Definition: mythdrmprimecontext.cpp:142
MythDRMPRIMEContext
A generic context handler for codecs that return AV_PIX_FMT_DRM_PRIME frames.
Definition: mythdrmprimecontext.h:14
MythDRMPRIMEContext::GetFormat
static enum AVPixelFormat GetFormat(AVCodecContext *Context, const AVPixelFormat *PixFmt)
Definition: mythdrmprimecontext.cpp:150
uint
unsigned int uint
Definition: compat.h:81
MythDRMPRIMEContext::DecoderWillResetOnFlush
bool DecoderWillResetOnFlush(void) override
Definition: mythdrmprimecontext.cpp:137
MythDRMPRIMEContext::m_interop
MythOpenGLInterop * m_interop
Definition: mythdrmprimecontext.h:47
MythDRMPRIMEContext::MythDRMPRIMEContext
MythDRMPRIMEContext(DecoderBase *Parent, MythCodecID CodecID)
Definition: mythdrmprimecontext.cpp:34
MythDRMPRIMEContext::GetDRMBuffer
bool GetDRMBuffer(AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int)
Definition: mythdrmprimecontext.cpp:161
mythdrmprimeinterop.h
mythcodeccontext.h
MythCodecContext
Definition: mythcodeccontext.h:54
MythVideoFrame
Definition: mythframe.h:88
MythDRMPRIMEContext::~MythDRMPRIMEContext
~MythDRMPRIMEContext() override
Definition: mythdrmprimecontext.cpp:39
MythDRMPRIMEContext::s_drmPrimeLock
static QRecursiveMutex s_drmPrimeLock
Definition: mythdrmprimecontext.h:44
DecoderBase
Definition: decoderbase.h:120