From: Priya Kohli Date: Mon, 2 Dec 2019 05:57:41 +0000 (+0530) Subject: [ITC][media-controller][Non-ACR][Code optimization and naming issue fix] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F08%2F219108%2F4;p=test%2Ftct%2Fnative%2Fapi.git [ITC][media-controller][Non-ACR][Code optimization and naming issue fix] Change-Id: Ic7d75d0bd75e4113dea441b92f4b8bf380725e50 Signed-off-by: Priya Kohli --- diff --git a/src/itc/media-controller/ITs-media-controller-client.c b/src/itc/media-controller/ITs-media-controller-client.c index f59d2c8d1..e8bea4ea5 100755 --- a/src/itc/media-controller/ITs-media-controller-client.c +++ b/src/itc/media-controller/ITs-media-controller-client.c @@ -1592,7 +1592,7 @@ int ITc_mc_client_set_unset_cb_send_event_reply_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: To check wether set and unset of callback is correct or not int ITc_mc_client_set_unset_playlist_updated_cb_p(void) { @@ -1634,7 +1634,7 @@ int ITc_mc_client_set_unset_playlist_updated_cb_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: To get playlist name int ITc_mc_playlist_get_name_p(void) { @@ -1692,7 +1692,7 @@ int ITc_mc_playlist_get_name_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: To set and unset the callback for monitoring the playback ability of the media controller server. int ITc_mc_client_set_unset_playback_ability_updated_cb_p(void) { @@ -1729,7 +1729,7 @@ int ITc_mc_client_set_unset_playback_ability_updated_cb_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: To set and get the playlist name and index of the media in playlist. int ITc_mc_client_set_get_playlist_item_info_p(void) { @@ -1816,7 +1816,7 @@ int ITc_mc_client_set_get_playlist_item_info_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: To set and get age rating of the content to update the latest playback info. int ITc_mc_client_set_get_age_rating_p(void) { @@ -1906,7 +1906,7 @@ int ITc_mc_client_set_get_age_rating_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: Sends the search command to server. int ITc_mc_client_send_search_cmd_p(void) { @@ -1964,7 +1964,7 @@ int ITc_mc_client_send_search_cmd_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: To test mc_search_create, mc_search_clone, mc_search_destroy. int ITc_mc_search_create_clone_destroy_p(void) { @@ -2005,7 +2005,7 @@ int ITc_mc_search_create_clone_destroy_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: Sets the information to search. int ITc_mc_search_set_condition_p(void) { @@ -2041,7 +2041,7 @@ int ITc_mc_search_set_condition_p(void) * @precondition NA * @postcondition NA * */ - //& type: auto +//& type: auto //& purpose: This function gets all search conditions set. int ITc_mc_search_foreach_condition_p(void) { @@ -2079,7 +2079,7 @@ int ITc_mc_search_foreach_condition_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: This function gets the number of conditions to search. int ITc_mc_search_get_condition_count_p(void) { @@ -2127,7 +2127,7 @@ int ITc_mc_search_get_condition_count_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: This function Set and Unset callback for ability support. int ITc_mc_client_set_unset_ability_support_updated_cb_p(void) { @@ -2170,7 +2170,7 @@ int ITc_mc_client_set_unset_ability_support_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the support value of the ability support of the updated media controller server. int ITc_mc_client_get_server_ability_support_p(void) { @@ -2213,7 +2213,7 @@ int ITc_mc_client_get_server_ability_support_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sets and unset the callback for monitoring the display mode ability of the media controller server. int ITc_mc_client_set_unset_display_mode_ability_updated_cb_p(void) { @@ -2252,7 +2252,7 @@ int ITc_mc_client_set_unset_display_mode_ability_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sets and unsets the callback for monitoring the display rotation ability of the media controller server. int ITc_mc_client_set_unset_display_rotation_ability_updated_cb_p(void) { @@ -2291,7 +2291,7 @@ int ITc_mc_client_set_unset_display_rotation_ability_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sets and unsets the callback for monitoring the media controller server's subtitles display. int ITc_mc_client_set_unset_subtitles_updated_cb_p(void) { @@ -2329,7 +2329,7 @@ int ITc_mc_client_set_unset_subtitles_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sets and unsets the callback for monitoring the media controller server's 360 mode display. int ITc_mc_client_set_unset_360_mode_updated_cb_p(void) { @@ -2367,7 +2367,7 @@ int ITc_mc_client_set_unset_360_mode_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sets and unsets the callback for monitoring the media controller server's display mode. int ITc_mc_client_set_unset_display_mode_updated_cb_p(void) { @@ -2410,7 +2410,7 @@ int ITc_mc_client_set_unset_display_mode_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sets and unsets the callback for monitoring the media controller server's display rotation. int ITc_mc_client_set_unset_display_rotation_updated_cb_p(void) { @@ -2453,7 +2453,7 @@ int ITc_mc_client_set_unset_display_rotation_updated_cb_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the latest subtitles display status. int ITc_mc_client_get_server_subtitles_enabled_p(void) { @@ -2489,7 +2489,7 @@ int ITc_mc_client_get_server_subtitles_enabled_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the latest subtitles display status. int ITc_mc_client_get_server_360_mode_enabled_p(void) { @@ -2525,7 +2525,7 @@ int ITc_mc_client_get_server_360_mode_enabled_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the latest display mode. int ITc_mc_client_get_server_display_mode_p(void) { @@ -2567,7 +2567,7 @@ int ITc_mc_client_get_server_display_mode_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the latest display rotation. int ITc_mc_client_get_server_display_rotation_p(void) { @@ -2609,7 +2609,7 @@ int ITc_mc_client_get_server_display_rotation_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the supported display mode of the updated media controller server. int ITc_mc_client_get_server_display_mode_ability_p(void) { @@ -2650,7 +2650,7 @@ int ITc_mc_client_get_server_display_mode_ability_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Gets the supported display rotation of the updated media controller server. int ITc_mc_client_get_server_display_rotation_ability_p(void) { @@ -2691,7 +2691,7 @@ int ITc_mc_client_get_server_display_rotation_ability_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sends the subtitles command to server. int ITc_mc_client_send_subtitles_cmd_p(void) { @@ -2737,7 +2737,7 @@ int ITc_mc_client_send_subtitles_cmd_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sends the 360 mode command to server. int ITc_mc_client_send_360_mode_cmd_p(void) { @@ -2781,7 +2781,7 @@ int ITc_mc_client_send_360_mode_cmd_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sends the display mode command to server. int ITc_mc_client_send_display_mode_cmd_p(void) { @@ -2832,7 +2832,7 @@ int ITc_mc_client_send_display_mode_cmd_p(void) * @precondition mc_server_create * @postcondition mc_server_destroy * */ - //& type: auto +//& type: auto //& purpose: Sends the display rotation command to server. int ITc_mc_client_send_display_rotation_cmd_p(void) { diff --git a/src/itc/media-controller/ITs-media-controller-server.c b/src/itc/media-controller/ITs-media-controller-server.c index c27af89c2..819303933 100755 --- a/src/itc/media-controller/ITs-media-controller-server.c +++ b/src/itc/media-controller/ITs-media-controller-server.c @@ -230,28 +230,28 @@ void ServerForeachPlaylistCommandReceivedCallback(const char *app_id, mc_playlis */ int ServerMcRegisterPlaylist(mc_playlist_h *hPlaylistReg) { - int nRet = MEDIA_CONTROLLER_ERROR_NONE; - mc_playlist_h hPlaylist = NULL; + int nRet = MEDIA_CONTROLLER_ERROR_NONE; + mc_playlist_h hPlaylist = NULL; - nRet = mc_server_create_playlist(g_hMcServer, g_PlaylistName, &hPlaylist); - PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_create_playlist", MediaControllerGetError(nRet)); - CHECK_HANDLE(hPlaylist, "mc_server_create_playlist"); + nRet = mc_server_create_playlist(g_hMcServer, g_PlaylistName, &hPlaylist); + PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_create_playlist", MediaControllerGetError(nRet)); + CHECK_HANDLE(hPlaylist, "mc_server_create_playlist"); - int sSize = sizeof(g_PlaylistArray)/sizeof(g_PlaylistArray[0]); - int StringIndex = 0; - for(StringIndex = 0; StringIndex < sSize; StringIndex++) - { - FPRINTF("[%d:%s] Adding item to playlist index=%d, [%s]\n", __LINE__, __FUNCTION__, StringIndex, g_PlaylistArray[StringIndex]); - nRet = mc_server_add_item_to_playlist(g_hMcServer, hPlaylist, "1", StringIndex, g_PlaylistArray[StringIndex]); - PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_add_item_to_playlist", MediaControllerGetError(nRet),mc_playlist_destroy(hPlaylist)); - } + int sSize = sizeof(g_PlaylistArray)/sizeof(g_PlaylistArray[0]); + int StringIndex = 0; + for(StringIndex = 0; StringIndex < sSize; StringIndex++) + { + FPRINTF("[%d:%s] Adding item to playlist index=%d, [%s]\n", __LINE__, __FUNCTION__, StringIndex, g_PlaylistArray[StringIndex]); + nRet = mc_server_add_item_to_playlist(g_hMcServer, hPlaylist, "1", StringIndex, g_PlaylistArray[StringIndex]); + PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_add_item_to_playlist", MediaControllerGetError(nRet),mc_playlist_destroy(hPlaylist)); + } - nRet = mc_server_update_playlist_done(g_hMcServer, hPlaylist); - PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_update_playlist_done", MediaControllerGetError(nRet),mc_playlist_destroy(hPlaylist)); + nRet = mc_server_update_playlist_done(g_hMcServer, hPlaylist); + PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_update_playlist_done", MediaControllerGetError(nRet),mc_playlist_destroy(hPlaylist)); - *hPlaylistReg = hPlaylist; + *hPlaylistReg = hPlaylist; - return MEDIA_CONTROLLER_ERROR_NONE; + return MEDIA_CONTROLLER_ERROR_NONE; } /* @@ -1355,12 +1355,12 @@ int ITc_mc_server_add_item_to_playlist_p(void) PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_create_playlist", MediaControllerGetError(nRet)); CHECK_HANDLE(hPlaylist, "mc_server_create_playlist"); - int sSize = sizeof(g_PlaylistArray)/sizeof(g_PlaylistArray[0]); - int StringIndex = 0; - for(StringIndex = 0; StringIndex < sSize; StringIndex++) + int nSize = sizeof(g_PlaylistArray)/sizeof(g_PlaylistArray[0]); + + for(int nStringIndex = 0; nStringIndex < nSize; nStringIndex++) { - FPRINTF("[%d:%s] Adding item to playlist index=%d, [%s]\n", __LINE__, __FUNCTION__, StringIndex, g_PlaylistArray[StringIndex]); - nRet = mc_server_add_item_to_playlist(g_hMcServer, hPlaylist, pszIndex, StringIndex, g_PlaylistArray[StringIndex]); + FPRINTF("[%d:%s] Adding item to playlist index=%d, [%s]\n", __LINE__, __FUNCTION__, nStringIndex, g_PlaylistArray[nStringIndex]); + nRet = mc_server_add_item_to_playlist(g_hMcServer, hPlaylist, pszIndex, nStringIndex, g_PlaylistArray[nStringIndex]); PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_add_item_to_playlist", MediaControllerGetError(nRet),mc_playlist_destroy(hPlaylist)); } @@ -1398,12 +1398,12 @@ int ITc_mc_server_update_playlist_done_p(void) PRINT_RESULT(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_create_playlist", MediaControllerGetError(nRet)); CHECK_HANDLE(hPlaylist, "mc_server_create_playlist"); - int sSize = sizeof(g_PlaylistArray)/sizeof(g_PlaylistArray[0]); - int StringIndex = 0; - for(StringIndex = 0; StringIndex < sSize; StringIndex++) + int nSize = sizeof(g_PlaylistArray)/sizeof(g_PlaylistArray[0]); + + for(int nStringIndex = 0; nStringIndex < nSize; nStringIndex++) { - FPRINTF("[%d:%s] Adding item to playlist index=%d, [%s]\n", __LINE__, __FUNCTION__, StringIndex, g_PlaylistArray[StringIndex]); - nRet = mc_server_add_item_to_playlist(g_hMcServer, hPlaylist, pszIndex, StringIndex, g_PlaylistArray[StringIndex]); + FPRINTF("[%d:%s] Adding item to playlist index=%d, [%s]\n", __LINE__, __FUNCTION__, nStringIndex, g_PlaylistArray[nStringIndex]); + nRet = mc_server_add_item_to_playlist(g_hMcServer, hPlaylist, pszIndex, nStringIndex, g_PlaylistArray[nStringIndex]); PRINT_RESULT_CLEANUP(MEDIA_CONTROLLER_ERROR_NONE, nRet, "mc_server_add_item_to_playlist", MediaControllerGetError(nRet),mc_playlist_destroy(hPlaylist)); }