[ITC][player-display][ACR-1636][Added new display type for video] 19/264619/3
authorNibha Sharma <nibha.sharma@samsung.com>
Mon, 27 Sep 2021 08:42:08 +0000 (14:12 +0530)
committershobhit verma <shobhit.v@samsung.com>
Mon, 27 Sep 2021 10:07:01 +0000 (10:07 +0000)
Change-Id: Ibfed7b0426fe3c62aad91fdf73263578380d8995
Signed-off-by: Nibha Sharma <nibha.sharma@samsung.com>
src/itc/player-display/ITs-player-display-common.c
src/itc/player-display/ITs-player-display-common.h
src/itc/player-display/ITs-player-display.c
src/itc/player-display/tct-player-display-native_mobile.h
src/itc/player-display/tct-player-display-native_wearable.h

index 7786e0437ac34f79686442da28d6b8684853d440..e746a051a34a9c45290acdbae1abf4d7b001440e 100755 (executable)
@@ -269,4 +269,32 @@ void CreateEvasWindow()
        evas_object_show(g_pEvasWindow);
 }
 
+/**
+* @function            createWindow
+* @description                 Creates an elm window object
+* @parameter[IN]       NA
+* @return                      NA
+*/
+void createWindow()
+{
+    int w = 0;
+    int h = 0;
+
+    if (g_pElmWindow) {
+        evas_object_del(g_pElmWindow);
+        g_pElmWindow = NULL;
+    }
+
+    g_pElmWindow = elm_win_util_standard_add("player_display_tc", "player_display_tc");
+    if (g_pElmWindow) {
+        elm_win_borderless_set(g_pElmWindow, EINA_TRUE);
+        evas_object_smart_callback_add(g_pElmWindow, "delete, request", WinDel, NULL);
+        elm_win_screen_size_get(g_pElmWindow, NULL, NULL, &w, &h);
+        evas_object_resize(g_pElmWindow, w, h);
+        elm_win_autodel_set(g_pElmWindow, EINA_TRUE);
+    } else {
+        FPRINTF("[Line: %d][%s] createWindow failed , g_pElmWindow created is NULL", __LINE__, API_NAMESPACE);
+    }
+}
+
 /** @} */
index 8f6652092b56c3955fdf67814519b08d92efd431..a2e87b2431d29361bf0b1b1a2e4dff52225f1a11 100755 (executable)
@@ -29,8 +29,8 @@
 #define PATH_LEN                                       1024
 #define WIDTH                                          16
 #define HEIGHT                                         9
-#define x                                              5
-#define y                                              5
+#define xVal                                           5
+#define yVal                                           5
 #define API_NAMESPACE                          "PLAYER_DISPLAY_ITC"
 #define MEDIA_360_PATH                                 "test_360.mp4"
 #define MEDIA_PATH_VIDEO                       "file.mp4"
@@ -46,6 +46,7 @@
 
 bool g_bIsSupported;
 Evas_Object *g_pEvasWindow;
+Evas_Object *g_pElmWindow;
 Evas_Object *g_pEvasObject;
 Evas *g_pEvasCore;
 
@@ -82,6 +83,7 @@ bool InitializePlayerHandler(bool bPrepare, int nMediaType);
 void PlayerGetState(player_state_e e);
 
 void CreateEvasWindow();
+void createWindow();
 void WinDel(void *data, Evas_Object *obj, void *event);
 
 /** @} */
index ce6048f3adda0239bd0198a04044c0b789a5f123..ba4a62bcbb15b95a1ede1c6d853721a94b9b894a 100755 (executable)
@@ -16,6 +16,8 @@
 #include "ITs-player-display-common.h"
 #include <curl/curl.h>
 #include "net_connection.h"
