diff --git a/ext/wayland/Makefile.am b/ext/wayland/Makefile.am
index 09c8f89..22ea823 100644
--- a/ext/wayland/Makefile.am
+++ b/ext/wayland/Makefile.am
@@ -8,7 +8,7 @@ libgstwaylandsink_la_SOURCES = \
wlwindow.c \
wlvideoformat.c \
wldmabuf.c \
- scaler-protocol.c \
+ viewporter-protocol.c \
linux-dmabuf-unstable-v1-protocol.c
libgstwaylandsink_la_CFLAGS = $(GST_CFLAGS) $(GST_PLUGINS_BASE_CFLAGS) \
@@ -30,27 +30,27 @@ noinst_HEADERS = \
wlwindow.h \
wlvideoformat.h \
wldmabuf.h \
- scaler-client-protocol.h \
+ viewporter-client-protocol.h \
linux-dmabuf-unstable-v1-client-protocol.h
-EXTRA_DIST = scaler.xml
-CLEANFILES = scaler-protocol.c scaler-client-protocol.h \
+CLEANFILES = viewporter-protocol.c viewporter-client-protocol.h \
linux-dmabuf-unstable-v1-protocol.c \
linux-dmabuf-unstable-v1-client-protocol.h
-gstwaylandsink.c: scaler-client-protocol.h linux-dmabuf-unstable-v1-client-protocol.h
+gstwaylandsink.c: viewporter-client-protocol.h linux-dmabuf-unstable-v1-client-protocol.h
-waylandpool.c: scaler-client-protocol.h
+waylandpool.c: viewporter-client-protocol.h
-wlbuffer.c: scaler-client-protocol.h
+wlshmallocator.c: viewporter-client-protocol.h
-wldisplay.c: scaler-client-protocol.h linux-dmabuf-unstable-v1-client-protocol.h
+wlbuffer.c: viewporter-client-protocol.h
-wlwindow.c: scaler-client-protocol.h
+wldisplay.c: viewporter-client-protocol.h linux-dmabuf-unstable-v1-client-protocol.h
+
+wlwindow.c: viewporter-client-protocol.h
wldmabuf.c: linux-dmabuf-unstable-v1-client-protocol.h
-wlshmallocator.c: scaler-client-protocol.h
.SECONDEXPANSION:
define protostability
@@ -61,17 +61,8 @@ define protoname
$(shell echo $1 | sed 's/\([a-z\-]\+\)-[a-z]\+-v[0-9]\+/\1/')
endef
-WAYLAND_GEN_PROTOCOL_CODE = $(wayland_scanner) code < $< > $@
-WAYLAND_GEN_PROTOCOL_HEADER = $(wayland_scanner) client-header < $< > $@
-
-scaler-protocol.c : scaler.xml
- $(WAYLAND_GEN_PROTOCOL_CODE)
-
-scaler-client-protocol.h : scaler.xml
- $(WAYLAND_GEN_PROTOCOL_HEADER)
-
%-protocol.c : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
- $(WAYLAND_GEN_PROTOCOL_CODE)
+ $(AM_V_GEN)$(wayland_scanner) code < $< > $@
%-client-protocol.h : $(WAYLAND_PROTOCOLS_DATADIR)/$$(call protostability,$$*)/$$(call protoname,$$*)/$$*.xml
- $(WAYLAND_GEN_PROTOCOL_HEADER)
+ $(AM_V_GEN)$(wayland_scanner) client-header < $< > $@
diff --git a/ext/wayland/scaler.xml b/ext/wayland/scaler.xml
deleted file mode 100644
index e21ae5b..0000000
--- a/ext/wayland/scaler.xml
+++ /dev/null
@@ -1,210 +0,0 @@
-
-
-
-
- Copyright © 2013-2014 Collabora, Ltd.
-
- Permission to use, copy, modify, distribute, and sell this
- software and its documentation for any purpose is hereby granted
- without fee, provided that the above copyright notice appear in
- all copies and that both that copyright notice and this permission
- notice appear in supporting documentation, and that the name of
- the copyright holders not be used in advertising or publicity
- pertaining to distribution of the software without specific,
- written prior permission. The copyright holders make no
- representations about the suitability of this software for any
- purpose. It is provided "as is" without express or implied
- warranty.
-
- THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
- SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
- FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
- SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN
- AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
- ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
- THIS SOFTWARE.
-
-
-
-
- The global interface exposing surface cropping and scaling
- capabilities is used to instantiate an interface extension for a
- wl_surface object. This extended interface will then allow
- cropping and scaling the surface contents, effectively
- disconnecting the direct relationship between the buffer and the
- surface size.
-
-
-
-
- Informs the server that the client will not be using this
- protocol object anymore. This does not affect any other objects,
- wl_viewport objects included.
-
-
-
-
-
-
-
-
-
- Instantiate an interface extension for the given wl_surface to
- crop and scale its content. If the given wl_surface already has
- a wl_viewport object associated, the viewport_exists
- protocol error is raised.
-
-
-
-
-
-
-
-
-
- An additional interface to a wl_surface object, which allows the
- client to specify the cropping and scaling of the surface
- contents.
-
- This interface allows to define the source rectangle (src_x,
- src_y, src_width, src_height) from where to take the wl_buffer
- contents, and scale that to destination size (dst_width,
- dst_height). This state is double-buffered, and is applied on the
- next wl_surface.commit.
-
- The two parts of crop and scale state are independent: the source
- rectangle, and the destination size. Initially both are unset, that
- is, no scaling is applied. The whole of the current wl_buffer is
- used as the source, and the surface size is as defined in
- wl_surface.attach.
-
- If the destination size is set, it causes the surface size to become
- dst_width, dst_height. The source (rectangle) is scaled to exactly
- this size. This overrides whatever the attached wl_buffer size is,
- unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
- has no content and therefore no size. Otherwise, the size is always
- at least 1x1 in surface coordinates.
-
- If the source rectangle is set, it defines what area of the
- wl_buffer is taken as the source. If the source rectangle is set and
- the destination size is not set, the surface size becomes the source
- rectangle size rounded up to the nearest integer. If the source size
- is already exactly integers, this results in cropping without scaling.
-
- The coordinate transformations from buffer pixel coordinates up to
- the surface-local coordinates happen in the following order:
- 1. buffer_transform (wl_surface.set_buffer_transform)
- 2. buffer_scale (wl_surface.set_buffer_scale)
- 3. crop and scale (wl_viewport.set*)
- This means, that the source rectangle coordinates of crop and scale
- are given in the coordinates after the buffer transform and scale,
- i.e. in the coordinates that would be the surface-local coordinates
- if the crop and scale was not applied.
-
- If the source rectangle is partially or completely outside of the
- wl_buffer, then the surface contents are undefined (not void), and
- the surface size is still dst_width, dst_height.
-
- The x, y arguments of wl_surface.attach are applied as normal to
- the surface. They indicate how many pixels to remove from the
- surface size from the left and the top. In other words, they are
- still in the surface-local coordinate system, just like dst_width
- and dst_height are.
-
- If the wl_surface associated with the wl_viewport is destroyed,
- the wl_viewport object becomes inert.
-
- If the wl_viewport object is destroyed, the crop and scale
- state is removed from the wl_surface. The change will be applied
- on the next wl_surface.commit.
-
-
-
-
- The associated wl_surface's crop and scale state is removed.
- The change is applied on the next wl_surface.commit.
-
-
-
-
-
-
-
-
-
- Set both source rectangle and destination size of the associated
- wl_surface. See wl_viewport for the description, and relation to
- the wl_buffer size.
-
- The bad_value protocol error is raised if src_width or
- src_height is negative, or if dst_width or dst_height is not
- positive.
-
- The crop and scale state is double-buffered state, and will be
- applied on the next wl_surface.commit.
-
- Arguments dst_x and dst_y do not exist here, use the x and y
- arguments to wl_surface.attach. The x, y, dst_width, and dst_height
- define the surface-local coordinate system irrespective of the
- attached wl_buffer size.
-
-
-
-
-
-
-
-
-
-
-
-
- Set the source rectangle of the associated wl_surface. See
- wl_viewport for the description, and relation to the wl_buffer
- size.
-
- If width is -1.0 and height is -1.0, the destination size is unset
- instead. Any other pair of values for width and height that
- contains zero or negative values raises the bad_value protocol
- error.
-
- The crop and scale state is double-buffered state, and will be
- applied on the next wl_surface.commit.
-
-
-
-
-
-
-
-
-
-
- Set the destination size of the associated wl_surface. See
- wl_viewport for the description, and relation to the wl_buffer
- size.
-
- If width is -1 and height is -1, the destination size is unset
- instead. Any other pair of values for width and height that
- contains zero or negative values raises the bad_value protocol
- error.
-
- The crop and scale state is double-buffered state, and will be
- applied on the next wl_surface.commit.
-
- Arguments x and y do not exist here, use the x and y arguments to
- wl_surface.attach. The x, y, width, and height define the
- surface-local coordinate system irrespective of the attached
- wl_buffer size.
-
-
-
-
-
-
-
diff --git a/ext/wayland/wldisplay.c b/ext/wayland/wldisplay.c
index 77d2e76..193a0c5 100644
--- a/ext/wayland/wldisplay.c
+++ b/ext/wayland/wldisplay.c
@@ -76,6 +76,9 @@ gst_wl_display_finalize (GObject * gobject)
g_hash_table_unref (self->buffers);
g_mutex_clear (&self->buffers_mutex);
+ if (self->viewporter)
+ wp_viewporter_destroy (self->viewporter);
+
if (self->shm)
wl_shm_destroy (self->shm);
@@ -97,9 +100,6 @@ gst_wl_display_finalize (GObject * gobject)
if (self->queue)
wl_event_queue_destroy (self->queue);
- if (self->scaler)
- wl_scaler_destroy (self->scaler);
-
if (self->own_display) {
wl_display_flush (self->display);
wl_display_disconnect (self->display);
@@ -180,8 +180,9 @@ registry_handle_global (void *data, struct wl_registry *registry,
} 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);
- } else if (g_strcmp0 (interface, "wl_scaler") == 0) {
- self->scaler = wl_registry_bind (registry, id, &wl_scaler_interface, 2);
+ } else if (g_strcmp0 (interface, "wp_viewporter") == 0) {
+ self->viewporter =
+ wl_registry_bind (registry, id, &wp_viewporter_interface, 1);
} else if (g_strcmp0 (interface, "zwp_linux_dmabuf_v1") == 0) {
self->dmabuf =
wl_registry_bind (registry, id, &zwp_linux_dmabuf_v1_interface, 1);
@@ -289,7 +290,7 @@ gst_wl_display_new_existing (struct wl_display * display,
VERIFY_INTERFACE_EXISTS (subcompositor, "wl_subcompositor");
VERIFY_INTERFACE_EXISTS (shell, "wl_shell");
VERIFY_INTERFACE_EXISTS (shm, "wl_shm");
- VERIFY_INTERFACE_EXISTS (scaler, "wl_scaler");
+ VERIFY_INTERFACE_EXISTS (viewporter, "wp_viewporter");
#undef VERIFY_INTERFACE_EXISTS
diff --git a/ext/wayland/wldisplay.h b/ext/wayland/wldisplay.h
index 338f066..da232b7 100644
--- a/ext/wayland/wldisplay.h
+++ b/ext/wayland/wldisplay.h
@@ -23,7 +23,7 @@
#include
#include
-#include "scaler-client-protocol.h"
+#include "viewporter-client-protocol.h"
#include "linux-dmabuf-unstable-v1-client-protocol.h"
G_BEGIN_DECLS
@@ -53,7 +53,7 @@ struct _GstWlDisplay
struct wl_shell *shell;
struct wl_shm *shm;
struct zwp_linux_dmabuf_v1 *dmabuf;
- struct wl_scaler *scaler;
+ struct wp_viewporter *viewporter;
GArray *formats;
GArray *dmabuf_formats;
diff --git a/ext/wayland/wldmabuf.c b/ext/wayland/wldmabuf.c
index 04ed755..098062a 100644
--- a/ext/wayland/wldmabuf.c
+++ b/ext/wayland/wldmabuf.c
@@ -112,7 +112,7 @@ gst_wl_dmabuf_construct_wl_buffer (GstWaylandSink * sink, GstBuffer * buf,
zwp_linux_buffer_params_v1_create (params, info->width, info->height,
gst_video_format_to_wl_dmabuf_format (info->finfo->format),
- ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT);
+ 0);
wl_display_flush (sink->display->display);
data.done = FALSE;
diff --git a/ext/wayland/wlwindow.c b/ext/wayland/wlwindow.c
index db082c8..1cd8f12 100644
--- a/ext/wayland/wlwindow.c
+++ b/ext/wayland/wlwindow.c
@@ -82,7 +82,7 @@ gst_wl_window_finalize (GObject * gobject)
need_destroy |= TRUE;
}
- wl_viewport_destroy (self->video_viewport);
+ wp_viewport_destroy (self->video_viewport);
if (self->use_subsurface) {
wl_subsurface_destroy (self->video_subsurface);
need_destroy |= TRUE;
@@ -93,7 +93,7 @@ gst_wl_window_finalize (GObject * gobject)
if (self->area_subsurface)
wl_subsurface_destroy (self->area_subsurface);
- wl_viewport_destroy (self->area_viewport);
+ wp_viewport_destroy (self->area_viewport);
wl_surface_destroy (self->area_surface);
g_clear_object (&self->display);
@@ -133,9 +133,9 @@ gst_wl_window_new_internal (GstWlDisplay * display, struct wl_surface *parent,
wl_subsurface_set_desync (window->video_subsurface);
}
- window->area_viewport = wl_scaler_get_viewport (display->scaler,
+ window->area_viewport = wp_viewporter_get_viewport (display->viewporter,
window->area_surface);
- window->video_viewport = wl_scaler_get_viewport (display->scaler,
+ window->video_viewport = wp_viewporter_get_viewport (display->viewporter,
window->video_surface);
/* draw the area_subsurface */
@@ -259,7 +259,7 @@ gst_wl_window_resize_video_surface (GstWlWindow * window, gboolean commit)
if (window->use_subsurface)
wl_subsurface_set_position (window->video_subsurface, res.x, res.y);
- wl_viewport_set_destination (window->video_viewport, res.w, res.h);
+ wp_viewport_set_destination (window->video_viewport, res.w, res.h);
if (commit) {
wl_surface_damage (window->video_surface, 0, 0, res.w, res.h);
@@ -333,7 +333,7 @@ gst_wl_window_set_render_rectangle (GstWlWindow * window, gint x, gint y,
wl_subsurface_set_position (window->area_subsurface, x, y);
/* change the size of the area */
- wl_viewport_set_destination (window->area_viewport, w, h);
+ wp_viewport_set_destination (window->area_viewport, w, h);
if (window->video_width != 0) {
if (window->use_subsurface)
diff --git a/ext/wayland/wlwindow.h b/ext/wayland/wlwindow.h
index c34f60f..a6bd7a6 100644
--- a/ext/wayland/wlwindow.h
+++ b/ext/wayland/wlwindow.h
@@ -44,10 +44,10 @@ struct _GstWlWindow
GstWlDisplay *display;
struct wl_surface *area_surface;
struct wl_subsurface *area_subsurface;
- struct wl_viewport *area_viewport;
+ struct wp_viewport *area_viewport;
struct wl_surface *video_surface;
struct wl_subsurface *video_subsurface;
- struct wl_viewport *video_viewport;
+ struct wp_viewport *video_viewport;
struct wl_shell_surface *shell_surface;
/* the size and position of the area_(sub)surface */