waylandsink: prefix wl_shell-specific variables with wl_

This commit is contained in:
Niels De Graef 2019-03-01 10:17:23 +01:00 committed by Niels De Graef
parent 18d3d31dc8
commit c461f22bef
4 changed files with 22 additions and 21 deletions

View file

@ -87,8 +87,8 @@ gst_wl_display_finalize (GObject * gobject)
if (self->dmabuf) if (self->dmabuf)
zwp_linux_dmabuf_v1_destroy (self->dmabuf); zwp_linux_dmabuf_v1_destroy (self->dmabuf);
if (self->shell) if (self->wl_shell)
wl_shell_destroy (self->shell); wl_shell_destroy (self->wl_shell);
if (self->fullscreen_shell) if (self->fullscreen_shell)
zwp_fullscreen_shell_v1_release (self->fullscreen_shell); zwp_fullscreen_shell_v1_release (self->fullscreen_shell);
@ -199,7 +199,7 @@ registry_handle_global (void *data, struct wl_registry *registry,
self->subcompositor = self->subcompositor =
wl_registry_bind (registry, id, &wl_subcompositor_interface, 1); wl_registry_bind (registry, id, &wl_subcompositor_interface, 1);
} else if (g_strcmp0 (interface, "wl_shell") == 0) { } else if (g_strcmp0 (interface, "wl_shell") == 0) {
self->shell = wl_registry_bind (registry, id, &wl_shell_interface, 1); self->wl_shell = wl_registry_bind (registry, id, &wl_shell_interface, 1);
} else if (g_strcmp0 (interface, "zwp_fullscreen_shell_v1") == 0) { } else if (g_strcmp0 (interface, "zwp_fullscreen_shell_v1") == 0) {
self->fullscreen_shell = wl_registry_bind (registry, id, self->fullscreen_shell = wl_registry_bind (registry, id,
&zwp_fullscreen_shell_v1_interface, 1); &zwp_fullscreen_shell_v1_interface, 1);
@ -331,7 +331,7 @@ gst_wl_display_new_existing (struct wl_display * display,
g_warning ("Could not bind to zwp_linux_dmabuf_v1"); g_warning ("Could not bind to zwp_linux_dmabuf_v1");
} }
if (!self->shell && !self->fullscreen_shell) { if (!self->wl_shell && !self->fullscreen_shell) {
/* If wl_surface and wl_display are passed via GstContext /* If wl_surface and wl_display are passed via GstContext
* wl_shell, zwp_fullscreen_shell are not used. * wl_shell, zwp_fullscreen_shell are not used.
* In this case is correct to continue. * In this case is correct to continue.

View file

@ -24,6 +24,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/video/video.h> #include <gst/video/video.h>
#include <wayland-client.h> #include <wayland-client.h>
#include "xdg-shell-client-protocol.h"
#include "viewporter-client-protocol.h" #include "viewporter-client-protocol.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h" #include "linux-dmabuf-unstable-v1-client-protocol.h"
#include "fullscreen-shell-unstable-v1-client-protocol.h" #include "fullscreen-shell-unstable-v1-client-protocol.h"
@ -53,7 +54,7 @@ struct _GstWlDisplay
struct wl_registry *registry; struct wl_registry *registry;
struct wl_compositor *compositor; struct wl_compositor *compositor;
struct wl_subcompositor *subcompositor; struct wl_subcompositor *subcompositor;
struct wl_shell *shell; struct wl_shell *wl_shell;
struct zwp_fullscreen_shell_v1 *fullscreen_shell; struct zwp_fullscreen_shell_v1 *fullscreen_shell;
struct wl_shm *shm; struct wl_shm *shm;
struct wp_viewporter *viewporter; struct wp_viewporter *viewporter;

View file

@ -36,14 +36,14 @@ G_DEFINE_TYPE (GstWlWindow, gst_wl_window, G_TYPE_OBJECT);
static void gst_wl_window_finalize (GObject * gobject); static void gst_wl_window_finalize (GObject * gobject);
static void static void
handle_ping (void *data, struct wl_shell_surface *shell_surface, handle_ping (void *data, struct wl_shell_surface *wl_shell_surface,
uint32_t serial) uint32_t serial)
{ {
wl_shell_surface_pong (shell_surface, serial); wl_shell_surface_pong (wl_shell_surface, serial);
} }
static void static void
handle_configure (void *data, struct wl_shell_surface *shell_surface, handle_configure (void *data, struct wl_shell_surface *wl_shell_surface,
uint32_t edges, int32_t width, int32_t height) uint32_t edges, int32_t width, int32_t height)
{ {
GstWlWindow *window = data; GstWlWindow *window = data;
@ -58,12 +58,12 @@ handle_configure (void *data, struct wl_shell_surface *shell_surface,
} }
static void static void
handle_popup_done (void *data, struct wl_shell_surface *shell_surface) handle_popup_done (void *data, struct wl_shell_surface *wl_shell_surface)
{ {
GST_DEBUG ("Window popup done."); GST_DEBUG ("Window popup done.");
} }
static const struct wl_shell_surface_listener shell_surface_listener = { static const struct wl_shell_surface_listener wl_shell_surface_listener = {
handle_ping, handle_ping,
handle_configure, handle_configure,
handle_popup_done handle_popup_done
@ -86,8 +86,8 @@ gst_wl_window_finalize (GObject * gobject)
{ {
GstWlWindow *self = GST_WL_WINDOW (gobject); GstWlWindow *self = GST_WL_WINDOW (gobject);
if (self->shell_surface) if (self->wl_shell_surface)
wl_shell_surface_destroy (self->shell_surface); wl_shell_surface_destroy (self->wl_shell_surface);
if (self->video_viewport) if (self->video_viewport)
wp_viewport_destroy (self->video_viewport); wp_viewport_destroy (self->video_viewport);
@ -158,10 +158,10 @@ gst_wl_window_ensure_fullscreen (GstWlWindow * window, gboolean fullscreen)
return; return;
if (fullscreen) if (fullscreen)
wl_shell_surface_set_fullscreen (window->shell_surface, wl_shell_surface_set_fullscreen (window->wl_shell_surface,
WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE, 0, NULL); WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE, 0, NULL);
else else
wl_shell_surface_set_toplevel (window->shell_surface); wl_shell_surface_set_toplevel (window->wl_shell_surface);
} }
GstWlWindow * GstWlWindow *
@ -173,14 +173,14 @@ gst_wl_window_new_toplevel (GstWlDisplay * display, const GstVideoInfo * info,
window = gst_wl_window_new_internal (display, render_lock); window = gst_wl_window_new_internal (display, render_lock);
if (display->shell) { if (display->wl_shell) {
/* go toplevel */ /* go toplevel */
window->shell_surface = wl_shell_get_shell_surface (display->shell, window->wl_shell_surface = wl_shell_get_shell_surface (display->wl_shell,
window->area_surface); window->area_surface);
if (window->shell_surface) { if (window->wl_shell_surface) {
wl_shell_surface_add_listener (window->shell_surface, wl_shell_surface_add_listener (window->wl_shell_surface,
&shell_surface_listener, window); &wl_shell_surface_listener, window);
gst_wl_window_ensure_fullscreen (window, fullscreen); gst_wl_window_ensure_fullscreen (window, fullscreen);
} else { } else {
GST_ERROR ("Unable to get wl_shell_surface"); GST_ERROR ("Unable to get wl_shell_surface");
@ -242,7 +242,7 @@ gst_wl_window_is_toplevel (GstWlWindow * window)
{ {
g_return_val_if_fail (window != NULL, FALSE); g_return_val_if_fail (window != NULL, FALSE);
return (window->shell_surface != NULL); return (window->wl_shell_surface != NULL);
} }
static void static void

View file

@ -52,7 +52,7 @@ struct _GstWlWindow
struct wl_surface *video_surface_wrapper; struct wl_surface *video_surface_wrapper;
struct wl_subsurface *video_subsurface; struct wl_subsurface *video_subsurface;
struct wp_viewport *video_viewport; struct wp_viewport *video_viewport;
struct wl_shell_surface *shell_surface; struct wl_shell_surface *wl_shell_surface;
/* the size and position of the area_(sub)surface */ /* the size and position of the area_(sub)surface */
GstVideoRectangle render_rectangle; GstVideoRectangle render_rectangle;