video_shell: Translate aspect_ratio by transform 30/317530/3
authorSeunghun Lee <shiin.lee@samsung.com>
Wed, 11 Sep 2024 03:21:56 +0000 (12:21 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Wed, 11 Sep 2024 08:38:23 +0000 (08:38 +0000)
Change-Id: I66584c13eda2b736d21f401f55df96522292a10c

src/bin/server/e_video_shell.c

index cc3c7e025c713c167c1a796f597d30ac398dc5d3..746449a89b962544edbbd73d526f51483dd13868 100644 (file)
@@ -966,8 +966,16 @@ _source_viewport_destination_update(E_Video_Viewport_Source *source)
 
    if (source->current.has_aspect_ratio)
      {
-        ratio_width = source->current.aspect_ratio.width;
-        ratio_height = source->current.aspect_ratio.height;
+        if (viewport->current.transform & WTZ_VIDEO_EXPORTED_VIEWPORT_TRANSFORM_90)
+          {
+             ratio_width = source->current.aspect_ratio.height;
+             ratio_height = source->current.aspect_ratio.width;
+          }
+        else
+          {
+             ratio_width = source->current.aspect_ratio.width;
+             ratio_height = source->current.aspect_ratio.height;
+          }
 
         _letter_box_geometry_calc(&dest_rect, ratio_width, ratio_height);
 
@@ -1180,7 +1188,10 @@ _source_cb_surface_commit(struct wl_listener *listener, void *data)
      }
 
    if (need_apply)
-     _source_viewport_apply(source);
+     {
+        _source_viewport_apply(source);
+        _source_viewport_transform_update(source);
+     }
 }
 
 static const char *
@@ -1325,6 +1336,7 @@ _source_viewport_link(E_Video_Viewport_Source *source, E_Video_Viewport *viewpor
 
    _source_viewport_destination_update(source);
    _source_viewport_apply(source);
+   _source_viewport_transform_update(source);
 
    return EINA_TRUE;
 }
@@ -1346,7 +1358,8 @@ _source_viewport_committed(E_Video_Viewport_Source *source)
 
    VS_DBG("SOURCE %p| viewport committed", source);
 
-   if (state->committed & E_VIDEO_VIEWPORT_STATE_DESTINATION)
+   if (state->committed & E_VIDEO_VIEWPORT_STATE_DESTINATION ||
+       state->committed & E_VIDEO_VIEWPORT_STATE_TRANSFORM)
      {
         _source_viewport_destination_update(source);
         _source_viewport_apply(source);