From: Eunhae Choi Date: Tue, 9 Aug 2016 09:41:00 +0000 (+0900) Subject: fix about timeout value bug and add test menu for tbm surface pool X-Git-Tag: submit/tizen/20160810.075454^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a69f740bf9f45a10951ba506094da5701b90f7a4;p=platform%2Fcore%2Fapi%2Fplayer.git fix about timeout value bug and add test menu for tbm surface pool Change-Id: I645b5f190d5ded058152b5255cc63ede58b1bcc3 --- diff --git a/include/player_private.h b/include/player_private.h index ed4ccc4..7a1bf0e 100644 --- a/include/player_private.h +++ b/include/player_private.h @@ -48,7 +48,7 @@ extern "C" { #define CONNECTION_RETRY 51 #define CONNECTION_TIME_OUT 50 /* ms */ #define CREATE_CB_TIME_OUT 400 /* ms */ -#define CALLBACK_TIME_OUT (5*1000) /* ms */ +#define CALLBACK_TIME_OUT 5000 /* ms */ #define MAX_SERVER_TIME_OUT 35000 /* ms */ @@ -110,7 +110,7 @@ typedef struct _callback_cb_info { typedef struct { intptr_t bo; - gint timeout; /* sec */ + gint timeout; /* ms */ } server_info_s; typedef struct _player_cli_s { diff --git a/src/player.c b/src/player.c index 6133311..a1877dc 100644 --- a/src/player.c +++ b/src/player.c @@ -114,9 +114,8 @@ int _player_media_packet_finalize(media_packet_h pkt, int error_code, void *user snd_len = muse_core_ipc_send_msg(fin_data->fd, snd_msg); muse_core_msg_json_factory_free(snd_msg); - if (snd_len <= 0) { + if (snd_len <= 0) LOGE("fail to send msg."); - } EXIT: if (fin_data) { @@ -1296,12 +1295,12 @@ int client_get_api_timeout(player_cli_s * pc, muse_player_api_e api) case MUSE_PLAYER_API_START: case MUSE_PLAYER_API_STOP: case MUSE_PLAYER_API_PAUSE: - timeout += SERVER_TIMEOUT(pc) * G_TIME_SPAN_MILLISECOND; + timeout += SERVER_TIMEOUT(pc); break; default: /* check prepare async is done */ if (pc && CALLBACK_INFO(pc) && CALLBACK_INFO(pc)->user_cb[MUSE_PLAYER_EVENT_TYPE_PREPARE]) - timeout += SERVER_TIMEOUT(pc) * G_TIME_SPAN_MILLISECOND; + timeout += SERVER_TIMEOUT(pc); break; } timeout += CALLBACK_TIME_OUT; @@ -1527,7 +1526,7 @@ int player_prepare_async(player_h player, player_prepared_cb callback, void *use int timeout = 0; player_msg_get_type(timeout, ret_buf, INT); - LOGD("server timeout will be %ds", timeout); + LOGD("server timeout will be %d sec", timeout); SERVER_TIMEOUT(pc) = timeout * G_TIME_SPAN_MILLISECOND; } @@ -1550,7 +1549,7 @@ int player_prepare(player_h player) int timeout = 0; player_msg_get_type(timeout, ret_buf, INT); - LOGD("server timeout will be %ds", timeout); + LOGD("server timeout will be %d sec", timeout); SERVER_TIMEOUT(pc) = timeout * G_TIME_SPAN_MILLISECOND; } diff --git a/test/player_test.c b/test/player_test.c index 9d89c33..8c899e1 100644 --- a/test/player_test.c +++ b/test/player_test.c @@ -1166,6 +1166,15 @@ static void _player_get_progressive_download_status() g_print("player_get_progressive_download_status return[%d] ==> [Player_Test] progressive download status : %lu/%lu\n", bRet, curr, total); } +static void _player_enable_tsurf_pool(void) +{ + bool enabled = FALSE; + player_is_enabled_tsurf_pool(g_player[0], &enabled); + + g_print("tbm surface pool will be %s", (enabled) ? "disabled" : "enabled"); + player_enable_tsurf_pool(g_player[0], !enabled); +} + static void set_next_uri(char * uri) { #ifndef TIZEN_TV @@ -1794,6 +1803,8 @@ void _interpret_main_menu(char *cmd) audio_frame_decoded_cb_ex(TRUE); } else if (strncmp(cmd, "X4", 2) == 0) { audio_frame_decoded_cb_ex(FALSE); + } else if (strncmp(cmd, "ep", 2) == 0) { + _player_enable_tsurf_pool(); } else if (strncmp(cmd, "su", 2) == 0) { g_menu_state = CURRENT_STATUS_NEXT_URI; } else if (strncmp(cmd, "gu", 2) == 0) { @@ -1830,7 +1841,7 @@ void display_sub_basic() g_print("[ volume ] f. Set Volume\t"); g_print("g. Get Volume\t"); g_print("z. Set Sound type\t"); - g_print("k. Set Sound Stream Info.\t"); + g_print("k. Set Sound Stream Info.\n"); g_print("[ mute ] h. Set Mute\t"); g_print("i. Get Mute\n"); g_print("[audio eq] E. Set Audio EQ\t"); @@ -1847,7 +1858,7 @@ void display_sub_basic() g_print("[display] ds. Change display surface type\n"); g_print("[overlay display] r. Set display mode\t"); g_print("s. Get display mode\n"); - g_print("[overlay display] t. Set display Rotation\t"); + g_print("[overlay display] t. Set display Rotation\n"); g_print("[Track] tl. Get Track language info(single only)\n"); g_print("[subtitle] A. Set(or change) subtitle path\n"); g_print("[subtitle] ss. Select(or change) subtitle track\n"); @@ -1855,11 +1866,12 @@ void display_sub_basic() g_print("[next uri] su. set next uri. \t"); g_print("gu. get next uri. \t"); g_print("sg. set gapless. \n"); - g_print("[etc] sp. Set Progressive Download\t"); - g_print("gp. Get Progressive Download status\n"); - g_print("mp. memory playback\n"); g_print("[audio_frame_decoded_cb_ex] X3. set audio_cb with sync\t"); g_print("X4. set audio_cb with async \n"); + g_print("[video_frame_decoded_cb] ep. enable tbm surface pool\n"); + g_print("[etc] sp. Set Progressive Download\t"); + g_print("gp. Get Progressive Download status\t"); + g_print("mp. memory playback\n"); g_print("\n"); g_print("=========================================================================================\n"); }