GNOME Bugzilla – Bug 795747
allocation: add event notifying downstream about allocated buffers
Last modified: 2018-11-03 12:46:06 UTC
We have a couple of use cases where elements would need to know about the buffers which have been allocated upstream: - bug #794817 : Msdk requires to know all the dmabuf fds which will be used. - bug #795746 : in gst-omx when using dynamic buffer mode, we'd like to have the same number of input/output buffers allocated on two consecutive ports. This is not possible with the current allocation API. The ALLOCATION query retrieves information from downstream but does not propagate its own requirement or notify downstream about what has actually be allocated. We could solve this by adding a new serialized downstream event sent once buffers have been allocated. Here is the event I used in my local branch to try solving #795746. It is sent as soon as the pool has been activated. gst_event_new_custom (GST_EVENT_CUSTOM_DOWNSTREAM, gst_structure_new ("buffers-allocated", "nb-buffers", G_TYPE_UINT, min, "pool", GST_TYPE_BUFFER_POOL, self->out_port_pool, NULL)); We could retrieve the number of buffers from the pool but having a specific field make it usable even if no pool is being used. Open questions: - Proper naming of this event and its fields. - Should we resend this event if extra buffers are being allocated in the pool?
Here is my WIP branch fixing bug #795746 and using this new API: https://gitlab.collabora.com/cassidy/gst-omx/commits/nb-buffers-46 Could someone working on bug #794817 try to use it as well so we have two implementations to move this API forward?
Created attachment 372113 [details] [review] v4l2src: implement "buffers-allocated" event
Here is an implementation of this event in v4l2src.
(In reply to Guillaume Desmottes from comment #3) > Here is an implementation of this event in v4l2src. Great! Unfortunately, a correct implementation of the same in gst-msdk requires major rewrite :(, I'm trying to do it in a different way first (without using event) as proposed here: https://github.com/Intel-Media-SDK/MediaSDK/issues/155#issuecomment-381790504 I will get back to this later.
-- 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/gstreamer/issues/289.