NVIDIA DRIVE OS Linux API Reference

5.1.3.0 Release

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nvros::NvRosEglCudaIO Class Reference

Detailed Description

Creates CUDA processing pipelines for EGLStreams.

This class can be treated as a pipe between two EGLStreams. The input end of this pipe connects to a given EGLStream and receives the contents in the form of a CUarray to process with the desired algorithm. The algorithm returns the processed contents in the form of a CUarray. The output end of this pipe puts the processed contents into an EGLStream that can be displayed on another processing subsystem.

Definition at line 100 of file nvros_egl_cuda_io.h.

Public Member Functions

 NvRosEglCudaIO ()
 Constructs the NvRosEglCudaIO class object. More...
 
 ~NvRosEglCudaIO ()
 Destroys the NvRosEglCudaIO object. More...
 
NvRosErr SetGlobalContext (CUcontext &context)
 Sets the global CUDA context for all threads that perform CUDA EGL inter-operations and executes certain CUDA algorithms. More...
 
NvRosErr InitEglCuIO (const char *inputSocketPath, const char *outputSocketPath)
 Initializes the EGL CUDA pipeline over the given input and output EGLStream socket paths. More...
 
NvRosErr RunEglCuInputLoop ()
 Fetches frames from the EGL CUDA pipeline over the input EGLStream and places them into the queue. More...
 
NvRosErr RunEglCuOutputLoop ()
 Sets up the CUDA context for the CUDA producer role. More...
 
NvRosErr StopEglCuInputLoop ()
 Stops the iterative processing of the EGL CUDA pipeline over the input stream as started by RunEglCuInputLoop. More...
 
NvRosErr StopEglCuOutputLoop ()
 Stops the iterative processing of the EGL CUDA pipeline over the output stream as started by RunEglCuOutputLoop. More...
 
NvRosErr RegisterErrCallbackFunc (void(*errCallback)(unsigned int))
 Registers a callback function for CUDA EGL library to invoke when an error is encountered. More...
 
EglFrameParams GetInEglFrameParams ()
 Gets parameters of input EGL frames. More...
 
NvRosErr SetOutEglFrameParams (EglFrameParams mOutEglFrameParams)
 Sets parameters of output EGL frames. More...
 
int GetAvailableFrameCount ()
 Gets the number of frames available for processing. More...
 
CUarray GetEglFrameContent ()
 Gets the contents from the first, oldest unprocessed EGL frame in the form of a CUarray that can be passed to a processing subsystem. More...
 
CUdeviceptr GetEglFrameContent (bool pitchLinearFrame)
 Gets the contents from the first, oldest unprocessed EGL frame in the form of a CUdeviceptr that can be passed to a processing subsystem. More...
 
NvRosErr PushEglFrameOut (CUarray outputArray)
 Pushes processed EGL frames out. More...
 
NvRosErr PushEglFrameOut (CUdeviceptr outCUdevptr)
 Pushes processed EGL frame out. More...
 

Constructor & Destructor Documentation

nvros::NvRosEglCudaIO::NvRosEglCudaIO ( )

Constructs the NvRosEglCudaIO class object.

nvros::NvRosEglCudaIO::~NvRosEglCudaIO ( )

Destroys the NvRosEglCudaIO object.

Member Function Documentation

int nvros::NvRosEglCudaIO::GetAvailableFrameCount ( )

Gets the number of frames available for processing.

Returns
The number of EGL frames that are received but not processed.
CUarray nvros::NvRosEglCudaIO::GetEglFrameContent ( )

Gets the contents from the first, oldest unprocessed EGL frame in the form of a CUarray that can be passed to a processing subsystem.

Return values
CUarrayImage data from the EGL frame.
CUdeviceptr nvros::NvRosEglCudaIO::GetEglFrameContent ( bool  pitchLinearFrame)

Gets the contents from the first, oldest unprocessed EGL frame in the form of a CUdeviceptr that can be passed to a processing subsystem.

Parameters
pitchLinearFrameA flag, if true, indicates that the the EGL frame is of pitch linear type.
Return values
CUdeviceptrImage data from the EGL frame.
EglFrameParams nvros::NvRosEglCudaIO::GetInEglFrameParams ( )

Gets parameters of input EGL frames.

Returns
EglFrameParams A structure populated with frame parameters.
NvRosErr nvros::NvRosEglCudaIO::InitEglCuIO ( const char *  inputSocketPath,
const char *  outputSocketPath 
)

Initializes the EGL CUDA pipeline over the given input and output EGLStream socket paths.

This function performs the following:

  1. Internally initializes the NvRosEglUtil object.
  2. Initializes two EGLStreams on the socket paths provided while constructing the NvRosEglCudaIO object.
  3. One side is initialized as CUDA consumer and the other as CUDA producer.
    Parameters
    inputSocketPathConnects the EGLStream socket path to receive the input EGLStream.
    outputSocketPathConnects EGLStream stream to emit processed EGLStream.
    Returns
    NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::PushEglFrameOut ( CUarray  outputArray)

Pushes processed EGL frames out.

Parameters
outputArrayA CUarray consisting of processed data contents to put in the EGL frame.
Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::PushEglFrameOut ( CUdeviceptr  outCUdevptr)

Pushes processed EGL frame out.

Parameters
outCUdevptrCUdevptr consisting of processed data contents to put in the EGL frame.
Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::RegisterErrCallbackFunc ( void(*)(unsigned int)  errCallback)

Registers a callback function for CUDA EGL library to invoke when an error is encountered.

The error code is obtained as an argument of this callback function.

Parameters
errCallbackA pointer to a function with this signature:
void (*errCallback)(unsigned int)
.
Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::RunEglCuInputLoop ( )

Fetches frames from the EGL CUDA pipeline over the input EGLStream and places them into the queue.

This function runs in a loop and must not run indefinitely without the associated RunEglCuOutputLoop running.

Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::RunEglCuOutputLoop ( )

Sets up the CUDA context for the CUDA producer role.

Fetches frames from the queue as they become available and places them into the EGL CUDA pipeline over the output EGLStream. This function runs in a loop, see RunEglCuInputLoop.

Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::SetGlobalContext ( CUcontext &  context)

Sets the global CUDA context for all threads that perform CUDA EGL inter-operations and executes certain CUDA algorithms.

Parameters
contextSpecifies a valid CUcontext initialized in a calling thread.
Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::SetOutEglFrameParams ( EglFrameParams  mOutEglFrameParams)

Sets parameters of output EGL frames.

Parameters
mOutEglFrameParamsEglFrameParams structure populated with desired EGL frame parameters.
Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::StopEglCuInputLoop ( )

Stops the iterative processing of the EGL CUDA pipeline over the input stream as started by RunEglCuInputLoop.

Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.
NvRosErr nvros::NvRosEglCudaIO::StopEglCuOutputLoop ( )

Stops the iterative processing of the EGL CUDA pipeline over the output stream as started by RunEglCuOutputLoop.

Returns
NVROS_SUCCESS on successful execution, or NVROS_ERR otherwise.

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