GstWlWindow * gst_wl_window_new_toplevel (GstWlDisplay * display, GstVideoInfo * video_info) { GstWlWindow *window; window = gst_wl_window_new_internal (display, wl_compositor_create_surface (display->compositor)); gst_wl_window_set_video_info (window, video_info); gst_wl_window_set_render_rectangle (window, 0, 0, window->video_width, window->video_height); window->shell_surface = wl_shell_get_shell_surface (display->shell, window->surface); if (window->shell_surface) { wl_shell_surface_add_listener (window->shell_surface, &shell_surface_listener, window); wl_shell_surface_set_toplevel (window->shell_surface); } else { GST_ERROR ("Unable to get wl_shell_surface"); g_object_unref (window); return NULL; } return window; }
GstWlWindow * gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info) { GstWlWindow *window; gint width; window = gst_wl_window_new_internal (display); /* go toplevel */ window->shell_surface = wl_shell_get_shell_surface (display->shell, window->area_surface); if (window->shell_surface) { wl_shell_surface_add_listener (window->shell_surface, &shell_surface_listener, window); wl_shell_surface_set_toplevel (window->shell_surface); } else { GST_ERROR ("Unable to get wl_shell_surface"); g_object_unref (window); return NULL; } /* set the initial size to be the same as the reported video size */ width = gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d); gst_wl_window_set_render_rectangle (window, 0, 0, width, info->height); return window; }
GstWlWindow * gst_wl_window_new_in_surface (GstWlDisplay * display, struct wl_surface * parent) { GstWlWindow *window; window = gst_wl_window_new_internal (display, wl_compositor_create_surface (display->compositor)); window->subsurface = wl_subcompositor_get_subsurface (display->subcompositor, window->surface, parent); wl_subsurface_set_desync (window->subsurface); return window; }
GstWlWindow * gst_wl_window_new_in_surface (GstWlDisplay * display, struct wl_surface * parent, GMutex * render_lock) { GstWlWindow *window; window = gst_wl_window_new_internal (display, render_lock); /* embed in parent */ window->area_subsurface = wl_subcompositor_get_subsurface (display->subcompositor, window->area_surface, parent); wl_subsurface_set_desync (window->area_subsurface); return window; }
GstWlWindow * gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info, gboolean fullscreen, GMutex * render_lock) { GstWlWindow *window; gint width; window = gst_wl_window_new_internal (display, render_lock); if (display->shell) { /* go toplevel */ window->shell_surface = wl_shell_get_shell_surface (display->shell, window->area_surface); if (window->shell_surface) { wl_shell_surface_add_listener (window->shell_surface, &shell_surface_listener, window); gst_wl_window_ensure_fullscreen (window, fullscreen); } else { GST_ERROR ("Unable to get wl_shell_surface"); g_object_unref (window); return NULL; } } else if (display->fullscreen_shell) { zwp_fullscreen_shell_v1_present_surface (display->fullscreen_shell, window->area_surface, ZWP_FULLSCREEN_SHELL_V1_PRESENT_METHOD_ZOOM, NULL); } else { GST_ERROR ("Unable to use wl_shell or zwp_fullscreen_shell."); g_object_unref (window); return NULL; } /* set the initial size to be the same as the reported video size */ width = gst_util_uint64_scale_int_round (info->width, info->par_n, info->par_d); gst_wl_window_set_render_rectangle (window, 0, 0, width, info->height); return window; }