tizen: Introduce wtz-video-shell protocol 95/312195/2
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 4 Jun 2024 05:02:23 +0000 (14:02 +0900)
committerJunSeok Kim <juns.kim@samsung.com>
Wed, 5 Jun 2024 08:25:41 +0000 (08:25 +0000)
The Video Shell is a tizen extension to the wayland protocol. It is
designed to ensure synchronization between updates to the toplevel
surface content and the viewport of a video surface traditionally
rendered by an extenal process responsible for rendering video content.

The protocol mainly introduces the wtz_video_exported_viewport and
wtz_video_viewport_source.

The wtz_video_exported_viewport is intended to be created within the
application process and provides configuration options such as
destination size and transformation settings.
By extending wtz_video_exported_viewport from wl_subsurface,
applications can leverage the synchronization capabilities of
wl_subsurface to align updates between the main surface content and
video output.

The wtz_video_viewport_source, on the other hand, is meant to be created
by the process handling video content creation. Its output will be
adjusted (scaled up or down) based on the destination size and
transformations specified through wtz_video_exported_viewport.

This design approach is largely inspired by the wtz-foreign-shell
protocol.

Change-Id: Idedce06e923e376b147b44e6b1ec8409d71970b5

Makefile.am
protocol/tizen/wtz-video-shell.xml [new file with mode: 0644]

index 881e5e20e88fbd85d808e4d6e139f1d535200c3e..c7b0db4f1f1e4d10b6579bec2cdd25ee461e990e 100644 (file)
@@ -527,6 +527,24 @@ liblinux_dmabuf_unstable_v1_client_la_SOURCES = protocol/unstable/linux-dmabuf-u
 liblinux_dmabuf_unstable_v1_client_la_CFLAGS  = @WAYLAND_CLIENT_CFLAGS@
 liblinux_dmabuf_unstable_v1_client_la_LIBADD  = @WAYLAND_CLIENT_LIBS@
 
+### wtz_video_shell
+protocol_LTLIBRARIES += \
+               libwtz-video-shell-server.la \
+               libwtz-video-shell-client.la
+pkgconfig_DATA += \
+        src/wtz-video-shell-server.pc \
+        src/wtz-video-shell-client.pc
+protocolinclude_HEADERS += \
+               protocol/tizen/wtz-video-shell-server-protocol.h \
+               protocol/tizen/wtz-video-shell-client-protocol.h
+libwtz_video_shell_server_la_SOURCES = protocol/tizen/wtz-video-shell-protocol.c
+libwtz_video_shell_server_la_CFLAGS  = @WAYLAND_SERVER_CFLAGS@
+libwtz_video_shell_server_la_LIBADD  = @WAYLAND_SERVER_LIBS@
+libwtz_video_shell_client_la_SOURCES = protocol/tizen/wtz-video-shell-protocol.c
+libwtz_video_shell_client_la_CFLAGS  = @WAYLAND_CLIENT_CFLAGS@
+libwtz_video_shell_client_la_LIBADD  = @WAYLAND_CLIENT_LIBS@
+
+
 ### wayland-protocols
 unstable_protocols = \
        protocol/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml \
@@ -583,6 +601,7 @@ tizen_protocols = \
                protocol/tizen/wtz-shell.xml \
                protocol/tizen/wtz-blender.xml \
                protocol/tizen/wtz-blur.xml \
+               protocol/tizen/wtz-video-shell.xml \
        $(NULL)
 
 nobase_dist_pkgdata_DATA = \
