This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

jpeg decoder problem when run in a loop

Hi all,

I am using dvsdk_4_02_00_06 and linux 2.6.32.17 on DM 368. I want to implement MJPEG decoder in my video phone application to decode the data from external USB camera. i found a sample code for JPEG deocder in dvsdk packages. It works fine for decoding one input image. To check its feasibility as MJPEG decoder i put it in a while(1) so that it will decode and write the output in a file again and again.

It works fine for 36 frames and after that I am getting a segmentation fault. I tried to find how and why its getting a segment fault but am unable to do so. I printed params value and it seems that these values are getting corrupted somehow.

e.g normally forceChromaFormat is equal to 4 but it shows some garbage value at the time of segment fault. I don't know why this is happening.

Can anyone please tell me why I am getting this problem and how can I solve it?

Also, is it proper to use this JPEG deocder as MJPEG decoder in my application? If not then is there any other way?

Thanks a lot

Thanks,

Rohan

  • I think you would be getting the segmentation fault as the application would have ran out of memory. Note that the standard dvsdk app is only meant for jpeg decode. How are you making sure that the memory is reused ?

    regards

    Yashwant

  • Thanks for reply.

    I don't see any reason for application to run out of memory. I am allocating all the buffers only once. Also I am printing the addresses wherever the buffers are being accessed. Everything works fine for some time. I also commented the output file write code. It is getting a segment fault even if file write is removed.

    I also observed that buffer addresses are also getting corrupted sometimes. Don't know why..!! Buffer size is more that enough.

    CMEM_alloc is used to allocate the memory in this sample application.Is this problem has anything to do with that? How?

    Thanks,

    Rohan