enum
{
PROP_0,
- PROP_DISPLAY
+ PROP_DISPLAY,
+ PROP_FULLSCREEN
};
GST_DEBUG_CATEGORY (gstwayland_debug);
g_param_spec_string ("display", "Wayland Display name", "Wayland "
"display name to connect to, if not supplied via the GstContext",
NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+ g_object_class_install_property (gobject_class, PROP_FULLSCREEN,
+ g_param_spec_boolean ("fullscreen", "Fullscreen",
+ "Whether the surface should be made fullscreen ", FALSE,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
}
static void
}
static void
+gst_wayland_sink_set_fullscreen (GstWaylandSink * sink, gboolean fullscreen)
+{
+ if (fullscreen == sink->fullscreen)
+ return;
+
+ g_mutex_lock (&sink->render_lock);
+ sink->fullscreen = fullscreen;
+ gst_wl_window_ensure_fullscreen (sink->window, fullscreen);
+ g_mutex_unlock (&sink->render_lock);
+}
+
+static void
gst_wayland_sink_get_property (GObject * object,
guint prop_id, GValue * value, GParamSpec * pspec)
{
g_value_set_string (value, sink->display_name);
GST_OBJECT_UNLOCK (sink);
break;
+ case PROP_FULLSCREEN:
+ GST_OBJECT_LOCK (sink);
+ g_value_set_boolean (value, sink->fullscreen);
+ GST_OBJECT_UNLOCK (sink);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
sink->display_name = g_value_dup_string (value);
GST_OBJECT_UNLOCK (sink);
break;
+ case PROP_FULLSCREEN:
+ GST_OBJECT_LOCK (sink);
+ gst_wayland_sink_set_fullscreen (sink, g_value_get_boolean (value));
+ GST_OBJECT_UNLOCK (sink);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
if (!sink->window) {
/* if we were not provided a window, create one ourselves */
sink->window = gst_wl_window_new_toplevel (sink->display,
- &sink->video_info, &sink->render_lock);
+ &sink->video_info, sink->fullscreen, &sink->render_lock);
}
}
return window;
}
+void
+gst_wl_window_ensure_fullscreen (GstWlWindow * window, gboolean fullscreen)
+{
+ if (!window)
+ return;
+
+ if (fullscreen)
+ wl_shell_surface_set_fullscreen (window->shell_surface,
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE, 0, NULL);
+ else
+ wl_shell_surface_set_toplevel (window->shell_surface);
+}
+
GstWlWindow *
gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
- GMutex * render_lock)
+ gboolean fullscreen, GMutex * render_lock)
{
GstWlWindow *window;
gint width;
if (window->shell_surface) {
wl_shell_surface_add_listener (window->shell_surface,
&shell_surface_listener, window);
- wl_shell_surface_set_toplevel (window->shell_surface);
+ gst_wl_window_ensure_fullscreen (window, fullscreen);
} else {
GST_ERROR ("Unable to get wl_shell_surface");
GType gst_wl_window_get_type (void);
+void gst_wl_window_ensure_fullscreen (GstWlWindow * window,
+ gboolean fullscreen);
GstWlWindow *gst_wl_window_new_toplevel (GstWlDisplay * display,
- const GstVideoInfo * info, GMutex * render_lock);
+ const GstVideoInfo * info, gboolean fullscreen, GMutex * render_lock);
GstWlWindow *gst_wl_window_new_in_surface (GstWlDisplay * display,
struct wl_surface * parent, GMutex * render_lock);