int player_get_volume(player_h player, float *pleft, float *pright)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pleft);
- PLAYER_NULL_ARG_CHECK(pright);
+ PLAYER_NULL_ARG_CHECK(pleft && pright);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VOLUME;
player_cli_s *pc = (player_cli_s *) player;
int player_get_codec_info(player_h player, char **paudio_codec, char **pvideo_codec)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(paudio_codec);
- PLAYER_NULL_ARG_CHECK(pvideo_codec);
+ PLAYER_NULL_ARG_CHECK(paudio_codec && pvideo_codec);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_CODEC_INFO;
player_cli_s *pc = (player_cli_s *) player;
int player_get_audio_stream_info(player_h player, int *psample_rate, int *pchannel, int *pbit_rate)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(psample_rate);
- PLAYER_NULL_ARG_CHECK(pchannel);
- PLAYER_NULL_ARG_CHECK(pbit_rate);
+ PLAYER_NULL_ARG_CHECK(psample_rate && pchannel && pbit_rate);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_AUDIO_STREAM_INFO;
player_cli_s *pc = (player_cli_s *) player;
int player_get_video_stream_info(player_h player, int *pfps, int *pbit_rate)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pfps);
- PLAYER_NULL_ARG_CHECK(pbit_rate);
+ PLAYER_NULL_ARG_CHECK(pfps && pbit_rate);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_STREAM_INFO;
player_cli_s *pc = (player_cli_s *) player;
int player_get_video_size(player_h player, int *pwidth, int *pheight)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pwidth);
- PLAYER_NULL_ARG_CHECK(pheight);
+ PLAYER_NULL_ARG_CHECK(pwidth && pheight);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_VIDEO_SIZE;
player_cli_s *pc = (player_cli_s *) player;
int player_get_album_art(player_h player, void **palbum_art, int *psize)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(palbum_art);
- PLAYER_NULL_ARG_CHECK(psize);
+ PLAYER_NULL_ARG_CHECK(palbum_art && psize);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_ALBUM_ART;
player_cli_s *pc = (player_cli_s *) player;
int player_audio_effect_get_equalizer_level_range(player_h player, int *pmin, int *pmax)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pmin);
- PLAYER_NULL_ARG_CHECK(pmax);
+ PLAYER_NULL_ARG_CHECK(pmin && pmax);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_AUDIO_EFFECT_GET_EQUALIZER_LEVEL_RANGE;
player_cli_s *pc = (player_cli_s *) player;
int player_get_progressive_download_status(player_h player, unsigned long *pcurrent, unsigned long *ptotal_size)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pcurrent);
- PLAYER_NULL_ARG_CHECK(ptotal_size);
+ PLAYER_NULL_ARG_CHECK(pcurrent && ptotal_size);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_PROGRESSIVE_DOWNLOAD_STATUS;
player_cli_s *pc = (player_cli_s *) player;
int player_get_streaming_download_progress(player_h player, int *pstart, int *pcurrent)
{
PLAYER_INSTANCE_CHECK(player);
- PLAYER_NULL_ARG_CHECK(pstart);
- PLAYER_NULL_ARG_CHECK(pcurrent);
+ PLAYER_NULL_ARG_CHECK(pstart && pcurrent);
int ret = PLAYER_ERROR_NONE;
muse_player_api_e api = MUSE_PLAYER_API_GET_STREAMING_DOWNLOAD_PROGRESS;
player_cli_s *pc = (player_cli_s *) player;
g_free(ret_buf);
return ret;
}
+
+int player_foreach_adaptive_variant(player_h player, player_adaptive_variant_cb callback, void *user_data)
+{
+ PLAYER_INSTANCE_CHECK(player);
+ PLAYER_NULL_ARG_CHECK(callback);
+ int ret = PLAYER_ERROR_NONE;
+ player_cli_s *pc = (player_cli_s *) player;
+ muse_player_api_e api = MUSE_PLAYER_API_GET_ADAPTIVE_VARIANT_INFO;
+ char *ret_buf = NULL;
+ char var_info[MUSE_MSG_MAX_LENGTH] = { 0, };
+ int idx = 0, num = 0;
+ int bandwidth = 0, width = 0, height = 0;
+ char *token = NULL;
+ char *ptr = NULL;
+
+ LOGD("ENTER");
+
+ player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ player_msg_get_type(num, ret_buf, INT);
+ if (num > 0)
+ player_msg_get_string(var_info, ret_buf);
+ else
+ LOGW("There is no stream variant info.");
+ }
+
+ for (idx = 0 ; idx < num ; idx++) {
+ bandwidth = width = height = 0;
+
+ token = strtok_r((ptr != NULL) ? (NULL) : (var_info), ",", &ptr);
+ if (!token) break;
+ bandwidth = atoi(token);
+
+ token = strtok_r(NULL, ",", &ptr);
+ if (!token) break;
+ width = atoi(token);
+
+ token = strtok_r(NULL, ",", &ptr);
+ if (!token) break;
+ height = atoi(token);
+
+ callback(bandwidth, width, height, user_data);
+ }
+
+ LOGD("LEAVE 0x%X", ret);
+ g_free(ret_buf);
+ return ret;
+}
+
+int player_set_max_adaptive_variant_limit(player_h player, int bandwidth, int width, int height)
+{
+ 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_MAX_ADAPTIVE_VARIANT_LIMIT;
+ char *ret_buf = NULL;
+
+ LOGD("ENTER");
+
+ player_msg_send3(api, pc, ret_buf, ret, INT, bandwidth, INT, width, INT, height);
+ g_free(ret_buf);
+
+ LOGD("LEAVE 0x%X", ret);
+ return ret;
+
+}
+
+int player_get_max_adaptive_variant_limit(player_h player, int *pbandwidth, int *pwidth, int *pheight)
+{
+ int ret = PLAYER_ERROR_NONE;
+ PLAYER_INSTANCE_CHECK(player);
+ 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;
+ char *ret_buf = NULL;
+ int bandwidth = -1, width = -1, height = -1;
+
+ LOGD("ENTER");
+
+ player_msg_send(api, pc, ret_buf, ret);
+ if (ret == PLAYER_ERROR_NONE) {
+ bool ret_val = TRUE;
+
+ player_msg_get3(ret_buf, bandwidth, INT, width, INT, height, INT, ret_val);
+ if (ret_val) {
+ *pbandwidth = bandwidth;
+ *pwidth = width;
+ *pheight = height;
+ } else {
+ ret = PLAYER_ERROR_INVALID_OPERATION;
+ }
+ }
+ g_free(ret_buf);
+
+ LOGD("LEAVE 0x%X", ret);
+ return ret;
+}
TIZEN_PROFILE_IVI = 0x8,
TIZEN_PROFILE_COMMON = 0x10,
} tizen_profile_t;
+
+typedef struct {
+ int bandwidth;
+ int width;
+ int height;
+} adaptive_variant_info_t;
+
static tizen_profile_t _get_tizen_profile()
{
char *profileName;
CURRENT_STATUS_GAPLESS,
CURRENT_STATUS_GET_TRACK_INFO,
CURRENT_STATUS_POSITION_ACCURATE,
+ CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT,
+ CURRENT_STATUS_SET_MAX_WIDTH_VARIANT,
+ CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT,
};
typedef struct {
static Evas_Object *g_eo[MAX_HANDLE] = { 0, };
static int g_current_surface_type = -1;
+static adaptive_variant_info_t max_limit = {-1, -1, -1};
typedef struct {
Evas_Object *win;
return;
}
+void variant_cb(int bandwidth, int width, int height, void *user_data)
+{
+ g_print(" ==> [Player_Test][b]%d, [w]%d, [h]%d\n", bandwidth, width, height);
+}
+
+static void get_variant_info()
+{
+ player_foreach_adaptive_variant(g_player[0], (player_adaptive_variant_cb)variant_cb, g_player[0]);
+}
+
+static void get_variant_limit()
+{
+ int bandwidth, width, height;
+ player_get_max_adaptive_variant_limit(g_player[0], &bandwidth, &width, &height);
+ g_print(" ==> [Player_Test]get [b]%d, [w]%d, [h]%d\n", bandwidth, width, height);
+}
+
+static void set_variant_limit()
+{
+ g_print(" ==> [Player_Test]set [b]%d, [w]%d, [h]%d\n", max_limit.bandwidth, max_limit.width, max_limit.height);
+ player_set_max_adaptive_variant_limit(g_player[0], max_limit.bandwidth, max_limit.width, max_limit.height);
+}
+
static void get_position()
{
int position = 0;
g_menu_state = CURRENT_STATUS_GAPLESS;
} else if (strncmp(cmd, "tl", 2) == 0) {
g_menu_state = CURRENT_STATUS_GET_TRACK_INFO;
+ } else if (strncmp(cmd, "vi", 2) == 0) {
+ get_variant_info();
+ } else if (strncmp(cmd, "vs", 2) == 0) {
+ g_menu_state = CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT;
+ } else if (strncmp(cmd, "vg", 2) == 0) {
+ get_variant_limit();
} else {
g_print("unknown menu \n");
}
g_print("s. Get display mode\n");
g_print("[overlay display] t. Set display Rotation\n");
g_print("[Track] tl. Get Track language info(single only)\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("[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("*** input gapless value.(0:disable, 1: enable) \n");
} else if (g_menu_state == CURRENT_STATUS_GET_TRACK_INFO) {
g_print("*** input stream type.(1:audio, 3:text) \n");
+ } else if (g_menu_state == CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT) {
+ g_print("*** set max bandwidth (default: -1) \n");
+ } else if (g_menu_state == CURRENT_STATUS_SET_MAX_WIDTH_VARIANT) {
+ 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 {
g_print("*** unknown status.\n");
quit_program();
reset_menu_state();
}
break;
+ case CURRENT_STATUS_SET_MAX_BANDWIDTH_VARIANT:
+ {
+ int value = atoi(cmd);
+ max_limit.bandwidth = value;
+ g_menu_state = CURRENT_STATUS_SET_MAX_WIDTH_VARIANT;
+ }
+ break;
+ case CURRENT_STATUS_SET_MAX_WIDTH_VARIANT:
+ {
+ int value = atoi(cmd);
+ max_limit.width = value;
+ g_menu_state = CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT;
+ }
+ break;
+ case CURRENT_STATUS_SET_MAX_HEIGHT_VARIANT:
+ {
+ int value = atoi(cmd);
+ max_limit.height = value;
+ set_variant_limit();
+ reset_menu_state();
+ }
+ break;
}
g_timeout_add(100, timeout_menu_display, 0);