viewporter-protocol.c \
viewporter-client-protocol.h \
linux-dmabuf-unstable-v1-protocol.c \
- linux-dmabuf-unstable-v1-client-protocol.h
+ linux-dmabuf-unstable-v1-client-protocol.h \
+ fullscreen-shell-unstable-v1-protocol.c \
+ fullscreen-shell-unstable-v1-client-protocol.h
libgstwaylandsink_la_SOURCES = \
gstwaylandsink.c \
nodist_libgstwaylandsink_la_SOURCES = \
viewporter-protocol.c \
- linux-dmabuf-unstable-v1-protocol.c
+ linux-dmabuf-unstable-v1-protocol.c \
+ fullscreen-shell-unstable-v1-protocol.c
libgstwaylandsink_la_CFLAGS = \
$(GST_PLUGINS_BAD_CFLAGS) \
protocol_defs = [
['/stable/viewporter/viewporter.xml', 'viewporter-protocol.c', 'viewporter-client-protocol.h'],
['/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml',
- 'linux-dmabuf-unstable-v1-protocol.c', 'linux-dmabuf-unstable-v1-client-protocol.h']
+ 'linux-dmabuf-unstable-v1-protocol.c', 'linux-dmabuf-unstable-v1-client-protocol.h'],
+ ['/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml',
+ 'fullscreen-shell-unstable-v1-protocol.c', 'fullscreen-shell-unstable-v1-client-protocol.h']
]
protocols_files = []
if (self->shell)
wl_shell_destroy (self->shell);
+ if (self->fullscreen_shell)
+ zwp_fullscreen_shell_v1_release (self->fullscreen_shell);
+
if (self->compositor)
wl_compositor_destroy (self->compositor);
wl_registry_bind (registry, id, &wl_subcompositor_interface, 1);
} else if (g_strcmp0 (interface, "wl_shell") == 0) {
self->shell = wl_registry_bind (registry, id, &wl_shell_interface, 1);
+ } else if (g_strcmp0 (interface, "zwp_fullscreen_shell_v1") == 0) {
+ self->fullscreen_shell = wl_registry_bind (registry, id,
+ &zwp_fullscreen_shell_v1_interface, 1);
} else if (g_strcmp0 (interface, "wl_shm") == 0) {
self->shm = wl_registry_bind (registry, id, &wl_shm_interface, 1);
wl_shm_add_listener (self->shm, &shm_listener, self);
VERIFY_INTERFACE_EXISTS (compositor, "wl_compositor");
VERIFY_INTERFACE_EXISTS (subcompositor, "wl_subcompositor");
- VERIFY_INTERFACE_EXISTS (shell, "wl_shell");
VERIFY_INTERFACE_EXISTS (shm, "wl_shm");
#undef VERIFY_INTERFACE_EXISTS
g_warning ("Could not bind to zwp_linux_dmabuf_v1");
}
+ if (!self->shell && !self->fullscreen_shell) {
+ /* If wl_surface and wl_display are passed via GstContext
+ * wl_shell, zwp_fullscreen_shell are not used.
+ * In this case is correct to continue.
+ */
+ g_warning ("Could not bind to wl_shell or zwp_fullscreen_shell, video "
+ "display may not work properly.");
+ }
+
self->thread = g_thread_try_new ("GstWlDisplay", gst_wl_display_thread_run,
self, &err);
if (err) {
#include <wayland-client.h>
#include "viewporter-client-protocol.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h"
+#include "fullscreen-shell-unstable-v1-client-protocol.h"
G_BEGIN_DECLS
struct wl_compositor *compositor;
struct wl_subcompositor *subcompositor;
struct wl_shell *shell;
+ struct zwp_fullscreen_shell_v1 *fullscreen_shell;
struct wl_shm *shm;
struct wp_viewporter *viewporter;
struct zwp_linux_dmabuf_v1 *dmabuf;
window = gst_wl_window_new_internal (display, render_lock);
- /* 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");
+ 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;
}