video: Handle negative positioned video 59/284959/1
authorSeunghun Lee <shiin.lee@samsung.com>
Thu, 11 Aug 2022 05:43:32 +0000 (14:43 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Fri, 2 Dec 2022 00:22:49 +0000 (09:22 +0900)
If video sub-surface has negative position, e_comp_wl_output_find()
returns NULL unless there is an output which has negative position.
So, it would eventually fail to calculate physical geometry to be
applied to physical device associated with the output.

To resolve this problem, here it uses e_comp_wl_output_find_all() to get
all outputs on which a E_Client is overlapped. And then it uses a first
output among the returned outputs because it's not ready yet to support
for displaying video on multi output.

The same is true of e_comp_zone_xy_get(). As the name suggests, the
e_comp_zone_xy_get() function returns a zone which contains given x, y
position. So it returns nothing with negative x, y position unless there
is a zone which has negative position.

For this reason, this patch uses a zone referenced directly by E_Client
instead of the value returned from e_comp_zone_xy_get().

Change-Id: I5c20927ab418e4194209790a1c5a4b8bc50ebb38

src/bin/video/iface/e_video_hwc.c

index f8c7864..ced3c81 100644 (file)
@@ -932,6 +932,7 @@ static void
 _e_video_hwc_geometry_tdm_config_update(E_Client *ec, E_Video_Hwc_Geometry *out)
 {
    E_Zone *zone;
+   Eina_Array *outputs;
    E_Comp_Wl_Output *output;
    E_Client *topmost;
    int tran, flip;
@@ -940,10 +941,15 @@ _e_video_hwc_geometry_tdm_config_update(E_Client *ec, E_Video_Hwc_Geometry *out)
    topmost = e_comp_wl_topmost_parent_get(ec);
    EINA_SAFETY_ON_NULL_GOTO(topmost, normal);
 
-   output = e_comp_wl_output_find(topmost);
-   EINA_SAFETY_ON_NULL_GOTO(output, normal);
+   outputs = e_comp_wl_output_find_all(topmost);
+   if (!outputs)
+       goto normal;
 
-   zone = e_comp_zone_xy_get(topmost->x, topmost->y);
+   /* NOTE: Not support multi output yet. So we use the first output. */
+   output = eina_array_data_get(outputs, 0);
+   eina_array_free(outputs);
+
+   zone = topmost->zone;
    EINA_SAFETY_ON_NULL_GOTO(zone, normal);
 
    tran = out->transform & 0x3;