[M108 Migration][MM][CAPI] Support Video Hole in the onscreen rendering mode. 43/289243/3
authorSun-woo Nam <sunny.nam@samsung.com>
Thu, 2 Mar 2023 04:51:10 +0000 (20:51 -0800)
committerBot Blink <blinkbot@samsung.com>
Sun, 5 Mar 2023 04:38:26 +0000 (04:38 +0000)
Ecore_Wl2_Window is used as the main window handle in the onscreen rendering
mode.
Previously, |player_set_display| was used to use video hole in CAPI MMPlayer.
However, |player_set_display| could only receive evas objects, including
elm window, as a parameter.
Threrefore, this patch uses |player_set_display_webapp| api to hand over
the wayland surface id for the TV profile. In case of the public profile,
use |player_set_ecore_wl_display| instead of |player_set_display_webapp|.

Reference: https://review.tizen.org/gerrit/#/c/289148/

Change-Id: I0eb011c20a6584e581b151fec35468cd58073cfa
Signed-off-by: Sun-woo Nam <sunny.nam@samsung.com>
tizen_src/chromium_impl/media/base/tizen/media_player_bridge_capi.cc

index 14136ef..f14ae60 100644 (file)
 #include "ui/gfx/geometry/size.h"
 
 #if defined(TIZEN_VIDEO_HOLE)
+#include <Ecore_Wl2.h>
 #include "tizen_src/chromium_impl/media/base/tizen/video_plane_controller_capi.h"
-#include "tizen_src/chromium_impl/media/filters/esplusplayer_util.h"
+#if BUILDFLAG(IS_TIZEN_TV)
+#include <player_product_platform_interface.h>
+#endif
 #endif
 
 namespace {
@@ -170,8 +173,25 @@ void MediaPlayerBridgeCapi::Prepare(CompleteCB cb) {
 
 #if defined(TIZEN_VIDEO_HOLE)
   if (is_video_hole_) {
-    ret = player_set_display(player_, PLAYER_DISPLAY_TYPE_OVERLAY,
-                             video_plane_controller_->GetVideoPlaneHandle());
+    if (video_plane_controller_->rendering_mode() ==
+        VideoPlaneController::RenderingMode::OFFSCREEN) {
+      ret = player_set_display(player_, PLAYER_DISPLAY_TYPE_OVERLAY,
+                               video_plane_controller_->GetVideoPlaneHandle());
+    } else {
+      Ecore_Wl2_Window* window_handle = static_cast<Ecore_Wl2_Window*>(
+          video_plane_controller_->GetVideoPlaneHandle());
+      int wl_w, wl_h, wl_x, wl_y;
+#if BUILDFLAG(IS_TIZEN_TV)
+      ecore_wl2_window_geometry_get(window_handle, &wl_x, &wl_y, &wl_w, &wl_h);
+      unsigned int surface_id = ecore_wl2_window_surface_id_get(window_handle);
+      ret = player_set_display_webapp(player_, PLAYER_DISPLAY_TYPE_OVERLAY,
+                                      surface_id, wl_h, wl_w, wl_x, wl_y);
+#else
+      ret = player_set_ecore_wl_display(player_, PLAYER_DISPLAY_TYPE_OVERLAY,
+                                        window_handle, wl_x, wl_y, wl_w, wl_h);
+#endif
+    }
+
     if (ret != PLAYER_ERROR_NONE) {
       OnHandlePlayerError(ret, FROM_HERE);
       RunCompleteCB(false, FROM_HERE);