Good morning everyone,
I am a beginner working with a DM6437 and I have an issue that I can't solve no matter what I do.
First let me explain my issue:
I am working with a camera that sends only 9 different images every second.
In the dm6437 program I am working with 25 images per second ( PAL format) to display images after the processing in a screen.
What I want to do is to process only one image every 3 images. So I first write the code that can do the basic display by using the different examples given.
Which is working.
Here are some of the lines of the code:
if(status)
{
FVID_queue(hGioVpfeCcdc, frameBuffTable[0]);
FVID_queue(hGioVpfeCcdc, frameBuffTable[1]);
FVID_queue(hGioVpfeCcdc, frameBuffTable[2]);
}
if(status)
{
FVID_queue(hGioVpbeVid0, frameBuffTable[3]);
FVID_queue(hGioVpbeVid0, frameBuffTable[4]);
FVID_queue(hGioVpbeVid0, frameBuffTable[5]);
}
if(status) FVID_dequeue(hGioVpfeCcdc, &frameBuffPtr);
while(status)
{
FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);
VLIB_extractLumaFromUYUV (((uint8_t*)(frameBuffPtr->frame.frameBufferPtr)), VID_DIMX_PAL,VID_DIMX_PAL,VID_DIMY_PAL, img); // basic processing
//BCACHE_wb(frameBuffPtr->frame.frameBufferPtr,VID_DIMY_PAL*VID_DIMX_PAL*2,true);
FVID_exchange(hGioVpbeVid0, &frameBuffPtr);
}
The problem comes after, because as I want to process only one image every 3 second, So first I have to remove the FVID_exchange API and replace them by FVID_queue and FVID_dequeue, and instead of using only one frameBuffPtr I have to use two of them: one I called CapframeBuffPtr and the other DispframeBuffPtr for the capture and display drivers.
So first I just wanted to do the equivalent with these API than with the FVID_exchange API which isn't working. It has been weeks than I try to find the solution but I didn't succeed. In a second time I want to process only one image every 3 image dequeued from the capture queue , and the others 2 images dequeued from the capture queue, just requeue them.
So please if there an expert that can clarify me, it would be welcome.
Sorry for my bad english.
And Thank you in advance.
Here is the code:
if(status)
{
FVID_queue(hGioVpfeCcdc, frameBuffTable[0]);
FVID_queue(hGioVpfeCcdc, frameBuffTable[1]);
FVID_queue(hGioVpfeCcdc, frameBuffTable[2]);
}
if(status)
{
FVID_queue(hGioVpbeVid0, frameBuffTable[3]);
FVID_queue(hGioVpbeVid0, frameBuffTable[4]);
FVID_queue(hGioVpbeVid0, frameBuffTable[5]);
}
FVID_dequeue(hGioVpbeVid0, &DispframeBuffPtr);
while(status)
{
//FVID_exchange(hGioVpfeCcdc, &frameBuffPtr);
FVID_dequeue(hGioVpfeCcdc,&CapframeBuffPtr);
//VLIB_extractLumaFromUYUV (((uint8_t*)(frameBuffPtr->frame.frameBufferPtr)), VID_DIMX_PAL,VID_DIMX_PAL,VID_DIMY_PAL, img);
VLIB_extractLumaFromUYUV (((uint8_t*)(CapframeBuffPtr->frame.frameBufferPtr)), VID_DIMX_PAL,VID_DIMX_PAL,VID_DIMY_PAL, img);
for(int i=0;i<720*560;i++)
{
((short*)(DispframeBuffPtr->frame.frameBufferPtr))[i]= ((short*)(CapframeBuffPtr->frame.frameBufferPtr))[i];
}
//BCACHE_wb(frameBuffPtr->frame.frameBufferPtr,VID_DIMY_PAL*VID_DIMX_PAL*2,true);
//FVID_exchange(hGioVpbeVid0, &frameBuffPtr); // display the video frame
FVID_queue(hGioVpfeCcdc,&CapframeBuffPtr);
FVID_queue(hGioVpbeVid0,&DispframeBuffPtr);
FVID_dequeue(hGioVpbeVid0,&DispframeBuffPtr);
}