DriveWorks SDK Reference
5.8.83 Release
For Test and Development only

Image Streamer Cross-Process

In addition to using the ImageStreamer module in a single process, you can also use it across multiple processes.

To utilize the ImageStreamer Cross-Process module, specify the ImageStreamer as either PRODUCER or CONSUMER
at initialization before streaming the image. For details on how to create and convert an image, please refer to
Image Creation and Conversion. All other details are left out of this tutorial for simplicity.

Initializing the ImageStreamer Module as a Producer

// Process 1:
while(true)
{
// CODE: Get an image to stream
}
DW_API_PUBLIC dwStatus dwImageStreamer_release(dwImageStreamerHandle_t streamer)
Releases the image streamer.
DW_API_PUBLIC dwStatus dwImageStreamer_initializeCrossProcess(dwImageStreamerHandle_t *streamer, const dwImageProperties *from, dwImageType to, dwImageStreamerCrossProcessModeParams params, dwContextHandle_t ctx)
Creates and initializes the image streamer capable of moving images between different API types acros...
DW_API_PUBLIC dwStatus dwImageStreamer_producerReturn(dwImageHandle_t *const image, dwTime_t const timeoutUs, dwImageStreamerHandle_t const streamer)
The producer streamer waits for the image sent to be returned by the consumer.
DW_API_PUBLIC dwStatus dwImageStreamer_producerSend(dwImageHandle_t image, dwImageStreamerHandle_t const streamer)
Sends an image through the streamer acting as the producer.

Initializing the ImageStreamer Module as a Consumer

// Process 2:
while(true)
{
// CODE: Use the streamed image
}
DW_API_PUBLIC dwStatus dwImageStreamer_consumerReturn(dwImageHandle_t *image, dwImageStreamerHandle_t const streamer)
Return the received image back to the producer.
DW_API_PUBLIC dwStatus dwImageStreamer_consumerReceive(dwImageHandle_t *image, dwTime_t const timeoutUs, dwImageStreamerHandle_t const streamer)
Receive a pointer to a dwImageHandle_t from the streamer, acting as a consumer.

To see a full demonstration of this workflow, please refer to dwx_image_streamer_cross_sample.