diff options
author | Hyunjun Ko <zzoon@igalia.com> | 2017-11-08 13:23:39 +0900 |
---|---|---|
committer | Michael Olbrich <m.olbrich@pengutronix.de> | 2020-07-31 14:02:33 +0200 |
commit | a5f37a21ec4c56e0237793c51f441c1de1c0bf08 (patch) | |
tree | 0752e9f88d196ecfc86ea47fcdd1fbef24edfc09 /gst/vaapi | |
parent | 40364c2c098e2a8f3013f61e2eaf1c5a7b10a613 (diff) |
vaapisink: implements gst_vaapisink_wayland_create_window_from_handle()
Implements gst_vaapisink_wayland_create_window_from_handle() to support
using external wl_surface.
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/-/merge_requests/342>
Diffstat (limited to 'gst/vaapi')
-rw-r--r-- | gst/vaapi/gstvaapisink.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c index 92f95347..c1f56bf0 100644 --- a/gst/vaapi/gstvaapisink.c +++ b/gst/vaapi/gstvaapisink.c @@ -561,11 +561,31 @@ gst_vaapisink_wayland_create_window (GstVaapiSink * sink, guint width, return TRUE; } +static gboolean +gst_vaapisink_wayland_create_window_from_handle (GstVaapiSink * sink, + guintptr window) +{ + GstVaapiDisplay *display; + + if (!gst_vaapisink_ensure_display (sink)) + return FALSE; + display = GST_VAAPI_PLUGIN_BASE_DISPLAY (sink); + + if (sink->window == NULL || (guintptr) sink->window != window) { + gst_vaapi_window_replace (&sink->window, NULL); + sink->window = gst_vaapi_window_wayland_new_with_surface (display, window); + } + + return sink->window != NULL; +} + static const inline GstVaapiSinkBackend * gst_vaapisink_backend_wayland (void) { static const GstVaapiSinkBackend GstVaapiSinkBackendWayland = { .create_window = gst_vaapisink_wayland_create_window, + .create_window_from_handle = + gst_vaapisink_wayland_create_window_from_handle, .render_surface = gst_vaapisink_render_surface, }; return &GstVaapiSinkBackendWayland; |