gloverlaycompositor: Add GL sync point when uploading overlays

In rare cases - notably on macOS, because of multiple GL contexts - the lack of a sync point was causing overlays
to disappear for a frame after being redrawn, or sometimes not appear at all. This change makes sure that the display
in one GL context will be correctly synchronised with the other GL context where the overlay texture was uploaded.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5610>
This commit is contained in:
Piotr Brzeziński 2023-11-07 00:32:32 +01:00
parent 05ce97c5c1
commit 4c5aaa742f

View file

@ -665,6 +665,7 @@ gst_gl_overlay_compositor_upload_overlays (GstGLOverlayCompositor * compositor,
GstVideoOverlayComposition *composition = NULL;
guint num_overlays, i;
GList *l = compositor->overlays;
GstGLSyncMeta *sync_meta;
GST_DEBUG ("GstVideoOverlayCompositionMeta found.");
@ -689,6 +690,11 @@ gst_gl_overlay_compositor_upload_overlays (GstGLOverlayCompositor * compositor,
}
}
sync_meta = gst_buffer_get_gl_sync_meta (buf);
if (sync_meta) {
gst_gl_sync_meta_set_sync_point (sync_meta, compositor->context);
}
/* remove old overlays from list */
while (l != NULL) {
GList *next = l->next;