From: Nibha Sharma Date: Wed, 28 Jul 2021 15:59:30 +0000 (+0530) Subject: [ITC][player][Separate display tct for iot profile] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F261908%2F4;p=test%2Ftct%2Fnative%2Fapi.git [ITC][player][Separate display tct for iot profile] Change-Id: I15e2920ccf9bf4047779e4d424dc271bc6df8397 Signed-off-by: Nibha Sharma --- diff --git a/packaging/itc/native-player-display-itc.xml b/packaging/itc/native-player-display-itc.xml new file mode 100755 index 000000000..5c70c7771 --- /dev/null +++ b/packaging/itc/native-player-display-itc.xml @@ -0,0 +1,28 @@ + + + + test + Native API test Application + + + + + + + + + + http://tizen.org/privilege/externalstorage + http://tizen.org/privilege/mediastorage + http://tizen.org/privilege/appmanager.launch + http://tizen.org/privilege/content.write + http://tizen.org/privilege/internet + http://tizen.org/privilege/notification + http://tizen.org/privilege/location + http://tizen.org/privilege/camera + http://tizen.org/privilege/display + http://tizen.org/privilege/download + http://tizen.org/privilege/network.get + http://tizen.org/privilege/network.profile + + diff --git a/scripts_tpk/spec.sh b/scripts_tpk/spec.sh index 4522cab93..2ef4b0fbf 100755 --- a/scripts_tpk/spec.sh +++ b/scripts_tpk/spec.sh @@ -437,6 +437,24 @@ case "$1" in chsmack -a "User::App::Shared" $APP_DATA_DIR/* chsmack -e "User::App::Shared" $APP_DATA_DIR/* ;; + "org.tizen.player-display-native-itc") + echo "Installing pre-requisites for the package $1" + mkdir -p $APP_DATA_DIR + chsmack -a "User::App::Shared" $APP_DATA_DIR + chsmack -e "User::App::Shared" $APP_DATA_DIR + cp short.mp3 $APP_DATA_DIR/short.mp3 + cp file.mp4 $APP_DATA_DIR/file.mp4 + cp sub.srt $APP_DATA_DIR/sub.srt + cp v.mp4 $APP_DATA_DIR/v.mp4 + cp test_drc.ts $APP_DATA_DIR/test_drc.ts + cp test.h264 $APP_DATA_DIR/test.h264 + cp AWB_header_change_AMR.amr $APP_DATA_DIR/AWB_header_change_AMR.amr + cp test_360.mp4 $APP_DATA_DIR/test_360.mp4 + chown -R 5000:5000 $APP_DATA_DIR + chmod -R 777 $APP_DATA_DIR + chsmack -a "User::App::Shared" $APP_DATA_DIR/* + chsmack -e "User::App::Shared" $APP_DATA_DIR/* + ;; "org.tizen.iotcon-native-itc") echo "Installing pre-requisites for the package $1" mkdir -p $APP_DATA_DIR diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index dd97c442c..8bcc7b637 100755 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -269,6 +269,8 @@ ELSE( DEFINED MODULE ) ADD_SUBDIRECTORY(itc/package-manager) MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/player") ADD_SUBDIRECTORY(itc/player) + MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/player") + ADD_SUBDIRECTORY(itc/player-display) MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/privilege-info") ADD_SUBDIRECTORY(itc/privilege-info) MESSAGE(STATUS "Building: ${CMAKE_CURRENT_SOURCE_DIR}/itc/push") diff --git a/src/itc/player-display/AWB_header_change_AMR.amr b/src/itc/player-display/AWB_header_change_AMR.amr new file mode 100644 index 000000000..5d8a7e6ec Binary files /dev/null and b/src/itc/player-display/AWB_header_change_AMR.amr differ diff --git a/src/itc/player-display/CMakeLists.txt b/src/itc/player-display/CMakeLists.txt new file mode 100755 index 000000000..72e00a1bd --- /dev/null +++ b/src/itc/player-display/CMakeLists.txt @@ -0,0 +1,47 @@ +SET(PKG_NAME "player-display") + +SET(EXEC_NAME "tct-${PKG_NAME}-native") +SET(RPM_NAME "native-${PKG_NAME}-itc") + +SET(CAPI_LIB "capi-media-player") +SET(TC_SOURCES + ITs-player-display-common.c + ITs-player-display.c + ITs-player-display-360.c +) + +PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED + ${CAPI_LIB} + capi-appfw-application + capi-system-info + glib-2.0 + gthread-2.0 + gobject-2.0 + elementary + ecore + evas + storage + dlog +) + +INCLUDE_DIRECTORIES( + ${${CAPI_LIB}_INCLUDE_DIRS} +) + +ADD_EXECUTABLE(${EXEC_NAME} ${EXEC_NAME}.c ${TC_SOURCES} ${COMMON_FILE}) +TARGET_LINK_LIBRARIES(${EXEC_NAME} + ${${CAPI_LIB}_LIBRARIES} + bundle +) + +INSTALL(PROGRAMS ${EXEC_NAME} + DESTINATION ${BIN_DIR}/${RPM_NAME}/bin +) + +IF( DEFINED ASAN ) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC -Wall -pie -g -fsanitize=address -fsanitize-recover=address -U_FORTIFY_SOURCE -fno-omit-frame-pointer") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -Wl,-fsanitize=address") +ELSE() +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -g -fPIE -Wall") +SET(CMAKE_EXE_LINKER_FLAGS "-Wl,--as-needed -Wl,--rpath=/usr/lib -pie") +ENDIF() diff --git a/src/itc/player-display/ITs-player-display-360.c b/src/itc/player-display/ITs-player-display-360.c new file mode 100755 index 000000000..c1720a9c5 --- /dev/null +++ b/src/itc/player-display/ITs-player-display-360.c @@ -0,0 +1,403 @@ +// +// Copyright (c) 2014 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "ITs-player-display-common.h" + +/** @addtogroup itc-player-display +* @ingroup itc +* @{ +*/ +//& set: Player +bool g_bPlayerCreation; + +/** +* @function ITs_player_360_startup +* @description Called before each test, created player handle +* @parameter NA +* @return NA +*/ +void ITs_player_360_startup(void) +{ + g_bIsSupported = false; + ecore_main_loop_glib_integrate(); + struct stat stBuff; + if ( stat(ERR_LOG, &stBuff) == 0 ) + { + int ret = remove(ERR_LOG); + if(ret == -1) + { + FPRINTF("[Line: %d][%s] unlinking file name error =%s \\n", __LINE__, API_NAMESPACE,ERR_LOG); + return; + } + } +#if DEBUG + FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_player_360_startup\\n", __LINE__, API_NAMESPACE); +#endif + + CreateEvasWindow(); + if ( g_pEvasObject == NULL ) + { + FPRINTF("[Line : %d][%s] Evas window object is not created, failed in Precondition\\n", __LINE__, API_NAMESPACE); + g_bPlayerCreation = false; + return; + } + + int nRet = player_create(&g_player); + if ( nRet != PLAYER_ERROR_NONE ) + { + FPRINTF("[Line : %d][%s] Unable to create player, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + g_bPlayerCreation = false; + } + else + { + FPRINTF("[Line : %d][%s] Player created successfully\\n",__LINE__, API_NAMESPACE); + g_bPlayerCreation = true; + } + + if(TCTCheckSystemInfoFeatureSupported(OPENGL_FEATURE, API_NAMESPACE) && TCTCheckSystemInfoFeatureSupported(SPHERICAL_VIDEO_FEATURE, API_NAMESPACE)) + { + g_bIsSupported = true; + } + else + { + FPRINTF("[Line : %d][%s] SPHERICAL and OPENGL feature not supported \\n", __LINE__, API_NAMESPACE); + g_bIsSupported = false; + } + return; +} + +/** +* @function ITs_player_360_cleanup +* @description Called after each test, destroys player handle +* @parameter NA +* @return NA +*/ +void ITs_player_360_cleanup(void) +{ +#if DEBUG + FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_player_360_cleanup\\n", __LINE__, API_NAMESPACE); +#endif + if ( g_bPlayerCreation && g_player ) + { + int nRet = player_destroy (g_player); + if ( nRet != PLAYER_ERROR_NONE ) + { + FPRINTF("[Line : %d][%s] player_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + } + g_player = NULL; + } + else + { + FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); + } + if ( g_pEvasObject ) + { + evas_object_del(g_pEvasObject); + g_pEvasObject = NULL; + } + if ( g_pEvasWindow ) + { + evas_object_del(g_pEvasWindow); + g_pEvasWindow = NULL; + } + g_bIsSupported = false; + return; +} +//& purpose: Gets information whether the current content of the player is spherical. +//& type: auto +/** +* @testcase ITc_media_player_360_is_content_spherical_p +* @author SRID(ankit.j) +* @reviewer SRID(nibha.sharma) +* @type auto +* @since_tizen 5.0 +* @description Gets information whether the current content of the player is spherical. +* @scenario Gets information whether the current content of the player is spherical. +* @apicovered player_360_is_content_spherical +* @passcase The value indicating whether the content is spherical returns success +* @failcase The value indicating whether the content is spherical returns negative value +* @precondition The player state must be one of:#PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED +* @postcondition N/A +*/ + +int ITc_media_player_360_is_content_spherical_p(void) +{ + START_TEST; + bool isContentSpherical=false; + int nRet = -1; + player_state_e state; + char pPath[PATH_LEN] = {0}; + + if ( false == PlayerAppendToAppDataPath(MEDIA_360_PATH, pPath)) + { + FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); + return 1; + } + + nRet = player_get_state(g_player,&state); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_IDLE ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_create() call",__LINE__, API_NAMESPACE); + return 1; + } + + 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, GET_DISPLAY(g_pEvasWindow)); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_prepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); + + nRet = player_360_is_content_spherical(g_player, &isContentSpherical); + if ( false == g_bIsSupported ) + { + PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_is_content_spherical", PlayerGetError(nRet)); + return 0; + } + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_is_content_spherical", PlayerGetError(nRet)); + + if(isContentSpherical != true) + { + FPRINTF("[Line : %d][%s] ITc_media_player_360_is_content_spherical_p, failed. It has returned false for spherical 360 media content \\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; + +} +/** @addtogroup itc-player-testcases +* @brief Integration testcases for module player +* @ingroup itc-player +* @{ +*/ + +//& purpose: Gets and Sets the 360 video display mode +//& type : auto +/** +* @testcase ITc_player_360_is_set_enabled_p +* @author SRID(manu.tiwari) +* @reviewer SRID(abhishek.j) +* @type auto +* @since_tizen 5.0 +* @description Gets and Sets the 360 video display mode +* @scenario Gets and Sets the 360 video display mode +* @apicovered player_360_set_enabled, player_360_is_enabled +* @passcase When API returns PLAYER_ERROR_NONE +* @failcase When API not returns PLAYER_ERROR_NONE +* @precondition player must be created +* @postcondition player must be destroyed +*/ +int ITc_player_360_is_set_enabled_p(void) +{ + START_TEST; + //isEnabled = false = display with full panorama mode + //isEnabled = true = display with 360 video mode + bool nSetEnabled = false; + bool nIsEnabled = true; //default value + //Target API + int nRet = player_360_set_enabled(g_player, nSetEnabled); + if ( false == g_bIsSupported ) + { + PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_enabled", PlayerGetError(nRet)); + return 0; + } + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_enabled", PlayerGetError(nRet)); + // Target API + nRet = player_360_is_enabled(g_player, &nIsEnabled); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_is_enabled", PlayerGetError(nRet)); + if(nIsEnabled != false) + { + FPRINTF("[Line : %d][%s] video display mode mismatch\\n", __LINE__, API_NAMESPACE); + return 1; + } + return 0; +} +//& purpose: Sets and Gets the 360 video direction of view +//& type : auto +/** +* @testcase ITc_player_360_set_get_direction_of_view_p +* @author SRID(manu.tiwari) +* @reviewer SRID(abhishek.j) +* @type auto +* @since_tizen 5.0 +* @description Sets and Gets the 360 video direction of view +* @scenario Sets and Gets the 360 video direction of view +* @apicovered player_360_set_direction_of_view, player_360_get_direction_of_view +* @passcase When API returns PLAYER_ERROR_NONE +* @failcase When API not returns PLAYER_ERROR_NONE +* @precondition player must be created +* @postcondition player must be destroyed +*/ +int ITc_player_360_set_get_direction_of_view_p(void) +{ + START_TEST; + float nGetYaw = -1.0; + float nSetYaw = 3.14; + float nSetPitch = 1.57; + float nGetPitch = -1.0; + int nRet = player_360_set_direction_of_view(g_player, nSetYaw, nSetPitch); + if ( false == g_bIsSupported ) + { + PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_direction_of_view", PlayerGetError(nRet)); + return 0; + } + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_direction_of_view", PlayerGetError(nRet)); + nRet = player_360_get_direction_of_view(g_player, &nGetYaw, &nGetPitch); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_direction_of_view", PlayerGetError(nRet)); + if (( nSetPitch != nGetPitch ) || ( nSetYaw != nGetYaw )) + { + FPRINTF("[Line : %d][%s] error returned = set get pitch values mismatched, set pitch value = %f, get pitch value = %f, set yaw value = %f, get yaw value = %f\\n", __LINE__, API_NAMESPACE, nSetPitch, nGetPitch, nSetYaw, nGetYaw); + return 1; + } + return 0; +} +//& purpose: Sets and Gets the zoom level of 360 video +//& type : auto +/** +* @testcase ITc_player_360_set_get_zoom_p +* @author SRID(manu.tiwari) +* @reviewer SRID(abhishek.j) +* @type auto +* @since_tizen 5.0 +* @description Sets and Gets the zoom level of 360 video +* @scenario Sets and Gets the zoom level of 360 video +* @apicovered player_360_set_zoom, player_360_get_zoom +* @passcase When API returns PLAYER_ERROR_NONE +* @failcase When API not returns PLAYER_ERROR_NONE +* @precondition player must be created +* @postcondition player must be destroyed +*/ +int ITc_player_360_set_get_zoom_p(void) +{ + START_TEST; + + float nSetZoom = 5.0; + float nGetZoom = 0.0; + int nRet = player_360_set_zoom(g_player, nSetZoom); + if ( false == g_bIsSupported ) + { + PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_zoom", PlayerGetError(nRet)); + return 0; + } + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_zoom", PlayerGetError(nRet)); + nRet = player_360_get_zoom(g_player, &nGetZoom); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_zoom", PlayerGetError(nRet)); + if(nGetZoom != nSetZoom) + { + FPRINTF("[Line : %d][%s] error returned = set get zoom values mismatched, set value = %f, get value = %f\\n", __LINE__, API_NAMESPACE, nSetZoom, nGetZoom); + return 1; + } + return 0; +} +//& purpose: Sets and Gets the field of view information of 360 video +//& type : auto +/** +* @testcase ITc_player_360_set_get_field_of_view +* @author SRID(manu.tiwari) +* @reviewer SRID(abhishek.j) +* @type auto +* @since_tizen 5.0 +* @description Sets and Gets the field of view information of 360 video +* @scenario Sets and Gets the field of view information of 360 video +* @apicovered player_360_set_field_of_view, player_360_get_field_of_view +* @passcase When API returns PLAYER_ERROR_NONE +* @failcase When API not returns PLAYER_ERROR_NONE +* @precondition player must be created +* @postcondition player must be destroyed +*/ +int ITc_player_360_set_get_field_of_view(void) +{ + START_TEST; + int nSethorizontaldegrees = 120; + int nSetverticaldegrees = 67; + int nGethorizontaldegrees = 0; + int nGetverticaldegrees = 0; + int nRet = player_360_set_field_of_view(g_player, nSethorizontaldegrees, nSetverticaldegrees); + if ( false == g_bIsSupported ) + { + PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_field_of_view", PlayerGetError(nRet)); + return 0; + } + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_field_of_view", PlayerGetError(nRet)); + nRet = player_360_get_field_of_view(g_player, &nGethorizontaldegrees, &nGetverticaldegrees); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_field_of_view", PlayerGetError(nRet)); + if (( nSethorizontaldegrees != nGethorizontaldegrees ) || ( nSetverticaldegrees != nGetverticaldegrees )) + { + FPRINTF("[Line : %d][%s] error returned = set get field of view values mismatched, set horizontal degree = %d, get horizontal degree = %d, set vertical degree = %d, get vertical degree = %d\\n", __LINE__, API_NAMESPACE, nSethorizontaldegrees, nGethorizontaldegrees, nSetverticaldegrees, nGetverticaldegrees); + return 1; + } + return 0; +} + +//& purpose: Sets zoom with field of view information of 360 video +//& type : auto +/** +* @testcase ITc_player_360_set_zoom_with_field_of_view_p +* @author SRID(manoj.g2) +* @reviewer SRID(nibha.sharma) +* @type auto +* @since_tizen 5.0 +* @description Sets zoom with field of view information of 360 video +* @scenario Sets zoom with field of view information of 360 video +* @apicovered player_360_set_zoom_with_field_of_view, player_360_get_field_of_view +* @passcase When API returns PLAYER_ERROR_NONE +* @failcase When API not returns PLAYER_ERROR_NONE +* @precondition player must be created +* @postcondition player must be destroyed +*/ +int ITc_player_360_set_zoom_with_field_of_view_p(void) +{ + START_TEST; + int nRet = -1; + int nSethorizontaldegrees = 120; + int nSetverticaldegrees = 90; + int nGetHorizontalDegree = 0; + int nGetVerticalDegree = 0; + float nSetlevel = 3.0; + float nGetlevel = 0.0; + + //Target API + nRet = player_360_set_zoom_with_field_of_view(g_player, nSetlevel, nSethorizontaldegrees, nSetverticaldegrees); + if ( false == g_bIsSupported ) + { + PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_zoom_with_field_of_view", PlayerGetError(nRet)); + return 0; + } + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_zoom_with_field_of_view", PlayerGetError(nRet)); + + nRet = player_360_get_zoom(g_player, &nGetlevel); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_zoom", PlayerGetError(nRet)); + if(nGetlevel != nSetlevel) + { + FPRINTF("[Line : %d][%s] player_360_get_zoom after call is %f ",__LINE__, API_NAMESPACE, nGetlevel); + return 1; + } + + nRet = player_360_get_field_of_view(g_player, &nGetHorizontalDegree, &nGetVerticalDegree); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_field_of_view", PlayerGetError(nRet)); + if (( nSethorizontaldegrees != nGetHorizontalDegree ) || ( nSetverticaldegrees != nGetVerticalDegree )) + { + FPRINTF("[Line : %d][%s] error returned = set get field of view values mismatched, set horizontal degree = %d, get horizontal degree = %d, set vertical degree = %d, get vertical degree = %d\\n", __LINE__, API_NAMESPACE, nSethorizontaldegrees, nGetHorizontalDegree, nSetverticaldegrees, nGetVerticalDegree); + return 1; + } + return 0; +} +/** @} */ +/** @} */ diff --git a/src/itc/player-display/ITs-player-display-common.c b/src/itc/player-display/ITs-player-display-common.c new file mode 100755 index 000000000..5b7f3d94d --- /dev/null +++ b/src/itc/player-display/ITs-player-display-common.c @@ -0,0 +1,399 @@ +// +// Copyright (c) 2014 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "ITs-player-display-common.h" + +extern bool PlayerPrepareWithConnectionCheck(player_h g_player); +extern bool CheckOnlineStatus(char *media_path); + +/** @addtogroup itc-player-display +* @ingroup itc +* @{ +*/ + +//Print Player State Code +void PlayerGetState(player_state_e state) +{ + switch ( state ) + { + case PLAYER_STATE_NONE: FPRINTF("[Line: %d][%s] PLAYER_STATE_NONE\\n", __LINE__, API_NAMESPACE); break; + case PLAYER_STATE_IDLE: FPRINTF("[Line: %d][%s] PLAYER_STATE_IDLE\\n", __LINE__, API_NAMESPACE); break; + case PLAYER_STATE_READY: FPRINTF("[Line: %d][%s] PLAYER_STATE_READY\\n", __LINE__, API_NAMESPACE); break; + case PLAYER_STATE_PLAYING: FPRINTF("[Line: %d][%s] PLAYER_STATE_PLAYING\\n", __LINE__, API_NAMESPACE); break; + case PLAYER_STATE_PAUSED: FPRINTF("[Line: %d][%s] PLAYER_STATE_PAUSED\\n", __LINE__, API_NAMESPACE); break; + } +} + +/** +* @function PlayerGetDataPath +* @description Returns the application data path +* @parameter pAppDataPath: application data path +* @return true if succeed else false +*/ +bool PlayerGetDataPath(char* pAppDataPath) +{ + if ( NULL == pAppDataPath ) + { + FPRINTF("[Line: %d][%s] Null Path provided;Check the input string\\n", __LINE__, API_NAMESPACE); + return false; + } + + memset(pAppDataPath, 0, PATH_LEN); + + char* pPath = NULL; + pPath = app_get_data_path(); + if ( NULL == pPath ) + { + FPRINTF("[Line: %d][%s] Unable to get application data path;app_get_data_path returned null value\\n", __LINE__, API_NAMESPACE); + return false; + } + + strncpy(pAppDataPath, pPath, PATH_LEN-1); + FPRINTF("[Line: %d][%s] application data path returned = %s\\n", __LINE__, API_NAMESPACE, pAppDataPath); + return true; +} + +/** +* @function PlayerAppendToAppDataPath +* @description Appends the input string to application data path +* @parameter pInputPath: path to append to data path;pFinalPath: final resultant path +* @return true if succeed else false +*/ +bool PlayerAppendToAppDataPath(char* pInputPath, char* pFinalPath) +{ + if ( (NULL == pInputPath) || (NULL == pFinalPath) ) + { + FPRINTF("[Line: %d][%s] Null Path provided;Check the input string\\n", __LINE__, API_NAMESPACE); + return false; + } + + char pAppDataPath[PATH_LEN] = {0,}; + if ( false == PlayerGetDataPath(pAppDataPath) ) + { + return false; + } + + memset(pFinalPath, 0, PATH_LEN); + strncpy(pFinalPath, pAppDataPath, strlen(pAppDataPath)+1); + strncat(pFinalPath, pInputPath, strlen(pInputPath)+1); + + FPRINTF("[Line: %d][%s] result path returned = %s\\n", __LINE__, API_NAMESPACE, pFinalPath); + return true; +} + +/** +* @function PlayerGetError +* @description Maps error enums to string values +* @parameter nRet: error code returned +* @return error string +*/ +char* PlayerGetError(int nRet) +{ + char *szErrorVal = NULL; + switch ( nRet ) + { + case PLAYER_ERROR_NONE: szErrorVal = "PLAYER_ERROR_NONE"; break; + case PLAYER_ERROR_OUT_OF_MEMORY: szErrorVal = "PLAYER_ERROR_OUT_OF_MEMORY"; break; + case PLAYER_ERROR_INVALID_PARAMETER: szErrorVal = "PLAYER_ERROR_INVALID_PARAMETER"; break; + case PLAYER_ERROR_NO_SUCH_FILE: szErrorVal = "PLAYER_ERROR_NO_SUCH_FILE"; break; + case PLAYER_ERROR_INVALID_OPERATION: szErrorVal = "PLAYER_ERROR_INVALID_OPERATION"; break; + case PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE: szErrorVal = "PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE"; break; + case PLAYER_ERROR_SEEK_FAILED: szErrorVal = "PLAYER_ERROR_SEEK_FAILED"; break; + case PLAYER_ERROR_INVALID_STATE: szErrorVal = "PLAYER_ERROR_INVALID_STATE"; break; + case PLAYER_ERROR_NOT_SUPPORTED_FILE: szErrorVal = "PLAYER_ERROR_NOT_SUPPORTED_FILE"; break; + case PLAYER_ERROR_INVALID_URI: szErrorVal = "PLAYER_ERROR_INVALID_URI"; break; + case PLAYER_ERROR_SOUND_POLICY: szErrorVal = "PLAYER_ERROR_SOUND_POLICY"; break; + case PLAYER_ERROR_CONNECTION_FAILED: szErrorVal = "PLAYER_ERROR_CONNECTION_FAILED"; break; + case PLAYER_ERROR_VIDEO_CAPTURE_FAILED: szErrorVal = "PLAYER_ERROR_VIDEO_CAPTURE_FAILED"; break; + case PLAYER_ERROR_DRM_EXPIRED: szErrorVal = "PLAYER_ERROR_DRM_EXPIRED"; break; + case PLAYER_ERROR_DRM_NO_LICENSE: szErrorVal = "PLAYER_ERROR_DRM_NO_LICENSE"; break; + case PLAYER_ERROR_DRM_FUTURE_USE: szErrorVal = "PLAYER_ERROR_DRM_NO_LICENSE"; break; + case PLAYER_ERROR_DRM_NOT_PERMITTED: szErrorVal = "PLAYER_ERROR_DRM_NOT_PERMITTED"; break; + case PLAYER_ERROR_RESOURCE_LIMIT: szErrorVal = "PLAYER_ERROR_RESOURCE_LIMIT"; break; + case PLAYER_ERROR_PERMISSION_DENIED: szErrorVal = "PLAYER_ERROR_PERMISSION_DENIED"; break; + case PLAYER_ERROR_BUFFER_SPACE: szErrorVal = "PLAYER_ERROR_BUFFER_SPACE"; break; + case PLAYER_ERROR_NOT_AVAILABLE: szErrorVal = "PLAYER_ERROR_NOT_ABAILABLE"; break; + case PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC: szErrorVal = "PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC"; break; + default: szErrorVal = "Unknown Error"; break; + } + + return szErrorVal; +} + +/** +* @function InitializePlayerHandler +* @description Creates a player handler, sets an uri and prepares the handler +* @parameter[IN] bool bPrepare [if it is true, player would be prepared. Otherwise, player would not be prepared] +* [IN] int nMediaType [if it is 0, player_set_uri would be set with an audio file. if it is 1, player_set_uri would be set with a video file. Otherwise, player_set_uri would be set with a download source file] +* @return true if successful, otherwise false. +*/ +bool InitializePlayerHandler(bool bPrepare, int nMediaType) +{ + int nRet = -1; + player_state_e state; + +#if defined(WEARABLE) + bool bValue = false; +#endif //WEARABLE + + char pPath1[PATH_LEN] = {0,}; + char pPath2[PATH_LEN] = {0,}; + char pPath3[PATH_LEN] = {0,}; + + if ( false == PlayerAppendToAppDataPath(MEDIA_PATH_AUDIO, pPath1) ) + { + FPRINTF("[Line: %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); + return false; + } + if ( false == PlayerAppendToAppDataPath(MEDIA_PATH_VIDEO, pPath2) ) + { + FPRINTF("[Line: %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); + return false; + } + + if ( false == PlayerAppendToAppDataPath(MEDIA_PATH_DRC, pPath3) ) + { + FPRINTF("[Line: %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); + return false; + } + + nRet=player_get_state(g_player,&state); + PlayerGetState(state); + if ( state != PLAYER_STATE_IDLE ) + { + FPRINTF("[Line: %d][%s] Could not create player", __LINE__, API_NAMESPACE); + return false; + } + + if ( nMediaType == 0 ) + { + nRet = player_set_uri(g_player, pPath1); + #if defined(WEARABLE) + bValue = false; + system_info_get_platform_bool(INTERNET_FEATURE, &bValue); + if(bValue == false) + { + if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) + { + FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return false; + } + } + #endif + } + else if ( nMediaType == 1 ) + { + nRet = player_set_uri(g_player, pPath2); + #if defined(WEARABLE) + bValue = false; + system_info_get_platform_bool(INTERNET_FEATURE, &bValue); + if(bValue == false) + { + if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) + { + FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return false; + } + } + #endif + } + else if ( nMediaType == 2 ) + { + char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,}; + if ( true == GetValueFromConfigFile("PLAYER_HTTP_STREAMING_URL", pstrValue, API_NAMESPACE) ) + { +#if DEBUG + FPRINTF("[Line: %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pstrValue); +#endif + } + else + { + FPRINTF("[Line: %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); + return false; + } + nRet = player_set_uri(g_player, pstrValue); + #if defined(WEARABLE) + bValue = false; + system_info_get_platform_bool(INTERNET_FEATURE, &bValue); + if(bValue == false) + { + if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) + { + FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return false; + } + + } + #endif + + if (!CheckOnlineStatus(pstrValue)) { + FPRINTF("[Line : %d][%s][Reference] network is disconnected\\n", __LINE__, API_NAMESPACE); + } + } + else if ( nMediaType == 3 ) + { + char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,}; + if ( true == GetValueFromConfigFile("PLAYER_DOWNLOAD_URL_AUDIO", pstrValue, API_NAMESPACE) ) + { +#if DEBUG + FPRINTF("[Line: %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pstrValue); +#endif + } + else + { + FPRINTF("[Line: %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); + return false; + } + nRet = player_set_uri(g_player, pstrValue); + #if defined(WEARABLE) + bValue = false; + system_info_get_platform_bool(INTERNET_FEATURE, &bValue); + if(bValue == false) + { + if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) + { + FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return false; + } + + } + #endif + } + else if ( nMediaType == 4 ) + { + nRet = player_set_uri(g_player, pPath3); + } + else if (nMediaType == 5 ) + { + char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,}; + if ( true == GetValueFromConfigFile("PLAYER_ADAPTIVE_STREAMING_URL", pstrValue, API_NAMESPACE) ) + { +#if DEBUG + FPRINTF("[Line: %d][%s] Values Received = %s\\n", __LINE__, API_NAMESPACE, pstrValue); +#endif + } + else + { + FPRINTF("[Line: %d][%s] GetValueFromConfigFile returned error\\n", __LINE__, API_NAMESPACE); + return false; + } + nRet = player_set_uri(g_player, pstrValue); + #if defined(WEARABLE) + bValue = false; + system_info_get_platform_bool(INTERNET_FEATURE, &bValue); + if(bValue == false) + { + if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) + { + FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return false; + } + } + #endif + + if (!CheckOnlineStatus(pstrValue)) { + FPRINTF("[Line : %d][%s][Reference] network is disconnected\\n", __LINE__, API_NAMESPACE); + } + } + + if ( nRet != PLAYER_ERROR_NONE ) + { + FPRINTF("[Line: %d][%s] Could not set player uri", __LINE__, API_NAMESPACE); + return false; + } + + if ( bPrepare ) + { + if (nMediaType == 5 ) { /* need to check connection statistics */ + nRet = PlayerPrepareWithConnectionCheck(g_player); + } else { + nRet = player_prepare(g_player); + } + player_get_state(g_player,&state); + PlayerGetState(state); + if ( nRet != PLAYER_ERROR_NONE ) + { + FPRINTF("[Line: %d][%s] Could not prepare player", __LINE__, API_NAMESPACE); + return false; + } + + if ( state != PLAYER_STATE_READY ) + { + FPRINTF("[Line: %d][%s] Player state does not change after player_prepare() call", __LINE__, API_NAMESPACE); + return false; + } + } + return true; +} + +/** +* @function WinDel +* @description Callback function registered by evas_object_smart_callback_add API +* @parameter[IN] void*, Evas_Object*, void* +* @return NA. +*/ +void WinDel(void *data, Evas_Object *obj, void *event) +{ + elm_exit(); +} + +/** +* @function CreateEvasWindow +* @description Creates an Evas window object +* @parameter[IN] NA +* @return Evas_Object if successful, otherwise NULL. +*/ +void CreateEvasWindow() +{ + int w = 0; + int h = 0; + /* use gl backend */ + elm_config_accel_preference_set("3d"); + + /* create window */ + g_pEvasWindow = elm_win_util_standard_add(PACKAGE, PACKAGE); + if ( g_pEvasWindow ) + { + elm_win_borderless_set(g_pEvasWindow, EINA_TRUE); + evas_object_smart_callback_add(g_pEvasWindow, "delete,request",WinDel, NULL); + elm_win_screen_size_get(g_pEvasWindow,NULL,NULL,&w,&h); + evas_object_resize(g_pEvasWindow,w,h); + elm_win_autodel_set(g_pEvasWindow, EINA_TRUE); + } + + if ( !g_pEvasWindow ) + { + FPRINTF("[Line: %d][%s] Evas object window not created", __LINE__, API_NAMESPACE); + return; + } + + g_pEvasCore = evas_object_evas_get(g_pEvasWindow); + if ( !g_pEvasCore ) + { + FPRINTF("[Line: %d][%s] evas_object_evas_get failed , Evas created is NULL", __LINE__, API_NAMESPACE); + return; + } + + g_pEvasObject = evas_object_image_add(g_pEvasCore); + + evas_object_image_size_set(g_pEvasObject, w, h); + evas_object_image_fill_set(g_pEvasObject, 0, 0, w, h); + evas_object_resize(g_pEvasObject, w, h); + + elm_win_activate(g_pEvasWindow); + evas_object_show(g_pEvasWindow); +} + +/** @} */ diff --git a/src/itc/player-display/ITs-player-display-common.h b/src/itc/player-display/ITs-player-display-common.h new file mode 100755 index 000000000..8f6652092 --- /dev/null +++ b/src/itc/player-display/ITs-player-display-common.h @@ -0,0 +1,88 @@ +// +// Copyright (c) 2021 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef _ITS_PLAYER_DISPLAY_COMMON_H_ +#define _ITS_PLAYER_DISPLAY_COMMON_H_ + +//Add test package related includes here +#include "tct_common.h" +#include "player.h" +#include +#include + +#include +#include + +#define PACKAGE "player_display_test" +#define PATH_LEN 1024 +#define WIDTH 16 +#define HEIGHT 9 +#define x 5 +#define y 5 +#define API_NAMESPACE "PLAYER_DISPLAY_ITC" +#define MEDIA_360_PATH "test_360.mp4" +#define MEDIA_PATH_VIDEO "file.mp4" +#define MEDIA_PATH_VIDEO2 "v.mp4" +#define MEDIA_PATH_AUDIO "short.mp3" +#define MEDIA_PATH_DRC "test_drc.ts" +#define INTERNET_FEATURE "http://tizen.org/feature/network.internet" +#define OPENGL_FEATURE "http://tizen.org/feature/opengles.version.2_0" +#define SPHERICAL_VIDEO_FEATURE "http://tizen.org/feature/multimedia.player.spherical_video" +#define WIFI_FEATURE "http://tizen.org/feature/network.wifi" +#define TELEPHONY_FEATURE "http://tizen.org/feature/network.telephony" +#define TIMEOUT 20000 + +bool g_bIsSupported; +Evas_Object *g_pEvasWindow; +Evas_Object *g_pEvasObject; +Evas *g_pEvasCore; + +/** @addtogroup itc-%{MODULE_NAME} +* @ingroup itc +* @{ +*/ + +//Add helper function declarations here + +#define START_TEST {\ + FPRINTF("[Line : %d][%s] Starting test : %s\\n", __LINE__, API_NAMESPACE, __FUNCTION__);\ + if ( !g_bPlayerCreation )\ +{\ + FPRINTF("[Line : %d][%s] Precondition of player create failed so leaving test\\n", __LINE__, API_NAMESPACE);\ + return 1;\ +}\ +} + +#define PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(api) \ + FPRINTF("[Line : %d][%s] %s failed\\n",__LINE__, API_NAMESPACE, #api); + +#define PRINT_API_ERROR_IN_LOOP_MSG(api, nRet) \ + FPRINTF("[Line : %d][%s] %s failed with return value: %d\\n",__LINE__, API_NAMESPACE, #api, nRet); + +player_h g_player; +char* PlayerGetError(int nRet); +bool PlayerGetDataPath(char* pPath); +bool PlayerAppendToAppDataPath(char* pInputPath, char* pFinalPath); + +// Initialization for player handler +bool InitializePlayerHandler(bool bPrepare, int nMediaType); +//Print Player State +void PlayerGetState(player_state_e e); + +void CreateEvasWindow(); +void WinDel(void *data, Evas_Object *obj, void *event); + +/** @} */ +#endif //_ITS_PLAYER_DISPLAY_COMMON_H_ diff --git a/src/itc/player-display/ITs-player-display.c b/src/itc/player-display/ITs-player-display.c new file mode 100755 index 000000000..872e1d1ac --- /dev/null +++ b/src/itc/player-display/ITs-player-display.c @@ -0,0 +1,1104 @@ +// +// Copyright (c) 2014 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "ITs-player-display-common.h" +#include +#include "net_connection.h" + +/** @addtogroup itc-player-display +* @ingroup itc +* @{ +*/ + +//& set: Player +bool g_bPlayerCreation; +bool g_bPlayerVideoCaptureCallback; +bool g_bPlayerVideoStreamChanged; +bool g_bPlayerCallbackParameter; + +int g_nTimeoutId; +GMainLoop *g_pMainLoop; +static connection_h g_connection = NULL; + +bool CheckConnectionStatistics(connection_h connection, long long *size) +{ + long long rv = 0; + int err = CONNECTION_ERROR_NONE; + connection_type_e type = CONNECTION_TYPE_DISCONNECTED; + bool wifi_supported = false; + bool telepony_supported = false; + + system_info_get_platform_bool(WIFI_FEATURE, &wifi_supported); + system_info_get_platform_bool(TELEPHONY_FEATURE, &telepony_supported); + + if (wifi_supported) { + type = CONNECTION_TYPE_WIFI; + } else if (telepony_supported) { + type = CONNECTION_TYPE_CELLULAR; + } else { + FPRINTF("[Line : %d][%s] network is not supportable.\\n", __LINE__, API_NAMESPACE); + return false; + } + + err = connection_get_statistics(connection, type, CONNECTION_STATISTICS_TYPE_TOTAL_RECEIVED_DATA, &rv); + + if (err != CONNECTION_ERROR_NONE) { + FPRINTF("[Line : %d][%s] Failed to check connection statistics.\\n", __LINE__, API_NAMESPACE); + return false; + } else { + FPRINTF("[Line : %d][%s] WiFi last recv data size [%lld]\\n", __LINE__, API_NAMESPACE, rv); + } + + *size = rv; + return true; +} + + +int PlayerPrepareWithConnectionCheck(player_h g_player) +{ + int ret = PLAYER_ERROR_NONE; + long long before = 0, after = 0; + + if (connection_create(&g_connection) != CONNECTION_ERROR_NONE) { + FPRINTF("[Line : %d][%s] Failed to create connection handle\\n", __LINE__, API_NAMESPACE); + } else { + FPRINTF("[Line : %d][%s] Success to create connection handle %p\\n", __LINE__, API_NAMESPACE, g_connection); + } + + if (g_connection && !CheckConnectionStatistics(g_connection, &before)) { + FPRINTF("[Line : %d][%s] Failed to get connection statistics\\n", __LINE__, API_NAMESPACE); + } + + ret = player_prepare(g_player); + if (g_connection) { + if (!CheckConnectionStatistics(g_connection, &after)) { + FPRINTF("[Line : %d][%s] Failed to get connection statistics\\n", __LINE__, API_NAMESPACE); + } else { + FPRINTF("[Line : %d][%s][Reference] total received data [%lld]\\n", + __LINE__, API_NAMESPACE, (after-before)); + } + } + + if (g_connection && connection_destroy(g_connection) != CONNECTION_ERROR_NONE) { + FPRINTF("[Line : %d][%s] Failed to destroy connection handle\\n", __LINE__, API_NAMESPACE); + } + + return ret; +} + +bool CheckOnlineStatus(char *media_path) +{ + bool ret = true; + CURL *curl = NULL; + CURLcode res = CURLE_OK; + + curl = curl_easy_init(); + if(curl) { + curl_easy_setopt(curl, CURLOPT_URL, media_path); + curl_easy_setopt(curl, CURLOPT_CONNECTTIMEOUT_MS, 4500L); + curl_easy_setopt(curl, CURLOPT_NOBODY, 1L); + curl_easy_setopt(curl, CURLOPT_IPRESOLVE, 1L); + + res = curl_easy_perform(curl); + if(res != CURLE_OK) { + FPRINTF("[Line : %d][%s] curl_easy_perform() failed: %s\n", __LINE__, API_NAMESPACE, curl_easy_strerror(res)); + ret = false; + } + + curl_easy_cleanup(curl); + } + + return ret; + +} +//Callbacks +/** +* @function QuitGmainLoop +* @description Called to quit +* @parameter NA +* @return NA +*/ +void QuitGmainLoop(void) +{ + if(g_pMainLoop) + { + g_main_loop_quit(g_pMainLoop); + } +} + +/** +* @function PlayerTimeoutFunction +* @description Called if some callback is not invoked for a particular Player Timeout +* @parameter gpointer data +* @return gboolean +*/ +static gboolean PlayerTimeoutFunction(gpointer data) +{ + QuitGmainLoop(); + return FALSE; +} + +/** +* @function PlayerWaitForAsync +* @description Called to wait +* @parameter NA +* @return NA +*/ + +static void PlayerWaitForAsync() +{ + g_pMainLoop = g_main_loop_new(NULL, false); + g_nTimeoutId = g_timeout_add(TIMEOUT, PlayerTimeoutFunction, NULL); + g_main_loop_run(g_pMainLoop); + + g_source_remove(g_nTimeoutId); + g_nTimeoutId = 0; + + g_main_loop_unref(g_pMainLoop); + g_pMainLoop = NULL; +} + +//Callbacks + +/** +* @function PlayerVideoCaptureCallback +* @description Callback function which is invoked when the video is captured +* @parameter unsigned char *data, int width, int height, unsigned int size, void *user_data +* @return void +*/ +static void PlayerVideoCaptureCallback(unsigned char *data, int width, int height, unsigned int size, void *user_data) +{ + FPRINTF("[Line : %d][%s] Callback PlayerVideoCaptureCallback Called\\n",__LINE__, API_NAMESPACE); + g_bPlayerVideoCaptureCallback = true; +} + +/** +* @function PlayerVideoStreamChangedCallback +* @description Called to notify the video stream changed. +* @parameter int width, int height, int fps, int bit_rate, void *user_data +* @return void +*/ +static void PlayerVideoStreamChangedCallback(int width, int height, int fps, int bit_rate, void *user_data) +{ + FPRINTF("[Line : %d][%s] Callback PlayerVideoStreamChangedCallback Called\\n",__LINE__, API_NAMESPACE); + g_bPlayerVideoStreamChanged = true; + if(width < 0) + { + FPRINTF("[Line : %d][%s] width is not valid\\n", __LINE__, API_NAMESPACE); + g_bPlayerCallbackParameter = false; + } + else if(height < 0) + { + FPRINTF("[Line : %d][%s] height is not valid\\n", __LINE__, API_NAMESPACE); + g_bPlayerCallbackParameter = false; + } + else if(fps < 0) + { + FPRINTF("[Line : %d][%s] fps is not valid\\n", __LINE__, API_NAMESPACE); + g_bPlayerCallbackParameter = false; + } + else if(bit_rate < 0) + { + FPRINTF("[Line : %d][%s] bit_rate is not valid\\n", __LINE__, API_NAMESPACE); + g_bPlayerCallbackParameter = false; + } + else + { + g_bPlayerCallbackParameter = true; + } +} + +/** +* @function ITs_player_startup_display +* @description Called before each test, created player handle +* @parameter NA +* @return NA +*/ +void ITs_player_display_startup(void) +{ + ecore_main_loop_glib_integrate(); + struct stat stBuff; + if ( stat(ERR_LOG, &stBuff) == 0 ) + { + remove(ERR_LOG); + } +#if DEBUG + FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); +#endif + + CreateEvasWindow(); + if ( g_pEvasObject == NULL ) + { + FPRINTF("[Line : %d][%s] Evas window object is not created, failed in Precondition\\n", __LINE__, API_NAMESPACE); + g_bPlayerCreation = false; + return; + } + + int nRet = player_create(&g_player); + if ( nRet != PLAYER_ERROR_NONE ) + { + FPRINTF("[Line : %d][%s] Unable to create player, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + g_bPlayerCreation = false; + } + else + { + FPRINTF("[Line : %d][%s] Player created successfully\\n",__LINE__, API_NAMESPACE); + g_bPlayerCreation = true; + } + return; +} + +/** +* @function ITs_player_cleanup_display +* @description Called after each test, destroys player handle +* @parameter NA +* @return NA +*/ +void ITs_player_display_cleanup(void) +{ +#if DEBUG + FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); +#endif + if ( g_bPlayerCreation && g_player ) + { + int nRet = player_destroy (g_player); + if ( nRet != PLAYER_ERROR_NONE ) + { + FPRINTF("[Line : %d][%s] player_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + } + g_player = NULL; + } + else + { + FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); + } + if ( g_pEvasObject ) + { + evas_object_del(g_pEvasObject); + g_pEvasObject = NULL; + } + if ( g_pEvasWindow ) + { + evas_object_del(g_pEvasWindow); + g_pEvasWindow = NULL; + } + + return; +} + + + +/** @addtogroup itc-player-testcases +* @brief Integration testcases for module player +* @ingroup itc-player +* @{ +*/ + + +//& purpose: Set and get ROI (Region Of Interest) area of the content video source +//& type: auto +/** +* @testcase ITc_player_set_get_video_roi_area_p +* @author SRID(s.rathi) +* @reviewer SRID(nibha.sharma) +* @type auto +* @since_tizen 5.0 +* @description Set and get ROI (Region Of Interest) area of the content video source +* @scenario Create player handle\n +* get player state\n +* unprepare player\n +* set player display\n +* set video ROI\n +* prepare player\n +* get video ROI\n +* check results\n +* destroy the handler +* @apicovered player_set_video_roi_area, player_get_video_roi_area +* @passcase When it set and get video ROI area +* @failcase When it does not set or get video ROI area +* @precondition The player display must be set as PLAYER_DISPLAY_TYPE_OVERLAY +* @postcondition N/A +*/ +int ITc_player_set_get_video_roi_area_p(void) +{ + START_TEST; + + double setX = 0.1, setY = 0.1, setWidth = 0.5, setHeight = 0.5; + double getX = 0.0, getY = 0.0, getWidth = 0.0, getHeight = 0.0; + int nRet = PLAYER_ERROR_NONE; + player_state_e state; + + if ( InitializePlayerHandler(true, 1) != true ) + { + PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); + return 1; + } + 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)); + } + + nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow)); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_set_video_roi_area(g_player, setX, setY, setWidth, setHeight); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_video_roi_area", PlayerGetError(nRet)); + + usleep(2000); + + nRet = player_prepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); + + nRet = player_get_video_roi_area(g_player, &getX, &getY, &getWidth, &getHeight); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_video_roi_area", PlayerGetError(nRet), player_unprepare(g_player)); + + if ( (setX != getX) || (setY != getY) || (setWidth != getWidth) || (setHeight != getHeight) ) + { + FPRINTF("[Line : %d][%s] player_set_get_video_roi_area mismatched, error returned = %s", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + player_unprepare(g_player); + return 1; + } + + nRet = player_unprepare(g_player); + PRINT_RESULT_NORETURN(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); + + return 0; +} + + +//& purpose: Set and get rotation of the x surface video display +//& type: auto +/** +* @testcase ITc_player_set_get_display_rotation_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Set and get rotation of the x surface video display +* @scenario Create player handle\n +* set player display\n +* set display rotation\n +* get display rotation\n +* check results\n +* destroy the handler +* @apicovered player_set_display, player_set_display_rotation, player_get_display_rotation +* @passcase When it set and get x11 display rotation +* @failcase When it does not set or get x11 display rotation +* @precondition The player display must be set as PLAYER_DISPLAY_TYPE_OVERLAY +* @postcondition N/A +*/ +int ITc_player_set_get_display_rotation_p(void) +{ + START_TEST; + + player_display_rotation_e rotation; + + int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow)); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_set_display_rotation(g_player, PLAYER_DISPLAY_ROTATION_90); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_rotation", PlayerGetError(nRet)); + + usleep(2000); + + nRet = player_get_display_rotation(g_player, &rotation); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_display_rotation", PlayerGetError(nRet)); + + if ( rotation != PLAYER_DISPLAY_ROTATION_90 ) + { + FPRINTF("[Line : %d][%s] player_set_get_display_rotation mismatched, error returned = %s", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return 1; + } + + return 0; +} + + +//& purpose: Set x surface video display visible +//& type: auto + +/** +* @testcase ITc_player_set_display_visible_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Set x surface video display visible +* @scenario Create player handle\n +* set player display\n +* set x surface video display visible\n +* destroy the handler +* @apicovered player_set_display, player_set_display_visible, +* @passcase When it can set visibility of the x surface video display +* @failcase When it can not set visibility of the x surface video display +* @precondition N/A +* @postcondition N/A +*/ +int ITc_player_set_display_visible_p(void) +{ + START_TEST; + int nRet = -1; + + nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_set_display_visible(g_player, true); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_visible", PlayerGetError(nRet)); + + return 0; +} + + +//& purpose: Set and get video display mode +//& type : auto +/** +* @testcase ITc_player_set_get_display_mode_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Set and get video display mode +* @scenario Initialize player handle\n +* set display mode\n +* get display mode\n +* check the result\n +* destroy the handler +* @apicovered player_set_display_mode, player_get_display_mode +* @passcase When it can set and get player position +* @failcase When it can not set or get player position +* @precondition The player state must be one of these: PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED +* @postcondition N/A +*/ +int ITc_player_set_get_display_mode_p(void) +{ + START_TEST; + + player_display_mode_e mode; + + if ( InitializePlayerHandler(true, 0) != true ) + { + PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); + return 1; + } + + int nRet = player_set_display_mode(g_player, PLAYER_DISPLAY_MODE_DST_ROI); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_display_mode", PlayerGetError(nRet), player_unprepare(g_player)); + + usleep(2000); + + nRet = player_get_display_mode(g_player, &mode); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_display_mode", PlayerGetError(nRet), player_unprepare(g_player)); + + if (mode != PLAYER_DISPLAY_MODE_DST_ROI) + { + FPRINTF("[Line : %d][%s] player_set_get_display_mode mismatched, error returned = %s", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + player_unprepare(g_player); + return 1; + } + + nRet = player_unprepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); + + return 0; +} + +//& purpose: Set the video display and checks if it is visible +//& type: auto +/** +* @testcase ITc_player_is_display_visible_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Set the video display and checks if it is visible +* @scenario Create player handle\n +* set player display\n +* check if display visible\n +* destroy the handler +* @apicovered player_set_display, player_is_display_visible +* @passcase When it set the display successfully and checks if it is visible +* @failcase When it set the display successfully and checks if it is visible +* @precondition The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED for set_display +* @postcondition N/A +*/ +int ITc_player_is_display_visible_p(void) +{ + START_TEST; + + bool visible; + + int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow)); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_is_display_visible(g_player, &visible); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_display_visible", PlayerGetError(nRet)); + + return 0; +} +//& purpose: Sets the ROI(Region Of Interest) area of display +//& type: auto +/** +* @testcase ITc_player_set_display_roi_area_p +* @author SRID(manu.tiwari) +* @reviewer SRID(amritanshu.p1) +* @type auto +* @since_tizen 3.0 +* @description Sets the ROI(Region Of Interest) area of display +* @scenario set player display mode\n +* set display roi area\n +* @apicovered player_set_display_mode, player_set_display_roi_area +* @passcase When player_set_display_roi_area api passed +* @failcase When player_set_display_roi_area api failed +* @precondition The player display mode must be set +* @postcondition N/A +*/ +int ITc_player_set_display_roi_area_p(void) +{ + START_TEST; + + int nRet = player_set_display_mode(g_player, PLAYER_DISPLAY_MODE_DST_ROI); + 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); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_roi_area", PlayerGetError(nRet)); + + return 0; +} + +//& purpose: Sets the audio only mode +//& type: auto +/** +* @testcase ITc_player_set_audio_only_p +* @author SRID(manmohan.k) +* @reviewer SRID(shobhit.v) +* @type auto +* @since_tizen 4.0 +* @description Sets the audio only mode +* @scenario Sets the audio only mode\n +* @apicovered player_set_audio_only +* @passcase When player_set_audio_only api passed +* @failcase When player_set_audio_only api failed +* @precondition The player state must be one of: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_READY +* @postcondition N/A +*/ +int ITc_player_set_audio_only_p(void) +{ + START_TEST; + + int nRet = -1; + player_state_e state; + 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; + } + + nRet = player_get_state(g_player,&state); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); + + PlayerGetState(state); + + if ( state != PLAYER_STATE_IDLE ) + { + FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as Player state is not PLAYER_STATE_IDLE to set uri",__LINE__, API_NAMESPACE); + return 1; + } + + 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, GET_DISPLAY(g_pEvasWindow)); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_prepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); + + nRet = player_get_state(g_player, &state); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); + PlayerGetState(state); + + if (!(state == PLAYER_STATE_READY || state == PLAYER_STATE_PLAYING || state == PLAYER_STATE_PAUSED)) + { + FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as Player state is not as precondition", __LINE__, API_NAMESPACE); + return 1; + } + + bool is = false; + nRet = player_is_audio_only(g_player, &is); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); + + bool audio_only = !is; + nRet = player_set_audio_only(g_player, audio_only); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_audio_only", PlayerGetError(nRet)); + + nRet = player_is_audio_only(g_player, &is); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); + + if(is != audio_only) + { + FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as get audio only is not same as set audio only\\n", __LINE__, API_NAMESPACE); + return 1; + } + + audio_only = !audio_only; + nRet = player_set_audio_only(g_player, audio_only); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_audio_only", PlayerGetError(nRet)); + + nRet = player_is_audio_only(g_player, &is); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); + + if(is != audio_only) + { + FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as get audio only is not same as set audio only\\n", __LINE__, API_NAMESPACE); + return 1; + } + + return 0; +} + +//& purpose: Gets the audio only mode status +//& type: auto +/** +* @testcase ITc_player_is_audio_only_p +* @author SRID(manmohan.k) +* @reviewer SRID(shobhit.v) +* @type auto +* @since_tizen 4.0 +* @description Gets the audio only mode status +* @scenario Gets the audio only mode status\n +* @apicovered player_is_audio_only +* @passcase When player_is_audio_only passed +* @failcase When player_is_audio_only failed +* @precondition The player state must be one of: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED +* @postcondition N/A +*/ +int ITc_player_is_audio_only_p(void) +{ + START_TEST; + + int nRet = -1; + player_state_e state; + 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; + } + + nRet = player_get_state(g_player,&state); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_IDLE ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_create() call",__LINE__, API_NAMESPACE); + return 1; + } + + 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, GET_DISPLAY(g_pEvasWindow)); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + nRet = player_prepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); + + nRet = player_get_state(g_player, &state); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); + PlayerGetState(state); + + if (!(state == PLAYER_STATE_IDLE || state == PLAYER_STATE_READY || state == PLAYER_STATE_PLAYING || state == PLAYER_STATE_PAUSED)) + { + FPRINTF("[Line : %d][%s] ITc_player_is_audio_only_p, failed as Player state is not as precondition", __LINE__, API_NAMESPACE); + return 1; + } + + bool is = false; + nRet = player_is_audio_only(g_player, &is); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); + + return 0; +} + +//& purpose: Gets the video display's height and width +//& type : auto +/** +* @testcase ITc_player_get_video_size_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Gets the video display's height and width +* @scenario Initialize player handle\n +* start player\n +* get video display's height and width\n +* check the result\n +* destroy the handler +* @apicovered player_start, player_get_video_size, player_unprepare +* @passcase When it can get video display's height and width +* @failcase When it can not get video display's height and width +* @precondition The player state must be PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED +* @postcondition N/A +*/ +int ITc_player_get_video_size_p(void) +{ + START_TEST; + + int nWidth; + int nHeight; + player_state_e state; + + if ( InitializePlayerHandler(true, 1) != true ) + { + PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); + return 1; + } + + int nRet = player_start(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_get_state(g_player,&state); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_PLAYING ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + nRet = player_get_video_size(g_player, &nWidth, &nHeight); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_video_size", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + nRet = player_stop(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_unprepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); + + return 0; +} + +//& purpose: Gets the video stream information +//& type : auto +/** +* @testcase ITc_player_get_video_stream_info_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Gets the video stream information +* @scenario Initialize player handle\n +* start player\n +* get video stream info\n +* check the result\n +* destroy the handler +* @apicovered player_start, player_get_video_stream_info, player_unprepare +* @passcase When it can get video stream information +* @failcase When it can not get video stream information +* @precondition The player state must be PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED +* @postcondition N/A +*/ +int ITc_player_get_video_stream_info_p(void) +{ + START_TEST; + + int nFps; + int nBit_rate; + player_state_e state; + + if ( InitializePlayerHandler(true, 1) != true ) + { + PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); + return 1; + } + + int nRet = player_start(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_get_state(g_player,&state); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_PLAYING ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + nRet = player_get_video_stream_info(g_player, &nFps, &nBit_rate); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_video_stream_info", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + nRet = player_stop(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_unprepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); + + return 0; +} + +//& purpose: Captures the video frame, asynchronously +//& type: auto +/** +* @testcase ITc_player_capture_video_p +* @author SRID(anshul1.jain) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.3 +* @description Captures the video frame, asynchronously +* @scenario Set player display\n +* Initialize player handle\n +* Start player\n +* callback player capture video\n +* check results\n +* destroy the handler +* @apicovered player_set_uri, player_prepare, player_start, player_capture_video, player_unprepare +* @passcase When it captures video frame +* @failcase When it does not captures video frame +* @precondition The player state must be PLAYER_STATE_PLAYING by player_start() or PLAYER_STATE_PAUSED by player_pause() +* @postcondition It invokes player_video_captured_cb() when capture completes, if you set a callback +*/ +int ITc_player_capture_video_p(void) +{ + START_TEST; + + player_state_e state; + + char pPath[PATH_LEN] = {0,}; + if ( false == PlayerAppendToAppDataPath(MEDIA_PATH_VIDEO2, pPath)) + { + FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); + return 1; + } + + int nRet = -1; + + nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + + sleep(2); + + nRet = player_set_uri(g_player, pPath); + + #if defined(WEARABLE) + bool bValue = false; + system_info_get_platform_bool(INTERNET_FEATURE, &bValue); + if(bValue == false) + { + if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) + { + FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); + return 1; + } + } + #endif + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_uri", PlayerGetError(nRet)); + + nRet = player_prepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); + + nRet = player_start(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_get_state(g_player,&state); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_PLAYING ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + sleep(4); + + nRet = player_pause(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_pause", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + nRet = player_get_state(g_player,&state); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_PAUSED ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_pause() call", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + sleep(2); + g_bPlayerVideoCaptureCallback = false; + + nRet = player_capture_video(g_player, PlayerVideoCaptureCallback, NULL); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_capture_video", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + PlayerWaitForAsync(); + + if ( !g_bPlayerVideoCaptureCallback ) + { + FPRINTF("[Line : %d][%s] player_video_captured_cb failed, error returned = callback not invoked", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + nRet = player_stop(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_unprepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); + + return 0; +} + +//& purpose: Registers/Unregisters a callback function to be invoked when video stream is changed. +//& type : auto +/** +* @testcase ITc_player_set_unset_video_stream_changed_cb_p +* @author SRID(m.khalid) +* @reviewer SRID(gupta.sanjay) +* @type auto +* @since_tizen 2.4 +* @description Registers/Unregisters a callback function to be invoked when video stream is changed. +* @scenario Registers the callback using player_set_video_stream_changed_cb\n +* Check if callback is hit\n +* Unregisters the callback using player_unset_video_stream_changed_cb +* @apicovered player_set_display, player_prepare, player_set_video_stream_changed_cb, player_start, player_unset_video_stream_changed_cb, player_stop, player_unprepare, player_get_state +* @passcase if all covered apis are passed and Callback is hit +* @failcase if any covered api is failed or Callback is not hit +* @precondition NA +* @postcondition NA +*/ +int ITc_player_set_unset_video_stream_changed_cb_p(void) +{ + START_TEST; + + bool bTelFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE); + bool bWifiFeatureSupported = TCTCheckSystemInfoFeatureSupported(WIFI_FEATURE, API_NAMESPACE); + if ( !bTelFeatureSupported && !bWifiFeatureSupported ) + { + FPRINTF("[Line : %d][%s] Network is not working. Skipping Test\\n", __LINE__, API_NAMESPACE); + return 0; + } + + player_state_e state; + + g_bPlayerVideoStreamChanged = false; + g_bPlayerCallbackParameter = false; + + int nRet = -1; + + nRet = player_get_state(g_player,&state); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); + + if ( state != PLAYER_STATE_IDLE ) + { + FPRINTF("[Line : %d][%s] Player state is not idle", __LINE__, API_NAMESPACE); + return 1; + } + + if ( InitializePlayerHandler(false, 4) != true ) + { + PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); + return 1; + } + + #if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE or WEARABLE + nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); + #endif //End MOBILE or WEARABLE + + nRet = player_set_video_stream_changed_cb(g_player, PlayerVideoStreamChangedCallback, NULL); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_video_stream_changed_cb", PlayerGetError(nRet)); + + nRet = player_prepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); + + sleep(3); + + nRet = player_get_state(g_player,&state); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_unprepare(g_player)); + + PlayerGetState(state); + if ( state != PLAYER_STATE_READY ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_prepare() call", __LINE__, API_NAMESPACE); + return 1; + } + + sleep(3); + + nRet = player_start(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_get_state(g_player,&state); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + + PlayerGetState(state); + if ( state != PLAYER_STATE_PLAYING ) + { + FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + PlayerWaitForAsync(); + + if ( !g_bPlayerVideoStreamChanged ) + { + FPRINTF("[Line : %d][%s] player_set_video_stream_changed_cb failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE); + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + else if ( !g_bPlayerCallbackParameter ) + { + player_stop(g_player); + player_unprepare(g_player); + return 1; + } + + nRet = player_unset_video_stream_changed_cb(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_unset_video_stream_changed_cb", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); + + nRet = player_stop(g_player); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); + + nRet = player_unprepare(g_player); + PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); + + return 0; +} +/** @} */ +/** @} */ diff --git a/src/itc/player-display/file.mp4 b/src/itc/player-display/file.mp4 new file mode 100644 index 000000000..84ba7defc Binary files /dev/null and b/src/itc/player-display/file.mp4 differ diff --git a/src/itc/player-display/short.mp3 b/src/itc/player-display/short.mp3 new file mode 100644 index 000000000..78527be2d Binary files /dev/null and b/src/itc/player-display/short.mp3 differ diff --git a/src/itc/player-display/sub.srt b/src/itc/player-display/sub.srt new file mode 100644 index 000000000..9759794f6 --- /dev/null +++ b/src/itc/player-display/sub.srt @@ -0,0 +1,4179 @@ +1 +00:00:00,318 --> 00:00:03,843 +When the boy was born... + +2 +00:01:11,721 --> 00:01:13,814 +...like all Spartans, he was inspected. + +3 +00:01:15,625 --> 00:01:20,255 +If he'd been small or puny +or sickly or misshapen... + +4 +00:01:20,430 --> 00:01:22,762 +...he would have been discarded. + +5 +00:01:29,873 --> 00:01:35,573 +From the time he could stand, +he was baptized in the fire of combat. + +6 +00:01:57,634 --> 00:02:01,297 +Taught never to retreat, +never to surrender. + +7 +00:02:01,471 --> 00:02:06,340 +Taught that death on the battlefield +in service to Sparta... + +8 +00:02:06,543 --> 00:02:09,842 +...was the greatest glory +he could achieve in his life. + +9 +00:02:24,994 --> 00:02:29,522 +At age 7, +as is customary in Sparta... + +10 +00:02:29,699 --> 00:02:34,864 +...the boy was taken from his mother +and plunged into a world of violence. + +11 +00:02:35,672 --> 00:02:40,200 +Manufactured by 300 years +of Spartan warrior society... + +12 +00:02:41,244 --> 00:02:45,544 +...to create the finest soldiers +the world has ever known. + +13 +00:02:45,715 --> 00:02:50,277 +The agoge, as it's called, +forces the boy to fight. + +14 +00:02:50,453 --> 00:02:54,082 +Starves them, +forces them to steal... + +15 +00:02:54,257 --> 00:02:58,626 +...and if necessary, to kill. + +16 +00:02:59,696 --> 00:03:02,688 +By rod and lash +the boy was punished... + +17 +00:03:02,866 --> 00:03:06,165 +...taught to show no pain, +no mercy. + +18 +00:03:07,871 --> 00:03:11,363 +Constantly tested, +tossed into the wild. + +19 +00:03:11,541 --> 00:03:16,843 +Left to pit his wits and will +against nature's fury. + +20 +00:03:17,213 --> 00:03:19,408 +It was his initiation... + +21 +00:03:19,582 --> 00:03:22,142 +...his time in the wild... + +22 +00:03:22,318 --> 00:03:26,812 +...for he would return +to his people a Spartan... + +23 +00:03:26,990 --> 00:03:29,117 +...or not at all. + +24 +00:03:51,447 --> 00:03:54,314 +The wolf begins to circle the boy. + +25 +00:03:54,484 --> 00:03:56,918 +Claws of black steel... + +26 +00:03:57,086 --> 00:03:59,316 +...fur as dark night. + +27 +00:03:59,822 --> 00:04:01,153 +Eyes glowing red... + +28 +00:04:01,324 --> 00:04:05,260 +...jewels from +the pit of hell itself. + +29 +00:04:14,003 --> 00:04:17,996 +The giant wolf sniffing... + +30 +00:04:18,174 --> 00:04:21,234 +...savoring the scent +of the meal to come. + +31 +00:04:45,401 --> 00:04:46,925 +It's not fear that grips him... + +32 +00:04:47,537 --> 00:04:50,700 +...only a heightened +sense of things. + +33 +00:04:51,040 --> 00:04:54,407 +The cold air in his lungs. + +34 +00:04:54,978 --> 00:04:58,311 +Windswept pines +moving against the coming night. + +35 +00:05:06,322 --> 00:05:08,722 +His hands are steady. + +36 +00:05:08,891 --> 00:05:11,155 +His form... + +37 +00:05:11,327 --> 00:05:13,420 +...perfect. + +38 +00:05:39,222 --> 00:05:41,952 +And so the boy, +given up for dead... + +39 +00:05:42,125 --> 00:05:46,858 +...returns to his people, +to sacred Sparta, a king! + +40 +00:05:47,296 --> 00:05:51,027 +Our king, Leonidas! + +41 +00:05:56,939 --> 00:06:00,705 +It's been more than 30 years +since the wolf and the winter cold. + +42 +00:06:02,111 --> 00:06:06,411 +And now, as then, a beast approaches. + +43 +00:06:06,582 --> 00:06:11,519 +Patient and confident, +savoring the meal to come. + +44 +00:06:12,155 --> 00:06:15,454 +But this beast +is made of men and horses... + +45 +00:06:15,625 --> 00:06:18,423 +...swords and spears. + +46 +00:06:18,628 --> 00:06:23,588 +An army of slaves, vast beyond imagining, +ready to devour tiny Greece. + +47 +00:06:23,933 --> 00:06:28,700 +Ready to snuff out the world's +one hope for reason and justice. + +48 +00:06:31,441 --> 00:06:34,205 +A beast approaches... + +49 +00:06:36,979 --> 00:06:42,508 +...and it was King Leonidas himself +who provoked it. + +50 +00:07:53,156 --> 00:07:54,987 +That's it. + +51 +00:07:55,324 --> 00:08:00,193 +Now, the more you sweat here, +the less you'll bleed in battle. + +52 +00:08:01,397 --> 00:08:03,865 +My father taught me... + +53 +00:08:04,033 --> 00:08:06,501 +...that fear is always a constant. + +54 +00:08:06,669 --> 00:08:08,193 +But accepting it... + +55 +00:08:08,571 --> 00:08:09,697 +...makes you stronger. + +56 +00:08:09,872 --> 00:08:11,237 +My queen. + +57 +00:08:11,407 --> 00:08:14,240 +A Persian emissary awaits Leonidas. + +58 +00:08:16,779 --> 00:08:18,178 +In the end... + +59 +00:08:18,347 --> 00:08:21,908 +...a Spartan's true strength +is the warrior next to him. + +60 +00:08:22,685 --> 00:08:27,179 +So give respect and honor to him, +and it will be returned to you. + +61 +00:08:27,723 --> 00:08:29,213 +First... + +62 +00:08:29,992 --> 00:08:32,927 +- ...you fight with your head. +- Then you fight with your heart. + +63 +00:08:35,264 --> 00:08:36,959 +What is it? + +64 +00:08:37,200 --> 00:08:39,065 +A Persian messenger awaits you. + +65 +00:08:41,370 --> 00:08:42,837 +Do not forget today's lesson. + +66 +00:08:43,005 --> 00:08:45,701 +- Respect and honor. +- Respect and honor. + +67 +00:09:01,224 --> 00:09:05,684 +Councilman Theron. +You found yourself needed, for once. + +68 +00:09:06,762 --> 00:09:09,697 +My king and queen, +I was just entertaining your guests. + +69 +00:09:09,899 --> 00:09:11,127 +I'm sure. + +70 +00:09:12,368 --> 00:09:14,199 +Before you speak, Persian... + +71 +00:09:14,370 --> 00:09:17,635 +...know that in Sparta everyone, +even a king's messenger... + +72 +00:09:17,807 --> 00:09:20,401 +...is held accountable +for the words of his voice. + +73 +00:09:21,410 --> 00:09:24,140 +Now, what message do you bring? + +74 +00:09:25,248 --> 00:09:27,716 +Earth and water. + +75 +00:09:29,986 --> 00:09:33,615 +You rode all the way from Persia +for earth and water? + +76 +00:09:35,191 --> 00:09:39,093 +Do not be coy or stupid, Persian. +You can afford neither in Sparta. + +77 +00:09:39,595 --> 00:09:42,063 +What makes this woman +think she can speak among men? + +78 +00:09:42,231 --> 00:09:45,064 +Because only Spartan women +give birth to real men. + +79 +00:09:46,569 --> 00:09:50,164 +Let us walk to cool our tongues. + +80 +00:09:52,775 --> 00:09:55,938 +If you value your lives +over your complete annihilation... + +81 +00:09:56,112 --> 00:09:57,773 +...listen carefully, Leonidas. + +82 +00:09:57,947 --> 00:10:02,646 +Xerxes conquers and controls +everything he rests his eyes upon. + +83 +00:10:02,818 --> 00:10:05,912 +He leads an army so massive, +it shakes the ground with its march. + +84 +00:10:06,088 --> 00:10:08,784 +So vast, it drinks the rivers dry. + +85 +00:10:08,958 --> 00:10:11,950 +All the God-King Xerxes requires is this: + +86 +00:10:12,295 --> 00:10:15,526 +A simple offering of earth and water... + +87 +00:10:15,698 --> 00:10:19,862 +...a token of Sparta's submission +to the will of Xerxes. + +88 +00:10:30,913 --> 00:10:33,074 +Submission. + +89 +00:10:35,251 --> 00:10:37,185 +Now, that's a bit of a problem. + +90 +00:10:37,620 --> 00:10:38,848 +See, rumor has it... + +91 +00:10:39,021 --> 00:10:41,649 +...the Athenians +have already turned you down. + +92 +00:10:42,558 --> 00:10:47,791 +And if those philosophers and boy-lovers +have found that kind of nerve, then-- + +93 +00:10:47,963 --> 00:10:52,195 +- We must be diplomatic. +- And, of course, Spartans... + +94 +00:10:53,235 --> 00:10:55,294 +...have their reputation to consider. + +95 +00:10:55,471 --> 00:10:59,498 +Choose your next words carefully, +Leonidas. + +96 +00:10:59,742 --> 00:11:02,370 +They may be your last as king. + +97 +00:11:42,852 --> 00:11:46,151 +"Earth and water." + +98 +00:11:51,427 --> 00:11:53,520 +Madman. You're a madman. + +99 +00:11:53,696 --> 00:11:55,357 +Earth and water. + +100 +00:11:55,731 --> 00:11:57,892 +You'll find plenty of both down there. + +101 +00:11:58,167 --> 00:12:01,603 +No man, Persian or Greek, +no man threatens a messenger. + +102 +00:12:02,071 --> 00:12:07,031 +You bring the crowns and heads +of conquered kings to my city steps. + +103 +00:12:07,209 --> 00:12:09,268 +You insult my queen. + +104 +00:12:09,445 --> 00:12:13,176 +You threaten my people +with slavery and death. + +105 +00:12:13,349 --> 00:12:16,284 +Oh, I've chosen my words carefully, +Persian. + +106 +00:12:16,452 --> 00:12:18,420 +Perhaps you should have done the same. + +107 +00:12:18,587 --> 00:12:22,250 +This is blasphemy. This is madness! + +108 +00:12:39,642 --> 00:12:41,701 +Madness? + +109 +00:12:42,344 --> 00:12:44,471 +This is Sparta! + +110 +00:14:11,000 --> 00:14:13,366 +Welcome, Leonidas. + +111 +00:14:13,969 --> 00:14:17,132 +We have been expecting you. + +112 +00:14:23,612 --> 00:14:28,948 +The ephors, +priests to the old gods. + +113 +00:14:29,351 --> 00:14:31,683 +Inbred swine. + +114 +00:14:31,854 --> 00:14:34,618 +More creature than man. + +115 +00:14:35,057 --> 00:14:40,495 +Creatures whom even Leonidas +must bribe and beg. + +116 +00:14:41,363 --> 00:14:46,198 +For no Spartan king has gone to war +without the ephors' blessing. + +117 +00:14:47,870 --> 00:14:51,931 +The Persians claim their forces +number in the millions. + +118 +00:14:52,575 --> 00:14:55,840 +I hope, for our sake, they exaggerate. + +119 +00:14:56,312 --> 00:15:00,544 +But there's no question, we face +the most massive army ever assembled. + +120 +00:15:00,783 --> 00:15:04,116 +Before your plan is heard... + +121 +00:15:04,286 --> 00:15:06,550 +...what do you offer? + +122 +00:15:16,098 --> 00:15:20,432 +We will use +our superior fighting skills... + +123 +00:15:20,603 --> 00:15:24,664 +...and the terrain of Greece herself +to destroy them. + +124 +00:15:24,840 --> 00:15:27,673 +We will march north to the coast, +where I will make sure-- + +125 +00:15:27,843 --> 00:15:32,746 +It is August, Leonidas. +The full moon approaches. + +126 +00:15:33,115 --> 00:15:36,312 +The sacred and ancient festival. + +127 +00:15:36,485 --> 00:15:40,581 +Sparta wages no war +at the time of the Carneia. + +128 +00:15:40,756 --> 00:15:42,348 +Sparta will burn! + +129 +00:15:42,791 --> 00:15:44,315 +Her men will die at arms... + +130 +00:15:44,493 --> 00:15:48,156 +...and her women and children +will be slaves or worse. + +131 +00:15:50,299 --> 00:15:55,362 +Now, we will block +the Persian coastal assault... + +132 +00:15:55,671 --> 00:15:57,969 +...by rebuilding the great Phocian Wall. + +133 +00:15:58,140 --> 00:16:02,839 +And from there, we will funnel them into +the mountain pass we call the Hot Gates. + +134 +00:16:03,012 --> 00:16:07,381 +Now, in that narrow corridor, +their numbers will count for nothing. + +135 +00:16:07,549 --> 00:16:10,143 +And wave after wave of Persian attack... + +136 +00:16:10,319 --> 00:16:14,255 +...will smash against Spartan shields. + +137 +00:16:14,823 --> 00:16:19,123 +Xerxes' losses will be so great, +his men so demoralized... + +138 +00:16:19,294 --> 00:16:23,697 +...he will have no choice +but to abandon his campaign. + +139 +00:16:23,866 --> 00:16:26,562 +We must consult the oracle. + +140 +00:16:27,269 --> 00:16:29,863 +Trust the gods, Leonidas. + +141 +00:16:30,039 --> 00:16:33,372 +I'd prefer you trusted your reason. + +142 +00:16:33,542 --> 00:16:35,567 +Your blasphemies... + +143 +00:16:35,744 --> 00:16:40,113 +...have cost us quite enough already. + +144 +00:16:40,849 --> 00:16:43,875 +Don't compound them. + +145 +00:16:45,954 --> 00:16:50,755 +We will consult the oracle. + +146 +00:16:52,895 --> 00:16:55,386 +Diseased old mystics. + +147 +00:16:56,398 --> 00:17:01,028 +Worthless remnants of a time +before Sparta's ascent from darkness. + +148 +00:17:01,370 --> 00:17:04,635 +Remnants of a senseless tradition. + +149 +00:17:04,807 --> 00:17:09,176 +Tradition even Leonidas +cannot defy... + +150 +00:17:09,344 --> 00:17:13,747 +...for he must respect +the word of the ephors. + +151 +00:17:13,916 --> 00:17:15,850 +That is the law. + +152 +00:17:18,887 --> 00:17:23,221 +And no Spartan, subject or citizen, +man or woman... + +153 +00:17:23,392 --> 00:17:27,419 +...slave or king, is above the law. + +154 +00:18:02,297 --> 00:18:06,563 +The ephors choose only +the most beautiful Spartan girls... + +155 +00:18:06,735 --> 00:18:09,226 +...to live among them as oracles. + +156 +00:18:09,404 --> 00:18:12,669 +Their beauty is their curse... + +157 +00:18:12,841 --> 00:18:16,641 +...for the old wretches +have the needs of men... + +158 +00:18:17,646 --> 00:18:21,742 +...and souls as black as hell. + +159 +00:18:24,720 --> 00:18:27,917 +"Pray to the winds... + +160 +00:18:30,425 --> 00:18:32,620 +...Sparta will fall. + +161 +00:18:35,564 --> 00:18:39,261 +All Greece will fall. + +162 +00:18:41,436 --> 00:18:45,065 +Trust not in men... + +163 +00:18:47,109 --> 00:18:50,374 +...honor the gods. + +164 +00:18:54,116 --> 00:18:57,779 +Honor the Carneia." + +165 +00:18:59,588 --> 00:19:03,183 +The king's climb down is harder. + +166 +00:19:03,358 --> 00:19:06,259 +Pompous, inbred swine. + +167 +00:19:06,428 --> 00:19:09,659 +Worthless, diseased, rotten... + +168 +00:19:09,832 --> 00:19:11,857 +...corrupt. + +169 +00:19:15,237 --> 00:19:18,866 +Truly, you're in the god-king's +favor now... + +170 +00:19:19,441 --> 00:19:21,534 +...O wise and holy men. + +171 +00:19:21,844 --> 00:19:23,277 +Yes. + +172 +00:19:23,445 --> 00:19:28,405 +And when Sparta burns, +you shall bathe in gold. + +173 +00:19:28,584 --> 00:19:31,178 +Fresh oracles shall be +delivered to you... + +174 +00:19:31,653 --> 00:19:33,052 +...daily... + +175 +00:19:33,222 --> 00:19:37,022 +...from every corner of the empire. + +176 +00:20:12,694 --> 00:20:16,255 +Your lips can finish +what your fingers have started. + +177 +00:20:19,401 --> 00:20:21,869 +Or has the oracle robbed you +of your desire as well? + +178 +00:20:23,405 --> 00:20:26,431 +It would take more than the words +of a drunken adolescent girl... + +179 +00:20:26,608 --> 00:20:28,303 +...to rob me of my desire for you. + +180 +00:20:32,481 --> 00:20:33,948 +Then why so distant? + +181 +00:20:37,085 --> 00:20:39,076 +Because it seems... + +182 +00:20:39,254 --> 00:20:45,193 +...though a slave and captive +of lecherous old men... + +183 +00:20:45,527 --> 00:20:48,758 +...the oracle's words +could set fire to all that I love. + +184 +00:20:48,931 --> 00:20:52,594 +So that is why my king loses sleep +and is forced from the warmth of his bed? + +185 +00:20:55,570 --> 00:20:59,904 +There's only one woman's words that +should affect the mood of my husband. + +186 +00:21:00,742 --> 00:21:02,300 +Those are mine. + +187 +00:21:06,481 --> 00:21:08,881 +Then what must a king do +to save his world... + +188 +00:21:09,051 --> 00:21:13,488 +...when the very laws he is sworn +to protect force him to do nothing? + +189 +00:21:16,425 --> 00:21:19,758 +It is not a question +of what a Spartan citizen should do... + +190 +00:21:19,928 --> 00:21:22,795 +...nor a husband, nor a king. + +191 +00:21:23,432 --> 00:21:26,128 +Instead ask yourself, my dearest love... + +192 +00:21:27,769 --> 00:21:29,760 +...what should a free man do? + +193 +00:22:35,237 --> 00:22:39,401 +- Is this all of them? +- As you ordered. Three hundred. + +194 +00:22:40,409 --> 00:22:43,708 +All with born sons +to carry on their name. + +195 +00:22:54,456 --> 00:22:55,787 +We are with you, sire. + +196 +00:22:56,158 --> 00:22:58,285 +For Sparta. For freedom. + +197 +00:22:58,460 --> 00:23:00,428 +To the death. + +198 +00:23:11,239 --> 00:23:12,900 +He is your son. + +199 +00:23:13,708 --> 00:23:16,609 +He is too young +to have felt a woman's warmth. + +200 +00:23:16,778 --> 00:23:20,737 +I have others to replace him. +Astinos is as brave and ready as any. + +201 +00:23:21,083 --> 00:23:25,110 +No younger than we were the first time +you stood next to me in battle. + +202 +00:23:28,890 --> 00:23:31,017 +You are a good friend... + +203 +00:23:31,193 --> 00:23:34,685 +...but a better captain, there is none. + +204 +00:23:40,202 --> 00:23:42,136 +My good king. + +205 +00:23:43,071 --> 00:23:46,404 +My good king, the oracle has spoken. + +206 +00:23:46,575 --> 00:23:49,442 +The ephors have spoken. +There must be no march. + +207 +00:23:49,611 --> 00:23:51,408 +It is the law, my lord. + +208 +00:23:51,580 --> 00:23:55,573 +- The Spartan army must not go to war. +- Nor shall it. + +209 +00:23:56,485 --> 00:23:58,077 +I've issued no such orders. + +210 +00:23:58,453 --> 00:24:01,980 +I'm here just taking a stroll, +stretching my legs. + +211 +00:24:02,224 --> 00:24:07,389 +These 300 men +are my personal bodyguard. + +212 +00:24:07,662 --> 00:24:09,823 +Our army will stay in Sparta. + +213 +00:24:10,432 --> 00:24:11,763 +Where will you go? + +214 +00:24:14,736 --> 00:24:16,966 +I hadn't really thought about it... + +215 +00:24:17,772 --> 00:24:19,933 +...but now that you ask... + +216 +00:24:20,108 --> 00:24:22,838 +...I suppose I'll head north. + +217 +00:24:24,279 --> 00:24:25,371 +The Hot Gates? + +218 +00:24:28,016 --> 00:24:30,416 +Move out! + +219 +00:24:30,619 --> 00:24:32,678 +Move out! + +220 +00:24:33,822 --> 00:24:35,414 +What shall we do? + +221 +00:24:36,958 --> 00:24:38,289 +What can we do? + +222 +00:24:38,994 --> 00:24:40,723 +What can you do? + +223 +00:24:43,765 --> 00:24:47,599 +Sparta will need sons. + +224 +00:25:35,383 --> 00:25:37,112 +Spartan! + +225 +00:25:46,394 --> 00:25:47,622 +Yes, milady? + +226 +00:26:03,712 --> 00:26:06,010 +Come back with your shield... + +227 +00:26:06,948 --> 00:26:08,381 +...or on it. + +228 +00:26:09,851 --> 00:26:11,216 +Yes, milady. + +229 +00:26:19,728 --> 00:26:22,026 +"Goodbye, my love." + +230 +00:26:22,664 --> 00:26:24,859 +He doesn't say it. + +231 +00:26:25,367 --> 00:26:27,597 +There's no room for softness... + +232 +00:26:27,769 --> 00:26:29,760 +...not in Sparta. + +233 +00:26:29,938 --> 00:26:32,702 +No place for weakness. + +234 +00:26:36,211 --> 00:26:40,409 +Only the hard and strong +may call themselves Spartans. + +235 +00:26:41,249 --> 00:26:45,743 +Only the hard. Only the strong. + +236 +00:27:14,215 --> 00:27:16,080 +We march... + +237 +00:27:16,785 --> 00:27:22,280 +...for our lands, for our families, +for our freedoms. + +238 +00:27:23,058 --> 00:27:25,219 +We march. + +239 +00:27:26,961 --> 00:27:28,622 +Daxos. + +240 +00:27:28,797 --> 00:27:32,198 +- What a pleasant surprise. +- This morning's full of surprises, Leonidas. + +241 +00:27:32,367 --> 00:27:34,767 +- We've been tricked. +- Can't be more than a hundred. + +242 +00:27:34,936 --> 00:27:37,166 +- This is a surprise. +- Silence. + +243 +00:27:37,605 --> 00:27:39,573 +This isn't their army. + +244 +00:27:39,741 --> 00:27:43,905 +We heard Sparta was on the warpath +and we were eager to join forces. + +245 +00:27:44,579 --> 00:27:48,675 +If it is blood you seek, +you are welcome to join us. + +246 +00:27:49,017 --> 00:27:52,248 +But you bring only this handful +of soldiers against Xerxes? + +247 +00:27:52,420 --> 00:27:56,015 +I see I was wrong to expect Sparta's +commitment to at least match our own. + +248 +00:27:57,192 --> 00:27:59,023 +Doesn't it? + +249 +00:28:00,462 --> 00:28:02,157 +You, there. + +250 +00:28:02,630 --> 00:28:03,824 +What is your profession? + +251 +00:28:04,366 --> 00:28:06,493 +I'm a potter, sir. + +252 +00:28:07,669 --> 00:28:11,435 +And you, Arcadian. +What is your profession? + +253 +00:28:11,806 --> 00:28:15,242 +- Sculptor, sir. +- Sculptor. + +254 +00:28:15,610 --> 00:28:17,544 +- And you? +- Blacksmith. + +255 +00:28:22,217 --> 00:28:25,516 +Spartans! What is your profession? + +256 +00:28:32,694 --> 00:28:34,628 +You see, old friend? + +257 +00:28:34,796 --> 00:28:37,697 +I brought more soldiers than you did. + +258 +00:28:47,642 --> 00:28:49,439 +No sleep tonight... + +259 +00:28:50,512 --> 00:28:52,980 +...not for the king. + +260 +00:28:53,148 --> 00:28:55,378 +All his 40 years +have been a straight road... + +261 +00:28:55,550 --> 00:28:59,111 +...to this one gleaming moment +in destiny... + +262 +00:28:59,287 --> 00:29:02,051 +...this one radiant clash +of shield and spear... + +263 +00:29:02,223 --> 00:29:05,818 +...sword and bone, +and flesh and blood. + +264 +00:29:07,529 --> 00:29:09,326 +His only regret... + +265 +00:29:09,497 --> 00:29:13,228 +...is that he has so few +to sacrifice. + +266 +00:29:34,522 --> 00:29:36,513 +We're being followed. + +267 +00:29:41,563 --> 00:29:43,758 +It has followed us since Sparta. + +268 +00:29:48,703 --> 00:29:51,695 +My king! Look! + +269 +00:30:12,660 --> 00:30:14,127 +What happened here? + +270 +00:30:14,696 --> 00:30:16,027 +Where are all the people? + +271 +00:30:17,131 --> 00:30:18,826 +Persians. + +272 +00:30:19,000 --> 00:30:20,797 +I put their number at around 20. + +273 +00:30:23,171 --> 00:30:24,536 +A scouting party. + +274 +00:30:27,909 --> 00:30:29,399 +But these footprints.... + +275 +00:30:40,788 --> 00:30:42,255 +Behind us! + +276 +00:30:56,304 --> 00:30:57,532 +Child! + +277 +00:31:30,505 --> 00:31:33,235 +It's quiet now. + +278 +00:31:33,708 --> 00:31:35,505 +They.... + +279 +00:31:35,877 --> 00:31:39,904 +They came with beasts +from the blackness. + +280 +00:31:41,482 --> 00:31:43,746 +With their claws and fangs... + +281 +00:31:43,918 --> 00:31:46,148 +...they grabbed them. + +282 +00:31:47,055 --> 00:31:49,216 +Everyone... + +283 +00:31:50,224 --> 00:31:52,283 +...but me. + +284 +00:32:04,539 --> 00:32:06,097 +The villagers. + +285 +00:32:06,641 --> 00:32:08,575 +I found them. + +286 +00:32:20,088 --> 00:32:22,886 +Have the gods no mercy? + +287 +00:32:24,058 --> 00:32:26,083 +We are doomed. + +288 +00:32:26,260 --> 00:32:28,888 +Quiet yourself. + +289 +00:32:32,300 --> 00:32:37,533 +The child speaks of the Persian ghosts, +known from the ancient times. + +290 +00:32:38,406 --> 00:32:41,102 +They are the hunters of men's souls. + +291 +00:32:42,143 --> 00:32:44,771 +They cannot be killed or defeated. + +292 +00:32:45,380 --> 00:32:49,544 +Not this darkness. Not these Immortals. + +293 +00:32:51,719 --> 00:32:53,914 +Immortals? + +294 +00:32:54,222 --> 00:32:57,282 +We'll put their name to the test. + +295 +00:33:19,347 --> 00:33:22,111 +Into the Hot Gates we march. + +296 +00:33:22,283 --> 00:33:25,582 +Into that narrow corridor +we march... + +297 +00:33:25,753 --> 00:33:28,017 +...where Xerxes' numbers +count for nothing. + +298 +00:33:29,190 --> 00:33:33,126 +Spartans, citizen-soldiers, +freed slaves. + +299 +00:33:33,294 --> 00:33:35,194 +Brave Greeks, all. + +300 +00:33:36,197 --> 00:33:39,291 +Brothers, fathers, sons... + +301 +00:33:39,467 --> 00:33:41,458 +...we march. + +302 +00:33:42,136 --> 00:33:46,334 +For honor's sake, for duty's sake, +for glory's sake, we march. + +303 +00:33:46,507 --> 00:33:49,601 +Look! Persians. + +304 +00:33:54,749 --> 00:33:58,480 +Into hell's mouth we march. + +305 +00:34:07,528 --> 00:34:09,587 +Let's watch these motherless dogs... + +306 +00:34:09,831 --> 00:34:13,892 +...as they're embraced by the loving arms +of Greece herself. Come. + +307 +00:34:16,704 --> 00:34:18,399 +True. + +308 +00:34:22,610 --> 00:34:25,078 +It does look like rain. + +309 +00:34:28,382 --> 00:34:31,613 +Zeus stabs the sky +with thunderbolts... + +310 +00:34:31,919 --> 00:34:35,946 +...and batters the Persian ships +with hurricane wind. + +311 +00:34:37,091 --> 00:34:39,525 +Glorious. + +312 +00:34:51,806 --> 00:34:54,673 +Only one among us +keeps his Spartan reserve. + +313 +00:35:00,615 --> 00:35:02,549 +Only he. + +314 +00:35:02,717 --> 00:35:05,185 +Only our king. + +315 +00:35:22,603 --> 00:35:24,537 +My queen? + +316 +00:35:29,710 --> 00:35:31,041 +My queen... + +317 +00:35:31,212 --> 00:35:34,545 +...the courtyard is a more fitting place +for a married woman. + +318 +00:35:34,715 --> 00:35:36,376 +I'm afraid gossip and protocol... + +319 +00:35:36,551 --> 00:35:39,076 +...are the least of my worries now, +councilman. + +320 +00:35:40,755 --> 00:35:42,586 +Is such secrecy needed? + +321 +00:35:42,757 --> 00:35:45,419 +How am I to trust beyond the walls +of my own home? + +322 +00:35:45,593 --> 00:35:49,324 +Even here, Theron has eyes and ears +which fuel Sparta with doubt and fear. + +323 +00:35:49,730 --> 00:35:53,131 +You speak as if all Sparta +conspires against you. + +324 +00:35:53,768 --> 00:35:55,827 +I wish it were only against me. + +325 +00:35:58,472 --> 00:36:01,964 +Many on our council +would vote to give all we have... + +326 +00:36:02,143 --> 00:36:04,008 +...and follow Leonidas... + +327 +00:36:04,345 --> 00:36:06,313 +...but you must show them favor. + +328 +00:36:08,616 --> 00:36:11,084 +And you can arrange for me +to speak to the council? + +329 +00:36:11,252 --> 00:36:13,686 +If it is reason they want, +I will let them know. + +330 +00:36:13,855 --> 00:36:15,982 +Know what, my queen? + +331 +00:36:16,357 --> 00:36:18,348 +Freedom isn't free at all. + +332 +00:36:18,526 --> 00:36:21,859 +That it comes with the highest of costs, +the cost of blood. + +333 +00:36:24,131 --> 00:36:26,759 +I will do my best to gather our council. + +334 +00:36:27,201 --> 00:36:31,035 +And its chamber +shall be filled with your voice. + +335 +00:36:31,372 --> 00:36:33,203 +- I'm in your debt. +- No. + +336 +00:36:33,541 --> 00:36:37,705 +Leonidas is my king as well as yours. + +337 +00:37:02,503 --> 00:37:04,368 +I saw those ships smash on the rocks. + +338 +00:37:05,473 --> 00:37:06,838 +How can this be? + +339 +00:37:07,008 --> 00:37:10,307 +We saw but a fraction of the monster +that is Xerxes' army. + +340 +00:37:10,978 --> 00:37:13,378 +There can be no victory here. + +341 +00:37:17,318 --> 00:37:19,013 +Why do you smile? + +342 +00:37:20,721 --> 00:37:22,655 +Arcadian... + +343 +00:37:22,823 --> 00:37:25,849 +...I have fought countless times... + +344 +00:37:26,127 --> 00:37:28,789 +...yet I've never met an adversary +who could offer me... + +345 +00:37:28,963 --> 00:37:31,124 +...what we Spartans +call "a beautiful death." + +346 +00:37:31,933 --> 00:37:33,594 +I can only hope... + +347 +00:37:33,768 --> 00:37:36,498 +...with all the world's warriors +gathered against us... + +348 +00:37:36,671 --> 00:37:40,334 +...there might be one down there +who's up to the task. + +349 +00:37:51,786 --> 00:37:54,118 +Move! + +350 +00:37:55,423 --> 00:37:58,358 +Keep going, you dogs! + +351 +00:38:06,033 --> 00:38:08,058 +Move! + +352 +00:38:09,503 --> 00:38:12,063 +Forward, I say! + +353 +00:38:14,408 --> 00:38:16,000 +Stop here! + +354 +00:38:16,844 --> 00:38:19,005 +Who commands here? + +355 +00:38:21,215 --> 00:38:23,877 +I am the emissary... + +356 +00:38:24,051 --> 00:38:26,315 +...to the ruler of all the world... + +357 +00:38:27,121 --> 00:38:31,023 +...the god of gods, king of kings... + +358 +00:38:31,192 --> 00:38:32,784 +...and by that authority... + +359 +00:38:32,960 --> 00:38:36,726 +...I demand that someone +show me your commander. + +360 +00:38:40,501 --> 00:38:46,406 +Listen. Do you think the paltry dozen +you slew scares us? + +361 +00:38:46,574 --> 00:38:50,066 +These hills swarm with our scouts. + +362 +00:38:50,244 --> 00:38:54,943 +And do you think your pathetic wall +will do anything... + +363 +00:38:55,116 --> 00:39:01,419 +...except fall like a heap of dry leaves +in the face of...? + +364 +00:39:13,134 --> 00:39:15,432 +Our ancestors built this wall... + +365 +00:39:16,170 --> 00:39:20,106 +...using ancient stones +from the bosom of Greece herself. + +366 +00:39:20,541 --> 00:39:22,907 +And with a little Spartan help... + +367 +00:39:23,210 --> 00:39:25,678 +...your Persian scouts +supplied the mortar. + +368 +00:39:26,280 --> 00:39:30,239 +You will pay for your barbarism! + +369 +00:39:49,403 --> 00:39:50,961 +My arm! + +370 +00:39:53,541 --> 00:39:55,406 +It's not yours anymore. + +371 +00:39:55,676 --> 00:40:00,306 +Go now. Run along and tell your Xerxes +he faces free men here... + +372 +00:40:00,681 --> 00:40:02,046 +...not slaves. + +373 +00:40:02,216 --> 00:40:03,444 +Do it quickly... + +374 +00:40:03,684 --> 00:40:06,619 +...before we decide to make our wall +just a little bit bigger. + +375 +00:40:07,121 --> 00:40:08,713 +No. + +376 +00:40:08,889 --> 00:40:11,323 +Not slaves. + +377 +00:40:13,127 --> 00:40:16,563 +Your women will be slaves. + +378 +00:40:16,897 --> 00:40:19,730 +Your sons, your daughters... + +379 +00:40:19,900 --> 00:40:22,232 +...your elders will be slaves! + +380 +00:40:22,403 --> 00:40:25,167 +But not you, no. + +381 +00:40:25,339 --> 00:40:29,400 +By noon this day you will be dead men. + +382 +00:40:30,578 --> 00:40:36,574 +A thousand nations of the Persian Empire +descend upon you. + +383 +00:40:36,984 --> 00:40:40,476 +Our arrows will blot out the sun. + +384 +00:40:42,256 --> 00:40:44,952 +Then we will fight in the shade. + +385 +00:40:46,494 --> 00:40:48,257 +The wall is solid. + +386 +00:40:48,429 --> 00:40:51,592 +It'll do the job of funneling the Persians +into the Hot Gates. + +387 +00:40:51,932 --> 00:40:54,628 +Have the men found any route +through the hills to our back? + +388 +00:40:55,136 --> 00:40:57,161 +None, sire. + +389 +00:40:57,438 --> 00:40:58,996 +There is such a route, good king. + +390 +00:40:59,540 --> 00:41:01,269 +Just pass that western ridge. + +391 +00:41:01,942 --> 00:41:03,637 +It's an old goat path. + +392 +00:41:03,811 --> 00:41:06,644 +The Persians could use it to outflank us. + +393 +00:41:06,814 --> 00:41:10,545 +Not one step closer, monster! + +394 +00:41:12,186 --> 00:41:15,781 +Wise king, I humbly request an audience. + +395 +00:41:15,956 --> 00:41:19,323 +- I'll skewer you where you stand. +- I gave no such order. + +396 +00:41:29,837 --> 00:41:31,065 +Forgive the captain. + +397 +00:41:31,739 --> 00:41:33,229 +He is a good soldier... + +398 +00:41:33,807 --> 00:41:36,435 +...but a bit short on manners. + +399 +00:41:36,610 --> 00:41:40,671 +There is nothing to forgive, brave king. +I know what I look like. + +400 +00:41:41,115 --> 00:41:43,140 +You wear the crimson of a Spartan. + +401 +00:41:43,751 --> 00:41:49,383 +I am Ephialtes, born of Sparta. + +402 +00:41:49,990 --> 00:41:54,051 +My mother's love +led my parents to flee Sparta... + +403 +00:41:54,228 --> 00:41:55,695 +...lest I be discarded. + +404 +00:41:56,230 --> 00:41:59,028 +Your shield and armor? + +405 +00:41:59,934 --> 00:42:01,595 +My father's, sir. + +406 +00:42:02,937 --> 00:42:06,998 +I beg you, bold king, +to permit me... + +407 +00:42:07,174 --> 00:42:12,202 +...to redeem my father's name +by serving you in combat. + +408 +00:42:12,513 --> 00:42:18,383 +My father trained me to feel no fear, +to make spear and shield and sword... + +409 +00:42:18,552 --> 00:42:21,282 +...as much a part of me +as my own beating heart. + +410 +00:42:21,722 --> 00:42:25,021 +I will earn my father's armor, +noble king... + +411 +00:42:25,192 --> 00:42:27,353 +...by serving you in the battle. + +412 +00:42:32,533 --> 00:42:34,626 +A fine thrust. + +413 +00:42:34,802 --> 00:42:36,394 +I will kill many Persians. + +414 +00:42:42,276 --> 00:42:43,868 +Raise your shield. + +415 +00:42:44,044 --> 00:42:46,706 +- Sire? +- Raise your shield as high as you can. + +416 +00:42:54,955 --> 00:42:57,981 +Your father should have taught you +how our phalanx works. + +417 +00:42:58,659 --> 00:42:59,956 +We fight... + +418 +00:43:00,494 --> 00:43:03,395 +...as a single, impenetrable unit. + +419 +00:43:03,564 --> 00:43:06,499 +That is the source of our strength. + +420 +00:43:07,334 --> 00:43:10,963 +Each Spartan protects the man +to his left... + +421 +00:43:11,138 --> 00:43:14,335 +...from thigh to neck with his shield. + +422 +00:43:14,508 --> 00:43:19,172 +A single weak spot +and the phalanx shatters. + +423 +00:43:20,581 --> 00:43:23,812 +From thigh to neck, Ephialtes. + +424 +00:43:25,853 --> 00:43:28,253 +I am sorry, my friend. + +425 +00:43:28,422 --> 00:43:31,016 +- But not all of us were made to be soldiers. +- But I-- + +426 +00:43:31,191 --> 00:43:33,625 +- If you want to help in a Spartan victory... +- Yes. + +427 +00:43:33,794 --> 00:43:38,959 +...clear the battlefield of the dead, +tend the wounded, bring them water... + +428 +00:43:39,133 --> 00:43:40,760 +...but as for the fight itself... + +429 +00:43:42,136 --> 00:43:44,036 +...I cannot use you. + +430 +00:43:45,873 --> 00:43:47,306 +You.... + +431 +00:43:55,182 --> 00:43:59,278 +Mother! Father! You were wrong! + +432 +00:44:02,556 --> 00:44:04,319 +You are wrong! + +433 +00:44:04,491 --> 00:44:09,019 +Leonidas! You are wrong! + +434 +00:44:09,496 --> 00:44:11,964 +Dispatch the Phocians to the goat path... + +435 +00:44:12,132 --> 00:44:16,660 +...and pray to the gods +nobody tells the Persians about it. + +436 +00:44:22,376 --> 00:44:23,934 +Earthquake. + +437 +00:44:24,478 --> 00:44:25,706 +No, captain. + +438 +00:44:27,314 --> 00:44:29,248 +Battle formations. + +439 +00:44:53,140 --> 00:44:56,337 +This is where we hold them. + +440 +00:44:56,510 --> 00:44:58,774 +This is where we fight! + +441 +00:44:59,346 --> 00:45:01,576 +This is where they die! + +442 +00:45:01,915 --> 00:45:03,780 +Earn these shields, boys! + +443 +00:45:06,520 --> 00:45:09,011 +Remember this day, men... + +444 +00:45:09,189 --> 00:45:12,920 +...for it will be yours for all time. + +445 +00:45:24,037 --> 00:45:25,800 +Spartans! + +446 +00:45:25,973 --> 00:45:28,100 +Lay down your weapons! + +447 +00:45:44,992 --> 00:45:47,256 +Persians! + +448 +00:45:47,828 --> 00:45:49,887 +Come and get them! + +449 +00:46:11,385 --> 00:46:13,012 +Hold! + +450 +00:46:15,856 --> 00:46:17,414 +Give them nothing... + +451 +00:46:17,858 --> 00:46:21,453 +...but take from them everything! + +452 +00:46:23,163 --> 00:46:24,892 +Steady! + +453 +00:46:35,676 --> 00:46:37,200 +Push! + +454 +00:46:41,048 --> 00:46:43,448 +Is that the best you can do? + +455 +00:46:45,652 --> 00:46:47,643 +Push! Push! + +456 +00:46:57,731 --> 00:46:59,255 +Now! + +457 +00:47:11,078 --> 00:47:12,568 +Push! + +458 +00:47:56,123 --> 00:47:58,717 +No prisoners! + +459 +00:47:59,059 --> 00:48:00,788 +No mercy! + +460 +00:49:20,107 --> 00:49:22,234 +They look thirsty. + +461 +00:49:23,343 --> 00:49:26,278 +Well, let's give them something to drink. + +462 +00:49:29,182 --> 00:49:31,844 +To the cliffs. + +463 +00:49:55,475 --> 00:49:57,636 +Halt. + +464 +00:49:59,746 --> 00:50:01,839 +Hell of a good start. + +465 +00:50:24,504 --> 00:50:26,972 +Tuck tail! + +466 +00:50:32,446 --> 00:50:34,004 +Persian cowards. + +467 +00:50:41,788 --> 00:50:44,723 +- What the hell are you laughing at? +- Well, you had to say it. + +468 +00:50:45,525 --> 00:50:49,188 +- What? +- "Fight in the shade." + +469 +00:51:02,709 --> 00:51:04,643 +Recover. + +470 +00:51:27,934 --> 00:51:30,562 +Today no Spartan dies. + +471 +00:51:55,695 --> 00:51:57,128 +Easy, son. + +472 +00:52:23,356 --> 00:52:25,324 +We do what we were trained to do... + +473 +00:52:25,492 --> 00:52:26,959 +...what we were bred to do... + +474 +00:52:27,127 --> 00:52:30,119 +...what we were born to do. + +475 +00:52:37,504 --> 00:52:40,496 +No prisoners. No mercy. + +476 +00:52:40,674 --> 00:52:42,141 +A good start. + +477 +00:53:51,611 --> 00:53:54,876 +- I was afraid you might not come. +- I'm sorry, my son is-- + +478 +00:53:55,048 --> 00:54:00,645 +Is doing what children do best. +Please, don't apologize. + +479 +00:54:01,655 --> 00:54:03,782 +Your son starts the agoge next year. + +480 +00:54:04,391 --> 00:54:08,384 +That is always a difficult time +for a Spartan mother. + +481 +00:54:09,496 --> 00:54:14,058 +Yes, it will be hard. But also necessary. + +482 +00:54:16,503 --> 00:54:20,735 +You will speak before the council +in two days' time. + +483 +00:54:22,609 --> 00:54:24,634 +My husband does not have two days. + +484 +00:54:25,045 --> 00:54:27,013 +Think of the two days as a gift. + +485 +00:54:29,082 --> 00:54:31,107 +It's no secret... + +486 +00:54:31,284 --> 00:54:34,151 +...Theron wants what you control. + +487 +00:54:34,321 --> 00:54:37,154 +It's his voice you must silence. + +488 +00:54:37,324 --> 00:54:39,417 +Make him your ally... + +489 +00:54:39,726 --> 00:54:42,286 +...and you will have your victory. + +490 +00:54:43,096 --> 00:54:44,859 +Thank you. + +491 +00:54:45,198 --> 00:54:47,598 +You are wise as you are kind. + +492 +00:55:14,661 --> 00:55:16,424 +There's your mother. + +493 +00:55:22,902 --> 00:55:26,338 +You should keep a better eye on him +if he's to be king one day. + +494 +00:55:26,539 --> 00:55:29,007 +Be unfortunate if anything +were to happen to him. + +495 +00:55:30,510 --> 00:55:32,375 +Or to his beautiful mother. + +496 +00:55:33,846 --> 00:55:35,336 +No! + +497 +00:55:53,584 --> 00:55:59,022 +Our Greek comrades are begging +for a crack at the Persians, sire. + +498 +00:55:59,323 --> 00:56:00,654 +Good. + +499 +00:56:00,825 --> 00:56:03,589 +I've got something +I think they can handle. + +500 +00:56:04,094 --> 00:56:05,789 +Tell Daxos that I want him... + +501 +00:56:05,963 --> 00:56:10,491 +...and 20 of his best eager, sober +and ready for the next charge. + +502 +00:56:10,668 --> 00:56:12,499 +King Leonidas. + +503 +00:56:15,005 --> 00:56:18,805 +- Stelios, catch your breath, boy. +- Yes, milord. + +504 +00:56:19,443 --> 00:56:21,570 +The Persians are approaching. + +505 +00:56:22,947 --> 00:56:26,815 +A small contingent. +Too small for an attack. + +506 +00:56:30,554 --> 00:56:34,115 +- Captain, I leave you in charge. +- But sire-- + +507 +00:56:34,291 --> 00:56:35,519 +Relax, old friend. + +508 +00:56:35,693 --> 00:56:40,255 +If they assassinate me, +all of Sparta goes to war. + +509 +00:56:41,198 --> 00:56:43,792 +Pray they're that stupid. + +510 +00:56:44,902 --> 00:56:46,597 +Pray... + +511 +00:56:47,137 --> 00:56:49,332 +...we're that lucky. + +512 +00:56:52,476 --> 00:56:54,239 +Besides... + +513 +00:56:56,514 --> 00:56:59,847 +...there's no reason we can't be civil... + +514 +00:57:00,150 --> 00:57:01,742 +...is there? + +515 +00:57:03,087 --> 00:57:04,076 +None, sire. + +516 +00:57:23,471 --> 00:57:25,701 +Let me guess. + +517 +00:57:26,440 --> 00:57:29,432 +You must be Xerxes. + +518 +00:57:41,455 --> 00:57:43,650 +Come, Leonidas. + +519 +00:57:45,092 --> 00:57:46,855 +Let us reason together. + +520 +00:57:47,128 --> 00:57:49,096 +It would be a regrettable waste... + +521 +00:57:49,497 --> 00:57:52,694 +...it would be nothing short of madness +were you, brave king... + +522 +00:57:52,867 --> 00:57:56,064 +...and your valiant troops to perish... + +523 +00:57:56,704 --> 00:57:58,763 +...all because of a simple +misunderstanding. + +524 +00:57:59,373 --> 00:58:02,206 +- There's much our cultures could share. +- Haven't you noticed? + +525 +00:58:02,376 --> 00:58:04,776 +We've been sharing our culture +with you all morning. + +526 +00:58:05,379 --> 00:58:07,643 +Yours is a fascinating tribe. + +527 +00:58:07,815 --> 00:58:09,976 +Even now you are defiant... + +528 +00:58:10,151 --> 00:58:14,281 +...in the face of annihilation +and the presence of a god. + +529 +00:58:14,455 --> 00:58:16,480 +It isn't wise to stand against me, +Leonidas. + +530 +00:58:17,158 --> 00:58:19,388 +Imagine what a horrible fate +awaits my enemies... + +531 +00:58:19,560 --> 00:58:22,461 +...when I would gladly kill +any of my own men for victory. + +532 +00:58:22,630 --> 00:58:25,258 +And I would die for any one of mine. + +533 +00:58:25,433 --> 00:58:29,665 +You Greeks take pride in your logic. +I suggest you employ it. + +534 +00:58:29,837 --> 00:58:33,398 +Consider the beautiful land +you so vigorously defend. + +535 +00:58:33,574 --> 00:58:36,065 +Picture it reduced to ash at my whim. + +536 +00:58:36,310 --> 00:58:37,777 +Consider the fate of your women. + +537 +00:58:38,379 --> 00:58:40,904 +Clearly you don't know our women. + +538 +00:58:41,082 --> 00:58:44,609 +I might as well have marched them up here, +judging by what I've seen. + +539 +00:58:45,720 --> 00:58:48,245 +You have many slaves, Xerxes... + +540 +00:58:49,190 --> 00:58:51,488 +...but few warriors. + +541 +00:58:51,659 --> 00:58:55,595 +It won't be long +before they fear my spears... + +542 +00:58:55,997 --> 00:58:58,431 +...more than your whips. + +543 +00:59:02,269 --> 00:59:05,136 +It's not the lash they fear... + +544 +00:59:07,875 --> 00:59:09,536 +...it is my divine power. + +545 +00:59:10,277 --> 00:59:14,771 +But I am a generous god. +I can make you rich beyond all measure. + +546 +00:59:15,216 --> 00:59:17,616 +I will make you warlord of all Greece. + +547 +00:59:18,252 --> 00:59:22,154 +You will carry my battle standard +to the heart of Europa. + +548 +00:59:22,323 --> 00:59:24,917 +Your Athenian rivals... + +549 +00:59:25,226 --> 00:59:27,387 +...will kneel at your feet... + +550 +00:59:28,095 --> 00:59:30,893 +...if you will but kneel at mine. + +551 +00:59:31,732 --> 00:59:33,996 +You are generous... + +552 +00:59:34,568 --> 00:59:36,968 +...as you are divine... + +553 +00:59:37,705 --> 00:59:39,332 +...O king of kings. + +554 +00:59:39,507 --> 00:59:43,409 +Such an offer +only a madman would refuse. + +555 +00:59:44,011 --> 00:59:46,002 +But the.... + +556 +00:59:46,914 --> 00:59:49,747 +The idea of kneeling, it's.... + +557 +00:59:49,917 --> 00:59:54,445 +You see, slaughtering +all those men of yours has.... + +558 +00:59:54,622 --> 00:59:58,456 +Well, it's left a nasty cramp in my leg... + +559 +00:59:58,626 --> 01:00:00,719 +...so kneeling will be hard for me. + +560 +01:00:00,995 --> 01:00:04,362 +There will be no glory in your sacrifice. + +561 +01:00:04,532 --> 01:00:08,127 +I will erase even the memory of Sparta +from the histories. + +562 +01:00:08,302 --> 01:00:11,499 +Every piece of Greek parchment +shall be burned. + +563 +01:00:11,672 --> 01:00:15,005 +Every Greek historian and every scribe +shall have their eyes put out... + +564 +01:00:15,176 --> 01:00:17,440 +...and their tongues +cut from their mouths. + +565 +01:00:17,611 --> 01:00:23,607 +Why, uttering the very name of Sparta +or Leonidas will be punishable by death. + +566 +01:00:24,251 --> 01:00:27,516 +The world will never know +you existed at all. + +567 +01:00:29,657 --> 01:00:34,253 +The world will know +that free men stood against a tyrant. + +568 +01:00:34,462 --> 01:00:37,954 +That few stood against many. + +569 +01:00:38,365 --> 01:00:41,493 +And before this battle was over... + +570 +01:00:41,769 --> 01:00:44,738 +...that even a god-king can bleed. + +571 +01:00:52,113 --> 01:00:54,308 +You fought well today... + +572 +01:00:55,649 --> 01:00:57,549 +...for a woman. + +573 +01:00:58,719 --> 01:01:00,380 +As did you. + +574 +01:01:00,554 --> 01:01:03,648 +Maybe if I'm injured, +you'll be able to keep up with me. + +575 +01:01:04,158 --> 01:01:09,118 +Perhaps I was so far ahead +you couldn't see me. + +576 +01:01:09,730 --> 01:01:12,927 +More likely offering your backside +to the Thespians. + +577 +01:01:13,868 --> 01:01:15,495 +Jealousy... + +578 +01:01:15,669 --> 01:01:18,160 +...does not become you, my friend. + +579 +01:01:20,908 --> 01:01:23,240 +Move it, men! + +580 +01:01:25,346 --> 01:01:27,576 +Pile those Persians high. + +581 +01:01:30,718 --> 01:01:33,516 +For unless I miss my guess... + +582 +01:01:34,088 --> 01:01:37,080 +...we're in for one wild night. + +583 +01:02:01,015 --> 01:02:06,180 +They have served the dark will +of Persian kings for 500 years. + +584 +01:02:06,353 --> 01:02:08,685 +Eyes as dark as night. + +585 +01:02:08,856 --> 01:02:10,847 +Teeth filed to fangs. + +586 +01:02:12,960 --> 01:02:15,224 +Soulless. + +587 +01:02:22,636 --> 01:02:27,403 +The personal guard to King Xerxes himself. +The Persian warrior elite. + +588 +01:02:29,210 --> 01:02:32,304 +The deadliest fighting force +in all of Asia: + +589 +01:02:33,080 --> 01:02:35,139 +The Immortals. + +590 +01:02:43,357 --> 01:02:46,758 +The god-king +has betrayed a fatal flaw: + +591 +01:02:47,261 --> 01:02:49,024 +Hubris. + +592 +01:02:51,265 --> 01:02:54,029 +Easy to taunt, easy to trick. + +593 +01:02:54,702 --> 01:02:57,136 +Before wounds and weariness +have taken their toll... + +594 +01:02:57,304 --> 01:03:00,831 +...the mad king +throws the best he has at us. + +595 +01:03:01,342 --> 01:03:03,037 +Xerxes has taken the bait. + +596 +01:03:03,210 --> 01:03:05,007 +Spartans, push! + +597 +01:03:15,689 --> 01:03:17,281 +Immortals. + +598 +01:03:17,758 --> 01:03:20,727 +We put their name to the test. + +599 +01:04:04,905 --> 01:04:06,338 +Father! + +600 +01:05:52,012 --> 01:05:53,274 +My king! + +601 +01:07:06,053 --> 01:07:08,021 +Arcadians, now! + +602 +01:07:10,324 --> 01:07:13,088 +Go! Show the Spartans what we can do. + +603 +01:07:13,694 --> 01:07:15,127 +Go! + +604 +01:07:24,538 --> 01:07:26,438 +They shout and curse... + +605 +01:07:26,607 --> 01:07:29,804 +...stabbing wildly, +more brawlers than warriors. + +606 +01:07:30,944 --> 01:07:33,504 +They make a wondrous +mess of things. + +607 +01:07:34,548 --> 01:07:37,312 +Brave amateurs, they do their part. + +608 +01:08:24,932 --> 01:08:26,797 +Immortals. + +609 +01:08:26,967 --> 01:08:29,561 +They fail our king's test. + +610 +01:08:29,736 --> 01:08:32,671 +And a man +who fancies himself a god... + +611 +01:08:33,407 --> 01:08:38,344 +...feels a very human chill +crawl up his spine. + +612 +01:08:45,452 --> 01:08:47,579 +To our king! + +613 +01:08:47,955 --> 01:08:49,946 +And our honored dead. + +614 +01:08:50,123 --> 01:08:52,921 +Whom will Xerxes dare to send next? +Whom?! + +615 +01:08:53,260 --> 01:08:55,956 +There's nothing that can stop us now! + +616 +01:08:56,830 --> 01:09:00,357 +Even the king allows himself +to hope for more than glory. + +617 +01:09:00,534 --> 01:09:03,867 +Such mad hope, but there it is: + +618 +01:09:04,304 --> 01:09:09,708 +"Against Asia's endless hordes, +against all odds, we can do it. + +619 +01:09:09,876 --> 01:09:12,606 +We can hold the Hot Gates. + +620 +01:09:12,779 --> 01:09:14,906 +We can win." + +621 +01:09:22,489 --> 01:09:24,252 +Dawn. + +622 +01:09:24,858 --> 01:09:28,885 +Whips crack. Barbarians howl. + +623 +01:09:29,062 --> 01:09:32,964 +Those behind cry, "Forward!" + +624 +01:09:34,835 --> 01:09:38,635 +Those in front cry, "Back!" + +625 +01:09:44,745 --> 01:09:47,270 +Our eyes bear witness +to the grotesque spectacle... + +626 +01:09:47,447 --> 01:09:51,543 +...coughed forth from the darkest +corner of Xerxes' empire. + +627 +01:10:41,768 --> 01:10:43,292 +When muscle failed... + +628 +01:10:43,737 --> 01:10:46,399 +...they turned to their magic. + +629 +01:10:47,441 --> 01:10:52,242 +One hundred nations descend +upon us, the armies of all Asia. + +630 +01:10:52,412 --> 01:10:56,872 +Funneled into this narrow corridor, +their numbers count for nothing. + +631 +01:11:31,251 --> 01:11:33,219 +They fall by the hundreds. + +632 +01:11:33,386 --> 01:11:38,983 +We send the severed bodies and the +fragile hearts back to Xerxes' feet. + +633 +01:11:55,609 --> 01:11:59,773 +King Xerxes is displeased +with his generals. + +634 +01:11:59,946 --> 01:12:02,506 +He disciplines them. + +635 +01:12:19,399 --> 01:12:23,802 +Xerxes dispatches his monsters +from half the world away. + +636 +01:12:34,781 --> 01:12:36,874 +They're clumsy beasts... + +637 +01:12:37,050 --> 01:12:39,416 +...and the piled Persian dead +are slippery. + +638 +01:13:15,856 --> 01:13:18,290 +- You still here? +- Somebody's gotta watch your back. + +639 +01:13:18,458 --> 01:13:20,050 +Not now, I'm a little busy. + +640 +01:14:00,333 --> 01:14:02,858 +Regroup! + +641 +01:14:06,072 --> 01:14:07,699 +Astinos! + +642 +01:14:07,908 --> 01:14:09,603 +My son! + +643 +01:14:18,551 --> 01:14:20,178 +Astinos! + +644 +01:14:20,353 --> 01:14:23,117 +No! + +645 +01:14:46,379 --> 01:14:48,506 +Day wears on. + +646 +01:14:48,848 --> 01:14:51,009 +We lose few... + +647 +01:14:51,184 --> 01:14:54,415 +...but each felled is a friend, +or dearest blood. + +648 +01:14:56,623 --> 01:15:00,525 +And upon seeing the headless body +of his own young son... + +649 +01:15:00,694 --> 01:15:02,559 +...the captain breaks rank. + +650 +01:15:02,729 --> 01:15:06,165 +He goes wild, blood-drunk. + +651 +01:15:30,790 --> 01:15:33,281 +The captain's cries of pain +at the loss of his son... + +652 +01:15:33,460 --> 01:15:37,191 +...are more frightening to the enemy +than the deepest battle drums. + +653 +01:15:37,364 --> 01:15:41,357 +It takes three men to restrain him +and bring him back to our own. + +654 +01:15:41,701 --> 01:15:44,033 +The day is ours. + +655 +01:15:44,437 --> 01:15:47,099 +No songs are sung. + +656 +01:16:27,213 --> 01:16:31,809 +Your gods were cruel to shape you so, +friend Ephialtes. + +657 +01:16:34,220 --> 01:16:35,517 +The Spartans, too... + +658 +01:16:36,256 --> 01:16:39,157 +...were cruel to reject you. + +659 +01:16:41,995 --> 01:16:44,429 +But I am kind. + +660 +01:16:50,937 --> 01:16:53,064 +Everything you could ever desire... + +661 +01:16:54,307 --> 01:16:56,070 +...every happiness you can imagine... + +662 +01:16:58,278 --> 01:17:02,874 +...every pleasure your fellow Greeks +and your false gods have denied you... + +663 +01:17:03,683 --> 01:17:05,947 +...I will grant you. + +664 +01:17:07,220 --> 01:17:09,620 +For I am kind. + +665 +01:17:23,570 --> 01:17:26,869 +Embrace me as your king +and as your god. + +666 +01:17:28,007 --> 01:17:29,702 +Yes. + +667 +01:17:31,177 --> 01:17:35,978 +Lead my soldiers to the hidden path +that enters behind the cursed Spartans... + +668 +01:17:36,149 --> 01:17:38,413 +...and your joys will be endless. + +669 +01:17:46,860 --> 01:17:50,023 +Yes! I want it all. + +670 +01:17:50,463 --> 01:17:54,024 +Wealth. Women. + +671 +01:17:56,035 --> 01:17:57,730 +And one more thing... + +672 +01:18:00,907 --> 01:18:03,569 +...I want a uniform. + +673 +01:18:08,081 --> 01:18:09,776 +Done. + +674 +01:18:11,417 --> 01:18:13,112 +You will find... + +675 +01:18:13,720 --> 01:18:15,654 +...I am kind. + +676 +01:18:16,789 --> 01:18:21,021 +Unlike the cruel Leonidas, +who demanded that you stand... + +677 +01:18:23,129 --> 01:18:24,824 +...I require only... + +678 +01:18:25,565 --> 01:18:26,998 +...that you kneel. + +679 +01:18:54,661 --> 01:18:56,595 +Beautiful night. + +680 +01:18:58,031 --> 01:19:02,024 +Yes, but I did not ask you here +for small talk, Theron. + +681 +01:19:02,669 --> 01:19:04,762 +You can be sure of that. + +682 +01:19:06,172 --> 01:19:08,834 +You never spared words with me. + +683 +01:19:09,409 --> 01:19:12,674 +Can I offer you something? +A drink, perhaps? + +684 +01:19:12,845 --> 01:19:14,676 +Is it poison? + +685 +01:19:15,081 --> 01:19:17,845 +I'm sorry to disappoint you, +it's only water. + +686 +01:19:27,627 --> 01:19:30,790 +I'm told it's been arranged for you +to go before the council. + +687 +01:19:31,464 --> 01:19:33,193 +Yes. + +688 +01:19:33,399 --> 01:19:36,732 +I need your help in winning votes +to send the army north to our king. + +689 +01:19:37,303 --> 01:19:38,930 +Yes. + +690 +01:19:39,606 --> 01:19:42,166 +I can see it, +the two of us standing together. + +691 +01:19:42,342 --> 01:19:46,711 +Me, politician. You, warrior. +Our voices as one. + +692 +01:19:48,047 --> 01:19:49,514 +But why would I want to do that? + +693 +01:19:50,483 --> 01:19:54,442 +It proves you care for a king who right now +fights for the very water we drink. + +694 +01:19:54,787 --> 01:19:56,379 +True. + +695 +01:19:56,756 --> 01:19:59,384 +But this is politics, not war. + +696 +01:19:59,692 --> 01:20:01,216 +Leonidas is an idealist. + +697 +01:20:01,628 --> 01:20:05,564 +I know your kind too well. You send men +to slaughter for your own gain. + +698 +01:20:05,732 --> 01:20:10,635 +Your husband, our king, +has taken 300 of our finest to slaughter. + +699 +01:20:10,803 --> 01:20:15,433 +He's broken our laws +and left without the council's consent. + +700 +01:20:15,942 --> 01:20:18,934 +- I'm simply a realist. +- You're an opportunist. + +701 +01:20:19,912 --> 01:20:24,212 +You're as foolish as Leonidas if you think +men don't have a price in this world. + +702 +01:20:24,384 --> 01:20:28,946 +All men are not created equal. +That's the Spartan code, my little queen. + +703 +01:20:32,625 --> 01:20:35,025 +I admire your passion. + +704 +01:20:36,362 --> 01:20:38,091 +But don't think that you... + +705 +01:20:38,531 --> 01:20:40,863 +...a woman, even a queen... + +706 +01:20:41,034 --> 01:20:44,970 +...can walk into the council chamber +and sway the minds of men. + +707 +01:20:45,138 --> 01:20:47,572 +I own that chamber... + +708 +01:20:47,740 --> 01:20:49,799 +...as if it were built with these hands. + +709 +01:20:54,280 --> 01:20:57,807 +I could crush +the life out of you right now. + +710 +01:20:58,885 --> 01:21:02,548 +You will go before the council, +but your words will fall on deaf ears. + +711 +01:21:02,722 --> 01:21:08,490 +Leonidas will receive no reinforcements, +and if he returns, without my help... + +712 +01:21:08,661 --> 01:21:11,630 +...he will go to jail or worse. + +713 +01:21:15,368 --> 01:21:16,835 +Do you love your Sparta? + +714 +01:21:17,337 --> 01:21:19,032 +Yes. + +715 +01:21:19,205 --> 01:21:21,469 +- And your king? +- I do. + +716 +01:21:27,313 --> 01:21:31,010 +Your husband fights for his land +and his love. + +717 +01:21:31,684 --> 01:21:33,982 +What do you have to offer... + +718 +01:21:34,754 --> 01:21:37,723 +...in return for my word +that I'll help you send our army north? + +719 +01:21:41,694 --> 01:21:44,356 +What does a realist want with his queen? + +720 +01:21:48,968 --> 01:21:50,697 +I think you know. + +721 +01:22:05,151 --> 01:22:07,847 +This will not be over quickly. + +722 +01:22:08,888 --> 01:22:11,379 +You will not enjoy this. + +723 +01:22:11,924 --> 01:22:14,188 +I'm not your king. + +724 +01:22:38,985 --> 01:22:40,782 +Dilios. + +725 +01:22:42,789 --> 01:22:46,816 +I trust that scratch +hasn't made you useless? + +726 +01:22:46,993 --> 01:22:50,019 +Hardly, my lord. It's just an eye. + +727 +01:22:50,196 --> 01:22:53,393 +The gods saw fit to grace me +with a spare. + +728 +01:22:55,268 --> 01:22:57,202 +My captain? + +729 +01:22:58,504 --> 01:23:02,304 +Curses the gods and mourns alone. + +730 +01:23:04,277 --> 01:23:06,245 +Leonidas! + +731 +01:23:07,447 --> 01:23:10,439 +We are undone. +Undone, I tell you. Destroyed. + +732 +01:23:10,616 --> 01:23:12,049 +Daxos, calm yourself. + +733 +01:23:12,218 --> 01:23:15,813 +Our hunchback traitor led Xerxes' Immortals +to the hidden goat path behind us. + +734 +01:23:16,222 --> 01:23:19,055 +The Phocians you posted there +were scattered without a fight. + +735 +01:23:19,225 --> 01:23:24,458 +- This battle is over, Leonidas. +- This battle is over when I say it is over. + +736 +01:23:24,630 --> 01:23:28,999 +By morning, the Immortals will surround us. +The Hot Gates will fall. + +737 +01:23:29,635 --> 01:23:34,004 +Spartans! Prepare for glory! + +738 +01:23:34,173 --> 01:23:37,370 +Glory? Have you gone mad? + +739 +01:23:37,543 --> 01:23:39,101 +There is no glory to be had now. + +740 +01:23:39,712 --> 01:23:43,307 +Only retreat or surrender. Or death. + +741 +01:23:43,483 --> 01:23:46,646 +Well, that's an easy choice +for us, Arcadian. + +742 +01:23:46,819 --> 01:23:52,314 +Spartans never retreat. +Spartans never surrender. + +743 +01:23:52,925 --> 01:23:55,018 +Go spread the word. + +744 +01:23:55,261 --> 01:23:58,924 +Let every Greek assembled +know the truth of this. + +745 +01:23:59,098 --> 01:24:01,931 +Let each among them +search his own soul. + +746 +01:24:03,636 --> 01:24:07,766 +And while you're at it, search your own. + +747 +01:24:15,281 --> 01:24:17,545 +My men will leave with me. + +748 +01:24:22,889 --> 01:24:25,119 +Godspeed, Leonidas. + +749 +01:24:31,430 --> 01:24:33,022 +Children! + +750 +01:24:34,000 --> 01:24:35,331 +Children. + +751 +01:24:36,369 --> 01:24:38,360 +Gather round. + +752 +01:24:40,239 --> 01:24:43,504 +No retreat, no surrender. + +753 +01:24:43,676 --> 01:24:47,544 +That is Spartan law. + +754 +01:24:47,780 --> 01:24:52,843 +And by Spartan law, +we will stand and fight... + +755 +01:24:53,019 --> 01:24:55,010 +...and die. + +756 +01:24:58,457 --> 01:25:01,949 +A new age has begun. + +757 +01:25:03,696 --> 01:25:06,824 +An age of freedom. + +758 +01:25:07,900 --> 01:25:11,563 +And all will know that 300 Spartans... + +759 +01:25:11,737 --> 01:25:15,002 +...gave their last breath to defend it. + +760 +01:25:35,294 --> 01:25:37,057 +My friend. + +761 +01:25:40,600 --> 01:25:46,163 +I have lived my entire life +without regret until now. + +762 +01:25:49,542 --> 01:25:55,481 +It's not that my son +gave up his life for his country. + +763 +01:25:57,383 --> 01:26:01,251 +It's just that I never told him +that I loved him the most. + +764 +01:26:02,855 --> 01:26:05,722 +That he stood by me with honor. + +765 +01:26:07,159 --> 01:26:10,094 +That he was all that was best in me. + +766 +01:26:19,205 --> 01:26:21,730 +My heart is broken for your loss. + +767 +01:26:22,475 --> 01:26:24,170 +Heart? + +768 +01:26:29,248 --> 01:26:32,342 +I have filled my heart... + +769 +01:26:32,518 --> 01:26:34,247 +...with hate. + +770 +01:26:38,391 --> 01:26:40,052 +Good. + +771 +01:26:49,201 --> 01:26:51,032 +Dilios... + +772 +01:26:52,738 --> 01:26:54,865 +...let's take a walk. + +773 +01:26:56,342 --> 01:26:58,401 +Yes, my lord. + +774 +01:27:00,813 --> 01:27:03,475 +But, sire, I am fit and ready for battle. + +775 +01:27:03,649 --> 01:27:06,777 +That you are, one of the finest. + +776 +01:27:07,086 --> 01:27:10,681 +But you have another talent +unlike any other Spartan. + +777 +01:27:13,392 --> 01:27:16,828 +You will deliver my final orders +to the council... + +778 +01:27:16,996 --> 01:27:19,487 +...with force and verve. + +779 +01:27:22,001 --> 01:27:24,265 +Tell them our story. + +780 +01:27:24,437 --> 01:27:28,965 +Make every Greek know +what happened here. + +781 +01:27:29,809 --> 01:27:32,437 +You'll have a grand tale to tell. + +782 +01:27:34,246 --> 01:27:35,941 +A tale of victory. + +783 +01:27:36,615 --> 01:27:38,173 +Victory. + +784 +01:27:42,221 --> 01:27:44,212 +Yes, my lord. + +785 +01:27:49,895 --> 01:27:52,261 +Sire, any message...? + +786 +01:27:55,134 --> 01:27:56,499 +For the queen? + +787 +01:28:18,958 --> 01:28:21,392 +None that need be spoken. + +788 +01:28:36,509 --> 01:28:38,909 +Hundreds leave. + +789 +01:28:39,545 --> 01:28:41,979 +A handful stay. + +790 +01:28:47,153 --> 01:28:49,781 +Only one looks back. + +791 +01:29:00,099 --> 01:29:02,294 +Spartans! + +792 +01:29:03,369 --> 01:29:06,532 +Ready your breakfast and eat hearty... + +793 +01:29:06,705 --> 01:29:10,641 +...for tonight we dine in hell! + +794 +01:29:19,518 --> 01:29:22,180 +May I give the floor now... + +795 +01:29:22,354 --> 01:29:26,791 +...to the wife of Leonidas +and queen of Sparta. + +796 +01:29:38,504 --> 01:29:40,233 +- What's this? +- This is nothing. + +797 +01:29:40,406 --> 01:29:42,237 +Councilmen... + +798 +01:29:42,408 --> 01:29:46,174 +...I stand before you +not only as your queen. + +799 +01:29:47,046 --> 01:29:49,776 +I come to you as a mother. + +800 +01:29:51,050 --> 01:29:53,450 +I come to you as a wife. + +801 +01:29:55,254 --> 01:29:57,779 +I come to you as a Spartan woman. + +802 +01:30:02,795 --> 01:30:05,889 +I come to you with great humility. + +803 +01:30:09,335 --> 01:30:11,735 +I am not here to represent Leonidas. + +804 +01:30:11,904 --> 01:30:14,668 +His actions speak louder +than my words ever could. + +805 +01:30:15,007 --> 01:30:17,407 +I am here for all those voices +which cannot be heard. + +806 +01:30:17,576 --> 01:30:20,101 +Mothers, daughters, fathers, sons. + +807 +01:30:20,279 --> 01:30:23,248 +Three hundred families +that bleed for our rights... + +808 +01:30:23,682 --> 01:30:26,879 +...and for the very principles +this room was built upon. + +809 +01:30:27,486 --> 01:30:29,579 +We are at war, gentlemen. + +810 +01:30:30,022 --> 01:30:32,547 +We must send the entire Spartan army +to aid our king... + +811 +01:30:32,725 --> 01:30:35,819 +...in the preservation of not +just ourselves, but of our children. + +812 +01:30:36,395 --> 01:30:39,523 +Send the army +for the preservation of liberty. + +813 +01:30:39,698 --> 01:30:42,030 +Send it for justice. + +814 +01:30:42,201 --> 01:30:43,828 +Send it for law and order. + +815 +01:30:44,370 --> 01:30:46,565 +Send it for reason. + +816 +01:30:46,739 --> 01:30:50,835 +But most importantly, +send our army for hope. + +817 +01:30:51,010 --> 01:30:54,571 +Hope that a king and his men have not +been wasted to the pages of history. + +818 +01:30:55,414 --> 01:30:58,850 +That their courage bonds us together. + +819 +01:30:59,151 --> 01:31:02,348 +That we are made stronger +by their actions... + +820 +01:31:03,355 --> 01:31:07,451 +...and that your choices today +reflect their bravery. + +821 +01:31:09,395 --> 01:31:11,056 +Three hundred. + +822 +01:31:13,399 --> 01:31:15,230 +We must send them. + +823 +01:31:19,004 --> 01:31:20,835 +Moving... + +824 +01:31:21,173 --> 01:31:24,074 +...eloquent, passionate. + +825 +01:31:24,476 --> 01:31:28,640 +But it doesn't change the fact +that your husband has brought war upon us. + +826 +01:31:28,814 --> 01:31:31,248 +You are wrong. +Xerxes brought it forth... + +827 +01:31:31,417 --> 01:31:33,885 +...and before that, +his father Darius at Marathon. + +828 +01:31:34,053 --> 01:31:35,782 +The Persians will not stop... + +829 +01:31:35,955 --> 01:31:39,322 +...until the only shelter we will find +is rubble and chaos. + +830 +01:31:39,725 --> 01:31:43,456 +This chamber needs no +history lesson, my queen. + +831 +01:31:43,963 --> 01:31:46,158 +Then what is the lesson +you would like to leave? + +832 +01:31:46,332 --> 01:31:48,425 +Shall I begin to enumerate all of them? + +833 +01:31:48,834 --> 01:31:52,270 +Honor. Duty. Glory. + +834 +01:31:52,538 --> 01:31:57,566 +You speak of honor, duty and glory? + +835 +01:31:58,877 --> 01:32:00,105 +But what of adultery? + +836 +01:32:00,279 --> 01:32:02,747 +- How dare you. +- How dare I? + +837 +01:32:03,182 --> 01:32:06,174 +Watch her carefully. + +838 +01:32:06,352 --> 01:32:09,321 +She is a trickster in true form. + +839 +01:32:09,488 --> 01:32:12,651 +Do not play with the members +of this sacred chamber, my queen. + +840 +01:32:12,825 --> 01:32:15,919 +Just hours ago, +you offered yourself to me. + +841 +01:32:16,095 --> 01:32:20,532 +Were I a weaker man, +I would have her scent on me still. + +842 +01:32:20,699 --> 01:32:23,691 +- This is outrage. +- Oh, the hypocrite speaks! + +843 +01:32:23,869 --> 01:32:26,861 +Did you not receive a similar payment, +which you took... + +844 +01:32:27,039 --> 01:32:30,270 +...in exchange for her having an audience +with these noble men? + +845 +01:32:30,442 --> 01:32:32,205 +- That is a lie. +- Is it? + +846 +01:32:32,378 --> 01:32:36,144 +Was he not, by your invitation, +asked to come to the king's bedchamber? + +847 +01:32:36,682 --> 01:32:41,312 +The very bed where you attempted +to negotiate with me so vigorously? + +848 +01:32:43,956 --> 01:32:47,414 +You look shocked. +A bribe of the flesh, gentlemen... + +849 +01:32:47,593 --> 01:32:50,892 +...while her husband +promotes anarchy and war. + +850 +01:32:53,832 --> 01:32:55,026 +He speaks truth. + +851 +01:32:55,634 --> 01:32:58,831 +Words escape +even the most cunning tongue... + +852 +01:32:59,004 --> 01:33:01,063 +...my little whore queen. + +853 +01:33:05,811 --> 01:33:07,642 +What queen-like behavior. + +854 +01:33:09,348 --> 01:33:12,476 +Remove her from this chamber +before she infects us further... + +855 +01:33:12,651 --> 01:33:15,643 +...with her inglorious and shabby self. + +856 +01:33:22,461 --> 01:33:24,053 +This will not be over quickly. + +857 +01:33:25,397 --> 01:33:28,924 +You will not enjoy this. +I am not your queen. + +858 +01:33:51,090 --> 01:33:53,024 +Traitor. + +859 +01:33:53,559 --> 01:33:58,360 +Traitor! Traitor! Traitor! + +860 +01:33:58,630 --> 01:34:00,894 +Traitor! + +861 +01:34:37,936 --> 01:34:43,932 +Leonidas, my compliments +and congratulations. + +862 +01:34:44,109 --> 01:34:47,772 +You surely have turned calamity +into victory. + +863 +01:34:47,946 --> 01:34:50,938 +Despite your insufferable arrogance... + +864 +01:34:51,116 --> 01:34:55,280 +...the god-king has come to admire +Spartan valor and fighting skill. + +865 +01:34:56,021 --> 01:34:57,386 +You will make a mighty ally. + +866 +01:34:57,556 --> 01:34:59,285 +Yield, Leonidas. + +867 +01:35:00,459 --> 01:35:03,326 +Use your reason. Think of your men. + +868 +01:35:06,165 --> 01:35:07,792 +I beg you. + +869 +01:35:08,367 --> 01:35:10,335 +Listen to your fellow Greek. + +870 +01:35:10,502 --> 01:35:14,199 +He can attest +to the divine one's generosity. + +871 +01:35:14,373 --> 01:35:18,833 +Despite your several insults, +despite your horrid blasphemies... + +872 +01:35:19,745 --> 01:35:22,942 +...the lord of hosts +is prepared to forgive all... + +873 +01:35:23,182 --> 01:35:26,208 +...and more, to reward your service. + +874 +01:35:26,485 --> 01:35:27,816 +You fight for your lands. + +875 +01:35:28,520 --> 01:35:30,351 +Keep them. + +876 +01:35:31,056 --> 01:35:33,024 +You fight for Sparta. + +877 +01:35:33,192 --> 01:35:37,185 +She will be wealthier and more powerful +than ever before. + +878 +01:35:37,396 --> 01:35:39,330 +You fight for your kingship. + +879 +01:35:40,232 --> 01:35:43,201 +You will be proclaimed warlord +of all Greece... + +880 +01:35:43,368 --> 01:35:47,668 +...answerable only +to the one true master of the world. + +881 +01:35:48,040 --> 01:35:52,773 +Leonidas, your victory will be complete... + +882 +01:35:52,945 --> 01:35:55,539 +...if you but lay down your arms... + +883 +01:35:55,714 --> 01:35:58,877 +...and kneel to holy Xerxes. + +884 +01:36:29,381 --> 01:36:34,318 +It's been more than 30 years +since the wolf in the winter cold. + +885 +01:36:34,486 --> 01:36:39,048 +And now, as then, +it's not fear that grips him... + +886 +01:36:39,224 --> 01:36:44,389 +...only restlessness. +A heightened sense of things. + +887 +01:36:45,163 --> 01:36:49,964 +The seaborne breeze coolly kissing +the sweat at his chest and neck. + +888 +01:36:50,135 --> 01:36:51,625 +Gulls cawing... + +889 +01:36:51,803 --> 01:36:56,035 +...complaining even as they feast +on the thousands of floating dead. + +890 +01:36:57,643 --> 01:37:02,706 +The steady breathing +of the 300 at his back... + +891 +01:37:03,482 --> 01:37:06,940 +...ready to die for him +without a moment's pause. + +892 +01:37:09,554 --> 01:37:10,919 +Every one of them... + +893 +01:37:12,391 --> 01:37:14,325 +...ready to die. + +894 +01:37:29,841 --> 01:37:32,776 +His helmet is stifling. + +895 +01:37:53,465 --> 01:37:56,298 +His shield is heavy. + +896 +01:38:03,909 --> 01:38:05,274 +Your spear. + +897 +01:38:14,086 --> 01:38:15,519 +You there... + +898 +01:38:15,954 --> 01:38:17,945 +...Ephialtes. + +899 +01:38:23,061 --> 01:38:25,325 +May you live forever. + +900 +01:38:32,738 --> 01:38:35,036 +Leonidas, your spear. + +901 +01:39:42,274 --> 01:39:43,866 +Stelios! + +902 +01:39:53,885 --> 01:39:55,477 +Slaughter them! + +903 +01:39:58,857 --> 01:40:00,449 +His helmet was stifling. + +904 +01:40:00,625 --> 01:40:03,753 +It narrowed his vision, +and he must see far. + +905 +01:40:05,063 --> 01:40:08,931 +His shield was heavy. +It threw him off balance... + +906 +01:40:09,100 --> 01:40:12,763 +...and his target is far away. + +907 +01:41:17,335 --> 01:41:21,897 +The old ones say we Spartans are +descended from Hercules himself. + +908 +01:41:23,375 --> 01:41:27,709 +Bold Leonidas gives testament +to our bloodline. + +909 +01:41:27,879 --> 01:41:32,009 +His roar is long and loud. + +910 +01:42:02,113 --> 01:42:03,705 +My king. + +911 +01:42:15,961 --> 01:42:19,590 +It's an honor to die at your side. + +912 +01:42:21,166 --> 01:42:25,660 +It's an honor to have lived at yours. + +913 +01:42:46,591 --> 01:42:48,684 +My queen! + +914 +01:42:56,935 --> 01:42:58,664 +My wife. + +915 +01:43:10,115 --> 01:43:11,912 +My love. + +916 +01:45:38,329 --> 01:45:40,456 +"Remember us." + +917 +01:45:42,133 --> 01:45:45,569 +As simple an order +as a king can give. + +918 +01:45:47,138 --> 01:45:50,335 +"Remember why we died." + +919 +01:45:52,343 --> 01:45:56,370 +For he did not wish tribute or song... + +920 +01:45:58,216 --> 01:46:02,414 +...nor monuments, +nor poems of war and valor. + +921 +01:46:05,290 --> 01:46:07,588 +His wish was simple. + +922 +01:46:12,964 --> 01:46:15,023 +"Remember us"... + +923 +01:46:16,067 --> 01:46:17,796 +...he said to me. + +924 +01:46:19,470 --> 01:46:21,665 +That was his hope. + +925 +01:46:21,873 --> 01:46:25,604 +Should any free soul +come across that place... + +926 +01:46:26,377 --> 01:46:29,710 +...in all the countless +centuries yet to be... + +927 +01:46:30,148 --> 01:46:32,708 +...may all our voices... + +928 +01:46:32,884 --> 01:46:36,945 +...whisper to you +from the ageless stones. + +929 +01:46:37,922 --> 01:46:41,551 +Go tell the Spartans, passerby... + +930 +01:46:41,893 --> 01:46:47,763 +...that here, by Spartan law, +we lie. + +931 +01:46:50,535 --> 01:46:53,231 +And so my king died... + +932 +01:46:54,105 --> 01:46:56,733 +...and my brothers died... + +933 +01:46:59,110 --> 01:47:01,578 +...barely a year ago. + +934 +01:47:05,516 --> 01:47:10,749 +Long I pondered my king's +cryptic talk of victory. + +935 +01:47:10,989 --> 01:47:13,617 +Time has proven him wise. + +936 +01:47:14,525 --> 01:47:17,551 +For from free Greek to free Greek... + +937 +01:47:17,729 --> 01:47:22,325 +...the word was spread +that bold Leonidas and his 300... + +938 +01:47:22,500 --> 01:47:24,491 +...so far from home... + +939 +01:47:24,669 --> 01:47:28,070 +...laid down their lives +not just for Sparta... + +940 +01:47:28,239 --> 01:47:32,039 +...but for all Greece +and the promise this country holds. + +941 +01:47:32,944 --> 01:47:38,007 +Now, here on this rugged patch of earth +called Plataea... + +942 +01:47:38,182 --> 01:47:43,176 +...Xerxes' hordes face obliteration! + +943 +01:47:44,856 --> 01:47:48,257 +Just there the barbarians huddle... + +944 +01:47:48,426 --> 01:47:53,295 +...sheer terror gripping tight +their hearts... + +945 +01:47:53,464 --> 01:47:55,364 +...with icy fingers... + +946 +01:47:55,533 --> 01:47:58,764 +...knowing full well +what merciless horrors they suffered... + +947 +01:47:58,937 --> 01:48:01,462 +...at the swords and spears of 300. + +948 +01:48:02,874 --> 01:48:08,437 +Yet they stare now across the plain +at 10,000 Spartans... + +949 +01:48:08,613 --> 01:48:11,912 +...commanding 30,000 free Greeks! + +950 +01:48:18,723 --> 01:48:22,625 +The enemy outnumber us +a paltry three to one. + +951 +01:48:22,927 --> 01:48:24,918 +Good odds for any Greek. + +952 +01:48:25,630 --> 01:48:30,329 +This day, we rescue a world +from mysticism and tyranny... + +953 +01:48:30,501 --> 01:48:34,870 +...and usher in a future +brighter than anything we can imagine. + +954 +01:48:39,310 --> 01:48:40,800 +Give thanks, men... + +955 +01:48:41,512 --> 01:48:45,278 +...to Leonidas and the brave 300!. + +956 +01:48:45,450 --> 01:48:48,180 +To Victory! + +957 +01:56:27,577 --> 01:56:29,568 +[ENGLISH] + diff --git a/src/itc/player-display/tct-player-display-native.c b/src/itc/player-display/tct-player-display-native.c new file mode 100755 index 000000000..7d235fa7c --- /dev/null +++ b/src/itc/player-display/tct-player-display-native.c @@ -0,0 +1,139 @@ +// +// Copyright (c) 2021 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#include "tct_common.h" + +#ifdef MOBILE //Starts MOBILE +#include "tct-player-display-native_mobile.h" +#endif //MOBILE //End MOBILE + +#ifdef WEARABLE //Starts WEARABLE +#include "tct-player-display-native_wearable.h" +#endif //WEARABLE //End WEARABLE + +#ifdef TIZENIOT //Starts TIZENIOT +#include "tct-player-display-native_tizeniot.h" +#endif //TIZENIOT //End TIZENIOT + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#include + +typedef struct appdata { + Evas_Object *win; + Evas_Object *conform; + Evas_Object *label; +} appdata_s; + +static bool app_create(void *data) +{ + return true; +} + +static void app_control(app_control_h app_control, void *data) +{ + char* pszGetTCName = NULL; + int i=0, result=0, nRet=0; + nRet = app_control_get_extra_data(app_control, "testcase_name", &pszGetTCName); + if(nRet != APP_CONTROL_ERROR_NONE) + { + dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] app_control_get_extra_data returns error = %d", __FUNCTION__, __LINE__, nRet); + PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to fetch test case name: app_control_get_extra_data API call fails\\n", __FILE__, __LINE__); + PRINT_TC_RESULT("%d",1); + FREE_MEMORY_TC(pszGetTCName); + return; + } + + dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Executing TC Name = %s", __FUNCTION__, __LINE__, pszGetTCName); + for ( i = 0; tc_array[i].name; i++ ) + { + if ( 0 == strncmp(pszGetTCName, tc_array[i].name, strlen(pszGetTCName)) ) + { + if ( tc_array[i].startup ) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Start up", pszGetTCName); + tc_array[i].startup(); + } + + dlog_print(DLOG_INFO, "NativeTCT", "%s : Body", pszGetTCName); + result = tc_array[i].function(); + dlog_print(DLOG_INFO, "NativeTCT", "%s returns value = %d", pszGetTCName, result); + + if ( tc_array[i].cleanup ) + { + dlog_print(DLOG_INFO, "NativeTCT", "%s : Clean up", pszGetTCName); + tc_array[i].cleanup(); + } + + PRINT_TC_RESULT("%d",result); + FREE_MEMORY_TC(pszGetTCName); + return; + } + } + + dlog_print(DLOG_ERROR, "NativeTCT", "[%s:%d] Unable to execute %s : Unknown Test Case Name", __FUNCTION__, __LINE__, pszGetTCName); + PRINT_UTC_LOG("\\n[%s][Line : %d]Unable to execute %s : Unknown Test Case Name\\n", __FILE__, __LINE__, pszGetTCName); + PRINT_TC_RESULT("%d",1); + FREE_MEMORY_TC(pszGetTCName); + return; +} + +static void app_terminate(void *data) +{ + dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is now Terminating", __FUNCTION__, __LINE__); +} + +int main(int argc, char *argv[]) +{ + int ret = 0; + appdata_s ad = {0,}; + + ui_app_lifecycle_callback_s event_callback = {0,}; + event_callback.create = app_create; + event_callback.terminate = app_terminate; + event_callback.app_control = app_control; + + //setting gcda file location for coverage + setenv("GCOV_PREFIX","/tmp",1); + dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Coverage *.gcda File location set to /tmp/home/abuild/rpmbuild/BUILD/ ", __FUNCTION__, __LINE__); + + dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Main Function is Invoked", __FUNCTION__, __LINE__); + ret = ui_app_main(argc, argv, &event_callback, &ad); + if (ret != APP_ERROR_NONE) + { + dlog_print(DLOG_ERROR, "NativeTCT", "Application ui_app_main call gets failed. err = %d", ret); + PRINT_UTC_LOG("\\n[%s][Line : %d]Application ui_app_main call gets failed. err = %d\\n", __FILE__, __LINE__, ret); + PRINT_TC_RESULT("%d",1); + return ret; + } + + dlog_print(DLOG_INFO, "NativeTCT", "[%s:%d] Application Package is Terminated", __FUNCTION__, __LINE__); + return ret; +} diff --git a/src/itc/player-display/tct-player-display-native_mobile.h b/src/itc/player-display/tct-player-display-native_mobile.h new file mode 100755 index 000000000..4cebaf340 --- /dev/null +++ b/src/itc/player-display/tct-player-display-native_mobile.h @@ -0,0 +1,68 @@ +// +// Copyright (c) 2021 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef __TCT_PLAYER_DISPLAY_NATIVE_H__ +#define __TCT_PLAYER_DISPLAY_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_player_display_startup(void); +extern void ITs_player_display_cleanup(void); +extern void ITs_player_360_startup(void); +extern void ITs_player_360_cleanup(void); + +extern int ITc_player_set_get_video_roi_area_p(void); +extern int ITc_player_set_get_display_rotation_p(void); +extern int ITc_player_set_display_visible_p(void); +extern int ITc_player_set_get_display_mode_p(void); +extern int ITc_player_is_display_visible_p(void); +extern int ITc_player_set_display_roi_area_p(void); +extern int ITc_player_set_audio_only_p(void); +extern int ITc_player_is_audio_only_p(void); +extern int ITc_player_get_video_size_p(void); +extern int ITc_player_get_video_stream_info_p(void); +extern int ITc_player_capture_video_p(void); +extern int ITc_player_set_unset_video_stream_changed_cb_p(void); +extern int ITc_media_player_360_is_content_spherical_p(void); +extern int ITc_player_360_is_set_enabled_p(void); +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); + +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_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}, + {"ITc_player_is_display_visible_p",ITc_player_is_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_display_roi_area_p",ITc_player_set_display_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_audio_only_p",ITc_player_set_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_is_audio_only_p",ITc_player_is_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_get_video_size_p",ITc_player_get_video_size_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_get_video_stream_info_p",ITc_player_get_video_stream_info_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_capture_video_p",ITc_player_capture_video_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_unset_video_stream_changed_cb_p",ITc_player_set_unset_video_stream_changed_cb_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_media_player_360_is_content_spherical_p",ITc_media_player_360_is_content_spherical_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_is_set_enabled_p",ITc_player_360_is_set_enabled_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_direction_of_view_p",ITc_player_360_set_get_direction_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_zoom_p",ITc_player_360_set_get_zoom_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_field_of_view",ITc_player_360_set_get_field_of_view,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_zoom_with_field_of_view_p",ITc_player_360_set_zoom_with_field_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {NULL, NULL} +}; + +#endif // __TCT_PLAYER_DISPLAY_NATIVE_H__ diff --git a/src/itc/player-display/tct-player-display-native_tizeniot.h b/src/itc/player-display/tct-player-display-native_tizeniot.h new file mode 100755 index 000000000..4cebaf340 --- /dev/null +++ b/src/itc/player-display/tct-player-display-native_tizeniot.h @@ -0,0 +1,68 @@ +// +// Copyright (c) 2021 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef __TCT_PLAYER_DISPLAY_NATIVE_H__ +#define __TCT_PLAYER_DISPLAY_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_player_display_startup(void); +extern void ITs_player_display_cleanup(void); +extern void ITs_player_360_startup(void); +extern void ITs_player_360_cleanup(void); + +extern int ITc_player_set_get_video_roi_area_p(void); +extern int ITc_player_set_get_display_rotation_p(void); +extern int ITc_player_set_display_visible_p(void); +extern int ITc_player_set_get_display_mode_p(void); +extern int ITc_player_is_display_visible_p(void); +extern int ITc_player_set_display_roi_area_p(void); +extern int ITc_player_set_audio_only_p(void); +extern int ITc_player_is_audio_only_p(void); +extern int ITc_player_get_video_size_p(void); +extern int ITc_player_get_video_stream_info_p(void); +extern int ITc_player_capture_video_p(void); +extern int ITc_player_set_unset_video_stream_changed_cb_p(void); +extern int ITc_media_player_360_is_content_spherical_p(void); +extern int ITc_player_360_is_set_enabled_p(void); +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); + +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_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}, + {"ITc_player_is_display_visible_p",ITc_player_is_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_display_roi_area_p",ITc_player_set_display_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_audio_only_p",ITc_player_set_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_is_audio_only_p",ITc_player_is_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_get_video_size_p",ITc_player_get_video_size_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_get_video_stream_info_p",ITc_player_get_video_stream_info_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_capture_video_p",ITc_player_capture_video_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_unset_video_stream_changed_cb_p",ITc_player_set_unset_video_stream_changed_cb_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_media_player_360_is_content_spherical_p",ITc_media_player_360_is_content_spherical_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_is_set_enabled_p",ITc_player_360_is_set_enabled_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_direction_of_view_p",ITc_player_360_set_get_direction_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_zoom_p",ITc_player_360_set_get_zoom_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_field_of_view",ITc_player_360_set_get_field_of_view,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_zoom_with_field_of_view_p",ITc_player_360_set_zoom_with_field_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {NULL, NULL} +}; + +#endif // __TCT_PLAYER_DISPLAY_NATIVE_H__ diff --git a/src/itc/player-display/tct-player-display-native_wearable.h b/src/itc/player-display/tct-player-display-native_wearable.h new file mode 100755 index 000000000..4cebaf340 --- /dev/null +++ b/src/itc/player-display/tct-player-display-native_wearable.h @@ -0,0 +1,68 @@ +// +// Copyright (c) 2021 Samsung Electronics Co., Ltd. +// +// Licensed under the Apache License, Version 2.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +#ifndef __TCT_PLAYER_DISPLAY_NATIVE_H__ +#define __TCT_PLAYER_DISPLAY_NATIVE_H__ + +#include "testcase.h" +#include "tct_common.h" + +extern void ITs_player_display_startup(void); +extern void ITs_player_display_cleanup(void); +extern void ITs_player_360_startup(void); +extern void ITs_player_360_cleanup(void); + +extern int ITc_player_set_get_video_roi_area_p(void); +extern int ITc_player_set_get_display_rotation_p(void); +extern int ITc_player_set_display_visible_p(void); +extern int ITc_player_set_get_display_mode_p(void); +extern int ITc_player_is_display_visible_p(void); +extern int ITc_player_set_display_roi_area_p(void); +extern int ITc_player_set_audio_only_p(void); +extern int ITc_player_is_audio_only_p(void); +extern int ITc_player_get_video_size_p(void); +extern int ITc_player_get_video_stream_info_p(void); +extern int ITc_player_capture_video_p(void); +extern int ITc_player_set_unset_video_stream_changed_cb_p(void); +extern int ITc_media_player_360_is_content_spherical_p(void); +extern int ITc_player_360_is_set_enabled_p(void); +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); + +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_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}, + {"ITc_player_is_display_visible_p",ITc_player_is_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_display_roi_area_p",ITc_player_set_display_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_audio_only_p",ITc_player_set_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_is_audio_only_p",ITc_player_is_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_get_video_size_p",ITc_player_get_video_size_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_get_video_stream_info_p",ITc_player_get_video_stream_info_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_capture_video_p",ITc_player_capture_video_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_player_set_unset_video_stream_changed_cb_p",ITc_player_set_unset_video_stream_changed_cb_p,ITs_player_display_startup,ITs_player_display_cleanup}, + {"ITc_media_player_360_is_content_spherical_p",ITc_media_player_360_is_content_spherical_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_is_set_enabled_p",ITc_player_360_is_set_enabled_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_direction_of_view_p",ITc_player_360_set_get_direction_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_zoom_p",ITc_player_360_set_get_zoom_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_get_field_of_view",ITc_player_360_set_get_field_of_view,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_player_360_set_zoom_with_field_of_view_p",ITc_player_360_set_zoom_with_field_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {NULL, NULL} +}; + +#endif // __TCT_PLAYER_DISPLAY_NATIVE_H__ diff --git a/src/itc/player-display/test.h264 b/src/itc/player-display/test.h264 new file mode 100644 index 000000000..83016b9c1 Binary files /dev/null and b/src/itc/player-display/test.h264 differ diff --git a/src/itc/player-display/test_360.mp4 b/src/itc/player-display/test_360.mp4 new file mode 100644 index 000000000..294fe3270 Binary files /dev/null and b/src/itc/player-display/test_360.mp4 differ diff --git a/src/itc/player-display/test_drc.ts b/src/itc/player-display/test_drc.ts new file mode 100644 index 000000000..633dd3293 Binary files /dev/null and b/src/itc/player-display/test_drc.ts differ diff --git a/src/itc/player-display/v.mp4 b/src/itc/player-display/v.mp4 new file mode 100644 index 000000000..84ba7defc Binary files /dev/null and b/src/itc/player-display/v.mp4 differ diff --git a/src/itc/player/CMakeLists.txt b/src/itc/player/CMakeLists.txt index 907a8e748..14ca7c003 100755 --- a/src/itc/player/CMakeLists.txt +++ b/src/itc/player/CMakeLists.txt @@ -5,36 +5,15 @@ SET(RPM_NAME "native-${PKG_NAME}-itc") SET(CAPI_LIB "capi-media-player") -IF(DEFINED TIZENIOT) SET(TC_SOURCES ITs-player-common.c ITs-player.c ITs-player-audio-effect.c ITs-player-stream-info.c -) -ENDIF() -IF( DEFINED MOBILE ) -SET(TC_SOURCES - ITs-player-common.c - ITs-player-display.c ITs-player-subtitle.c - ITs-player-audio-effect.c - ITs-player-stream-info.c ITs-player.c ITs-player-360.c ) -ENDIF() -IF( DEFINED WEARABLE ) -SET(TC_SOURCES - ITs-player-common.c - ITs-player-display.c - ITs-player-subtitle.c - ITs-player-audio-effect.c - ITs-player-stream-info.c - ITs-player.c - ITs-player-360.c -) -ENDIF() IF(DEFINED TIZENIOT) PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED diff --git a/src/itc/player/ITs-player-360.c b/src/itc/player/ITs-player-360.c deleted file mode 100755 index 44d4db76b..000000000 --- a/src/itc/player/ITs-player-360.c +++ /dev/null @@ -1,403 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "ITs-player-common.h" - -/** @addtogroup itc-player -* @ingroup itc -* @{ -*/ -//& set: Player -bool g_bPlayerCreation; - -/** -* @function ITs_player_360_startup -* @description Called before each test, created player handle -* @parameter NA -* @return NA -*/ -void ITs_player_360_startup(void) -{ - g_bIsSupported = false; - ecore_main_loop_glib_integrate(); - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - int ret = remove(ERR_LOG); - if(ret == -1) - { - FPRINTF("[Line: %d][%s] unlinking file name error =%s \\n", __LINE__, API_NAMESPACE,ERR_LOG); - return; - } - } -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_player_360_startup\\n", __LINE__, API_NAMESPACE); -#endif - - CreateEvasWindow(); - if ( g_pEvasObject == NULL ) - { - FPRINTF("[Line : %d][%s] Evas window object is not created, failed in Precondition\\n", __LINE__, API_NAMESPACE); - g_bPlayerCreation = false; - return; - } - - int nRet = player_create(&g_player); - if ( nRet != PLAYER_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] Unable to create player, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - g_bPlayerCreation = false; - } - else - { - FPRINTF("[Line : %d][%s] Player created successfully\\n",__LINE__, API_NAMESPACE); - g_bPlayerCreation = true; - } - - if(TCTCheckSystemInfoFeatureSupported(OPENGL_FEATURE, API_NAMESPACE) && TCTCheckSystemInfoFeatureSupported(SPHERICAL_VIDEO_FEATURE, API_NAMESPACE)) - { - g_bIsSupported = true; - } - else - { - FPRINTF("[Line : %d][%s] SPHERICAL and OPENGL feature not supported \\n", __LINE__, API_NAMESPACE); - g_bIsSupported = false; - } - return; -} - -/** -* @function ITs_player_360_cleanup -* @description Called after each test, destroys player handle -* @parameter NA -* @return NA -*/ -void ITs_player_360_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_player_360_cleanup\\n", __LINE__, API_NAMESPACE); -#endif - if ( g_bPlayerCreation && g_player ) - { - int nRet = player_destroy (g_player); - if ( nRet != PLAYER_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] player_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - } - g_player = NULL; - } - else - { - FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); - } - if ( g_pEvasObject ) - { - evas_object_del(g_pEvasObject); - g_pEvasObject = NULL; - } - if ( g_pEvasWindow ) - { - evas_object_del(g_pEvasWindow); - g_pEvasWindow = NULL; - } - g_bIsSupported = false; - return; -} -//& purpose: Gets information whether the current content of the player is spherical. -//& type: auto -/** -* @testcase ITc_media_player_360_is_content_spherical_p -* @author SRID(ankit.j) -* @reviewer SRID(nibha.sharma) -* @type auto -* @since_tizen 5.0 -* @description Gets information whether the current content of the player is spherical. -* @scenario Gets information whether the current content of the player is spherical. -* @apicovered player_360_is_content_spherical -* @passcase The value indicating whether the content is spherical returns success -* @failcase The value indicating whether the content is spherical returns negative value -* @precondition The player state must be one of:#PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED -* @postcondition N/A -*/ - -int ITc_media_player_360_is_content_spherical_p(void) -{ - START_TEST; - bool isContentSpherical=false; - int nRet = -1; - player_state_e state; - char pPath[PATH_LEN] = {0}; - - if ( false == PlayerAppendToAppDataPath(MEDIA_360_PATH, pPath)) - { - FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); - return 1; - } - - nRet = player_get_state(g_player,&state); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_IDLE ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_create() call",__LINE__, API_NAMESPACE); - return 1; - } - - 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, GET_DISPLAY(g_pEvasWindow)); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - nRet = player_prepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); - - nRet = player_360_is_content_spherical(g_player, &isContentSpherical); - if ( false == g_bIsSupported ) - { - PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_is_content_spherical", PlayerGetError(nRet)); - return 0; - } - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_is_content_spherical", PlayerGetError(nRet)); - - if(isContentSpherical != true) - { - FPRINTF("[Line : %d][%s] ITc_media_player_360_is_content_spherical_p, failed. It has returned false for spherical 360 media content \\n", __LINE__, API_NAMESPACE); - return 1; - } - - return 0; - -} -/** @addtogroup itc-player-testcases -* @brief Integration testcases for module player -* @ingroup itc-player -* @{ -*/ - -//& purpose: Gets and Sets the 360 video display mode -//& type : auto -/** -* @testcase ITc_player_360_is_set_enabled_p -* @author SRID(manu.tiwari) -* @reviewer SRID(abhishek.j) -* @type auto -* @since_tizen 5.0 -* @description Gets and Sets the 360 video display mode -* @scenario Gets and Sets the 360 video display mode -* @apicovered player_360_set_enabled, player_360_is_enabled -* @passcase When API returns PLAYER_ERROR_NONE -* @failcase When API not returns PLAYER_ERROR_NONE -* @precondition player must be created -* @postcondition player must be destroyed -*/ -int ITc_player_360_is_set_enabled_p(void) -{ - START_TEST; - //isEnabled = false = display with full panorama mode - //isEnabled = true = display with 360 video mode - bool nSetEnabled = false; - bool nIsEnabled = true; //default value - //Target API - int nRet = player_360_set_enabled(g_player, nSetEnabled); - if ( false == g_bIsSupported ) - { - PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_enabled", PlayerGetError(nRet)); - return 0; - } - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_enabled", PlayerGetError(nRet)); - // Target API - nRet = player_360_is_enabled(g_player, &nIsEnabled); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_is_enabled", PlayerGetError(nRet)); - if(nIsEnabled != false) - { - FPRINTF("[Line : %d][%s] video display mode mismatch\\n", __LINE__, API_NAMESPACE); - return 1; - } - return 0; -} -//& purpose: Sets and Gets the 360 video direction of view -//& type : auto -/** -* @testcase ITc_player_360_set_get_direction_of_view_p -* @author SRID(manu.tiwari) -* @reviewer SRID(abhishek.j) -* @type auto -* @since_tizen 5.0 -* @description Sets and Gets the 360 video direction of view -* @scenario Sets and Gets the 360 video direction of view -* @apicovered player_360_set_direction_of_view, player_360_get_direction_of_view -* @passcase When API returns PLAYER_ERROR_NONE -* @failcase When API not returns PLAYER_ERROR_NONE -* @precondition player must be created -* @postcondition player must be destroyed -*/ -int ITc_player_360_set_get_direction_of_view_p(void) -{ - START_TEST; - float nGetYaw = -1.0; - float nSetYaw = 3.14; - float nSetPitch = 1.57; - float nGetPitch = -1.0; - int nRet = player_360_set_direction_of_view(g_player, nSetYaw, nSetPitch); - if ( false == g_bIsSupported ) - { - PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_direction_of_view", PlayerGetError(nRet)); - return 0; - } - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_direction_of_view", PlayerGetError(nRet)); - nRet = player_360_get_direction_of_view(g_player, &nGetYaw, &nGetPitch); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_direction_of_view", PlayerGetError(nRet)); - if (( nSetPitch != nGetPitch ) || ( nSetYaw != nGetYaw )) - { - FPRINTF("[Line : %d][%s] error returned = set get pitch values mismatched, set pitch value = %f, get pitch value = %f, set yaw value = %f, get yaw value = %f\\n", __LINE__, API_NAMESPACE, nSetPitch, nGetPitch, nSetYaw, nGetYaw); - return 1; - } - return 0; -} -//& purpose: Sets and Gets the zoom level of 360 video -//& type : auto -/** -* @testcase ITc_player_360_set_get_zoom_p -* @author SRID(manu.tiwari) -* @reviewer SRID(abhishek.j) -* @type auto -* @since_tizen 5.0 -* @description Sets and Gets the zoom level of 360 video -* @scenario Sets and Gets the zoom level of 360 video -* @apicovered player_360_set_zoom, player_360_get_zoom -* @passcase When API returns PLAYER_ERROR_NONE -* @failcase When API not returns PLAYER_ERROR_NONE -* @precondition player must be created -* @postcondition player must be destroyed -*/ -int ITc_player_360_set_get_zoom_p(void) -{ - START_TEST; - - float nSetZoom = 5.0; - float nGetZoom = 0.0; - int nRet = player_360_set_zoom(g_player, nSetZoom); - if ( false == g_bIsSupported ) - { - PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_zoom", PlayerGetError(nRet)); - return 0; - } - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_zoom", PlayerGetError(nRet)); - nRet = player_360_get_zoom(g_player, &nGetZoom); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_zoom", PlayerGetError(nRet)); - if(nGetZoom != nSetZoom) - { - FPRINTF("[Line : %d][%s] error returned = set get zoom values mismatched, set value = %f, get value = %f\\n", __LINE__, API_NAMESPACE, nSetZoom, nGetZoom); - return 1; - } - return 0; -} -//& purpose: Sets and Gets the field of view information of 360 video -//& type : auto -/** -* @testcase ITc_player_360_set_get_field_of_view -* @author SRID(manu.tiwari) -* @reviewer SRID(abhishek.j) -* @type auto -* @since_tizen 5.0 -* @description Sets and Gets the field of view information of 360 video -* @scenario Sets and Gets the field of view information of 360 video -* @apicovered player_360_set_field_of_view, player_360_get_field_of_view -* @passcase When API returns PLAYER_ERROR_NONE -* @failcase When API not returns PLAYER_ERROR_NONE -* @precondition player must be created -* @postcondition player must be destroyed -*/ -int ITc_player_360_set_get_field_of_view(void) -{ - START_TEST; - int nSethorizontaldegrees = 120; - int nSetverticaldegrees = 67; - int nGethorizontaldegrees = 0; - int nGetverticaldegrees = 0; - int nRet = player_360_set_field_of_view(g_player, nSethorizontaldegrees, nSetverticaldegrees); - if ( false == g_bIsSupported ) - { - PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_field_of_view", PlayerGetError(nRet)); - return 0; - } - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_field_of_view", PlayerGetError(nRet)); - nRet = player_360_get_field_of_view(g_player, &nGethorizontaldegrees, &nGetverticaldegrees); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_field_of_view", PlayerGetError(nRet)); - if (( nSethorizontaldegrees != nGethorizontaldegrees ) || ( nSetverticaldegrees != nGetverticaldegrees )) - { - FPRINTF("[Line : %d][%s] error returned = set get field of view values mismatched, set horizontal degree = %d, get horizontal degree = %d, set vertical degree = %d, get vertical degree = %d\\n", __LINE__, API_NAMESPACE, nSethorizontaldegrees, nGethorizontaldegrees, nSetverticaldegrees, nGetverticaldegrees); - return 1; - } - return 0; -} - -//& purpose: Sets zoom with field of view information of 360 video -//& type : auto -/** -* @testcase ITc_player_360_set_zoom_with_field_of_view_p -* @author SRID(manoj.g2) -* @reviewer SRID(nibha.sharma) -* @type auto -* @since_tizen 5.0 -* @description Sets zoom with field of view information of 360 video -* @scenario Sets zoom with field of view information of 360 video -* @apicovered player_360_set_zoom_with_field_of_view, player_360_get_field_of_view -* @passcase When API returns PLAYER_ERROR_NONE -* @failcase When API not returns PLAYER_ERROR_NONE -* @precondition player must be created -* @postcondition player must be destroyed -*/ -int ITc_player_360_set_zoom_with_field_of_view_p(void) -{ - START_TEST; - int nRet = -1; - int nSethorizontaldegrees = 120; - int nSetverticaldegrees = 90; - int nGetHorizontalDegree = 0; - int nGetVerticalDegree = 0; - float nSetlevel = 3.0; - float nGetlevel = 0.0; - - //Target API - nRet = player_360_set_zoom_with_field_of_view(g_player, nSetlevel, nSethorizontaldegrees, nSetverticaldegrees); - if ( false == g_bIsSupported ) - { - PRINT_RESULT(PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE, nRet, "player_360_set_zoom_with_field_of_view", PlayerGetError(nRet)); - return 0; - } - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_set_zoom_with_field_of_view", PlayerGetError(nRet)); - - nRet = player_360_get_zoom(g_player, &nGetlevel); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_zoom", PlayerGetError(nRet)); - if(nGetlevel != nSetlevel) - { - FPRINTF("[Line : %d][%s] player_360_get_zoom after call is %f ",__LINE__, API_NAMESPACE, nGetlevel); - return 1; - } - - nRet = player_360_get_field_of_view(g_player, &nGetHorizontalDegree, &nGetVerticalDegree); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_360_get_field_of_view", PlayerGetError(nRet)); - if (( nSethorizontaldegrees != nGetHorizontalDegree ) || ( nSetverticaldegrees != nGetVerticalDegree )) - { - FPRINTF("[Line : %d][%s] error returned = set get field of view values mismatched, set horizontal degree = %d, get horizontal degree = %d, set vertical degree = %d, get vertical degree = %d\\n", __LINE__, API_NAMESPACE, nSethorizontaldegrees, nGetHorizontalDegree, nSetverticaldegrees, nGetVerticalDegree); - return 1; - } - return 0; -} -/** @} */ -/** @} */ diff --git a/src/itc/player/ITs-player-audio-effect.c b/src/itc/player/ITs-player-audio-effect.c index 8997106ce..5785b3276 100755 --- a/src/itc/player/ITs-player-audio-effect.c +++ b/src/itc/player/ITs-player-audio-effect.c @@ -31,9 +31,9 @@ bool g_bPlayerCreation; */ void ITs_player_audio_effect_startup(void) { -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_glib_integrate(); -#endif // TIZENIOT +#endif // For Mobile or Wearable struct stat stBuff; if ( stat(ERR_LOG, &stBuff) == 0 ) { @@ -43,7 +43,7 @@ void ITs_player_audio_effect_startup(void) FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); #endif -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable CreateEvasWindow(); if ( g_pEvasObject == NULL ) { @@ -51,7 +51,7 @@ void ITs_player_audio_effect_startup(void) g_bPlayerCreation = false; return; } -#endif //TIZENIOT +#endif //For Mobile or Wearable int nRet = player_create(&g_player); if ( nRet != PLAYER_ERROR_NONE ) @@ -92,7 +92,7 @@ void ITs_player_audio_effect_cleanup(void) FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); } -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable if ( g_pEvasObject ) { evas_object_del(g_pEvasObject); @@ -103,7 +103,7 @@ void ITs_player_audio_effect_cleanup(void) evas_object_del(g_pEvasWindow); g_pEvasWindow = NULL; } -#endif // TIZENIOT +#endif // For Mobile or Wearable return; } diff --git a/src/itc/player/ITs-player-common.c b/src/itc/player/ITs-player-common.c index a77cb4382..470b22f4d 100755 --- a/src/itc/player/ITs-player-common.c +++ b/src/itc/player/ITs-player-common.c @@ -338,7 +338,7 @@ bool InitializePlayerHandler(bool bPrepare, int nMediaType) return true; } -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable /** * @function WinDel * @description Callback function registered by evas_object_smart_callback_add API diff --git a/src/itc/player/ITs-player-common.h b/src/itc/player/ITs-player-common.h index 638849de5..d60685e2b 100755 --- a/src/itc/player/ITs-player-common.h +++ b/src/itc/player/ITs-player-common.h @@ -22,9 +22,9 @@ #include #include -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable #include -#endif // TIZENIOT +#endif // For Mobile or Wearable #include @@ -67,11 +67,11 @@ media_format_h g_hMediaFormat; #endif -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable Evas_Object *g_pEvasWindow; Evas_Object *g_pEvasObject; Evas *g_pEvasCore; -#endif // TIZENIOT +#endif // For Mobile or Wearable FILE *file_src; int g_nRet; @@ -102,10 +102,10 @@ bool InitializePlayerHandler(bool bPrepare, int nMediaType); //Print Player State void PlayerGetState(player_state_e e); -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable void CreateEvasWindow(); void WinDel(void *data, Evas_Object *obj, void *event); -#endif // TIZENIOT +#endif // For Mobile or Wearable char* MediaPacketGetError(int nRet); char* MediaFormatGetError(int nRet); diff --git a/src/itc/player/ITs-player-display.c b/src/itc/player/ITs-player-display.c deleted file mode 100755 index 88a8897c7..000000000 --- a/src/itc/player/ITs-player-display.c +++ /dev/null @@ -1,547 +0,0 @@ -// -// Copyright (c) 2014 Samsung Electronics Co., Ltd. -// -// Licensed under the Apache License, Version 2.0 (the License); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -#include "ITs-player-common.h" - -/** @addtogroup itc-player -* @ingroup itc -* @{ -*/ - -//& set: Player -bool g_bPlayerCreation; -/** -* @function ITs_player_startup_display -* @description Called before each test, created player handle -* @parameter NA -* @return NA -*/ -void ITs_player_display_startup(void) -{ - ecore_main_loop_glib_integrate(); - struct stat stBuff; - if ( stat(ERR_LOG, &stBuff) == 0 ) - { - remove(ERR_LOG); - } -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); -#endif - - CreateEvasWindow(); - if ( g_pEvasObject == NULL ) - { - FPRINTF("[Line : %d][%s] Evas window object is not created, failed in Precondition\\n", __LINE__, API_NAMESPACE); - g_bPlayerCreation = false; - return; - } - - int nRet = player_create(&g_player); - if ( nRet != PLAYER_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] Unable to create player, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - g_bPlayerCreation = false; - } - else - { - FPRINTF("[Line : %d][%s] Player created successfully\\n",__LINE__, API_NAMESPACE); - g_bPlayerCreation = true; - } - return; -} - -/** -* @function ITs_player_cleanup_display -* @description Called after each test, destroys player handle -* @parameter NA -* @return NA -*/ -void ITs_player_display_cleanup(void) -{ -#if DEBUG - FPRINTF("[Line : %d][%s] TEST SUIT clean-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); -#endif - if ( g_bPlayerCreation && g_player ) - { - int nRet = player_destroy (g_player); - if ( nRet != PLAYER_ERROR_NONE ) - { - FPRINTF("[Line : %d][%s] player_destroy failed, error returned = %s\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - } - g_player = NULL; - } - else - { - FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); - } - if ( g_pEvasObject ) - { - evas_object_del(g_pEvasObject); - g_pEvasObject = NULL; - } - if ( g_pEvasWindow ) - { - evas_object_del(g_pEvasWindow); - g_pEvasWindow = NULL; - } - - return; -} - - - -/** @addtogroup itc-player-testcases -* @brief Integration testcases for module player -* @ingroup itc-player -* @{ -*/ - - -//& purpose: Set and get ROI (Region Of Interest) area of the content video source -//& type: auto -/** -* @testcase ITc_player_set_get_video_roi_area_p -* @author SRID(s.rathi) -* @reviewer SRID(nibha.sharma) -* @type auto -* @since_tizen 5.0 -* @description Set and get ROI (Region Of Interest) area of the content video source -* @scenario Create player handle\n -* get player state\n -* unprepare player\n -* set player display\n -* set video ROI\n -* prepare player\n -* get video ROI\n -* check results\n -* destroy the handler -* @apicovered player_set_video_roi_area, player_get_video_roi_area -* @passcase When it set and get video ROI area -* @failcase When it does not set or get video ROI area -* @precondition The player display must be set as PLAYER_DISPLAY_TYPE_OVERLAY -* @postcondition N/A -*/ -int ITc_player_set_get_video_roi_area_p(void) -{ - START_TEST; - - double setX = 0.1, setY = 0.1, setWidth = 0.5, setHeight = 0.5; - double getX = 0.0, getY = 0.0, getWidth = 0.0, getHeight = 0.0; - int nRet = PLAYER_ERROR_NONE; - player_state_e state; - - if ( InitializePlayerHandler(true, 1) != true ) - { - PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); - return 1; - } - 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)); - } - - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow)); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - nRet = player_set_video_roi_area(g_player, setX, setY, setWidth, setHeight); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_video_roi_area", PlayerGetError(nRet)); - - usleep(2000); - - nRet = player_prepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); - - nRet = player_get_video_roi_area(g_player, &getX, &getY, &getWidth, &getHeight); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_video_roi_area", PlayerGetError(nRet), player_unprepare(g_player)); - - if ( (setX != getX) || (setY != getY) || (setWidth != getWidth) || (setHeight != getHeight) ) - { - FPRINTF("[Line : %d][%s] player_set_get_video_roi_area mismatched, error returned = %s", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - player_unprepare(g_player); - return 1; - } - - nRet = player_unprepare(g_player); - PRINT_RESULT_NORETURN(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); - - return 0; -} - - -//& purpose: Set and get rotation of the x surface video display -//& type: auto -/** -* @testcase ITc_player_set_get_display_rotation_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Set and get rotation of the x surface video display -* @scenario Create player handle\n -* set player display\n -* set display rotation\n -* get display rotation\n -* check results\n -* destroy the handler -* @apicovered player_set_display, player_set_display_rotation, player_get_display_rotation -* @passcase When it set and get x11 display rotation -* @failcase When it does not set or get x11 display rotation -* @precondition The player display must be set as PLAYER_DISPLAY_TYPE_OVERLAY -* @postcondition N/A -*/ -int ITc_player_set_get_display_rotation_p(void) -{ - START_TEST; - - player_display_rotation_e rotation; - - int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow)); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - nRet = player_set_display_rotation(g_player, PLAYER_DISPLAY_ROTATION_90); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_rotation", PlayerGetError(nRet)); - - usleep(2000); - - nRet = player_get_display_rotation(g_player, &rotation); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_display_rotation", PlayerGetError(nRet)); - - if ( rotation != PLAYER_DISPLAY_ROTATION_90 ) - { - FPRINTF("[Line : %d][%s] player_set_get_display_rotation mismatched, error returned = %s", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - return 1; - } - - return 0; -} - - -//& purpose: Set x surface video display visible -//& type: auto - -/** -* @testcase ITc_player_set_display_visible_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Set x surface video display visible -* @scenario Create player handle\n -* set player display\n -* set x surface video display visible\n -* destroy the handler -* @apicovered player_set_display, player_set_display_visible, -* @passcase When it can set visibility of the x surface video display -* @failcase When it can not set visibility of the x surface video display -* @precondition N/A -* @postcondition N/A -*/ -int ITc_player_set_display_visible_p(void) -{ - START_TEST; - int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE - - nRet = player_set_display_visible(g_player, true); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_visible", PlayerGetError(nRet)); - - return 0; -} - - -//& purpose: Set and get video display mode -//& type : auto -/** -* @testcase ITc_player_set_get_display_mode_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Set and get video display mode -* @scenario Initialize player handle\n -* set display mode\n -* get display mode\n -* check the result\n -* destroy the handler -* @apicovered player_set_display_mode, player_get_display_mode -* @passcase When it can set and get player position -* @failcase When it can not set or get player position -* @precondition The player state must be one of these: PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED -* @postcondition N/A -*/ -int ITc_player_set_get_display_mode_p(void) -{ - START_TEST; - - player_display_mode_e mode; - - if ( InitializePlayerHandler(true, 0) != true ) - { - PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); - return 1; - } - - int nRet = player_set_display_mode(g_player, PLAYER_DISPLAY_MODE_DST_ROI); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_display_mode", PlayerGetError(nRet), player_unprepare(g_player)); - - usleep(2000); - - nRet = player_get_display_mode(g_player, &mode); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_display_mode", PlayerGetError(nRet), player_unprepare(g_player)); - - if (mode != PLAYER_DISPLAY_MODE_DST_ROI) - { - FPRINTF("[Line : %d][%s] player_set_get_display_mode mismatched, error returned = %s", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - player_unprepare(g_player); - return 1; - } - - nRet = player_unprepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); - - return 0; -} - -//& purpose: Set the video display and checks if it is visible -//& type: auto -/** -* @testcase ITc_player_is_display_visible_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Set the video display and checks if it is visible -* @scenario Create player handle\n -* set player display\n -* check if display visible\n -* destroy the handler -* @apicovered player_set_display, player_is_display_visible -* @passcase When it set the display successfully and checks if it is visible -* @failcase When it set the display successfully and checks if it is visible -* @precondition The player state must be one of these: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED for set_display -* @postcondition N/A -*/ -int ITc_player_is_display_visible_p(void) -{ - START_TEST; - - bool visible; - - int nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, GET_DISPLAY(g_pEvasWindow)); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - nRet = player_is_display_visible(g_player, &visible); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_display_visible", PlayerGetError(nRet)); - - return 0; -} -//& purpose: Sets the ROI(Region Of Interest) area of display -//& type: auto -/** -* @testcase ITc_player_set_display_roi_area_p -* @author SRID(manu.tiwari) -* @reviewer SRID(amritanshu.p1) -* @type auto -* @since_tizen 3.0 -* @description Sets the ROI(Region Of Interest) area of display -* @scenario set player display mode\n -* set display roi area\n -* @apicovered player_set_display_mode, player_set_display_roi_area -* @passcase When player_set_display_roi_area api passed -* @failcase When player_set_display_roi_area api failed -* @precondition The player display mode must be set -* @postcondition N/A -*/ -int ITc_player_set_display_roi_area_p(void) -{ - START_TEST; - - int nRet = player_set_display_mode(g_player, PLAYER_DISPLAY_MODE_DST_ROI); - 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); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display_roi_area", PlayerGetError(nRet)); - - return 0; -} - -//& purpose: Sets the audio only mode -//& type: auto -/** -* @testcase ITc_player_set_audio_only_p -* @author SRID(manmohan.k) -* @reviewer SRID(shobhit.v) -* @type auto -* @since_tizen 4.0 -* @description Sets the audio only mode -* @scenario Sets the audio only mode\n -* @apicovered player_set_audio_only -* @passcase When player_set_audio_only api passed -* @failcase When player_set_audio_only api failed -* @precondition The player state must be one of: #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_READY -* @postcondition N/A -*/ -int ITc_player_set_audio_only_p(void) -{ - START_TEST; - - int nRet = -1; - player_state_e state; - 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; - } - - nRet = player_get_state(g_player,&state); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); - - PlayerGetState(state); - - if ( state != PLAYER_STATE_IDLE ) - { - FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as Player state is not PLAYER_STATE_IDLE to set uri",__LINE__, API_NAMESPACE); - return 1; - } - - 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, GET_DISPLAY(g_pEvasWindow)); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - nRet = player_prepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); - - nRet = player_get_state(g_player, &state); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); - PlayerGetState(state); - - if (!(state == PLAYER_STATE_READY || state == PLAYER_STATE_PLAYING || state == PLAYER_STATE_PAUSED)) - { - FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as Player state is not as precondition", __LINE__, API_NAMESPACE); - return 1; - } - - bool is = false; - nRet = player_is_audio_only(g_player, &is); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); - - bool audio_only = !is; - nRet = player_set_audio_only(g_player, audio_only); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_audio_only", PlayerGetError(nRet)); - - nRet = player_is_audio_only(g_player, &is); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); - - if(is != audio_only) - { - FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as get audio only is not same as set audio only\\n", __LINE__, API_NAMESPACE); - return 1; - } - - audio_only = !audio_only; - nRet = player_set_audio_only(g_player, audio_only); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_audio_only", PlayerGetError(nRet)); - - nRet = player_is_audio_only(g_player, &is); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); - - if(is != audio_only) - { - FPRINTF("[Line : %d][%s] ITc_player_set_audio_only_p, failed as get audio only is not same as set audio only\\n", __LINE__, API_NAMESPACE); - return 1; - } - - return 0; -} - -//& purpose: Gets the audio only mode status -//& type: auto -/** -* @testcase ITc_player_is_audio_only_p -* @author SRID(manmohan.k) -* @reviewer SRID(shobhit.v) -* @type auto -* @since_tizen 4.0 -* @description Gets the audio only mode status -* @scenario Gets the audio only mode status\n -* @apicovered player_is_audio_only -* @passcase When player_is_audio_only passed -* @failcase When player_is_audio_only failed -* @precondition The player state must be one of: #PLAYER_STATE_IDLE, #PLAYER_STATE_READY, #PLAYER_STATE_PLAYING, or #PLAYER_STATE_PAUSED -* @postcondition N/A -*/ -int ITc_player_is_audio_only_p(void) -{ - START_TEST; - - int nRet = -1; - player_state_e state; - 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; - } - - nRet = player_get_state(g_player,&state); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_IDLE ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_create() call",__LINE__, API_NAMESPACE); - return 1; - } - - 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, GET_DISPLAY(g_pEvasWindow)); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - nRet = player_prepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); - - nRet = player_get_state(g_player, &state); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); - PlayerGetState(state); - - if (!(state == PLAYER_STATE_IDLE || state == PLAYER_STATE_READY || state == PLAYER_STATE_PLAYING || state == PLAYER_STATE_PAUSED)) - { - FPRINTF("[Line : %d][%s] ITc_player_is_audio_only_p, failed as Player state is not as precondition", __LINE__, API_NAMESPACE); - return 1; - } - - bool is = false; - nRet = player_is_audio_only(g_player, &is); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_is_audio_only", PlayerGetError(nRet)); - - return 0; -} -/** @} */ -/** @} */ diff --git a/src/itc/player/ITs-player-stream-info.c b/src/itc/player/ITs-player-stream-info.c index 5aa29d0a0..ba16fd5f8 100755 --- a/src/itc/player/ITs-player-stream-info.c +++ b/src/itc/player/ITs-player-stream-info.c @@ -46,9 +46,9 @@ static bool _check_sound_stream_feature(void) */ void ITs_player_stream_info_startup(void) { -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_glib_integrate(); -#endif // TIZENIOT +#endif // For Mobile or Wearable struct stat stBuff; if ( stat(ERR_LOG, &stBuff) == 0 ) @@ -59,7 +59,7 @@ void ITs_player_stream_info_startup(void) FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); #endif -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable CreateEvasWindow(); if ( g_pEvasObject == NULL ) { @@ -67,7 +67,7 @@ void ITs_player_stream_info_startup(void) g_bPlayerCreation = false; return; } -#endif // TIZENIOT +#endif // For Mobile or Wearable int nRet = player_create(&g_player); if ( nRet != PLAYER_ERROR_NONE ) @@ -107,7 +107,7 @@ void ITs_player_stream_info_cleanup(void) { FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); } -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable if ( g_pEvasObject ) { evas_object_del(g_pEvasObject); @@ -118,7 +118,7 @@ void ITs_player_stream_info_cleanup(void) evas_object_del(g_pEvasWindow); g_pEvasWindow = NULL; } -#endif // TIZENIOT +#endif // For Mobile or Wearable return; } @@ -639,128 +639,6 @@ int ITc_player_get_content_info_p(void) return 0; } -//& purpose: Gets the video display's height and width -//& type : auto -/** -* @testcase ITc_player_get_video_size_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Gets the video display's height and width -* @scenario Initialize player handle\n -* start player\n -* get video display's height and width\n -* check the result\n -* destroy the handler -* @apicovered player_start, player_get_video_size, player_unprepare -* @passcase When it can get video display's height and width -* @failcase When it can not get video display's height and width -* @precondition The player state must be PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED -* @postcondition N/A -*/ -int ITc_player_get_video_size_p(void) -{ - START_TEST; - - int nWidth; - int nHeight; - player_state_e state; - - if ( InitializePlayerHandler(true, 1) != true ) - { - PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); - return 1; - } - - int nRet = player_start(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_get_state(g_player,&state); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_PLAYING ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - nRet = player_get_video_size(g_player, &nWidth, &nHeight); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_video_size", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - nRet = player_stop(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_unprepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); - - return 0; -} - -//& purpose: Gets the video stream information -//& type : auto -/** -* @testcase ITc_player_get_video_stream_info_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Gets the video stream information -* @scenario Initialize player handle\n -* start player\n -* get video stream info\n -* check the result\n -* destroy the handler -* @apicovered player_start, player_get_video_stream_info, player_unprepare -* @passcase When it can get video stream information -* @failcase When it can not get video stream information -* @precondition The player state must be PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED -* @postcondition N/A -*/ -int ITc_player_get_video_stream_info_p(void) -{ - START_TEST; - - int nFps; - int nBit_rate; - player_state_e state; - - if ( InitializePlayerHandler(true, 1) != true ) - { - PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); - return 1; - } - - int nRet = player_start(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_get_state(g_player,&state); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_PLAYING ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - nRet = player_get_video_stream_info(g_player, &nFps, &nBit_rate); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_video_stream_info", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - nRet = player_stop(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_unprepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); - - return 0; -} - //& purpose: Gets the total running time of the associated media //& type : auto /** diff --git a/src/itc/player/ITs-player-subtitle.c b/src/itc/player/ITs-player-subtitle.c index 11c0d24a0..de794a949 100755 --- a/src/itc/player/ITs-player-subtitle.c +++ b/src/itc/player/ITs-player-subtitle.c @@ -20,6 +20,10 @@ * @{ */ +#ifdef TIZENIOT // For TIZENIOT + int g_nTimeoutId; + GMainLoop *g_pMainLoop; +#endif // TIZENIOT //& set: Player bool g_bPlayerCreation; bool g_bPlayerSubtitleUpdatedCallback; @@ -34,7 +38,9 @@ bool g_bPlayerCallbackParameter; */ void ITs_player_subtitle_startup(void) { +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_glib_integrate(); +#endif // For Mobile or Wearable struct stat stBuff; if ( stat(ERR_LOG, &stBuff) == 0 ) { @@ -44,6 +50,7 @@ void ITs_player_subtitle_startup(void) FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); #endif +#ifndef TIZENIOT // For Mobile or Wearable CreateEvasWindow(); if ( g_pEvasObject == NULL ) { @@ -51,7 +58,7 @@ void ITs_player_subtitle_startup(void) g_bPlayerCreation = false; return; } - +#endif // For Mobile or Wearable int nRet = player_create(&g_player); if ( nRet != PLAYER_ERROR_NONE ) { @@ -90,6 +97,8 @@ void ITs_player_subtitle_cleanup(void) { FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); } + +#ifndef TIZENIOT // For Mobile or Wearable if ( g_pEvasObject ) { evas_object_del(g_pEvasObject); @@ -100,11 +109,58 @@ void ITs_player_subtitle_cleanup(void) evas_object_del(g_pEvasWindow); g_pEvasWindow = NULL; } +#endif // For Mobile or Wearable return; } +#ifdef TIZENIOT // For TIZENIOT +/** +* @function QuitGmainLoop +* @description Called to quit +* @parameter NA +* @return NA +*/ +void QuitGmainLoop(void) +{ + if(g_pMainLoop) + { + g_main_loop_quit(g_pMainLoop); + } +} +/** +* @function PlayerTimeoutFunction +* @description Called if some callback is not invoked for a particular Player Timeout +* @parameter gpointer data +* @return gboolean +*/ +static gboolean PlayerTimeoutFunction(gpointer data) +{ + QuitGmainLoop(); + return FALSE; +} + +/** +* @function PlayerWaitForAsync +* @description Called to wait +* @parameter NA +* @return NA +*/ + +static void PlayerWaitForAsync() +{ + g_pMainLoop = g_main_loop_new(NULL, false); + g_nTimeoutId = g_timeout_add(TIMEOUT, PlayerTimeoutFunction, NULL); + g_main_loop_run(g_pMainLoop); + + g_source_remove(g_nTimeoutId); + g_nTimeoutId = 0; + + g_main_loop_unref(g_pMainLoop); + g_pMainLoop = NULL; +} +#else /** * @function PlayerTimeoutFunction * @description Called if some callback is not invoked for a particular Player Timeout @@ -130,7 +186,7 @@ static void PlayerWaitForAsync() g_timeout_add(TIMEOUT, PlayerTimeoutFunction, NULL); ecore_main_loop_begin(); } - +#endif //Callbacks /** @@ -151,7 +207,9 @@ static void PlayerSubtitleUpdatedCallback(unsigned long duration, char *text, vo { g_bPlayerCallbackParameter = true; } +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); +#endif } /** @addtogroup itc-player-testcases @@ -196,13 +254,10 @@ int ITc_player_set_subtitle_position_offset_p(void) } int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #else //End MOBILE or WEARABLE or TV, Starts TIZENIOT - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End TIZENIOT + #endif //End Mobile or Wearable nRet = player_set_subtitle_path(g_player, pPath); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_subtitle_path", PlayerGetError(nRet)); @@ -310,13 +365,10 @@ int ITc_player_set_unset_subtitle_updated_cb_p(void) } int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #else //End MOBILE or WEARABLE or TV, Starts TIZENIOT - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End TIZENIOT + #endif //End Mobile or Wearable nRet = player_set_subtitle_path(g_player, pPath); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_subtitle_path", PlayerGetError(nRet)); diff --git a/src/itc/player/ITs-player.c b/src/itc/player/ITs-player.c index ee6212dcf..b47619e60 100755 --- a/src/itc/player/ITs-player.c +++ b/src/itc/player/ITs-player.c @@ -68,9 +68,9 @@ static connection_h g_connection = NULL; */ void ITs_player_startup(void) { -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_glib_integrate(); -#endif // TIZENIOT +#endif // Mobile or Wearable struct stat stBuff; if ( stat(ERR_LOG, &stBuff) == 0 ) { @@ -85,7 +85,7 @@ void ITs_player_startup(void) FPRINTF("[Line : %d][%s] TEST SUIT start-up: ITs_Player_p\\n", __LINE__, API_NAMESPACE); #endif -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable CreateEvasWindow(); if ( g_pEvasObject == NULL ) { @@ -93,7 +93,7 @@ void ITs_player_startup(void) g_bPlayerCreation = false; return; } -#endif // TIZENIOT +#endif // Mobile or Wearable int nRet = player_create(&g_player); if ( nRet != PLAYER_ERROR_NONE ) @@ -133,7 +133,7 @@ void ITs_player_cleanup(void) { FPRINTF("[Line : %d][%s] Player was not created\\n",__LINE__, API_NAMESPACE); } -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable if ( g_pEvasObject ) { evas_object_del(g_pEvasObject); @@ -144,7 +144,7 @@ void ITs_player_cleanup(void) evas_object_del(g_pEvasWindow); g_pEvasWindow = NULL; } -#endif // TIZENIOT +#endif // Mobile or Wearable return; } @@ -155,7 +155,7 @@ void ITs_player_cleanup(void) * @parameter NA * @return NA */ -void QuitGmainLoop(void) +static void QuitGmainLoop(void) { if(g_pMainLoop) { @@ -171,7 +171,6 @@ void QuitGmainLoop(void) */ static gboolean PlayerTimeoutFunction(gpointer data) { - FPRINTF("[Line : %d][%s] Callback Player wait complete for 20 seconds. Timeout\\n",__LINE__, API_NAMESPACE); QuitGmainLoop(); return FALSE; } @@ -221,7 +220,7 @@ static void PlayerWaitForAsync2(int timeout) g_pMainLoop = NULL; } } -#else // For Mobile or Wearable or TV +#else // For Mobile or Wearable /** * @function PlayerTimeoutFunction * @description Called if some callback is not invoked for a particular Player Timeout @@ -230,7 +229,6 @@ static void PlayerWaitForAsync2(int timeout) */ static gboolean PlayerTimeoutFunction(gpointer data) { - FPRINTF("[Line : %d][%s] Callback Player wait complete for 20 seconds. Timeout\\n",__LINE__, API_NAMESPACE); ecore_main_loop_quit(); return FALSE; } @@ -272,7 +270,7 @@ static void PlayerVideoCaptureCallback(unsigned char *data, int width, int heigh g_bPlayerVideoCaptureCallback = true; ecore_main_loop_quit(); } -#endif // End of Mobile or Wearable or TV +#endif // End of Mobile or Wearable //Callbacks @@ -307,9 +305,9 @@ static void PlayerBufferingCallback(int percent, void *user_data) { g_bPlayerCallbackParameter = true; } -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } //Callbacks @@ -323,9 +321,9 @@ static void PlayerBufferingCallback(int percent, void *user_data) static void PlayerCompletedCallback(void *user_data) { g_bPlayerCompletedCallback = true; -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } //Callbacks @@ -339,9 +337,9 @@ static void PlayerCompletedCallback(void *user_data) static void PlayerErrorCallback(int error_code, void *user_data) { g_bPlayerErrorCallback = true; -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } //Callbacks @@ -355,9 +353,9 @@ static void PlayerErrorCallback(int error_code, void *user_data) static void PlayerSeekCompletedCallback(void *user_data) { g_bPlayerSeekCompletedCallback = true; -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } //Callbacks @@ -371,13 +369,11 @@ static void PlayerSeekCompletedCallback(void *user_data) static void PlayerPreparedCallback(void *user_data) { g_bPlayerPreparedCallback = true; -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } -#if (defined(MOBILE) || defined(TIZENIOT) || defined(WEARABLE) || (defined(TV) && defined(_MEDIA_STREAM_API )) ) //Starts MOBILE or TIZENIOT or WEARABLE or TV - //Callbacks /** @@ -399,9 +395,9 @@ static void PlayerMediaPacketVideoFrameDecodedCallback(media_packet_h pkt, void media_packet_destroy(pkt); g_bPlayerCallbackParameter = true; } -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } /** @@ -456,9 +452,9 @@ static void PlayerAudioDecodedCb(media_packet_h pkt, void *user_data) g_bPlayerAudioDecodedCallback = true; media_packet_destroy(pkt); -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } //Callbacks @@ -473,14 +469,11 @@ static void PlayerAudioDecodedCb(media_packet_h pkt, void *user_data) static void PlayerMediaStreamBufferStatusCallback(player_media_stream_buffer_status_e status, void *user_data) { g_bPlayerMediaStreamBufferStatus = true; -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable } -#endif //End MOBILE or WEARABLE or TIZENIOT or TV - -#if (defined(MOBILE) || defined(WEARABLE) || (defined(TV) && defined(_MEDIA_STREAM_API )) ) //Starts MOBILE or WEARABLE or TV //Callbacks /** @@ -516,7 +509,9 @@ static void PlayerVideoStreamChangedCallback(int width, int height, int fps, int { g_bPlayerCallbackParameter = true; } +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); +#endif } @@ -532,7 +527,9 @@ static void PlayerVideoStreamChangedCallback(int width, int height, int fps, int static void PlayerMediaStreamSeekCallBack(unsigned long long offset, void *user_data) { g_bPlayerMediaStreamSeek = true; +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); +#endif } /** @@ -653,9 +650,6 @@ unsigned int ByteStreamToNalUnit(FILE *fd, unsigned char* nal) return nal_length; } -#endif //End MOBILE or WEARABLE or TV - -#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE or WEARABLE /** * @function FeedVideoData @@ -761,7 +755,6 @@ static void PlayerPreparedCB(void *user_data) FPRINTF("[Line : %d][%s] player_start is failed\\n", __LINE__, API_NAMESPACE); } } -#endif // End MOBILE or WEARABLE bool CheckOnlineStatus(char *media_path) { @@ -926,9 +919,9 @@ EXIT: static bool AudioOffloadFormatCB(media_format_mimetype_e eMediaFormat, void *pszData) { g_bPlayerAudioOffloadFormatCallback = true; -#ifndef TIZENIOT // For Mobile or Wearable or TV +#ifndef TIZENIOT // For Mobile or Wearable ecore_main_loop_quit(); -#endif // TIZENIOT +#endif // Mobile or Wearable return true; } @@ -975,6 +968,7 @@ static bool PlayerSupportedMediaFormatCB(media_format_mimetype_e eMediaFormat, v */ int ITc_player_start_p(void) { + START_TEST; player_state_e state; char pPath[PATH_LEN] = {0}; @@ -1072,6 +1066,7 @@ int ITc_player_start_p(void) */ int ITc_player_create_destroy_p(void) { + START_TEST; usleep(2000); int nRet = player_destroy(g_player); @@ -1126,6 +1121,7 @@ int ITc_player_create_destroy_p(void) */ int ITc_player_initialize_p(void) { + START_TEST; player_state_e state; char pPath[PATH_LEN] = {0}; @@ -1327,10 +1323,10 @@ int ITc_player_get_streaming_download_progress_p(void) player_state_e state; int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE char pstrValue[CONFIG_VALUE_LEN_MAX] = {0,}; if ( true == GetValueFromConfigFile("PLAYER_HTTP_STREAMING_URL", pstrValue, API_NAMESPACE)) @@ -1720,10 +1716,10 @@ int ITc_player_pause_p(void) player_state_e state; int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE sleep(2); @@ -1934,10 +1930,10 @@ int ITc_player_set_unset_completed_cb_p(void) int nRet = player_set_completed_cb(g_player, PlayerCompletedCallback, NULL); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_completed_cb", PlayerGetError(nRet)); - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, GET_DISPLAY(g_pEvasObject)); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE if ( InitializePlayerHandler(true, 1) == false ) { @@ -1981,7 +1977,6 @@ int ITc_player_set_unset_completed_cb_p(void) return 0; } -#if (defined(MOBILE) || defined(TIZENIOT) || defined(WEARABLE) || (defined(TV) && defined(_MEDIA_STREAM_API )) ) //Starts MOBILE or TIZENIOT or WEARABLE or TV //& purpose: Registers a callback function to be invoked when every video frame is decoded //& type : auto /** @@ -2012,10 +2007,10 @@ int ITc_player_set_unset_media_packet_video_frame_decoded_cb_p(void) int nRet = player_set_media_packet_video_frame_decoded_cb(g_player, PlayerMediaPacketVideoFrameDecodedCallback, NULL); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_media_packet_video_frame_decoded_cb", PlayerGetError(nRet)); - #if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE or WEARABLE + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_NONE, GET_DISPLAY(g_pEvasObject)); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or WEARABLE + #endif if ( InitializePlayerHandler(true, 1) == false ) { @@ -2072,7 +2067,6 @@ int ITc_player_set_unset_media_packet_video_frame_decoded_cb_p(void) PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); return 0; } -#endif //Ends MOBILE or TIZENIOT or WEARABLE or TV //& purpose: Prepares the media player for playback, asynchronously @@ -2106,10 +2100,10 @@ int ITc_player_prepare_async_p(void) int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE g_bPlayerPreparedCallback = false; nRet = player_prepare_async(g_player, PlayerPreparedCallback, NULL); @@ -2365,10 +2359,10 @@ int ITc_player_get_track_count_p(void) int nCount = 0; int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE sleep(2); if ( InitializePlayerHandler(true, 1) != true ) @@ -2431,10 +2425,10 @@ int ITc_player_get_current_track_p(void) int nCount = 0, nIndex = 0; int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE sleep(2); if ( InitializePlayerHandler(true, 1) != true ) @@ -2510,10 +2504,10 @@ int ITc_player_get_track_language_code_p(void) char *pszLangCode = NULL; int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE sleep(2); if ( InitializePlayerHandler(true, 1) != true ) @@ -2588,10 +2582,10 @@ int ITc_player_select_track_p(void) int nCount = 0, nIndex = 0; int nRet = -1; - #ifndef TIZENIOT // For Mobile or Wearable or TV + #ifndef TIZENIOT // For Mobile or Wearable nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or TV or WEARABLE + #endif //End MOBILE or WEARABLE sleep(2); if ( InitializePlayerHandler(true, 1) != true ) @@ -2644,7 +2638,6 @@ int ITc_player_select_track_p(void) return 0; } -#if defined(MOBILE) || defined(TIZENIOT) || defined(WEARABLE) //Starts MOBILE or TIZENIOT or WEARABLE //& purpose: Registers/Unregisters a callback function to be invoked when buffer underrun or overflow is occurred. //& type : auto /** @@ -2732,7 +2725,6 @@ int ITc_player_set_unset_media_stream_buffer_status_cb_p(void) return 0; } -#endif // End MOBILE or TIZENIOT or WEARABLE //& purpose: Registers a callback function to be invoked when the playback is interrupted or the interrupt is completed. //& type: auto @@ -2807,7 +2799,7 @@ int ITc_player_set_get_replaygain_status_p(void) return 0; } -#if (defined(TV) && defined(_MEDIA_STREAM_API )) //Starts TV +#if (defined(_MEDIA_STREAM_API )) //& purpose: Pushes elementary stream to decode audio or video //& type : auto /** @@ -2884,7 +2876,7 @@ int ITc_player_push_media_stream_p(void) } #endif -#if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE or WEARABLE +#if defined(MOBILE) || defined(WEARABLE) || defined(TIZENIOT) //Starts MOBILE or WEARABLE //& purpose: Pushes elementary stream to decode audio or video //& type : auto /** @@ -2969,8 +2961,10 @@ int ITc_player_push_media_stream_p(void) nRet = player_set_media_stream_seek_cb(g_player, PLAYER_STREAM_TYPE_VIDEO, PlayerMediaStreamSeekCallBack, NULL); PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_seek_cb", PlayerGetError(nRet), media_format_unref(g_hMediaFormat); fclose(file_src)); - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet), media_format_unref(g_hMediaFormat); fclose(file_src)); + #ifndef TIZENIOT // For Mobile or Wearable + nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet), media_format_unref(g_hMediaFormat); fclose(file_src)); + #endif nRet = player_set_media_stream_info(g_player, PLAYER_STREAM_TYPE_VIDEO, g_hMediaFormat); PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_info", PlayerGetError(nRet), media_format_unref(g_hMediaFormat); fclose(file_src)); @@ -3003,247 +2997,6 @@ int ITc_player_push_media_stream_p(void) } #endif //Ends MOBILE or WEARABLE -//All Non-TIZENIOT profile TC placed to the end for uniformity - -#ifndef TIZENIOT // For Mobile or Wearable or TV -//& purpose: Captures the video frame, asynchronously -//& type: auto -/** -* @testcase ITc_player_capture_video_p -* @author SRID(anshul1.jain) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.3 -* @description Captures the video frame, asynchronously -* @scenario Set player display\n -* Initialize player handle\n -* Start player\n -* callback player capture video\n -* check results\n -* destroy the handler -* @apicovered player_set_uri, player_prepare, player_start, player_capture_video, player_unprepare -* @passcase When it captures video frame -* @failcase When it does not captures video frame -* @precondition The player state must be PLAYER_STATE_PLAYING by player_start() or PLAYER_STATE_PAUSED by player_pause() -* @postcondition It invokes player_video_captured_cb() when capture completes, if you set a callback -*/ -int ITc_player_capture_video_p(void) -{ - START_TEST; - - player_state_e state; - - char pPath[PATH_LEN] = {0,}; - if ( false == PlayerAppendToAppDataPath(MEDIA_PATH_VIDEO2, pPath)) - { - FPRINTF("[Line : %d][%s] unable to get the app data path\\n", __LINE__, API_NAMESPACE); - return 1; - } - - int nRet = -1; - - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - - sleep(2); - - nRet = player_set_uri(g_player, pPath); - - #if defined(WEARABLE) - bool bValue = false; - system_info_get_platform_bool(INTERNET_FEATURE, &bValue); - if(bValue == false) - { - if(nRet != PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE) - { - FPRINTF("[Line : %d][%s] player_set_uri API call returned mismatch %s error for unsupported internet feature\\n", __LINE__, API_NAMESPACE, PlayerGetError(nRet)); - return 1; - } - } - #endif - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_uri", PlayerGetError(nRet)); - - nRet = player_prepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); - - nRet = player_start(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_get_state(g_player,&state); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_PLAYING ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - sleep(4); - - nRet = player_pause(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_pause", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - nRet = player_get_state(g_player,&state); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_PAUSED ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_pause() call", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - sleep(2); - g_bPlayerVideoCaptureCallback = false; - - nRet = player_capture_video(g_player, PlayerVideoCaptureCallback, NULL); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_capture_video", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - PlayerWaitForAsync(); - - if ( !g_bPlayerVideoCaptureCallback ) - { - FPRINTF("[Line : %d][%s] player_video_captured_cb failed, error returned = callback not invoked", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - nRet = player_stop(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_unprepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); - - return 0; -} - -//& purpose: Registers/Unregisters a callback function to be invoked when video stream is changed. -//& type : auto -/** -* @testcase ITc_player_set_unset_video_stream_changed_cb_p -* @author SRID(m.khalid) -* @reviewer SRID(gupta.sanjay) -* @type auto -* @since_tizen 2.4 -* @description Registers/Unregisters a callback function to be invoked when video stream is changed. -* @scenario Registers the callback using player_set_video_stream_changed_cb\n -* Check if callback is hit\n -* Unregisters the callback using player_unset_video_stream_changed_cb -* @apicovered player_set_display, player_prepare, player_set_video_stream_changed_cb, player_start, player_unset_video_stream_changed_cb, player_stop, player_unprepare, player_get_state -* @passcase if all covered apis are passed and Callback is hit -* @failcase if any covered api is failed or Callback is not hit -* @precondition NA -* @postcondition NA -*/ -int ITc_player_set_unset_video_stream_changed_cb_p(void) -{ - START_TEST; - - bool bTelFeatureSupported = TCTCheckSystemInfoFeatureSupported(TELEPHONY_FEATURE, API_NAMESPACE); - bool bWifiFeatureSupported = TCTCheckSystemInfoFeatureSupported(WIFI_FEATURE, API_NAMESPACE); - if ( !bTelFeatureSupported && !bWifiFeatureSupported ) - { - FPRINTF("[Line : %d][%s] Network is not working. Skipping Test\\n", __LINE__, API_NAMESPACE); - return 0; - } - - player_state_e state; - - g_bPlayerVideoStreamChanged = false; - g_bPlayerCallbackParameter = false; - - int nRet = -1; - - nRet = player_get_state(g_player,&state); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet)); - - if ( state != PLAYER_STATE_IDLE ) - { - FPRINTF("[Line : %d][%s] Player state is not idle", __LINE__, API_NAMESPACE); - return 1; - } - - if ( InitializePlayerHandler(false, 4) != true ) - { - PRINT_API_ERROR_IN_LOOP_MSG_SINGLE(InitializePlayerHandler); - return 1; - } - - #if defined(MOBILE) || defined(WEARABLE) //Starts MOBILE or WEARABLE - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_EVAS, g_pEvasObject); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet)); - #endif //End MOBILE or WEARABLE - - nRet = player_set_video_stream_changed_cb(g_player, PlayerVideoStreamChangedCallback, NULL); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_set_video_stream_changed_cb", PlayerGetError(nRet)); - - nRet = player_prepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_prepare", PlayerGetError(nRet)); - - sleep(3); - - nRet = player_get_state(g_player,&state); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_unprepare(g_player)); - - PlayerGetState(state); - if ( state != PLAYER_STATE_READY ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_prepare() call", __LINE__, API_NAMESPACE); - return 1; - } - - sleep(3); - - nRet = player_start(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_start", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_get_state(g_player,&state); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_get_state", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - - PlayerGetState(state); - if ( state != PLAYER_STATE_PLAYING ) - { - FPRINTF("[Line : %d][%s] Player state does not change after player_start() call", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - PlayerWaitForAsync(); - - if ( !g_bPlayerVideoStreamChanged ) - { - FPRINTF("[Line : %d][%s] player_set_video_stream_changed_cb failed, error returned = callback not invoked\\n", __LINE__, API_NAMESPACE); - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - else if ( !g_bPlayerCallbackParameter ) - { - player_stop(g_player); - player_unprepare(g_player); - return 1; - } - - nRet = player_unset_video_stream_changed_cb(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_unset_video_stream_changed_cb", PlayerGetError(nRet), player_stop(g_player);player_unprepare(g_player)); - - nRet = player_stop(g_player); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_stop", PlayerGetError(nRet), player_unprepare(g_player)); - - nRet = player_unprepare(g_player); - PRINT_RESULT(PLAYER_ERROR_NONE, nRet, "player_unprepare", PlayerGetError(nRet)); - - return 0; -} - //& purpose: Registers/Unregisters a callback function to be invoked when seeking is occurred. //& type : auto /** @@ -3320,8 +3073,10 @@ int ITc_player_set_unset_media_stream_seek_cb_p(void) nRet = player_set_media_stream_seek_cb(g_player, PLAYER_STREAM_TYPE_VIDEO, PlayerMediaStreamSeekCallBack, NULL); PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_seek_cb", PlayerGetError(nRet), media_format_unref(g_hMediaFormat)); - nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow); - PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet), media_format_unref(g_hMediaFormat)); + #ifndef TIZENIOT // For Mobile or Wearable + nRet = player_set_display(g_player, PLAYER_DISPLAY_TYPE_OVERLAY, g_pEvasWindow); + PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_display", PlayerGetError(nRet), media_format_unref(g_hMediaFormat)); + #endif nRet = player_set_media_stream_info(g_player, PLAYER_STREAM_TYPE_VIDEO, g_hMediaFormat); PRINT_RESULT_CLEANUP(PLAYER_ERROR_NONE, nRet, "player_set_media_stream_info", PlayerGetError(nRet), media_format_unref(g_hMediaFormat)); @@ -3348,7 +3103,6 @@ int ITc_player_set_unset_media_stream_seek_cb_p(void) player_unprepare(g_player); return 0; } -#endif // End of Mobile or Wearable or TV //& purpose: set and get the play position for playback //& type : auto diff --git a/src/itc/player/tct-player-native.c b/src/itc/player/tct-player-native.c index 6d331d32b..4fbf2cdc3 100755 --- a/src/itc/player/tct-player-native.c +++ b/src/itc/player/tct-player-native.c @@ -25,10 +25,6 @@ #include "tct-player-native_wearable.h" #endif //WEARABLE //End WEARABLE -#ifdef TV //Starts TV -#include "tct-player-native_tv.h" -#endif //TV //End TV - #ifdef TIZENIOT //Starts TIZENIOT #include "tct-player-native_tizeniot.h" #endif //TIZENIOT //End TIZENIOT diff --git a/src/itc/player/tct-player-native_mobile.h b/src/itc/player/tct-player-native_mobile.h index fc0327810..703e44f06 100755 --- a/src/itc/player/tct-player-native_mobile.h +++ b/src/itc/player/tct-player-native_mobile.h @@ -19,8 +19,6 @@ #include "testcase.h" #include "tct_common.h" -extern void ITs_player_display_startup(void); -extern void ITs_player_display_cleanup(void); extern void ITs_player_subtitle_startup(void); extern void ITs_player_subtitle_cleanup(void); extern void ITs_player_audio_effect_startup(void); @@ -29,15 +27,7 @@ extern void ITs_player_stream_info_startup(void); extern void ITs_player_stream_info_cleanup(void); extern void ITs_player_startup(void); extern void ITs_player_cleanup(void); -extern void ITs_player_360_startup(void); -extern void ITs_player_360_cleanup(void); -extern int ITc_player_set_get_video_roi_area_p(void); -extern int ITc_player_set_get_display_rotation_p(void); -extern int ITc_player_set_display_visible_p(void); -extern int ITc_player_set_get_display_mode_p(void); -extern int ITc_player_is_display_visible_p(void); -extern int ITc_player_set_display_roi_area_p(void); extern int ITc_player_set_subtitle_position_offset_p(void); extern int ITc_player_set_unset_subtitle_updated_cb_p(void); extern int ITc_player_audio_effect_equalizer_is_available_p(void); @@ -53,13 +43,10 @@ extern int ITc_player_set_sound_stream_info_p(void); extern int ITc_player_get_album_art_p(void); extern int ITc_player_get_codec_info_p(void); extern int ITc_player_get_content_info_p(void); -extern int ITc_player_get_video_size_p(void); -extern int ITc_player_get_video_stream_info_p(void); extern int ITc_player_get_duration_p(void); extern int ITc_player_start_p(void); extern int ITc_player_create_destroy_p(void); extern int ITc_player_initialize_p(void); -extern int ITc_player_capture_video_p(void); extern int ITc_player_set_unset_buffering_cb_p(void); extern int ITc_player_set_unset_error_cb_p(void); extern int ITc_player_get_streaming_download_progress_p(void); @@ -77,7 +64,6 @@ extern int ITc_player_set_unset_media_packet_video_frame_decoded_cb_p(void); extern int ITc_player_prepare_async_p(void); extern int ITc_player_set_get_play_position_p(void); extern int ITc_player_push_media_stream_p(void); -extern int ITc_player_set_unset_video_stream_changed_cb_p(void); extern int ITc_player_set_media_stream_info_p(void); extern int ITc_player_set_unset_media_stream_seek_cb_p(void); extern int ITc_player_set_get_media_stream_buffer_max_size_p(void); @@ -90,18 +76,10 @@ extern int ITc_player_set_unset_media_stream_buffer_status_cb_p(void); extern int ITc_player_in_set_unset_interrupted_cb_p(void); extern int ITc_player_set_get_adaptive_variant_limit_p(void); extern int ITc_player_foreach_adaptive_variant_p(void); -extern int ITc_player_set_audio_only_p(void); -extern int ITc_player_is_audio_only_p(void); extern int ITc_media_player_set_get_streaming_buffering_time_p(void); extern int ITc_player_set_get_replaygain_status_p(void); -extern int ITc_media_player_360_is_content_spherical_p(void); -extern int ITc_player_360_is_set_enabled_p(void); -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_set_get_play_position_nsec_p(void); extern int ITc_player_get_duration_nsec_p(void); -extern int ITc_player_360_set_zoom_with_field_of_view_p(void); extern int ITc_player_audio_pitch_set_get_enabled_p(void); extern int ITc_player_audio_pitch_set_get_value_p(void); extern int ITc_player_set_unset_media_packet_audio_frame_decoded_cb_signed_le_deinterleave_p(void); @@ -121,12 +99,6 @@ extern int ITc_player_foreach_media_stream_supported_format_p(void); extern int ITc_player_audio_set_get_audio_codec_type_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_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}, - {"ITc_player_is_display_visible_p",ITc_player_is_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup}, - {"ITc_player_set_display_roi_area_p",ITc_player_set_display_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup}, {"ITc_player_set_subtitle_position_offset_p",ITc_player_set_subtitle_position_offset_p,ITs_player_subtitle_startup,ITs_player_subtitle_cleanup}, {"ITc_player_set_unset_subtitle_updated_cb_p",ITc_player_set_unset_subtitle_updated_cb_p,ITs_player_subtitle_startup,ITs_player_subtitle_cleanup}, {"ITc_player_audio_effect_equalizer_is_available_p",ITc_player_audio_effect_equalizer_is_available_p,ITs_player_audio_effect_startup,ITs_player_audio_effect_cleanup}, @@ -143,13 +115,10 @@ testcase tc_array[] = { {"ITc_player_get_album_art_p",ITc_player_get_album_art_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_codec_info_p",ITc_player_get_codec_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_content_info_p",ITc_player_get_content_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, - {"ITc_player_get_video_size_p",ITc_player_get_video_size_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, - {"ITc_player_get_video_stream_info_p",ITc_player_get_video_stream_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_duration_p",ITc_player_get_duration_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_start_p",ITc_player_start_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_create_destroy_p",ITc_player_create_destroy_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_initialize_p",ITc_player_initialize_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_player_capture_video_p",ITc_player_capture_video_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_unset_buffering_cb_p",ITc_player_set_unset_buffering_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_unset_error_cb_p",ITc_player_set_unset_error_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_get_streaming_download_progress_p",ITc_player_get_streaming_download_progress_p,ITs_player_startup,ITs_player_cleanup}, @@ -167,7 +136,6 @@ testcase tc_array[] = { {"ITc_player_prepare_async_p",ITc_player_prepare_async_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_get_play_position_p",ITc_player_set_get_play_position_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_push_media_stream_p",ITc_player_push_media_stream_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_player_set_unset_video_stream_changed_cb_p",ITc_player_set_unset_video_stream_changed_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_media_stream_info_p",ITc_player_set_media_stream_info_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_unset_media_stream_seek_cb_p",ITc_player_set_unset_media_stream_seek_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_get_media_stream_buffer_max_size_p",ITc_player_set_get_media_stream_buffer_max_size_p,ITs_player_startup,ITs_player_cleanup}, @@ -180,16 +148,8 @@ testcase tc_array[] = { {"ITc_player_in_set_unset_interrupted_cb_p",ITc_player_in_set_unset_interrupted_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_get_adaptive_variant_limit_p",ITc_player_set_get_adaptive_variant_limit_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_foreach_adaptive_variant_p",ITc_player_foreach_adaptive_variant_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_player_set_audio_only_p",ITc_player_set_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, - {"ITc_player_is_audio_only_p",ITc_player_is_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, {"ITc_player_set_get_replaygain_status_p",ITc_player_set_get_replaygain_status_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_media_player_set_get_streaming_buffering_time_p",ITc_media_player_set_get_streaming_buffering_time_p,ITs_player_display_startup,ITs_player_display_cleanup}, - {"ITc_media_player_360_is_content_spherical_p",ITc_media_player_360_is_content_spherical_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_is_set_enabled_p",ITc_player_360_is_set_enabled_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_get_direction_of_view_p",ITc_player_360_set_get_direction_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_get_zoom_p",ITc_player_360_set_get_zoom_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_get_field_of_view",ITc_player_360_set_get_field_of_view,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_zoom_with_field_of_view_p",ITc_player_360_set_zoom_with_field_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_media_player_set_get_streaming_buffering_time_p",ITc_media_player_set_get_streaming_buffering_time_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_set_get_play_position_nsec_p",ITc_player_set_get_play_position_nsec_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_get_duration_nsec_p",ITc_player_get_duration_nsec_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_audio_pitch_set_get_enabled_p",ITc_player_audio_pitch_set_get_enabled_p,ITs_player_startup,ITs_player_cleanup}, diff --git a/src/itc/player/tct-player-native_tizeniot.h b/src/itc/player/tct-player-native_tizeniot.h index 6faa477eb..fc74d870a 100755 --- a/src/itc/player/tct-player-native_tizeniot.h +++ b/src/itc/player/tct-player-native_tizeniot.h @@ -19,6 +19,8 @@ #include "testcase.h" #include "tct_common.h" +extern void ITs_player_subtitle_startup(void); +extern void ITs_player_subtitle_cleanup(void); extern void ITs_player_audio_effect_startup(void); extern void ITs_player_audio_effect_cleanup(void); extern void ITs_player_stream_info_startup(void); @@ -26,6 +28,8 @@ extern void ITs_player_stream_info_cleanup(void); extern void ITs_player_startup(void); extern void ITs_player_cleanup(void); +extern int ITc_player_set_subtitle_position_offset_p(void); +extern int ITc_player_set_unset_subtitle_updated_cb_p(void); extern int ITc_player_audio_effect_equalizer_is_available_p(void); extern int ITc_player_audio_effect_get_equalizer_bands_count_p(void); extern int ITc_player_audio_effect_get_equalizer_band_frequency_range_p(void); @@ -38,11 +42,9 @@ extern int ITc_player_get_audio_stream_info_p(void); extern int ITc_player_set_sound_stream_info_p(void); extern int ITc_player_set_get_adaptive_variant_limit_p(void); extern int ITc_player_foreach_adaptive_variant_p(void); -extern int ITc_player_get_video_stream_info_p(void); extern int ITc_player_get_album_art_p(void); extern int ITc_player_get_codec_info_p(void); extern int ITc_player_get_content_info_p(void); -extern int ITc_player_get_video_size_p(void); extern int ITc_player_get_duration_p(void); extern int ITc_player_start_p(void); extern int ITc_player_create_destroy_p(void); @@ -89,8 +91,21 @@ extern int ITc_player_audio_offload_set_is_enabled_p(void); extern int ITc_player_audio_offload_is_activated_p(void); extern int ITc_player_foreach_media_stream_supported_format_p(void); extern int ITc_player_audio_set_get_audio_codec_type_p(void); +extern int ITc_player_foreach_adaptive_variant_p(void); +extern int ITc_player_set_media_stream_info_p(void); +extern int ITc_player_push_media_stream_p(void); +extern int ITc_player_set_get_media_stream_buffer_max_size_p(void); +extern int ITc_player_set_get_media_stream_buffer_min_threshold_p(void); +extern int ITc_player_set_unset_media_stream_buffer_status_cb_p(void); +extern int ITc_player_set_unset_media_stream_seek_cb_p(void); +extern int ITc_player_foreach_media_stream_supported_format_p(void); +extern int ITc_media_player_set_get_streaming_buffering_time_p(void); +extern int ITc_player_set_unset_media_packet_video_frame_decoded_cb_p(void); +extern int ITc_player_set_get_adaptive_variant_limit_p(void); testcase tc_array[] = { + {"ITc_player_set_subtitle_position_offset_p",ITc_player_set_subtitle_position_offset_p,ITs_player_subtitle_startup,ITs_player_subtitle_cleanup}, + {"ITc_player_set_unset_subtitle_updated_cb_p",ITc_player_set_unset_subtitle_updated_cb_p,ITs_player_subtitle_startup,ITs_player_subtitle_cleanup}, {"ITc_player_audio_effect_equalizer_is_available_p",ITc_player_audio_effect_equalizer_is_available_p,ITs_player_audio_effect_startup,ITs_player_audio_effect_cleanup}, {"ITc_player_audio_set_get_audio_codec_type_p",ITc_player_audio_set_get_audio_codec_type_p,ITs_player_audio_effect_startup,ITs_player_audio_effect_cleanup}, {"ITc_player_audio_effect_get_equalizer_bands_count_p",ITc_player_audio_effect_get_equalizer_bands_count_p,ITs_player_audio_effect_startup,ITs_player_audio_effect_cleanup}, @@ -105,8 +120,6 @@ testcase tc_array[] = { {"ITc_player_get_album_art_p",ITc_player_get_album_art_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_codec_info_p",ITc_player_get_codec_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_content_info_p",ITc_player_get_content_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, - {"ITc_player_get_video_size_p",ITc_player_get_video_size_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, - {"ITc_player_get_video_stream_info_p",ITc_player_get_video_stream_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_duration_p",ITc_player_get_duration_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_start_p",ITc_player_start_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_create_destroy_p",ITc_player_create_destroy_p,ITs_player_startup,ITs_player_cleanup}, @@ -154,6 +167,17 @@ testcase tc_array[] = { {"ITc_player_audio_offload_set_is_enabled_p", ITc_player_audio_offload_set_is_enabled_p, ITs_player_startup, ITs_player_cleanup}, {"ITc_player_audio_offload_is_activated_p", ITc_player_audio_offload_is_activated_p, ITs_player_startup, ITs_player_cleanup}, {"ITc_player_foreach_media_stream_supported_format_p", ITc_player_foreach_media_stream_supported_format_p, ITs_player_startup, ITs_player_cleanup}, + {"ITc_player_foreach_adaptive_variant_p",ITc_player_foreach_adaptive_variant_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_set_media_stream_info_p",ITc_player_set_media_stream_info_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_push_media_stream_p",ITc_player_push_media_stream_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_set_get_media_stream_buffer_max_size_p",ITc_player_set_get_media_stream_buffer_max_size_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_set_get_media_stream_buffer_min_threshold_p",ITc_player_set_get_media_stream_buffer_min_threshold_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_set_unset_media_stream_buffer_status_cb_p",ITc_player_set_unset_media_stream_buffer_status_cb_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_set_unset_media_stream_seek_cb_p",ITc_player_set_unset_media_stream_seek_cb_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_foreach_media_stream_supported_format_p", ITc_player_foreach_media_stream_supported_format_p, ITs_player_startup, ITs_player_cleanup}, + {"ITc_media_player_set_get_streaming_buffering_time_p",ITc_media_player_set_get_streaming_buffering_time_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, + {"ITc_player_set_unset_media_packet_video_frame_decoded_cb_p",ITc_player_set_unset_media_packet_video_frame_decoded_cb_p,ITs_player_startup,ITs_player_cleanup}, + {"ITc_player_set_get_adaptive_variant_limit_p",ITc_player_set_get_adaptive_variant_limit_p,ITs_player_startup,ITs_player_cleanup}, {NULL, NULL} }; diff --git a/src/itc/player/tct-player-native_wearable.h b/src/itc/player/tct-player-native_wearable.h index cf006f8ff..58438321c 100755 --- a/src/itc/player/tct-player-native_wearable.h +++ b/src/itc/player/tct-player-native_wearable.h @@ -19,8 +19,6 @@ #include "testcase.h" #include "tct_common.h" -extern void ITs_player_display_startup(void); -extern void ITs_player_display_cleanup(void); extern void ITs_player_subtitle_startup(void); extern void ITs_player_subtitle_cleanup(void); extern void ITs_player_audio_effect_startup(void); @@ -29,15 +27,7 @@ extern void ITs_player_stream_info_startup(void); extern void ITs_player_stream_info_cleanup(void); extern void ITs_player_startup(void); extern void ITs_player_cleanup(void); -extern void ITs_player_360_startup(void); -extern void ITs_player_360_cleanup(void); -extern int ITc_player_set_get_video_roi_area_p(void); -extern int ITc_player_set_get_display_rotation_p(void); -extern int ITc_player_set_display_visible_p(void); -extern int ITc_player_set_get_display_mode_p(void); -extern int ITc_player_is_display_visible_p(void); -extern int ITc_player_set_display_roi_area_p(void); extern int ITc_player_set_subtitle_position_offset_p(void); extern int ITc_player_set_unset_subtitle_updated_cb_p(void); extern int ITc_player_audio_effect_equalizer_is_available_p(void); @@ -53,13 +43,10 @@ extern int ITc_player_set_sound_stream_info_p(void); extern int ITc_player_get_album_art_p(void); extern int ITc_player_get_codec_info_p(void); extern int ITc_player_get_content_info_p(void); -extern int ITc_player_get_video_size_p(void); -extern int ITc_player_get_video_stream_info_p(void); extern int ITc_player_get_duration_p(void); extern int ITc_player_start_p(void); extern int ITc_player_create_destroy_p(void); extern int ITc_player_initialize_p(void); -extern int ITc_player_capture_video_p(void); extern int ITc_player_set_unset_buffering_cb_p(void); extern int ITc_player_set_unset_error_cb_p(void); extern int ITc_player_get_streaming_download_progress_p(void); @@ -77,7 +64,6 @@ extern int ITc_player_set_unset_media_packet_video_frame_decoded_cb_p(void); extern int ITc_player_prepare_async_p(void); extern int ITc_player_set_get_play_position_p(void); extern int ITc_player_push_media_stream_p(void); -extern int ITc_player_set_unset_video_stream_changed_cb_p(void); extern int ITc_player_set_media_stream_info_p(void); extern int ITc_player_set_unset_media_stream_seek_cb_p(void); extern int ITc_player_set_get_media_stream_buffer_max_size_p(void); @@ -90,18 +76,10 @@ extern int ITc_player_set_unset_media_stream_buffer_status_cb_p(void); extern int ITc_player_in_set_unset_interrupted_cb_p(void); extern int ITc_player_set_get_adaptive_variant_limit_p(void); extern int ITc_player_foreach_adaptive_variant_p(void); -extern int ITc_player_set_audio_only_p(void); -extern int ITc_player_is_audio_only_p(void); extern int ITc_media_player_set_get_streaming_buffering_time_p(void); extern int ITc_player_set_get_replaygain_status_p(void); -extern int ITc_media_player_360_is_content_spherical_p(void); -extern int ITc_player_360_is_set_enabled_p(void); -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_set_get_play_position_nsec_p(void); extern int ITc_player_get_duration_nsec_p(void); -extern int ITc_player_360_set_zoom_with_field_of_view_p(void); extern int ITc_player_audio_pitch_set_get_enabled_p(void); extern int ITc_player_audio_pitch_set_get_value_p(void); extern int ITc_player_set_unset_media_packet_audio_frame_decoded_cb_signed_le_deinterleave_p(void); @@ -121,12 +99,6 @@ extern int ITc_player_foreach_media_stream_supported_format_p(void); extern int ITc_player_audio_set_get_audio_codec_type_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_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}, - {"ITc_player_is_display_visible_p",ITc_player_is_display_visible_p,ITs_player_display_startup,ITs_player_display_cleanup}, - {"ITc_player_set_display_roi_area_p",ITc_player_set_display_roi_area_p,ITs_player_display_startup,ITs_player_display_cleanup}, {"ITc_player_set_subtitle_position_offset_p",ITc_player_set_subtitle_position_offset_p,ITs_player_subtitle_startup,ITs_player_subtitle_cleanup}, {"ITc_player_set_unset_subtitle_updated_cb_p",ITc_player_set_unset_subtitle_updated_cb_p,ITs_player_subtitle_startup,ITs_player_subtitle_cleanup}, {"ITc_player_audio_effect_equalizer_is_available_p",ITc_player_audio_effect_equalizer_is_available_p,ITs_player_audio_effect_startup,ITs_player_audio_effect_cleanup}, @@ -143,13 +115,10 @@ testcase tc_array[] = { {"ITc_player_get_album_art_p",ITc_player_get_album_art_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_codec_info_p",ITc_player_get_codec_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_get_content_info_p",ITc_player_get_content_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, - {"ITc_player_get_video_size_p",ITc_player_get_video_size_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, - {"ITc_player_get_video_stream_info_p",ITc_player_get_video_stream_info_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_start_p",ITc_player_start_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_get_duration_p",ITc_player_get_duration_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_create_destroy_p",ITc_player_create_destroy_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_initialize_p",ITc_player_initialize_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_player_capture_video_p",ITc_player_capture_video_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_unset_buffering_cb_p",ITc_player_set_unset_buffering_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_unset_error_cb_p",ITc_player_set_unset_error_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_get_streaming_download_progress_p",ITc_player_get_streaming_download_progress_p,ITs_player_startup,ITs_player_cleanup}, @@ -167,7 +136,6 @@ testcase tc_array[] = { {"ITc_player_prepare_async_p",ITc_player_prepare_async_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_get_play_position_p",ITc_player_set_get_play_position_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_push_media_stream_p",ITc_player_push_media_stream_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_player_set_unset_video_stream_changed_cb_p",ITc_player_set_unset_video_stream_changed_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_media_stream_info_p",ITc_player_set_media_stream_info_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_unset_media_stream_seek_cb_p",ITc_player_set_unset_media_stream_seek_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_get_media_stream_buffer_max_size_p",ITc_player_set_get_media_stream_buffer_max_size_p,ITs_player_startup,ITs_player_cleanup}, @@ -180,16 +148,8 @@ testcase tc_array[] = { {"ITc_player_in_set_unset_interrupted_cb_p",ITc_player_in_set_unset_interrupted_cb_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_set_get_adaptive_variant_limit_p",ITc_player_set_get_adaptive_variant_limit_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_foreach_adaptive_variant_p",ITc_player_foreach_adaptive_variant_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_player_set_audio_only_p",ITc_player_set_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, - {"ITc_player_is_audio_only_p",ITc_player_is_audio_only_p,ITs_player_display_startup,ITs_player_display_cleanup}, {"ITc_player_set_get_replaygain_status_p",ITc_player_set_get_replaygain_status_p,ITs_player_startup,ITs_player_cleanup}, - {"ITc_media_player_set_get_streaming_buffering_time_p",ITc_media_player_set_get_streaming_buffering_time_p,ITs_player_display_startup,ITs_player_display_cleanup}, - {"ITc_media_player_360_is_content_spherical_p",ITc_media_player_360_is_content_spherical_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_is_set_enabled_p",ITc_player_360_is_set_enabled_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_get_direction_of_view_p",ITc_player_360_set_get_direction_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_get_zoom_p",ITc_player_360_set_get_zoom_p,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_get_field_of_view",ITc_player_360_set_get_field_of_view,ITs_player_360_startup,ITs_player_360_cleanup}, - {"ITc_player_360_set_zoom_with_field_of_view_p",ITc_player_360_set_zoom_with_field_of_view_p,ITs_player_360_startup,ITs_player_360_cleanup}, + {"ITc_media_player_set_get_streaming_buffering_time_p",ITc_media_player_set_get_streaming_buffering_time_p,ITs_player_stream_info_startup,ITs_player_stream_info_cleanup}, {"ITc_player_set_get_play_position_nsec_p",ITc_player_set_get_play_position_nsec_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_get_duration_nsec_p",ITc_player_get_duration_nsec_p,ITs_player_startup,ITs_player_cleanup}, {"ITc_player_audio_pitch_set_get_enabled_p",ITc_player_audio_pitch_set_get_enabled_p,ITs_player_startup,ITs_player_cleanup}, diff --git a/tct_unsupported.txt b/tct_unsupported.txt index 115001802..bd0dcd56f 100755 --- a/tct_unsupported.txt +++ b/tct_unsupported.txt @@ -301,6 +301,7 @@ tv:armv7l:utc:mediademuxer; tv:armv7l:utc:mediamuxer; tv:armv7l:utc:radio; tv:armv7l:utc:player; +tv:armv7l:utc:player-display; tv:armv7l:utc:recorder; tv:armv7l:utc:streamrecorder; tv:armv7l:utc:screen-mirroring; @@ -345,6 +346,7 @@ tv:armv7l:itc:capi-mediademuxer; tv:armv7l:itc:capi-mediamuxer; tv:armv7l:itc:radio; tv:armv7l:itc:player; +tv:armv7l:itc:player-display; tv:armv7l:itc:recorder; tv:armv7l:itc:mediastreamrecorder; tv:armv7l:itc:screen-mirroring;