Hello Steve
I know it is hard to see without the code. I didn’t put it because it is based on the sample_drivenet code. I only modified onProcess() for the getNextFrame function. I will try to explain what I did:
two streamer were initialized:
m_streamerCPU2CUDA
m_streamerCUDA2GL
then in onProcess() a CPU image is creted:
dwImageCPU *cpu_a;
after recieving the pixel values, they are copied to the CPU image
mempcpy(cpu_a->data[0], pixel_data_R, DATA_SIZE / 3); //
mempcpy(cpu_a->data[1], pixel_data_G, DATA_SIZE / 3); // ...
mempcpy(cpu_a->data[2], pixel_data_B, DATA_SIZE / 3);
after that, stream cpu image to CUDA:
status = dwImageStreamer_producerSend(m_rgbCPU, m_streamerCPU2CUDA);
status = dwImageStreamer_consumerReceive(&rgbCUDA, 1000, m_streamerCPU2CUDA)
dwImage_getCUDA(nextFrameCUDA, rgbCUDA); // nextFrameCUDA is the output for getNextFrame().
then format convert the RGB into RGBA
status = dwImage_copyConvert(m_rgbaCUDA, rgbCUDA, m_context);
stream CUDA image to GL
status = dwImageStreamerGL_producerSend(m_rgbaCUDA, m_streamerCUDA2GL);
status = dwImageStreamerGL_consumerReceive(&glImageNew, 1000, m_streamerCUDA2GL);
dwImage_getGL(nextFrameGL, glImageNew);//nextFrameGL is also the ouput for getNextFrame like in the original drivenet sample code.
at last return the streamers
CHECK_DW_ERROR(dwImageStreamerGL_consumerReturn(&glImageNew, m_streamerCUDA2GL));
CHECK_DW_ERROR(dwImageStreamerGL_producerReturn(nullptr, 1000, m_streamerCUDA2GL));
CHECK_DW_ERROR(dwImageStreamer_consumerReturn(&rgbCUDA, m_streamerCPU2CUDA));
CHECK_DW_ERROR(dwImageStreamer_producerReturn(nullptr, 1000, m_streamerCPU2CUDA));
//endof getNextFrame()
The thing I don’t understand is it works good on HOST PC, but not on target…