MythTV  master
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
MythVAAPIInterop Class Reference

#include <mythvaapiinterop.h>

Inheritance diagram for MythVAAPIInterop:
Inheritance graph
[legend]
Collaboration diagram for MythVAAPIInterop:
Collaboration graph
[legend]

Public Member Functions

VASurfaceID VerifySurface (MythRenderOpenGL *Context, VideoFrame *Frame)
 
VADisplay GetDisplay (void)
 
QString GetVendor (void)
 
- Public Member Functions inherited from MythOpenGLInterop
 ~MythOpenGLInterop () override
 
virtual vector< MythVideoTexture * > Acquire (MythRenderOpenGL *Context, VideoColourSpace *ColourSpace, VideoFrame *Frame, FrameScanType Scan)
 
Type GetType (void)
 
MythPlayerGetPlayer (void)
 
void SetPlayer (MythPlayer *Player)
 
void SetDefaultFree (FreeAVHWDeviceContext FreeContext)
 
void SetDefaultUserOpaque (void *UserOpaque)
 
FreeAVHWDeviceContext GetDefaultFree (void)
 
void * GetDefaultUserOpaque (void)
 
- Public Member Functions inherited from ReferenceCounter
 ReferenceCounter (const QString &debugName, bool logDebug=true)
 Creates reference counter with an initial value of 1. More...
 
virtual int IncrRef (void)
 Increments reference count. More...
 
virtual int DecrRef (void)
 Decrements reference count and deletes on 0. More...
 

Static Public Member Functions

static MythVAAPIInteropCreate (MythRenderOpenGL *Context, Type InteropType)
 
static bool SetupDeinterlacer (MythDeintType Deinterlacer, bool DoubleRate, AVBufferRef *FramesContext, int Width, int Height, AVFilterGraph *&Graph, AVFilterContext *&Source, AVFilterContext *&Sink)
 
- Static Public Member Functions inherited from MythOpenGLInterop
static QStringList GetAllowedRenderers (VideoFrameType Format)
 
static Type GetInteropType (VideoFrameType Format, MythPlayer *Player)
 Check whether we support direct rendering for the given VideoFrameType. More...
 
static void GetInteropTypeCallback (void *Wait, void *Format, void *Result)
 
static vector< MythVideoTexture * > Retrieve (MythRenderOpenGL *Context, VideoColourSpace *ColourSpace, VideoFrame *Frame, FrameScanType Scan)
 
static QString TypeToString (Type InteropType)
 
static MythOpenGLInteropCreateDummy (void)
 
- Static Public Member Functions inherited from ReferenceCounter
static void PrintDebug (void)
 Print out any leaks if that level of debugging is enabled. More...
 

Protected Member Functions

 MythVAAPIInterop (MythRenderOpenGL *Context, Type InteropType)
 
 ~MythVAAPIInterop () override
 
void InitaliseDisplay (void)
 
VASurfaceID Deinterlace (VideoFrame *Frame, VASurfaceID Current, FrameScanType Scan)
 
virtual void DestroyDeinterlacer (void)
 
virtual void PostInitDeinterlacer (void)
 
- Protected Member Functions inherited from MythOpenGLInterop
 MythOpenGLInterop (MythRenderOpenGL *Context, Type InteropType)
 
virtual void DeleteTextures (void)
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 

Static Protected Member Functions

static Type GetInteropType (VideoFrameType Format)
 Return an 'interoperability' method that is supported by the current render device. More...
 

Protected Attributes

VADisplay m_vaDisplay { nullptr }
 
QString m_vaVendor { }
 
MythDeintType m_deinterlacer { DEINT_NONE }
 
bool m_deinterlacer2x { false }
 
bool m_firstField { true }
 
AVBufferRef * m_vppFramesContext { nullptr }
 
AVFilterContext * m_filterSink { nullptr }
 
AVFilterContext * m_filterSource { nullptr }
 
AVFilterGraph * m_filterGraph { nullptr }
 
bool m_filterError { false }
 
int m_filterWidth { 0 }
 
int m_filterHeight { 0 }
 
VASurfaceID m_lastFilteredFrame { 0 }
 
long long m_lastFilteredFrameCount { 0 }
 
- Protected Attributes inherited from MythOpenGLInterop
MythRenderOpenGLm_context
 
Type m_type
 
QHash< unsigned long long, vector< MythVideoTexture * > > m_openglTextures
 
QSize m_openglTextureSize { }
 
long long m_discontinuityCounter { 0 }
 
FreeAVHWDeviceContext m_defaultFree { nullptr }
 
void * m_defaultUserOpaque { nullptr }
 
MythPlayerm_player { nullptr }
 
- Protected Attributes inherited from ReferenceCounter
bool m_logDebug
 This is used to suppress creating LoggingItem classes for LoggingItem reference count changes. More...
 
QAtomicInt m_referenceCount {1}
 

Friends

class MythOpenGLInterop
 

Additional Inherited Members

- Public Types inherited from MythOpenGLInterop
enum  Type {
  Unsupported = 0, VAAPIGLXCOPY, VAAPIGLXPIX, VAAPIEGLDRM,
  VTBOPENGL, VTBSURFACE, MEDIACODEC, VDPAU,
  NVDEC, MMAL, DRMPRIME, DUMMY
}
 

Detailed Description

Todo:

Fix pause frame deinterlacing

Deinterlacing 'breaks' after certain stream changes (e.g. aspect ratio)

Scaling of some 1080 H.264 material (garbage line at bottom - presumably scaling from 1088 to 1080 - but only some files). Same effect on all VAAPI interop types.

Definition at line 36 of file mythvaapiinterop.h.

Constructor & Destructor Documentation

◆ MythVAAPIInterop()

