DriveWorks SDK Reference
3.0.4260 Release
For Test and Development only

Image Streamer
SW Release Applicability: This tutorial is applicable to modules in both NVIDIA DriveWorks and NVIDIA DRIVE Software releases.

This tutorial demonstrates how to stream an image from host (CPU) memory, to device (CUDA) memory.

The ImageStreamer module is accessed through a handle:

Creating an Image

To create an image for streaming:

// the image is going to be format interleaved RGB and type UINT_8
cpuProp.type = DW_IMAGE_CPU;
cpuProp.width = imageWidth;
cpuProp.height = imageHeight;
cpuProp.format = DW_IMAGE_FORMAT_RGB_UINT8;
cpuProp.memoryLayout = DW_IMAGE_MEMORY_TYPE_DEFAULT; // not necessary to specify if init with {}
//Create an image with these properties
dwImage_create(&rgbCPU, cpuProp, m_context);

Initializing the ImageStreamer Module

Once an image is creating for streaming, an ImageStreamer must be initialized to stream the CPU image to CUDA.
In the following example, the dwImageStreamerHandle_t handle initializes the ImageCapture module to stream
an image with cpuProp image properties to type dwImageCUDA:

// streamer from CPU to CUDA
dwImageStreamer_initialize(streamerCPU2CUDA, &cpuProp, DW_IMAGE_CUDA, dwContext);

Streaming the Image

To stream the image:


Returning the Images

An image must be returned once streaming to CUDA memory is complete:


Releasing the Handle

To release the handle:


To see a full demonstration of this workflow, please refer to Simple Image Streamer Sample.