GNOME Bugzilla – Bug 791937
glimagesink: need fix video tearing
Last modified: 2018-11-03 12:02:38 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.
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.
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.
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.
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 ?
(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
-- 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.