MythTV master
mythnvdecinterop.h
Go to the documentation of this file.
1#ifndef MYTHNVDECINTEROP_H
2#define MYTHNVDECINTEROP_H
3
4// MythTV
6
7extern "C" {
8#include <ffnvcodec/dynlink_cuda.h>
9struct CudaFunctions;
10}
11
13{
14 public:
17 static bool CreateCUDAContext(MythRenderOpenGL* GLContext, CudaFunctions*& CudaFuncs,
18 CUcontext& CudaContext);
19 static void CleanupContext(MythRenderOpenGL* GLContext, CudaFunctions*& CudaFuncs,
20 CUcontext& CudaContext);
21
22 bool IsValid();
23 CUcontext GetCUDAContext();
24
25 std::vector<MythVideoTextureOpenGL*>
26 Acquire(MythRenderOpenGL* Context, MythVideoColourSpace* ColourSpace,
27 MythVideoFrame* Frame, FrameScanType Scan) override;
28
29 protected:
31 ~MythNVDECInterop() override;
32
33 private:
34 bool InitialiseCuda();
35 void DeleteTextures() override;
36 void RotateReferenceFrames(CUdeviceptr Buffer);
37 static bool CreateCUDAPriv(MythRenderOpenGL* GLContext, CudaFunctions*& CudaFuncs,
38 CUcontext& CudaContext, bool& Retry);
39 CUcontext m_cudaContext {};
40 CudaFunctions* m_cudaFuncs { nullptr };
41 QVector<CUdeviceptr> m_referenceFrames;
42};
43
44#endif
std::map< VideoFrameType, InteropTypes > InteropMap
std::vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Map CUDA video memory to OpenGL textures.
CUcontext GetCUDAContext()
static bool CreateCUDAPriv(MythRenderOpenGL *GLContext, CudaFunctions *&CudaFuncs, CUcontext &CudaContext, bool &Retry)
bool InitialiseCuda()
Initialise a CUDA context.
CudaFunctions * m_cudaFuncs
MythNVDECInterop(MythPlayerUI *Player, MythRenderOpenGL *Context)
static bool CreateCUDAContext(MythRenderOpenGL *GLContext, CudaFunctions *&CudaFuncs, CUcontext &CudaContext)
~MythNVDECInterop() override
void RotateReferenceFrames(CUdeviceptr Buffer)
static MythNVDECInterop * CreateNVDEC(MythPlayerUI *Player, MythRenderOpenGL *Context)
static void GetNVDECTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
void DeleteTextures() override
QVector< CUdeviceptr > m_referenceFrames
CUcontext m_cudaContext
static void CleanupContext(MythRenderOpenGL *GLContext, CudaFunctions *&CudaFuncs, CUcontext &CudaContext)
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
FrameScanType
Definition: videoouttypes.h:95