How to stream and display images updated in callback function

Hello everyone,

I’m having a trouble to link an image continuously updated in a callback function (video from UDP) to driveworks. The image is on CPU and I’ve already tried to use the dwImageStreamer as in the following code inside of my callback function:

*(&image->data[0]) = t_ima.data; // image is a dwImageCPU
        dwImageStreamer_postCPU(image, m_cpuImas);
        dwImageCUDA *cudaYUV = new dwImageCUDA;

        dwImageStreamer_receiveCUDA(&cudaYUV, 10000,m_cpuImas);

        dwImageFormatConverter_copyConvertCUDA(g_cudaRGBA, cudaYUV, g_yuv2RGBA, (cudaStream_t)0);

        dwImageStreamer_postCUDA(g_cudaRGBA, g_image2GL);

        dwImageGL *m_frameGlRgba;
        dwImageStreamer_receiveGL(&m_frameGlRgba, 30000, g_image2GL);

        dwImageCUDA *processed;
        if (dwImageStreamer_waitPostedCUDA(&processed, 30000, g_image2GL) !=
                DW_SUCCESS ||
            processed != g_cudaRGBA) {
            std::cerr << "consumer did not gave frame back" << std::endl;
        }
        *(g_newFrames[0]) = *cudaYUV;

All the streamer variables were initialized before. There is no error in the compilation, however I got a seg default or sometimes just black image in the GUI. Can anyone have solved this issue? or have some similar code example?

Thank you in advance.