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 791937 - glimagesink: need fix video tearing
glimagesink: need fix video tearing
Status: RESOLVED OBSOLETE
Product: GStreamer
Classification: Platform
Component: gst-plugins-base
1.12.x
Other Windows
: Normal normal
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-12-25 06:38 UTC by Haihua Hu
Modified: 2018-11-03 12:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
glimagesink: need add glFinish after eglswapbuffer (1018 bytes, patch)
2017-12-28 09:00 UTC, Haihua Hu
rejected Details | Review

Description Haihua Hu 2017-12-25 06:38:30 UTC
video will tearing when using glimagesink. eglswapbuffer is an async call. That means the GPU has not complete the drawing on display, but sink has return and doing next buffer perparing.
Comment 1 Nicolas Dufresne (ndufresne) 2017-12-25 22:20:33 UTC
glimagesink keeps two old buffers, so this is a theoretical issue (unless you have high latency display path). The right solution is to place a fence after swap, and only unref when the fence is signalled.
Comment 2 Haihua Hu 2017-12-28 09:00:39 UTC
Created attachment 366038 [details] [review]
glimagesink: need add glFinish after eglswapbuffer

when video playback using glimagesink, video tearing occurs. eglswapbuffer is an async call that is to say the buffer maybe still used by GPU but we are already prepare next buffer.
Comment 3 Nicolas Dufresne (ndufresne) 2017-12-28 15:25:21 UTC
That solution is not as good as using fences, it will impair the throughput. Have you tried it at least ? Any reply would be appreciated.
Comment 4 Matthew Waters (ystreet00) 2017-12-30 11:03:01 UTC
Review of attachment 366038 [details] [review]:

glFinish() after swapBuffers is a no-go performance wise.  As Nicolas said, if you have to do this, fences are the best option and are supported by GstGLSyncMeta with the necessary glFlush/glFinish fallbacks for old drivers.

The question is why do you need this in the first place ?
Comment 5 Haihua Hu 2018-01-02 01:02:25 UTC
(In reply to Matthew Waters (ystreet00) from comment #4)
> Review of attachment 366038 [details] [review] [review]:
> 
> glFinish() after swapBuffers is a no-go performance wise.  As Nicolas said,
> if you have to do this, fences are the best option and are supported by
> GstGLSyncMeta with the necessary glFlush/glFinish fallbacks for old drivers.
> 
> The question is why do you need this in the first place ?

Sorry, I have not test the fence solution. I found glimagesink will tearing when playback on wayland, as eglswapbuffer is a none-block call, after it return, video buffer maybe still been used by GPU, so we need sync after eglswapbuffer
Comment 6 GStreamer system administrator 2018-11-03 12:02:38 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/411.