MythVAAPIInterop::MythVAAPIInterop ( MythRenderOpenGL Context,
Type  InteropType 
)
protected

Definition at line 78 of file mythvaapiinterop.cpp.

◆ ~MythVAAPIInterop()

MythVAAPIInterop::~MythVAAPIInterop ( )
overrideprotected

Definition at line 83 of file mythvaapiinterop.cpp.

Member Function Documentation

◆ Create()

MythVAAPIInterop * MythVAAPIInterop::Create ( MythRenderOpenGL Context,
Type  InteropType 
)
static

Definition at line 56 of file mythvaapiinterop.cpp.

Referenced by MythVAAPIContext::InitialiseContext().

◆ VerifySurface()

VASurfaceID MythVAAPIInterop::VerifySurface ( MythRenderOpenGL Context,
VideoFrame Frame 
)

◆ GetDisplay()

VADisplay MythVAAPIInterop::GetDisplay ( void  )

Definition at line 91 of file mythvaapiinterop.cpp.

Referenced by MythVAAPIContext::InitialiseContext().

◆ GetVendor()

QString MythVAAPIInterop::GetVendor ( void  )

Definition at line 96 of file mythvaapiinterop.cpp.

Referenced by MythVAAPIContext::InitialiseContext().

◆ SetupDeinterlacer()

bool MythVAAPIInterop::SetupDeinterlacer ( MythDeintType  Deinterlacer,
bool  DoubleRate,
AVBufferRef *  FramesContext,
int  Width,
int  Height,
AVFilterGraph *&  Graph,
AVFilterContext *&  Source,
AVFilterContext *&  Sink 
)
static

Definition at line 170 of file mythvaapiinterop.cpp.

Referenced by Deinterlace(), and MythVAAPIContext::PostProcessFrame().

◆ GetInteropType()

MythOpenGLInterop::Type MythVAAPIInterop::GetInteropType ( VideoFrameType  Format)
staticprotected

Return an 'interoperability' method that is supported by the current render device.

DRM interop is the preferred option as it is copy free but requires EGL. DRM returns raw YUV frames which gives us full colourspace and deinterlacing control.

GLX Pixmap interop will copy the frame to an RGBA texture. VAAPI functionality is used for colourspace conversion and deinterlacing. It is not supported when EGL and/or Wayland are running.

GLX Copy is only available when GLX is running (no OpenGLES or Wayland) and, under the hood, performs the same Pixmap copy as GLXPixmap support plus an additional render to texture via a FramebufferObject. As it is less performant and less widely available than GLX Pixmap, it may be removed in the future.

Definition at line 31 of file mythvaapiinterop.cpp.

Referenced by MythOpenGLInterop::GetInteropType().

◆ InitaliseDisplay()

void MythVAAPIInterop::InitaliseDisplay ( void  )
protected

◆ Deinterlace()

VASurfaceID MythVAAPIInterop::Deinterlace ( VideoFrame Frame,
VASurfaceID  Current,
FrameScanType  Scan 
)
protected

◆ DestroyDeinterlacer()

void MythVAAPIInterop::DestroyDeinterlacer ( void  )
protectedvirtual

◆ PostInitDeinterlacer()

virtual void MythVAAPIInterop::PostInitDeinterlacer ( void  )
inlineprotectedvirtual

Reimplemented in MythVAAPIInteropDRM.

Definition at line 60 of file mythvaapiinterop.h.

Referenced by Deinterlace().

Friends And Related Function Documentation

◆ MythOpenGLInterop

friend class MythOpenGLInterop
friend

Definition at line 38 of file mythvaapiinterop.h.

Member Data Documentation

◆ m_vaDisplay

VADisplay MythVAAPIInterop::m_vaDisplay { nullptr }
protected

◆ m_vaVendor

QString MythVAAPIInterop::m_vaVendor { }
protected

◆ m_deinterlacer

MythDeintType MythVAAPIInterop::m_deinterlacer { DEINT_NONE }
protected

◆ m_deinterlacer2x

bool MythVAAPIInterop::m_deinterlacer2x { false }
protected

Definition at line 67 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().

◆ m_firstField

bool MythVAAPIInterop::m_firstField { true }
protected

Definition at line 68 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().

◆ m_vppFramesContext

AVBufferRef* MythVAAPIInterop::m_vppFramesContext { nullptr }
protected

Definition at line 69 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().

◆ m_filterSink

AVFilterContext* MythVAAPIInterop::m_filterSink { nullptr }
protected

Definition at line 70 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().

◆ m_filterSource

AVFilterContext* MythVAAPIInterop::m_filterSource { nullptr }
protected

Definition at line 71 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().

◆ m_filterGraph

AVFilterGraph* MythVAAPIInterop::m_filterGraph { nullptr }
protected

◆ m_filterError

bool MythVAAPIInterop::m_filterError { false }
protected

Definition at line 73 of file mythvaapiinterop.h.

Referenced by MythVAAPIInteropDRM::Acquire(), and Deinterlace().

◆ m_filterWidth

int MythVAAPIInterop::m_filterWidth { 0 }
protected

Definition at line 74 of file mythvaapiinterop.h.

Referenced by Deinterlace().

◆ m_filterHeight

int MythVAAPIInterop::m_filterHeight { 0 }
protected

Definition at line 75 of file mythvaapiinterop.h.

Referenced by Deinterlace().

◆ m_lastFilteredFrame

VASurfaceID MythVAAPIInterop::m_lastFilteredFrame { 0 }
protected

Definition at line 76 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().

◆ m_lastFilteredFrameCount

long long MythVAAPIInterop::m_lastFilteredFrameCount { 0 }
protected

Definition at line 77 of file mythvaapiinterop.h.

Referenced by Deinterlace(), and DestroyDeinterlacer().


The documentation for this class was generated from the following files: