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>
This commit is contained in:
Hyunjun Ko 2017-11-08 13:23:39 +09:00 committed by Michael Olbrich
parent 40364c2c09
commit a5f37a21ec

View file

@ -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;