diff --git a/protocol/tizen/wtz-video-shell.xml b/protocol/tizen/wtz-video-shell.xml
new file mode 100644 (file)
index 0000000..3bf19ca
--- /dev/null
@@ -0,0 +1,156 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="wtz_video_shell">
+  <copyright>
+    Copyright 2024 Samsung Electronics co., Ltd. All Rights Reserved.
+
+    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.
+  </copyright>
+
+  <description summary="TODO">
+    TODO
+  </description>
+
+  <interface name="wtz_video_shell" version="1">
+    <enum name="error">
+      <entry name="role" value="0" summary="given surface has another role"/>
+    </enum>
+
+    <request name="export_viewport">
+      <arg name="id" type="new_id" interface="wtz_video_exported_viewport"/>
+      <arg name="subsurface" type="object" interface="wl_subsurface"/>
+    </request>
+
+    <request name="get_surface">
+      <arg name="id" type="new_id" interface="wtz_video_surface"/>
+      <arg name="surface" type="object" interface="wl_surface"/>
+    </request>
+  </interface>
+
+  <interface name="wtz_video_exported_viewport" version="1">
+    <enum name="error">
+      <entry name="bad_value" value="0" summary="negative or zero values in width or height"/>
+      <entry name="invalid_transform" value="1" summary="transform value is invalid"/>
+      <entry name="no_subsurface" value="2" summary="the wl_subsurface was destroyed"/>
+    </enum>
+
+    <enum name="transform">
+      <entry name="normal" value="0" summary="no transform"/>
+      <entry name="90" value="1" summary="90 degrees clockwise"/>
+      <entry name="180" value="2" summary="180 degrees clockwise"/>
+      <entry name="270" value="3" summary="270 degrees clockwise"/>
+    </enum>
+
+    <event name="handle">
+      <arg name="handle" type="string" summary=""/>
+    </event>
+
+    <request name="destroy" type="destructor">
+      <description summary="">
+      </description>
+    </request>
+
+    <request name="set_destination">
+      <description summary="set the size for scaling">
+      </description>
+      <arg name="width" type="int" summary=""/>
+      <arg name="height" type="int" summary=""/>
+    </request>
+
+    <request name="set_transform">
+      <description summary="">
+      </description>
+      <arg name="transform" type="int" enum="transform"
+       summary=""/>
+    </request>
+
+    <request name="map">
+      <description summary="">
+      </description>
+    </request>
+
+    <request name="unmap">
+      <description summary="">
+      </description>
+    </request>
+  </interface>
+
+  <interface name="wtz_video_surface" version="1">
+    <enum name="error">
+      <entry name="source_exists" value="0" summary=""/>
+      <entry name="role" value="0" summary="given surface has another role"/>
+      <entry name="no_surface" value="0" summary="the wl_surface was destroyed"/>
+    </enum>
+
+    <request name="destroy" type="destructor">
+    </request>
+
+    <request name="get_viewport_source">
+      <arg name="id" type="new_id" interface="wtz_video_viewport_source"/>
+      <arg name="handle" type="string"/>
+    </request>
+
+    <request name="get_subsurface">
+      <arg name="id" type="new_id" interface="wl_subsurface"
+           summary="the new sub-surface object ID"/>
+      <arg name="parent" type="object" interface="wl_surface"
+           summary="the parent_surface"/>
+    </request>
+
+    <request name="set_name">
+      <arg name="name" type="string" allow-null="true"/>
+    </request>
+
+    <request name="set_stand_alone">
+    </request>
+
+    <request name="unset_stand_alone">
+    </request>
+  </interface>
+
+  <interface name="wtz_video_viewport_source" version="1">
+    <request name="destroy" type="destructor">
+    </request>
+
+    <enum name="error">
+      <entry name="bad_value" value="0" summary="negative or zero values in width or height"/>
+      <entry name="no_surface" value="1" summary="the wl_surface was destroyed"/>
+    </enum>
+
+    <request name="set_source">
+      <description summary="set the source rectangle for cropping">
+      </description>
+      <arg name="x" type="fixed" summary="source rectangle x"/>
+      <arg name="y" type="fixed" summary="source rectangle y"/>
+      <arg name="width" type="fixed" summary="source rectangle width"/>
+      <arg name="height" type="fixed" summary="source rectangle height"/>
+    </request>
+
+    <request name="set_aspect_ratio">
+      <arg name="width" type="int"/>
+      <arg name="height" type="int"/>
+    </request>
+
+    <event name="viewport_destroyed">
+    </event>
+  </interface>
+
+</protocol>