MythTV  master
Public Slots | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | 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)
 

Public Member Functions

std::vector< MythVideoTextureOpenGL * > Acquire (MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
 Map VDPAU video surfaces to an OpenGL texture. More...
 
bool IsPreempted (void) const
 
- Public Member Functions inherited from MythOpenGLInterop
 ~MythOpenGLInterop () override
 
- Public Member Functions inherited from MythInteropGPU
 MythInteropGPU (MythRender *Context, InteropType Type, MythPlayerUI *Player=nullptr)
 
 ~MythInteropGPU () override
 
InteropType GetType ()
 
MythPlayerUIGetPlayer ()
 
void SetDefaultFree (FreeAVHWDeviceContext FreeContext)
 
void SetDefaultUserOpaque (void *UserOpaque)
 
FreeAVHWDeviceContext GetDefaultFree ()
 
void * GetDefaultUserOpaque ()
 
- 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 void GetVDPAUTypes (MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
 
static MythVDPAUInteropCreateVDPAU (MythPlayerUI *Player, MythRenderOpenGL *Context, MythCodecID CodecId)
 
- Static Public Member Functions inherited from MythOpenGLInterop
static void GetTypes (MythRender *Render, MythInteropGPU::InteropMap &Types)
 
static std::vector< MythVideoTextureOpenGL * > Retrieve (MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan)
 
- Static Public Member Functions inherited from MythInteropGPU
static InteropMap GetTypes (MythRender *Render)
 
static QString TypeToString (InteropType Type)
 
static QString TypesToString (const InteropMap &Types)
 
static MythInteropGPUCreateDummy ()
 
- 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 (MythPlayerUI *Player, MythRenderOpenGL *Context, MythCodecID CodecID)
 
 ~MythVDPAUInterop () override
 
- Protected Member Functions inherited from MythOpenGLInterop
 MythOpenGLInterop (MythRenderOpenGL *Context, InteropType Type, MythPlayerUI *Player=nullptr)
 
virtual void DeleteTextures ()
 
- Protected Member Functions inherited from ReferenceCounter
virtual ~ReferenceCounter (void)
 Called on destruction, will warn if object deleted with references in place. More...
 

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

MythVideoColourSpacem_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 }
 
MYTH_VDPAUMAPSURFNV m_unmapNV { nullptr }
 
MythCodecID m_codec { kCodec_NONE }
 
bool m_preempted { false }
 
bool m_preemptedWarning { false }
 
bool m_mapped { false }
 

Additional Inherited Members

- Public Types inherited from MythInteropGPU
enum  InteropType {
  Unsupported = 0, GL_VAAPIGLXCOPY, GL_VAAPIGLXPIX, GL_VAAPIEGLDRM,
  GL_VTB, GL_VTBSURFACE, GL_MEDIACODEC, GL_VDPAU,
  GL_NVDEC, GL_MMAL, GL_DRMPRIME, DRM_DRMPRIME,
  DUMMY
}
 
using InteropTypes = std::vector< InteropType >
 
using InteropMap = std::map< VideoFrameType, InteropTypes >
 
- Protected Attributes inherited from MythOpenGLInterop
MythRenderOpenGLm_openglContext { nullptr }
 
QHash< unsigned long long, std::vector< MythVideoTextureOpenGL * > > m_openglTextures
 
- Protected Attributes inherited from MythInteropGPU
MythRenderm_context { nullptr }
 
QSize m_textureSize
 
uint64_t m_discontinuityCounter { 0 }
 
FreeAVHWDeviceContext m_defaultFree { nullptr }
 
void * m_defaultUserOpaque { nullptr }
 
MythPlayerUIm_player { nullptr }
 
InteropType m_type { Unsupported }
 
- 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 ( MythPlayerUI Player,
MythRenderOpenGL Context,
MythCodecID  CodecID 
)
protected

Definition at line 37 of file mythvdpauinterop.cpp.

Referenced by CreateVDPAU().

◆ ~MythVDPAUInterop()

MythVDPAUInterop::~MythVDPAUInterop ( )
overrideprotected

Definition at line 43 of file mythvdpauinterop.cpp.

Member Function Documentation

◆ GetVDPAUTypes()

void MythVDPAUInterop::GetVDPAUTypes ( MythRenderOpenGL Render,
MythInteropGPU::InteropMap Types 
)
static

Definition at line 25 of file mythvdpauinterop.cpp.

Referenced by CreateVDPAU(), and MythOpenGLInterop::GetTypes().

◆ CreateVDPAU()

MythVDPAUInterop * MythVDPAUInterop::CreateVDPAU ( MythPlayerUI Player,
MythRenderOpenGL Context,
MythCodecID  CodecId 
)
static

Definition at line 9 of file mythvdpauinterop.cpp.

Referenced by MythVDPAUContext::InitialiseContext().

◆ Acquire()

std::vector< MythVideoTextureOpenGL * > MythVDPAUInterop::Acquire ( MythRenderOpenGL Context,
MythVideoColourSpace ColourSpace,
MythVideoFrame 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 225 of file mythvdpauinterop.cpp.

◆ IsPreempted()

bool MythVDPAUInterop::IsPreempted ( void  ) const

Definition at line 387 of file mythvdpauinterop.cpp.

◆ UpdateColourSpace

void MythVDPAUInterop::UpdateColourSpace ( bool  PrimariesChanged)
slot

Definition at line 368 of file mythvdpauinterop.cpp.

Referenced by Acquire().

◆ DisplayPreempted

void MythVDPAUInterop::DisplayPreempted ( void  )
slot

Definition at line 377 of file mythvdpauinterop.cpp.

Referenced by InitNV().

◆ InitNV()

bool MythVDPAUInterop::InitNV ( AVVDPAUDeviceContext *  DeviceContext)
private

Definition at line 114 of file mythvdpauinterop.cpp.

Referenced by Acquire().

◆ InitVDPAU()

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

Definition at line 151 of file mythvdpauinterop.cpp.

Referenced by Acquire().

◆ Cleanup()

void MythVDPAUInterop::Cleanup ( void  )
private

Definition at line 57 of file mythvdpauinterop.cpp.

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

◆ CleanupDeinterlacer()

void MythVDPAUInterop::CleanupDeinterlacer ( void  )
private

Definition at line 82 of file mythvdpauinterop.cpp.

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

◆ RotateReferenceFrames()

void MythVDPAUInterop::RotateReferenceFrames ( AVBufferRef *  Buffer)
private

Definition at line 91 of file mythvdpauinterop.cpp.

Referenced by Acquire().

Member Data Documentation

◆ m_colourSpace

MythVideoColourSpace* MythVDPAUInterop::m_colourSpace { nullptr }
private

Definition at line 53 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 55 of file mythvdpauinterop.h.

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

◆ m_outputSurfaceReg

MythVDPAUSurfaceNV MythVDPAUInterop::m_outputSurfaceReg { 0 }
private

Definition at line 56 of file mythvdpauinterop.h.

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

◆ m_mixer

VdpVideoMixer MythVDPAUInterop::m_mixer { 0 }
private

Definition at line 57 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 58 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_mixerSize

QSize MythVDPAUInterop::m_mixerSize
private

Definition at line 59 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_deinterlacer

MythDeintType MythVDPAUInterop::m_deinterlacer { DEINT_BASIC }
private

Definition at line 60 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitVDPAU().

◆ m_referenceFrames

QVector<AVBufferRef*> MythVDPAUInterop::m_referenceFrames
private

Definition at line 61 of file mythvdpauinterop.h.

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

◆ m_initNV

MYTH_VDPAUINITNV MythVDPAUInterop::m_initNV { nullptr }
private

Definition at line 62 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_finiNV

MYTH_VDPAUFININV MythVDPAUInterop::m_finiNV { nullptr }
private

Definition at line 63 of file mythvdpauinterop.h.

Referenced by Cleanup(), and InitNV().

◆ m_registerNV

MYTH_VDPAUREGOUTSURFNV MythVDPAUInterop::m_registerNV { nullptr }
private

Definition at line 64 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_accessNV

MYTH_VDPAUSURFACCESSNV MythVDPAUInterop::m_accessNV { nullptr }
private

Definition at line 65 of file mythvdpauinterop.h.

Referenced by InitNV(), and InitVDPAU().

◆ m_mapNV

MYTH_VDPAUMAPSURFNV MythVDPAUInterop::m_mapNV { nullptr }
private

Definition at line 66 of file mythvdpauinterop.h.

Referenced by Acquire(), and InitNV().

◆ m_unmapNV

MYTH_VDPAUMAPSURFNV MythVDPAUInterop::m_unmapNV { nullptr }
private

Definition at line 67 of file mythvdpauinterop.h.

Referenced by Acquire(), and InitNV().

◆ 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().

◆ m_mapped

bool MythVDPAUInterop::m_mapped { false }
private

Definition at line 71 of file mythvdpauinterop.h.

Referenced by Acquire(), and Cleanup().


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