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

#include <mythvdpauinterop.h>

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

Public Slots

void UpdateColourSpace (bool PrimariesChanged)
 
void DisplayPreempted (void)
 
bool IsPreempted (void)
 

Public Member Functions

vector< MythVideoTexture * > Acquire (MythRenderOpenGL *Context, VideoColourSpace *ColourSpace, VideoFrame *Frame, FrameScanType Scan) override
 Map VDPAU video surfaces to an OpenGL texture. More...
 
- Public Member Functions inherited from MythOpenGLInterop
 ~MythOpenGLInterop () override
 
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 MythVDPAUInteropCreate (MythRenderOpenGL *Context, MythCodecID CodecId)
 
- 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

 MythVDPAUInterop (MythRenderOpenGL *Context, MythCodecID CodecID)
 
 ~MythVDPAUInterop () override
 
- 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)
 

Private Member Functions

bool InitNV (AVVDPAUDeviceContext *DeviceContext)
 
bool InitVDPAU (AVVDPAUDeviceContext *DeviceContext, VdpVideoSurface Surface, MythDeintType Deint, bool DoubleRate)
 
void Cleanup (void)
 
void CleanupDeinterlacer (void)
 
void RotateReferenceFrames (AVBufferRef *Buffer)
 

Private Attributes

VideoColourSpacem_colourSpace { nullptr }
 
MythVDPAUHelperm_helper { nullptr }
 
VdpOutputSurface m_outputSurface { 0 }
 
MythVDPAUSurfaceNV m_outputSurfaceReg { 0 }
 
VdpVideoMixer m_mixer { 0 }
 
VdpChromaType m_mixerChroma { VDP_CHROMA_TYPE_420 }
 
QSize m_mixerSize { }
 
MythDeintType m_deinterlacer { DEINT_BASIC }
 
QVector< AVBufferRef * > m_referenceFrames { }
 
MYTH_VDPAUINITNV m_initNV { nullptr }
 
MYTH_VDPAUFININV m_finiNV { nullptr }
 
MYTH_VDPAUREGOUTSURFNV m_registerNV { nullptr }
 
MYTH_VDPAUSURFACCESSNV m_accessNV { nullptr }
 
MYTH_VDPAUMAPSURFNV m_mapNV { nullptr }
 
MythCodecID m_codec { kCodec_NONE }
 
bool m_preempted { false }
 
bool m_preemptedWarning { false }
 

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
}
 
- 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}
 

Detailed Description

Definition at line 25 of file mythvdpauinterop.h.

Constructor & Destructor Documentation

◆ MythVDPAUInterop()

MythVDPAUInterop::MythVDPAUInterop ( MythRenderOpenGL Context,
MythCodecID  CodecID 
)
protected

Definition at line 30 of file mythvdpauinterop.cpp.

Referenced by Create().

◆ ~MythVDPAUInterop()

MythVDPAUInterop::~MythVDPAUInterop ( )
overrideprotected

Definition at line 36 of file mythvdpauinterop.cpp.

Member Function Documentation

◆ Create()

MythVDPAUInterop * MythVDPAUInterop::Create ( MythRenderOpenGL Context,
MythCodecID  CodecId 
)
static

Definition at line 9 of file mythvdpauinterop.cpp.

Referenced by MythVDPAUContext::InitialiseContext().

◆ Acquire()

vector< MythVideoTexture * > MythVDPAUInterop::Acquire ( MythRenderOpenGL Context,
VideoColourSpace ColourSpace,
VideoFrame Frame,
FrameScanType  Scan 
)
overridevirtual

Map VDPAU video surfaces to an OpenGL texture.

Note
There can only be one VDPAU context mapped to an OpenGL context.
We use a VdpVideoMixer to complete the conversion from YUV to RGB. Hence the returned texture is RGB... We could use GL_NV_vdpau_interop2 to return raw YUV frames.

Reimplemented from MythOpenGLInterop.

Definition at line 217 of file mythvdpauinterop.cpp.

◆ UpdateColourSpace

void MythVDPAUInterop::UpdateColourSpace ( bool  PrimariesChanged)
slot

Definition at line 356 of file mythvdpauinterop.cpp.

Referenced by Acquire().

◆ DisplayPreempted

void MythVDPAUInterop::DisplayPreempted ( void  )
slot

Definition at line 365 of file mythvdpauinterop.cpp.

Referenced by InitNV().

◆ IsPreempted

bool MythVDPAUInterop::IsPreempted ( void  )
slot

Definition at line 375 of file mythvdpauinterop.cpp.

◆ GetInteropType()

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

Definition at line 16 of file mythvdpauinterop.cpp.

