*/
EAPI Eina_Bool ecore_wl2_subsurface_video_surface_destination_set(Ecore_Wl2_Subsurface *subsurface, int x, int y, int w, int h);
+/**
+ * @brief Defines the rotation types of video surface
+ *
+ * @see ecore_wl2_subsurface_video_surface_rotation_set
+ *
+ * @ingroup Ecore_Wl2_Subsurface_Group
+ * @since_tizen 6.0
+ */
+typedef enum _Ecore_Wl2_Subsurface_Rotation
+{
+ ECORE_WL2_SUBSURFACE_ROTATION_NORMAL,
+ ECORE_WL2_SUBSURFACE_ROTATION_90,
+ ECORE_WL2_SUBSURFACE_ROTATION_180,
+ ECORE_WL2_SUBSURFACE_ROTATION_270,
+ ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED,
+ ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_90,
+ ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_180,
+ ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_270
+} Ecore_Wl2_Subsurface_Rotation;
+
+/**
+ * @brief Set video surface rotation for a given subsurface
+ *
+ * @param subsurface The subsurface to set video surface rotation
+ * @param rotation The rotation type to set video surface rotation
+ *
+ * @return @c EINA_TRUE on success, @c EINA_FALSE otherwise
+ *
+ * @ingroup Ecore_Wl2_Subsurface_Group
+ * @since_tizen 6.0
+ */
+EAPI Eina_Bool ecore_wl2_subsurface_video_surface_rotation_set(Ecore_Wl2_Subsurface *subsurface, Ecore_Wl2_Subsurface_Rotation rotation);
+
/**
* @brief Set an auxiliary hint on a given subsurface
*
return subsurface->parent;
}
-EAPI Eina_Bool
-ecore_wl2_subsurface_video_surface_destination_set(Ecore_Wl2_Subsurface *subsurface, int x, int y, int w, int h)
+static Eina_Bool _tizen_video_viewport_get(Ecore_Wl2_Subsurface *subsurface)
{
Ecore_Wl2_Display *display;
struct wl_registry *registry;
Eina_Iterator *globals;
Ecore_Wl2_Global *global;
- EINA_SAFETY_ON_NULL_RETURN_VAL(subsurface, EINA_FALSE);
-
if (!subsurface->video)
{
ERR("prepare subsurface(%p) first", subsurface);
}
}
+ return EINA_TRUE;
+}
+
+EAPI Eina_Bool
+ecore_wl2_subsurface_video_surface_destination_set(Ecore_Wl2_Subsurface *subsurface, int x, int y, int w, int h)
+{
+ EINA_SAFETY_ON_NULL_RETURN_VAL(subsurface, EINA_FALSE);
+ if (!_tizen_video_viewport_get(subsurface)) return EINA_FALSE;
+
tizen_viewport_set_destination(subsurface->wl.viewport, x, y, w, h);
wl_surface_commit(subsurface->wl.surface);
return EINA_TRUE;
}
+EAPI Eina_Bool
+ecore_wl2_subsurface_video_surface_rotation_set(Ecore_Wl2_Subsurface *subsurface, Ecore_Wl2_Subsurface_Rotation rotation)
+{
+ int transform;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(subsurface, EINA_FALSE);
+
+ if (rotation < ECORE_WL2_SUBSURFACE_ROTATION_NORMAL ||
+ rotation > ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_270)
+ {
+ ERR("Not supported: %d", rotation);
+ return EINA_FALSE;
+ }
+
+ if (!_tizen_video_viewport_get(subsurface)) return EINA_FALSE;
+
+ switch (rotation)
+ {
+ case ECORE_WL2_SUBSURFACE_ROTATION_NORMAL:
+ transform = WL_OUTPUT_TRANSFORM_NORMAL;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_90:
+ transform = WL_OUTPUT_TRANSFORM_90;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_180:
+ transform = WL_OUTPUT_TRANSFORM_180;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_270:
+ transform = WL_OUTPUT_TRANSFORM_270;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_90:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_90;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_180:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_180;
+ break;
+ case ECORE_WL2_SUBSURFACE_ROTATION_FLIPPED_270:
+ transform = WL_OUTPUT_TRANSFORM_FLIPPED_270;
+ break;
+ }
+
+ tizen_viewport_set_transform(subsurface->wl.viewport, transform);
+ wl_surface_commit(subsurface->wl.surface);
+
+ return EINA_TRUE;
+}
+
void
_ecore_wl2_subsurfae_place_surface_stack(Ecore_Wl2_Subsurface *subsurf, Ecore_Wl2_Subsurface *other, Eina_Bool above)
{