After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 795747 - allocation: add event notifying downstream about allocated buffers
allocation: add event notifying downstream about allocated buffers
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
unspecified
Other Linux
: Normal enhancement
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks: 794817 795746
 
 
Reported: 2018-05-02 09:14 UTC by Guillaume Desmottes
Modified: 2018-11-03 12:46 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
v4l2src: implement "buffers-allocated" event (1.48 KB, patch)
2018-05-16 07:34 UTC, Guillaume Desmottes
none Details | Review

Description Guillaume Desmottes 2018-05-02 09:14:31 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?
Comment 1 Guillaume Desmottes 2018-05-08 08:42:07 UTC
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?
Comment 2 Guillaume Desmottes 2018-05-16 07:34:53 UTC
Created attachment 372113 [details] [review]
v4l2src: implement "buffers-allocated" event
Comment 3 Guillaume Desmottes 2018-05-16 07:35:13 UTC
Here is an implementation of this event in v4l2src.
Comment 4 sreerenj 2018-05-18 00:02:22 UTC
(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.
Comment 5 GStreamer system administrator 2018-11-03 12:46:06 UTC
-- 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.