Referenced by MythOpenGLInterop::GetInteropType().

◆ InitNV()

bool MythVDPAUInterop::InitNV ( AVVDPAUDeviceContext *  DeviceContext)
private

Definition at line 107 of file mythvdpauinterop.cpp.

Referenced by Acquire().

◆ InitVDPAU()

bool MythVDPAUInterop::InitVDPAU ( AVVDPAUDeviceContext *  DeviceContext,
VdpVideoSurface  Surface,
MythDeintType  Deint,
bool  DoubleRate 
)
private

Definition at line 143 of file mythvdpauinterop.cpp.

Referenced by Acquire().

◆ Cleanup()

void MythVDPAUInterop::Cleanup ( void  )
private

Definition at line 50 of file mythvdpauinterop.cpp.

Referenced by InitVDPAU(), and ~MythVDPAUInterop().

◆ CleanupDeinterlacer()

void MythVDPAUInterop::CleanupDeinterlacer ( void  )
private

Definition at line 75 of file mythvdpauinterop.cpp.

Referenced by Acquire(), and ~MythVDPAUInterop().

◆ RotateReferenceFrames()

void MythVDPAUInterop::RotateReferenceFrames ( AVBufferRef *  Buffer)
private

Definition at line 84 of file mythvdpauinterop.cpp.

Referenced by Acquire().

Friends And Related Function Documentation

◆ MythOpenGLInterop

friend class MythOpenGLInterop
friend

Definition at line 29 of file mythvdpauinterop.h.

Member Data Documentation

◆ m_colourSpace

VideoColourSpace* MythVDPAUInterop::m_colourSpace { nullptr }
private

Definition at line 54 of file mythvdpauinterop.h.

Referenced by Acquire(), UpdateColourSpace(), and ~MythVDPAUInterop().

◆ m_helper

MythVDPAUHelper* MythVDPAUInterop::m_helper { nullptr }
private

◆ m_outputSurface

VdpOutputSurface MythVDPAUInterop::m_outputSurface { 0 }
private

Definition at line 56 of file mythvdpauinterop.h.

Referenced by Acquire(), Cleanup(), and InitVDPAU().

◆ m_outputSurfaceReg

MythVDPAUSurfaceNV MythVDPAUInterop::m_outputSurfaceReg { 0 }
private

Definition at line 57 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_mixer

VdpVideoMixer MythVDPAUInterop::m_mixer { 0 }
private

Definition at line 58 of file mythvdpauinterop.h.

Referenced by Acquire(), Cleanup(), InitVDPAU(), and UpdateColourSpace().

◆ m_mixerChroma

VdpChromaType MythVDPAUInterop::m_mixerChroma { VDP_CHROMA_TYPE_420 }
private

Definition at line 59 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_mixerSize

QSize MythVDPAUInterop::m_mixerSize { }
private

Definition at line 60 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_deinterlacer

MythDeintType MythVDPAUInterop::m_deinterlacer { DEINT_BASIC }
private

Definition at line 61 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_referenceFrames

QVector<AVBufferRef*> MythVDPAUInterop::m_referenceFrames { }
private

Definition at line 62 of file mythvdpauinterop.h.

Referenced by Acquire(), CleanupDeinterlacer(), and RotateReferenceFrames().

◆ m_initNV

MYTH_VDPAUINITNV MythVDPAUInterop::m_initNV { nullptr }
private

Definition at line 63 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_finiNV

MYTH_VDPAUFININV MythVDPAUInterop::m_finiNV { nullptr }
private

Definition at line 64 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitNV().

◆ m_registerNV

MYTH_VDPAUREGOUTSURFNV MythVDPAUInterop::m_registerNV { nullptr }
private

Definition at line 65 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_accessNV

MYTH_VDPAUSURFACCESSNV MythVDPAUInterop::m_accessNV { nullptr }
private

Definition at line 66 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_mapNV

MYTH_VDPAUMAPSURFNV MythVDPAUInterop::m_mapNV { nullptr }
private

Definition at line 67 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_codec

MythCodecID MythVDPAUInterop::m_codec { kCodec_NONE }
private

Definition at line 68 of file mythvdpauinterop.h.

Referenced by Acquire().

◆ m_preempted

bool MythVDPAUInterop::m_preempted { false }
private

Definition at line 69 of file mythvdpauinterop.h.

Referenced by Acquire(), Cleanup(), DisplayPreempted(), and IsPreempted().

◆ m_preemptedWarning

bool MythVDPAUInterop::m_preemptedWarning { false }
private

Definition at line 70 of file mythvdpauinterop.h.

Referenced by Acquire().


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