mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-29 11:40:38 +00:00
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:
parent
40364c2c09
commit
a5f37a21ec
1 changed files with 20 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue