MythTV
master
|
#include <libmythtv/decoders/mythvaapicontext.h>
Public Member Functions | |
MythVAAPIContext (DecoderBase *Parent, MythCodecID CodecID) | |
~MythVAAPIContext () override | |
void | InitVideoCodec (AVCodecContext *Context, bool SelectedStream, bool &DirectRendering) override |
bool | RetrieveFrame (AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame) override |
int | FilteredReceiveFrame (AVCodecContext *Context, AVFrame *Frame) override |
Retrieve decoded frame and optionally deinterlace. More... | |
void | PostProcessFrame (AVCodecContext *Context, MythVideoFrame *Frame) override |
bool | IsDeinterlacing (bool &DoubleRate, bool StreamChange=false) override |
bool | DecoderWillResetOnFlush () override |
bool | DecoderWillResetOnAspect () override |
Public Member Functions inherited from MythCodecContext | |
MythCodecContext (DecoderBase *Parent, MythCodecID CodecID) | |
virtual | ~MythCodecContext ()=default |
virtual int | HwDecoderInit (AVCodecContext *) |
virtual void | SetDeinterlacing (AVCodecContext *, MythVideoProfile *, bool) |
virtual void | SetDecoderOptions (AVCodecContext *, const AVCodec *) |
virtual bool | DecoderNeedsReset (AVCodecContext *) |
Static Public Member Functions | |
static MythCodecID | GetSupportedCodec (AVCodecContext **Context, const AVCodec **Codec, const QString &Decoder, uint StreamType) |
Confirm whether VAAPI support is available given Decoder and Context. More... | |
static enum AVPixelFormat | GetFormat (AVCodecContext *Context, const AVPixelFormat *PixFmt) |
static enum AVPixelFormat | GetFormat2 (AVCodecContext *Context, const AVPixelFormat *PixFmt) |
static QString | HaveVAAPI (bool ReCheck=false) |
Check whether VAAPI is available and not emulated via VDPAU. More... | |
static void | GetDecoderList (QStringList &Decoders) |
Static Public Member Functions inherited from MythCodecContext | |
static MythCodecContext * | CreateContext (DecoderBase *Parent, MythCodecID Codec) |
static void | GetDecoders (RenderOptions &Opts, bool Reinit=false) |
static QStringList | GetDecoderDescription (void) |
static MythCodecID | FindDecoder (const QString &Decoder, AVStream *Stream, AVCodecContext **Context, const AVCodec **Codec) |
static int | GetBuffer (struct AVCodecContext *Context, AVFrame *Frame, int Flags) |
A generic hardware buffer initialisation method when using AVHWFramesContext. More... | |
static bool | GetBuffer2 (struct AVCodecContext *Context, MythVideoFrame *Frame, AVFrame *AvFrame, int Flags) |
A generic hardware buffer initialisation method when AVHWFramesContext is NOT used. More... | |
static int | InitialiseDecoder (AVCodecContext *Context, CreateHWDecoder Callback, const QString &Debug) |
Initialise a hardware decoder that is expected to use AVHWFramesContext. More... | |
static int | InitialiseDecoder2 (AVCodecContext *Context, CreateHWDecoder Callback, const QString &Debug) |
Initialise a hardware decoder that is NOT expected to use AVHWFramesContext. More... | |
static void | ReleaseBuffer (void *Opaque, uint8_t *Data) |
static void | FramesContextFinished (AVHWFramesContext *Context) |
static void | DeviceContextFinished (AVHWDeviceContext *Context) |
static void | CreateDecoderCallback (void *Wait, void *Context, void *Callback) |
static MythPlayerUI * | GetPlayerUI (AVCodecContext *Context) |
static bool | FrameTypeIsSupported (AVCodecContext *Context, VideoFrameType Format) |
static AVBufferRef * | CreateDevice (AVHWDeviceType Type, MythInteropGPU *Interop, const QString &Device=QString()) |
static bool | IsUnsupportedProfile (AVCodecContext *Context) |
Most hardware decoders do not support these codecs/profiles. More... | |
static QString | GetProfileDescription (CodecProfile Profile, QSize Size, VideoFrameType Format=FMT_NONE, uint ColorDepth=0) |
static CodecProfile | FFmpegToMythProfile (AVCodecID CodecID, int Profile) |
Private Member Functions | |
void | DestroyDeinterlacer () |
Static Private Member Functions | |
static int | InitialiseContext (AVCodecContext *Context) |
Create a VAAPI hardware context with appropriate OpenGL interop. More... | |
static int | InitialiseContext2 (AVCodecContext *Context) |
Create a VAAPI hardware context without OpenGL interop. More... | |
static VAProfile | VAAPIProfileForCodec (const AVCodecContext *Codec) |
static AVPixelFormat | FramesFormat (AVPixelFormat Format) |
static const VAAPIProfiles & | GetProfiles () |
Private Attributes | |
MythDeintType | m_deinterlacer { DEINT_NONE } |
bool | m_deinterlacer2x { false } |
bool | m_lastInterlaced { false } |
bool | m_lastTopFieldFirst { false } |
AVFilterContext * | m_filterSink { nullptr } |
AVFilterContext * | m_filterSource { nullptr } |
AVFilterGraph * | m_filterGraph { nullptr } |
bool | m_filterError { false } |
AVBufferRef * | m_framesCtx { nullptr } |
std::array< int64_t, 2 > | m_filterPriorPTS { 0 } |
int64_t | m_filterPTSUsed { 0 } |
int | m_filterWidth { 0 } |
int | m_filterHeight { 0 } |
Scaling errors when deinterlacing H.264 1080 and for 10bit HEVC 1080p.
Fix crash when skipping to the end of an H.264 stream. Appears to be because the decoder is partially initialised but we never feed it any packets to complete the setup (as we have reached the end of the file). Should be a simple null pointer check in FFmpeg.
Definition at line 23 of file mythvaapicontext.h.
MythVAAPIContext::MythVAAPIContext | ( | DecoderBase * | Parent, |
MythCodecID | CodecID | ||
) |
Definition at line 33 of file mythvaapicontext.cpp.
|
override |
Definition at line 38 of file mythvaapicontext.cpp.
|
overridevirtual |
Reimplemented from MythCodecContext.
Definition at line 586 of file mythvaapicontext.cpp.
|
overridevirtual |
Reimplemented from MythCodecContext.
Definition at line 606 of file mythvaapicontext.cpp.
|
overridevirtual |
Retrieve decoded frame and optionally deinterlace.
Reimplemented from MythCodecContext.
Definition at line 623 of file mythvaapicontext.cpp.
|
overridevirtual |
Reimplemented from MythCodecContext.
Definition at line 686 of file mythvaapicontext.cpp.
|
overridevirtual |
Reimplemented from MythCodecContext.
Definition at line 778 of file mythvaapicontext.cpp.
|
overridevirtual |
Reimplemented from MythCodecContext.
Definition at line 792 of file mythvaapicontext.cpp.
|
overridevirtual |
Reimplemented from MythCodecContext.
Definition at line 798 of file mythvaapicontext.cpp.
|
static |
Confirm whether VAAPI support is available given Decoder and Context.
Definition at line 132 of file mythvaapicontext.cpp.
Referenced by MythCodecContext::FindDecoder().
|
static |
Definition at line 210 of file mythvaapicontext.cpp.
Referenced by InitVideoCodec().
|
static |
Definition at line 222 of file mythvaapicontext.cpp.
Referenced by InitVideoCodec().
Check whether VAAPI is available and not emulated via VDPAU.
The VDPAU backend appears to be largely unmaintained, does not expose the full range of VDPAU functionality (deinterlacing, full colourspace handling etc) and in testing fails when used by FFmpeg. So disallow VAAPI over VDPAU - VDPAU should just be used directly.
Definition at line 419 of file mythvaapicontext.cpp.
Referenced by MythCodecContext::GetDecoders(), GetSupportedCodec(), and VAAPIDevice().
|
static |
Definition at line 575 of file mythvaapicontext.cpp.
Referenced by MythCodecContext::GetDecoderDescription().
|
staticprivate |
Create a VAAPI hardware context with appropriate OpenGL interop.
Definition at line 236 of file mythvaapicontext.cpp.
Referenced by GetFormat().
|
staticprivate |
Create a VAAPI hardware context without OpenGL interop.
Definition at line 370 of file mythvaapicontext.cpp.
Referenced by GetFormat2().
|
staticprivate |
Definition at line 43 of file mythvaapicontext.cpp.
Referenced by GetSupportedCodec().
|
inlinestaticprivate |
Definition at line 118 of file mythvaapicontext.cpp.
Referenced by InitialiseContext(), and InitialiseContext2().
|
private |
Definition at line 804 of file mythvaapicontext.cpp.
Referenced by FilteredReceiveFrame(), PostProcessFrame(), and ~MythVAAPIContext().
|
staticprivate |
Definition at line 466 of file mythvaapicontext.cpp.
Referenced by GetDecoderList(), GetSupportedCodec(), and HaveVAAPI().
|
private |
Definition at line 52 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), IsDeinterlacing(), and PostProcessFrame().
Definition at line 53 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), FilteredReceiveFrame(), IsDeinterlacing(), and PostProcessFrame().
Definition at line 54 of file mythvaapicontext.h.
Referenced by FilteredReceiveFrame(), and PostProcessFrame().
Definition at line 55 of file mythvaapicontext.h.
Referenced by FilteredReceiveFrame(), and PostProcessFrame().
|
private |
Definition at line 56 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), FilteredReceiveFrame(), and PostProcessFrame().
|
private |
Definition at line 57 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), FilteredReceiveFrame(), and PostProcessFrame().
|
private |
Definition at line 58 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), FilteredReceiveFrame(), and PostProcessFrame().
Definition at line 59 of file mythvaapicontext.h.
Referenced by PostProcessFrame().
|
private |
Definition at line 60 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), and PostProcessFrame().
|
private |
Definition at line 61 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), and FilteredReceiveFrame().
|
private |
Definition at line 62 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), and FilteredReceiveFrame().
|
private |
Definition at line 63 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), FilteredReceiveFrame(), and PostProcessFrame().
|
private |
Definition at line 64 of file mythvaapicontext.h.
Referenced by DestroyDeinterlacer(), FilteredReceiveFrame(), and PostProcessFrame().