Logo
ApraPipes 1.0
Loading...
Searching...
No Matches
DMAFDWrapper.h
1#pragma once
2#include "ApraEGLDisplay.h" // this is added to address the following issue: https://github.com/opencv/opencv/issues/7113
3#include "nvbuf_utils.h"
4#include "EGL/egl.h"
5#include "cudaEGL.h"
6
8{
9public:
10 /* Always use this static method to create DMAFDWrapper */
11 static DMAFDWrapper *create(int index, int width, int height,
12 NvBufferColorFormat colorFormat,
13 NvBufferLayout layout, EGLDisplay eglDisplay);
14
15 virtual ~DMAFDWrapper();
16
17 /* Return DMA buffer handle */
18 int getFd() const { return m_fd; }
19 EGLImageKHR getEGLImage() const { return eglImage; }
20 EGLDisplay getEGLDisplay() const { return eglDisplay; }
21 void* getHostPtr();
22 void* getHostPtrY();
23 void* getHostPtrU();
24 void* getHostPtrV();
25 void* getHostPtrUV();
26 void* getCudaPtr() const;
27 int getIndex() const;
28
29 const void* getClientData() const;
30 void setClientData(const void* clientData);
31
32
33public:
34 int tempFD;
35
36private:
37 DMAFDWrapper(int index, EGLDisplay EGLDisplay);
38
39private:
40 int m_fd;
41 EGLImageKHR eglImage;
42 CUgraphicsResource pResource;
43 CUeglFrame eglFrame;
44 EGLDisplay eglDisplay;
45
46 void* hostPtr; // Y, InterleavedUYVY, RGBA
47 void* hostPtrU; // U and UV (NV12)
48 void* hostPtrV;
49
50 uint8_t* cudaPtr;
51 const int index;
52
53 const void* clientData;
54};
Definition DMAFDWrapper.h:8
uint8_t * cudaPtr
Definition DMAFDWrapper.h:50
int m_fd
Definition DMAFDWrapper.h:40
EGLDisplay getEGLDisplay() const
Definition DMAFDWrapper.h:20
int tempFD
Definition DMAFDWrapper.h:34
void * getHostPtr()
Definition DMAFDWrapper.cpp:137
void setClientData(const void *clientData)
Definition DMAFDWrapper.cpp:192
EGLImageKHR eglImage
Definition DMAFDWrapper.h:41
void * getHostPtrY()
Definition DMAFDWrapper.cpp:147
const void * clientData
Definition DMAFDWrapper.h:53
void * hostPtrU
Definition DMAFDWrapper.h:47
CUgraphicsResource pResource
Definition DMAFDWrapper.h:42
void * hostPtrV
Definition DMAFDWrapper.h:48
static DMAFDWrapper * create(int index, int width, int height, NvBufferColorFormat colorFormat, NvBufferLayout layout, EGLDisplay eglDisplay)
Definition DMAFDWrapper.cpp:9
int getIndex() const
Definition DMAFDWrapper.cpp:182
CUeglFrame eglFrame
Definition DMAFDWrapper.h:43
const int index
Definition DMAFDWrapper.h:51
void * hostPtr
Definition DMAFDWrapper.h:46
void * getHostPtrUV()
Definition DMAFDWrapper.cpp:172
EGLImageKHR getEGLImage() const
Definition DMAFDWrapper.h:19
virtual ~DMAFDWrapper()
Definition DMAFDWrapper.cpp:95
const void * getClientData() const
Definition DMAFDWrapper.cpp:187
EGLDisplay eglDisplay
Definition DMAFDWrapper.h:44
void * getHostPtrU()
Definition DMAFDWrapper.cpp:152
int getFd() const
Definition DMAFDWrapper.h:18
void * getHostPtrV()
Definition DMAFDWrapper.cpp:162
DMAFDWrapper(int index, EGLDisplay EGLDisplay)
Definition DMAFDWrapper.cpp:84
void * getCudaPtr() const
Definition DMAFDWrapper.cpp:177