{
int ret = PLAYER_ERROR_NONE;
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pbandwidth && pwidth && pheight);
+ PLAYER_NULL_ARG_CHECK(pbandwidth || pwidth || pheight);
player_cli_s *pc = (player_cli_s *) player;
muse_player_api_e api = MUSE_PLAYER_API_GET_MAX_ADAPTIVE_VARIANT_LIMIT;
player_msg_get3(ret_buf, bandwidth, INT, width, INT, height, INT, ret_val);
if (ret_val) {
- *pbandwidth = bandwidth;
- *pwidth = width;
- *pheight = height;
+ if (pbandwidth) *pbandwidth = bandwidth;
+ if (pwidth) *pwidth = width;
+ if (pheight) *pheight = height;
} else {
ret = PLAYER_ERROR_INVALID_OPERATION;
}
LOGD("LEAVE 0x%X", ret);
return ret;
}
+
+int player_set_audio_only(player_h player, bool audio_only)
+{
+ int ret = PLAYER_ERROR_NONE;
+ PLAYER_INSTANCE_CHECK(player);
+ player_cli_s *pc = (player_cli_s *) player;
+ muse_player_api_e api = MUSE_PLAYER_API_SET_AUDIO_ONLY;
+ char *ret_buf = NULL;
+
+ LOGD("ENTER audio_only: %d", audio_only);
+
+ player_msg_send1(api, pc, ret_buf, ret, INT, audio_only);
+ g_free(ret_buf);
+
+ LOGD("LEAVE 0x%X", ret);
+ return ret;
+
+}
+
+int player_is_audio_only(player_h player, bool *paudio_only)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(paudio_only);
+ int ret = PLAYER_ERROR_NONE;
+ muse_player_api_e api = MUSE_PLAYER_API_IS_AUDIO_ONLY;
+ player_cli_s *pc = (player_cli_s *) player;
+ char *ret_buf = NULL;
+ int audio_only = 0;
+
+ LOGD("ENTER");
+
+ player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get(audio_only, ret_buf);
+ *paudio_only = (bool)audio_only;
+ }
+ g_free(ret_buf);
+
+ LOGD("LEAVE 0x%X", ret);
+ return ret;
+}
CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT,
CURRENT_STATUS_SET_MAX_WIDTH_VARIANT,
CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT,
+ CURRENT_STATUS_SET_AUDIO_ONLY,
};
typedef struct {
g_print("failed to player_capture_video\n");
}
+static void set_audio_only(int val)
+{
+ int ret = PLAYER_ERROR_NONE;
+ bool audio_only = false;
+ ret = player_is_audio_only(g_player[0], &audio_only);
+ if (ret != PLAYER_ERROR_NONE)
+ g_print("failed to get current setting. 0x%X\n", ret);
+ else
+ g_print("current audio only mode : %s\n", (audio_only) ? "enabled" : "disabled");
+ g_print("new audio only mode : %s\n", (val != 0) ? "enabled" : "disabled");
+
+ if (val != 0)
+ ret = player_set_audio_only(g_player[0], true);
+ else
+ ret = player_set_audio_only(g_player[0], false);
+ g_print("finished 0x%X\n", ret);
+}
+
static void decoding_audio()
{
#if 0
g_menu_state = CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT;
} else if (strncmp(cmd, "vg", 2) == 0) {
get_variant_limit();
+ } else if (strncmp(cmd, "ao", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_SET_AUDIO_ONLY;
} else {
g_print("unknown menu \n");
}
g_print("[Variant] vi. Get Streaming Variant Info\t");
g_print("vs. Set max limit of variant\t");
g_print("vg. Get max limit of variant\n");
+ g_print("[audio only] ao. set audio only\n");
g_print("[subtitle] A. Set(or change) subtitle path\n");
g_print("[subtitle] ss. Select(or change) subtitle track\n");
g_print("[Video Capture] C. Capture \n");
g_print("*** set max width (default: -1) \n");
} else if (g_menu_state == CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT) {
g_print("*** set max height (default: -1) \n");
+ } else if (g_menu_state == CURRENT_STATUS_SET_AUDIO_ONLY) {
+ g_print("*** set audio only mode (0:disable, 1:enable) \n");
} else {
g_print("*** unknown status.\n");
quit_program();
reset_menu_state();
}
break;
+ case CURRENT_STATUS_SET_AUDIO_ONLY:
+ {
+ int value = atoi(cmd);
+ set_audio_only(value);
+ reset_menu_state();
+ }
+ break;
}
g_timeout_add(100, timeout_menu_display, 0);