From f829d2c8b82482961739339796a66be1f5899323 Mon Sep 17 00:00:00 2001 From: Eunhae Choi Date: Thu, 21 Jul 2016 18:48:21 +0900 Subject: [PATCH] modify test suite to check the gapless funct seperately Change-Id: I04063e5dbdb55cc03320b4ee955154d47a5bee03 --- test/player_test.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/test/player_test.c b/test/player_test.c index e622f08..9d89c33 100644 --- a/test/player_test.c +++ b/test/player_test.c @@ -83,6 +83,7 @@ enum { CURRENT_STATUS_STREAMING_PLAYBACK_RATE, CURRENT_STATUS_SWITCH_SUBTITLE, CURRENT_STATUS_NEXT_URI, + CURRENT_STATUS_GAPLESS, }; #define MAX_HANDLE 20 @@ -1168,7 +1169,6 @@ static void _player_get_progressive_download_status() static void set_next_uri(char * uri) { #ifndef TIZEN_TV - player_set_gapless(g_player[0], TRUE); if (player_set_next_uri(g_player[0], uri) != PLAYER_ERROR_NONE) g_print("fail to set next uri"); #else @@ -1394,6 +1394,24 @@ static void get_stream_info() g_print(" ==> [Player_Test] Width: [%d ] , Height: [%d ] \n", w, h); } +static void set_gapless(bool gapless) +{ +#ifndef TIZEN_TV + if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) { + if (player_set_gapless(g_player[0], gapless) != PLAYER_ERROR_NONE) + g_print("failed set_gapless\n"); + } else { + int i = 0; + for (i = 0; i < g_handle_num; i++) { + if (player_set_gapless(g_player[i], gapless) != PLAYER_ERROR_NONE) + g_print("failed to set_gapless\n"); + } + } +#else + g_print("not support at TV profile"); +#endif +} + static void set_looping(bool looping) { if (g_current_surface_type == PLAYER_DISPLAY_TYPE_OVERLAY) { @@ -1780,6 +1798,8 @@ void _interpret_main_menu(char *cmd) g_menu_state = CURRENT_STATUS_NEXT_URI; } else if (strncmp(cmd, "gu", 2) == 0) { get_next_uri(); + } else if (strncmp(cmd, "sg", 2) == 0) { + g_menu_state = CURRENT_STATUS_GAPLESS; } else { g_print("unknown menu \n"); } @@ -1834,6 +1854,7 @@ void display_sub_basic() g_print("[Video Capture] C. Capture \n"); 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"); @@ -1893,6 +1914,8 @@ static void displaymenu() g_print("no track\n"); } else if (g_menu_state == CURRENT_STATUS_NEXT_URI) { g_print("*** input next uri.\n"); + } else if (g_menu_state == CURRENT_STATUS_GAPLESS) { + g_print("*** input gapless value.(0:disable, 1: enable) \n"); } else { g_print("*** unknown status.\n"); quit_program(); @@ -1984,6 +2007,13 @@ static void interpret(char *cmd) reset_menu_state(); } break; + case CURRENT_STATUS_GAPLESS: + { + int gapless = atoi(cmd); + set_gapless(gapless); + reset_menu_state(); + } + break; case CURRENT_STATUS_DISPLAY_SURFACE_CHANGE: { int type = atoi(cmd); -- 2.7.4