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.

dequeue of framebuffer

hi,

As i understand i use 3 buffers in order to captuer image and 3 others to realese it to the output.

when i want to make that some fuction will run over the frame i ues the current frame:

process_test( (void*)(frameBuffPtr->frame.frameBufferPtr), 576, 720);

my question is how can i use a previews buffer or the next one?

 

thanks alot,

vadim

  • I am not sure I perfectly understand your question but I will give it a shot. The driver will swap your frame with the FVID_exchange call, so that is how you get your next frame from the capture driver or give your next frame to the display, the driver will be processing on the frames you pass to it so you cannot necessarily get a previous buffer. If you have buffers you want to be able to back and forth with you can allocate additional buffer space and save the frames you want to be able to go back to but the driver is not really keeping a history of frame buffers.

    The FVID_exchange call is actually equivalent to FVID_queue followed by FVID_dequeue, that is it effectively gives your current frame to the driver and then requests the next frame, the drivers will always give and expect the latest frame.

  • thank you for your answer, but let me try to explain what i want to do.

    i want to make some convoltion (for start 3X1: (    1    0    -1    ) it spose to be age detection if im not mistaken))

    in order to do that i want to make the function work on the currentframe and then the answer not to use in that frame because it wont work but to give it to the next frame and so on,

    in order to that i want to know if there is a way to get the 2 buffers one after another to work on the first and then the answer of the convolution to the next frame.

    i thoufgt that it shuld be that kind of option to get (n-2) and (n-1) buffers and not just working on the current one (n). if there is no use of it why we use 3 buffers from the start?

    and as i understand i can just comy a framy to the memory and work on it but is it the only solution?

     

    thanks alot,

    vadim

  • Vadim said:
    if there is no use of it why we use 3 buffers from the start?

    The buffers are not there so you can go look at prior frames, but rather so that the driver can continuously be filling/displaying frames while your application code has one to work on, so as soon as you give a frame buffer back to the driver it could potentially be filing it with the next new frame or be in the process of displaying the image. This being said, even though there are typically three frames allocated you only use one in your application code at a given time, and if you need to have multiple previous frames you just need to allocate additional frames and than manage them in your application code instead of passing them all to the driver.