+#include <Ecore_Wayland2.h>
+#include <Ecore_Evas.h>
 
 /** @addtogroup itc-player-display
 *  @ingroup itc
@@ -576,7 +578,7 @@ int ITc_player_set_display_roi_area_p(void)
        PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_mode", PlayerGetError(nRet));
        usleep(2000);
 
-       nRet = player_set_display_roi_area(g_player, x, y, WIDTH, HEIGHT);
+       nRet = player_set_display_roi_area(g_player, xVal, yVal, WIDTH, HEIGHT);
        PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_roi_area", PlayerGetError(nRet));
 
        return 0;
@@ -1083,5 +1085,62 @@ int ITc_player_set_unset_video_stream_changed_cb_p(void)
 
        return 0;
 }
+
+//& purpose: Sets player display
+//& type: auto
+/**
+* @testcase                            ITc_player_set_display_p
+* @author                              SRID(nibha.sharma)
+* @reviewer                            SRID(shobhit.v)
+* @type                                        auto
+* @since_tizen                 6.5
+* @description                 Sets player display
+* @scenario                            Sets player display
+* @apicovered                  player_set_display
+* @passcase                            When player_set_display api passed
+* @failcase                            When player_set_display api failed
+* @precondition                        Evas window should be created
+* @postcondition               N/A
+*/
+int ITc_player_set_display_p(void)
+{
+       START_TEST;
+       player_state_e state;
+       const char *pszExportedShellHandle = NULL;
+       Ecore_Evas *ecore_evas;
+       Ecore_Wl2_Window *ecore_wl2_win;
+       Ecore_Wl2_Subsurface *ecore_wl2_subsurface;
+       char pPath[PATH_LEN] = {0};
+
+       if ( false == PlayerAppendToAppDataPath(MEDIA_PATH_VIDEO, pPath))
+       {
+               FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE);
+               return 1;
+       }
+
+       int nRet = player_get_state(g_player,&state);
+       PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet));
+       if ( state == PLAYER_STATE_READY )
+       {
+               nRet = player_unprepare(g_player);
+               PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet));
+       }
+
+       createWindow();
+
+       ecore_evas = ecore_evas_ecore_evas_get(evas_object_evas_get(g_pElmWindow));
+       ecore_wl2_win = ecore_evas_wayland2_window_get(ecore_evas);
+       ecore_wl2_subsurface = ecore_wl2_subsurface_new(ecore_wl2_win);
+       ecore_wl2_subsurface_export(ecore_wl2_subsurface);
+       pszExportedShellHandle = ecore_wl2_subsurface_exported_surface_handle_get(ecore_wl2_subsurface);
+
+       nRet = player_set_uri(g_player, pPath);
+       PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_uri", PlayerGetError(nRet));
+
+       nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY_SYNC_UI, GET_DISPLAY(pszExportedShellHandle));
+       PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet));
+
+       return 0;
+}
 /** @} */
 /** @} */
index 4cebaf3406f6dd2539b253ae85858ce6a207a869..07be928c7eb6c35e8cfa9f155a58e16414bd274a 100755 (executable)
@@ -42,9 +42,11 @@ extern int ITc_player_360_set_get_direction_of_view_p(void);
 extern int ITc_player_360_set_get_zoom_p(void);
 extern int ITc_player_360_set_get_field_of_view(void);
 extern int ITc_player_360_set_zoom_with_field_of_view_p(void);
+extern int ITc_player_set_display_p(void);
 
 testcase tc_array[] = {
        {"ITc_player_set_get_video_roi_area_p",ITc_player_set_get_video_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup},
+       {"ITc_player_set_display_p",ITc_player_set_display_p,ITs_player_display_startup,ITs_player_display_cleanup},
        {"ITc_player_set_get_display_rotation_p",ITc_player_set_get_display_rotation_p,ITs_player_display_startup,ITs_player_display_cleanup},
        {"ITc_player_set_display_visible_p",ITc_player_set_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup},
        {"ITc_player_set_get_display_mode_p",ITc_player_set_get_display_mode_p,ITs_player_display_startup,ITs_player_display_cleanup},
index 4cebaf3406f6dd2539b253ae85858ce6a207a869..07be928c7eb6c35e8cfa9f155a58e16414bd274a 100755 (executable)
@@ -42,9 +42,11 @@ extern int ITc_player_360_set_get_direction_of_view_p(void);
 extern int ITc_player_360_set_get_zoom_p(void);
 extern int ITc_player_360_set_get_field_of_view(void);
 extern int ITc_player_360_set_zoom_with_field_of_view_p(void);
+extern int ITc_player_set_display_p(void);
 
 testcase tc_array[] = {
        {"ITc_player_set_get_video_roi_area_p",ITc_player_set_get_video_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup},
+       {"ITc_player_set_display_p",ITc_player_set_display_p,ITs_player_display_startup,ITs_player_display_cleanup},
        {"ITc_player_set_get_display_rotation_p",ITc_player_set_get_display_rotation_p,ITs_player_display_startup,ITs_player_display_cleanup},
        {"ITc_player_set_display_visible_p",ITc_player_set_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup},
        {"ITc_player_set_get_display_mode_p",ITc_player_set_get_display_mode_p,ITs_player_display_startup,ITs_player_display_cleanup},