From 666134810a394e64ae88a96fcd428a6d0db2f89a Mon Sep 17 00:00:00 2001 From: Sangchul Lee Date: Thu, 19 Mar 2020 14:29:40 +0900 Subject: [PATCH] [0.3.127] player_audio_test: Add new test menu to set latency mode Change-Id: Iae8246bcea13793b15183eefbd0be4f306ce1cef Signed-off-by: Sangchul Lee --- packaging/capi-media-player.spec | 2 +- test/player_audio_test.c | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/packaging/capi-media-player.spec b/packaging/capi-media-player.spec index 78e7cbc..97a14fc 100644 --- a/packaging/capi-media-player.spec +++ b/packaging/capi-media-player.spec @@ -1,6 +1,6 @@ Name: capi-media-player Summary: A Media Player API -Version: 0.3.126 +Version: 0.3.127 Release: 0 Group: Multimedia/API License: Apache-2.0 diff --git a/test/player_audio_test.c b/test/player_audio_test.c index 45ce770..3548dd2 100644 --- a/test/player_audio_test.c +++ b/test/player_audio_test.c @@ -120,6 +120,7 @@ enum { CURRENT_STATUS_AUDIO_EQUALIZER, CURRENT_STATUS_PLAYBACK_RATE, CURRENT_STATUS_STREAMING_PLAYBACK_RATE, + CURRENT_STATUS_LATENCY, CURRENT_STATUS_NEXT_URI, CURRENT_STATUS_GAPLESS, CURRENT_STATUS_GET_TRACK_INFO, @@ -926,6 +927,14 @@ static void get_audio_eq() g_print(" ==> [Player_Audio_Test] eq bands frequency range: [%d] \n", value); } +static void set_latency(int value) +{ + int ret = PLAYER_ERROR_NONE; + + if ((ret = player_set_audio_latency_mode(g_player[0], value))) + g_print("failed to player_set_audio_latency_mode, ret(0x%x)\n", ret); +} + void quit_program() { if (g_pcm_fd) @@ -1017,6 +1026,8 @@ void _interpret_main_menu(char *cmd) g_menu_state = CURRENT_STATUS_HANDLE_NUM; } else if (strncmp(cmd, "tr", 2) == 0) { g_menu_state = CURRENT_STATUS_PLAYBACK_RATE; + } else if (strncmp(cmd, "lt", 2) == 0) { + g_menu_state = CURRENT_STATUS_LATENCY; } else if (strncmp(cmd, "su", 2) == 0) { g_menu_state = CURRENT_STATUS_NEXT_URI; } else if (strncmp(cmd, "gu", 2) == 0) { @@ -1068,6 +1079,7 @@ void display_sub_basic() g_print("[position] j. Set Position \t"); g_print("l. Get Position\n"); g_print("[trick] tr. set playback rate\n"); + g_print("[latency] lt. Set latency\n"); g_print("[duration] m. Get Duration\n"); g_print("[Stream Info] n. Get stream info (Video Size, codec, audio stream info, and tag info)\n"); g_print("[Looping] o. Set Looping\t"); @@ -1110,6 +1122,8 @@ static void displaymenu() g_print(" *** input audio eq value.(0: UNSET, 1: SET) \n"); } else if (g_menu_state == CURRENT_STATUS_PLAYBACK_RATE || g_menu_state == CURRENT_STATUS_STREAMING_PLAYBACK_RATE) { g_print(" *** input playback rate.(-5.0 ~ 5.0)\n"); + } else if (g_menu_state == CURRENT_STATUS_LATENCY) { + g_print(" *** input latency.(0: Low, 1: Mid, 2: High)\n"); } else if (g_menu_state == CURRENT_STATUS_NEXT_URI) { g_print("*** input next uri.\n"); } else if (g_menu_state == CURRENT_STATUS_GAPLESS) { @@ -1240,6 +1254,13 @@ static void interpret(char *cmd) reset_menu_state(); } break; + case CURRENT_STATUS_LATENCY: + { + int value = atoi(cmd); + set_latency(value); + reset_menu_state(); + } + break; case CURRENT_STATUS_NEXT_URI: { set_next_uri(cmd); -- 2.7.4