mavo wrote: ↑
Wed Mar 13, 2019 3:10 pm
What is the best solution to manually keep the 3 render input buffers full? Wait for EmptyBufferDone on the previously submitted buffer before using OMX_EmptyThisBuffer on the same buffer?
That is mandatory. Once you've called OMX_EmptyThisBuffer the buffer is not yours to modify until you've had the EmptyBufferDone callback.
Ignore that and you will get unexpected behaviours.
mavo wrote:If i use OMX_EmptyThisBuffer as soon as there is 1 (of 3) EmptyBufferDone, it seems the render is skipping every other frame. Effectively running 60fps, but 60s of video only lasts 30s. I receive 2xEmptyBufferDone per VSYNC.
If i use OMX_EmptyThisBuffer when there are 2 (of 3) EmptyBufferDone, rendering seems to be perfect, but it does not seem like it's utilizing the entire fifo of 3.
It's not a FIFO of 3, it is 3 buffers allocated. And actually nBufferCountMin is 2 as that is the minimum that is required by the component.
Submit buffer A and it will be put on screen until the vsync AFTER you submit buffer B.
At the vsync you'll get the EmptyBufferDone for buffer A. That would be the sensible point to submit buffer C (that you have prefilled), and start filling buffer A again. At the next vsync buffer C will be displayed, and buffer B will be returned through EmptyBufferDone, so submit buffer A.
The component requires 2 buffers to function, but to be more efficient having one additional buffer for the application to be filling makes more sense, so 3 buffers total.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.