19 #ifndef _NVROS_EGL_CUDA_IO_
20 #define _NVROS_EGL_CUDA_IO_
23 #include <condition_variable>
25 #include "nvros_egl_utils/nvros_egl_utils.h"
106 std::queue<CUarray> inQ;
107 std::queue<CUarray> outQ;
108 std::queue<CUdeviceptr> inQPl;
109 std::queue<CUdeviceptr> outQPl;
110 const char* inSocketPath;
111 const char* outSocketPath;
116 EGLStreamKHR eglStreamIn;
117 EGLStreamKHR eglStreamOut;
118 EGLDisplay eglDisplayIn;
119 EGLDisplay eglDisplayOut;
122 void (*errCallback)(
unsigned int);
127 std::condition_variable inQCV;
128 std::mutex outFrameParamsWaitCVMtx;
129 std::condition_variable outFrameParamsWaitCV;
130 std::mutex outQMutex;
131 std::condition_variable outQCV;
NvRosErr RegisterErrCallbackFunc(void(*errCallback)(unsigned int))
Registers a callback function for CUDA EGL library to invoke when an error is encountered.
Class to initialize the EGLStream for the following roles: EGLOUTPUT_CONSUMER, CUDA_CONSUMER, CUDA_PRODUCER, IMAGE_PRODUCER.
NvRosErr PushEglFrameOut(CUarray outputArray)
Pushes processed EGL frames out.
NvRosErr RunEglCuInputLoop()
Fetches frames from the EGL CUDA pipeline over the input EGLStream and places them into the queue...
EglFrameParams GetInEglFrameParams()
Gets parameters of input EGL frames.
int GetAvailableFrameCount()
Gets the number of frames available for processing.
NvRosErr SetOutEglFrameParams(EglFrameParams mOutEglFrameParams)
Sets parameters of output EGL frames.
NvRosErr StopEglCuInputLoop()
Stops the iterative processing of the EGL CUDA pipeline over the input stream as started by RunEglCuI...
NvRosErr StopEglCuOutputLoop()
Stops the iterative processing of the EGL CUDA pipeline over the output stream as started by RunEglCu...
Indicates that an error occurred during the CUDA driver/runtime API call.
CUarray GetEglFrameContent()
Gets the contents from the first, oldest unprocessed EGL frame in the form of a CUarray that can be p...
unsigned int depth
Specifies the depth.
Indicates that EGLStream is in a disconnected state.
unsigned int frameType
Specifies the frame type.
NvRosEglCudaIO()
Constructs the NvRosEglCudaIO class object.
enum nvros::_EglCuIOErrors EglCuIOErrors
Defines the error codes emitted by the EGL CUDA IO library.
Creates CUDA processing pipelines for EGLStreams.
Holds the required EGL frame-related parameters for processing that frame.
unsigned int frameWidth
Specifies the width of the frame.
Indicates that the EGL frame is unsupported.
unsigned int colorFormat
Specifies the color format.
enum nvros::_NvRosErrCode NvRosErr
Declares error codes for all NvROS modules and packages.
~NvRosEglCudaIO()
Destroys the NvRosEglCudaIO object.
unsigned int frameHeight
Specifies the height of the frame.
unsigned int planes
Specifies the number of planes in the frame.
NvRosErr InitEglCuIO(const char *inputSocketPath, const char *outputSocketPath)
Initializes the EGL CUDA pipeline over the given input and output EGLStream socket paths...
Holds EGL related parameters.
unsigned int channels
Specifies the number of channels.
NvRosErr SetGlobalContext(CUcontext &context)
Sets the global CUDA context for all threads that perform CUDA EGL inter-operations and executes cert...
struct nvros::_EglFrameParams EglFrameParams
Holds the required EGL frame-related parameters for processing that frame.
Holds CUDA EGL related parameters.
_EglCuIOErrors
Defines the error codes emitted by the EGL CUDA IO library.
NvRosErr RunEglCuOutputLoop()
Sets up the CUDA context for the CUDA producer role.
unsigned int pitch
Specifies the pitch.