mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-26 11:41:09 +00:00
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:
parent
05ce97c5c1
commit
4c5aaa742f
1 changed files with 6 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue