From: Nibha Sharma Date: Mon, 27 Sep 2021 08:42:08 +0000 (+0530) Subject: [ITC][player-display][ACR-1636][Added new display type for video] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F19%2F264619%2F3;p=test%2Ftct%2Fnative%2Fapi.git [ITC][player-display][ACR-1636][Added new display type for video] Change-Id: Ibfed7b0426fe3c62aad91fdf73263578380d8995 Signed-off-by: Nibha Sharma --- diff --git a/src/itc/player-display/ITs-player-display-common.c b/src/itc/player-display/ITs-player-display-common.c index 7786e0437..e746a051a 100755 --- a/src/itc/player-display/ITs-player-display-common.c +++ b/src/itc/player-display/ITs-player-display-common.c @@ -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); + } +} + /** @} */ diff --git a/src/itc/player-display/ITs-player-display-common.h b/src/itc/player-display/ITs-player-display-common.h index 8f6652092..a2e87b243 100755 --- a/src/itc/player-display/ITs-player-display-common.h +++ b/src/itc/player-display/ITs-player-display-common.h @@ -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); /** @} */ diff --git a/src/itc/player-display/ITs-player-display.c b/src/itc/player-display/ITs-player-display.c index ce6048f3a..ba4a62bcb 100755 --- a/src/itc/player-display/ITs-player-display.c +++ b/src/itc/player-display/ITs-player-display.c @@ -16,6 +16,8 @@ #include "ITs-player-display-common.h" #include #include "net_connection.h" +#include +#include /** @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; +} /** @} */ /** @} */ diff --git a/src/itc/player-display/tct-player-display-native_mobile.h b/src/itc/player-display/tct-player-display-native_mobile.h index 4cebaf340..07be928c7 100755 --- a/src/itc/player-display/tct-player-display-native_mobile.h +++ b/src/itc/player-display/tct-player-display-native_mobile.h @@ -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}, diff --git a/src/itc/player-display/tct-player-display-native_wearable.h b/src/itc/player-display/tct-player-display-native_wearable.h index 4cebaf340..07be928c7 100755 --- a/src/itc/player-display/tct-player-display-native_wearable.h +++ b/src/itc/player-display/tct-player-display-native_wearable.h @@ -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},