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 786738 - ximagesink,xvimagesink: handle drain query
ximagesink,xvimagesink: handle drain query
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
git master
Other Linux
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-08-24 09:25 UTC by Julien Isorce
Modified: 2018-11-03 11:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xvimagesink: unref current image on a drain query (1.73 KB, patch)
2017-08-24 09:25 UTC, Julien Isorce
rejected Details | Review
ximagesink: unref current image on a drain query (1.78 KB, patch)
2017-08-24 09:27 UTC, Julien Isorce
rejected Details | Review

Description Julien Isorce 2017-08-24 09:25:48 UTC
Created attachment 358306 [details] [review]
xvimagesink: unref current image on a drain query

So that an upstream element can claim all buffers to return to its buffer pool.
Comment 1 Julien Isorce 2017-08-24 09:27:11 UTC
Created attachment 358307 [details] [review]
ximagesink: unref current image on a drain query
Comment 2 Nicolas Dufresne (ndufresne) 2017-09-13 13:24:53 UTC
Review of attachment 358306 [details] [review]:

XVImage does not use buffers from upstream, they could endup being copied into an XImage, so this patch makes no sense.
Comment 3 Nicolas Dufresne (ndufresne) 2017-09-13 13:25:05 UTC
Review of attachment 358307 [details] [review]:

Same.
Comment 4 Nicolas Dufresne (ndufresne) 2017-09-13 13:25:39 UTC
I think this is invalid, since this sink does not hold on upstream buffers.
Comment 5 Julien Isorce 2017-09-13 14:04:04 UTC
Sorry I should have mentioned that this is when used with gst-omx. This is mostly due to GstOMXBufferPool which steal buffers from downstream for the OMX_UseBuffer/UseEGLImage cases https://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxbufferpool.c#n355 .
The attached patches are to honor the drain query sent from: https://cgit.freedesktop.org/gstreamer/gst-omx/tree/omx/gstomxvideodec.c#n1723
Same thing was done for glimagesink few years ago.

This can be reproduced with:

GST_OMX_CONFIG_DIR=config/tizonia/ gst-launch-1.0 filesrc location=dynamic_resolution_change.mkv ! matroskademux ! omxvp8dec ! xvimagesink

It is worth mentioning that ximagesink and ximagesink allow downstream elements to write directly into the images they have allocated: https://cgit.freedesktop.org/gstreamer/gst-plugins-base/tree/sys/xvimage/xvimagesink.c#n927

Maybe I should modify the patches to only unref the curr_image if the condition xvimagesink.c#n927 was true when it has ref that buffer (and if its current pool is not xvimagesink's pool)

I will provide some logs and tests.
Comment 6 GStreamer system administrator 2018-11-03 11:59:21 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/gst-plugins-base/issues/378.