diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-12-29 15:55:28 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2021-01-04 15:00:36 -0500 |
commit | 8f585f7a53a2152801843357c7f9e6b8fb9bdea3 (patch) | |
tree | 72bd290934ea4cf8e265b7b4696366d6fe82be7d /gtk/gtkvideo.c | |
parent | 874b19b27e04b56bdacc0d124dd209a9a5867afc (diff) | |
download | gtk+-8f585f7a53a2152801843357c7f9e6b8fb9bdea3.tar.gz |
video: Realize the media stream before setting a file
This makes it so that we obtain a GL context before
creating the GstSink, so we at least advertise our
ability to handle GL buffer.
Gstreamer still won't send us any.
Diffstat (limited to 'gtk/gtkvideo.c')
-rw-r--r-- | gtk/gtkvideo.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gtk/gtkvideo.c b/gtk/gtkvideo.c index 15a5e25a36..f5b6f303e0 100644 --- a/gtk/gtkvideo.c +++ b/gtk/gtkvideo.c @@ -688,7 +688,13 @@ gtk_video_set_file (GtkVideo *self, stream = gtk_media_file_new (); if (gtk_widget_get_realized (GTK_WIDGET (self))) - gtk_media_file_set_file (GTK_MEDIA_FILE (stream), file); + { + GdkSurface *surface; + + surface = gtk_native_get_surface (gtk_widget_get_native (GTK_WIDGET (self))); + gtk_media_stream_realize (stream, surface); + gtk_media_file_set_file (GTK_MEDIA_FILE (stream), file); + } gtk_video_set_media_stream (self, stream); g_object_unref (stream); |