GNOME Bugzilla – Bug 795746
gst-omx: should allocate the same number of buffers on consecutive ports when using dynamic buffer mode
Last modified: 2018-11-03 13:02:04 UTC
On the Zynq, when using dynamic mode (including dma import), let's say we have "A ! B" with A's output port requiring N buffers and B's input port requiring M buffers. To prevent starvation, as buffers from A will be kept by B, we should ensure that both ports have N+M buffers allocated.
This would require extra API to notify downstream about allocated buffers: 795747
Created attachment 372189 [details] [review] omxvideodec: implement propose_allocation Tell upstream about how many buffer we plan to use so they can adjust their own number of buffers accordingly if needed. Same logic as the existing gst_omx_video_enc_propose_allocation().
Created attachment 372190 [details] [review] omxvideodec: implement propose_allocation Tell upstream about how many buffer we plan to use so they can adjust their own number of buffers accordingly if needed. Same logic as the existing gst_omx_video_enc_propose_allocation().
Created attachment 372191 [details] [review] omxvideoenc: implement decide_allocation Increase the number of output buffers by the number of buffers requested downstream. Prevent buffers starvation if downstream is going to use dynamic buffer mode on its input.
Here is the first half of the fixes for this task. It doesn't require bug #795747 but is based on top of the patches from bug #791211
It's not clear why this would cause starvation. Is that because of the side effect of the buffer stealing technique ? (e.g. placing foreign buffer into local pool ?). Also, I really don't like the "extra" parameter.
Yes, in dynamic mode the element will keep upstream buffer alive until it has been processed by OMX which may starve the upstream pool.
I realize my question was a bit stupid. I basically didn't understood the context, upstream / downstream. It makes a lot of sense.
Review of attachment 372190 [details] [review]: Lgtm.
Review of attachment 372191 [details] [review]: Lgtm.
Attachment 372190 [details] pushed as 431eac0 - omxvideodec: implement propose_allocation Attachment 372191 [details] pushed as c8969b0 - omxvideoenc: implement decide_allocation
Thanks, I merged those patches. Keeping this bug open as the second half requires bug #795747 to be addressed first.
-- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/gstreamer/gst-omx/issues/22.