MythTV  master
mythnvdecinterop.h
Go to the documentation of this file.
1 #ifndef MYTHNVDECINTEROP_H
2 #define MYTHNVDECINTEROP_H
3 
4 // MythTV
6 
7 // FFmpeg
8 extern "C" {
9 #include "compat/cuda/dynlink_loader.h"
10 #include "libavutil/hwcontext_cuda.h"
11 }
12 
14 {
15  public:
16  static void GetNVDECTypes(MythRenderOpenGL* Render, MythInteropGPU::InteropMap& Types);
18  static bool CreateCUDAContext(MythRenderOpenGL* GLContext, CudaFunctions*& CudaFuncs,
19  CUcontext& CudaContext);
20  static void CleanupContext(MythRenderOpenGL* GLContext, CudaFunctions*& CudaFuncs,
21  CUcontext& CudaContext);
22 
23  bool IsValid();
24  CUcontext GetCUDAContext();
25  vector<MythVideoTextureOpenGL*> Acquire(MythRenderOpenGL* Context, MythVideoColourSpace* ColourSpace,
26  MythVideoFrame* Frame, FrameScanType Scan) override;
27 
28  protected:
30  ~MythNVDECInterop() override;
31 
32  private:
33  bool InitialiseCuda();
34  void DeleteTextures() override;
35  void RotateReferenceFrames(CUdeviceptr Buffer);
36  static bool CreateCUDAPriv(MythRenderOpenGL* GLContext, CudaFunctions*& CudaFuncs,
37  CUcontext& CudaContext, bool& Retry);
38  CUcontext m_cudaContext;
39  CudaFunctions* m_cudaFuncs { nullptr };
40  QVector<CUdeviceptr> m_referenceFrames;
41 };
42 
43 #endif
MythNVDECInterop::GetNVDECTypes
static void GetNVDECTypes(MythRenderOpenGL *Render, MythInteropGPU::InteropMap &Types)
Definition: mythnvdecinterop.cpp:94
MythNVDECInterop::m_referenceFrames
QVector< CUdeviceptr > m_referenceFrames
Definition: mythnvdecinterop.h:40
MythNVDECInterop::m_cudaContext
CUcontext m_cudaContext
Definition: mythnvdecinterop.h:38
mythopenglinterop.h
Frame
Definition: zmdefines.h:93
FrameScanType
FrameScanType
Definition: videoouttypes.h:94
MythNVDECInterop
Definition: mythnvdecinterop.h:13
MythNVDECInterop::RotateReferenceFrames
void RotateReferenceFrames(CUdeviceptr Buffer)
Definition: mythnvdecinterop.cpp:411
MythNVDECInterop::Acquire
vector< MythVideoTextureOpenGL * > Acquire(MythRenderOpenGL *Context, MythVideoColourSpace *ColourSpace, MythVideoFrame *Frame, FrameScanType Scan) override
Map CUDA video memory to OpenGL textures.
Definition: mythnvdecinterop.cpp:107
MythInteropGPU::InteropMap
std::map< VideoFrameType, InteropTypes > InteropMap
Definition: mythinteropgpu.h:45
MythPlayerUI
Definition: mythplayerui.h:10
MythOpenGLInterop
Definition: mythopenglinterop.h:17
MythNVDECInterop::CreateCUDAContext
static bool CreateCUDAContext(MythRenderOpenGL *GLContext, CudaFunctions *&CudaFuncs, CUcontext &CudaContext)
Definition: mythnvdecinterop.cpp:372
MythNVDECInterop::IsValid
bool IsValid()
Definition: mythnvdecinterop.cpp:68
MythNVDECInterop::CreateCUDAPriv
static bool CreateCUDAPriv(MythRenderOpenGL *GLContext, CudaFunctions *&CudaFuncs, CUcontext &CudaContext, bool &Retry)
Definition: mythnvdecinterop.cpp:317
MythNVDECInterop::DeleteTextures
void DeleteTextures() override
Definition: mythnvdecinterop.cpp:37
MythRenderOpenGL
Definition: mythrenderopengl.h:96
Buffer
Definition: MythExternControl.h:36
MythNVDECInterop::GetCUDAContext
CUcontext GetCUDAContext()
Definition: mythnvdecinterop.cpp:73
MythNVDECInterop::InitialiseCuda
bool InitialiseCuda()
Initialise a CUDA context.
Definition: mythnvdecinterop.cpp:312
MythNVDECInterop::CreateNVDEC
static MythNVDECInterop * CreateNVDEC(MythPlayerUI *Player, MythRenderOpenGL *Context)
Definition: mythnvdecinterop.cpp:78
MythNVDECInterop::CleanupContext
static void CleanupContext(MythRenderOpenGL *GLContext, CudaFunctions *&CudaFuncs, CUcontext &CudaContext)
Definition: mythnvdecinterop.cpp:396
MythNVDECInterop::~MythNVDECInterop
~MythNVDECInterop() override
Definition: mythnvdecinterop.cpp:30
Player
Definition: zmliveplayer.h:34
MythVideoFrame
Definition: mythframe.h:85
MythVideoColourSpace
MythVideoColourSpace contains a QMatrix4x4 that can convert YCbCr data to RGB.
Definition: mythvideocolourspace.h:20
MythNVDECInterop::m_cudaFuncs
CudaFunctions * m_cudaFuncs
Definition: mythnvdecinterop.h:39
MythNVDECInterop::MythNVDECInterop
MythNVDECInterop(MythPlayerUI *Player, MythRenderOpenGL *Context)
Definition: mythnvdecinterop.cpp:23