MMPLAYER_FENTER();
MMPLAYER_RETURN_VAL_IF_FAIL(player && value, false);
- MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline && player->pipeline->mainbin, true);
+ MMPLAYER_RETURN_VAL_IF_FAIL(player->pipeline && player->pipeline->audiobin, true);
pipeline = player->pipeline;
mm_attrs_get_int_by_name(player->attrs, MM_PLAYER_PITCH_CONTROL, &pitch_control);
return total_count;
}
-static int __mmplayer_get_default_audio_codec_type(MMHandleType handle)
-{
- mmplayer_t *player = MM_PLAYER_CAST(handle);
-
- if (!strcmp(player->ini.audiocodec_default_type, "hw"))
- return MM_PLAYER_CODEC_TYPE_HW;
- else
- return MM_PLAYER_CODEC_TYPE_SW;
-}
-
static int __mmplayer_set_ini_to_valid_info(MMHandleType handle)
{
mmplayer_t *player = MM_PLAYER_CAST(handle);
player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_2.count = total_count;
}
- /* default audio codec type */
- player->default_attrs[MMPLAYER_ATTRS_AUDIO_CODEC_TYPE].default_value.value_int = __mmplayer_get_default_audio_codec_type(handle);
+ /* default codec type */
+ if (!strcmp(player->ini.audiocodec_default_type, "sw"))
+ player->default_attrs[MMPLAYER_ATTRS_AUDIO_CODEC_TYPE].default_value.value_int = MM_PLAYER_CODEC_TYPE_SW;
+
+ if (!strcmp(player->ini.videocodec_default_type, "sw"))
+ player->default_attrs[MMPLAYER_ATTRS_VIDEO_CODEC_TYPE].default_value.value_int = MM_PLAYER_CODEC_TYPE_SW;
return MM_ERROR_NONE;
}
player = MM_PLAYER_CAST(handle);
- /* apply display attr value to player handle */
- if (!g_strrstr(attribute_name, "display"))
+ if (!g_strrstr(attribute_name, "display") || !g_strcmp0(attribute_name, "exported_shell_handle"))
return MM_ERROR_NONE;
if (!_mmplayer_is_videosink_ready(player, MM_DISPLAY_SURFACE_NUM)) {
NULL,
},
{
+ MMPLAYER_ATTRS_DISPLAY_EXPORTED_SHELL_HANDLE,
+ (char *)"exported_shell_handle",
+ MM_ATTRS_TYPE_STRING,
+ MM_ATTRS_FLAG_RW,
+ {(void *)NULL},
+ MM_ATTRS_VALID_TYPE_NONE,
+ {0},
+ {0},
+ NULL,
+ },
+ {
MMPLAYER_ATTRS_SOUND_STREAM_TYPE,
(char *)"sound_stream_type",
MM_ATTRS_TYPE_STRING,
(char *)"video_codec_type",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- {(void *)MM_PLAYER_CODEC_TYPE_DEFAULT},
+ {(void *)MM_PLAYER_CODEC_TYPE_HW},
MM_ATTRS_VALID_TYPE_INT_RANGE,
{.int_min = MM_PLAYER_CODEC_TYPE_HW},
- {.int_max = MM_PLAYER_CODEC_TYPE_DEFAULT},
+ {.int_max = MM_PLAYER_CODEC_TYPE_SW},
NULL,
},
{
(char *)"audio_codec_type",
MM_ATTRS_TYPE_INT,
MM_ATTRS_FLAG_RW,
- {(void *)MM_PLAYER_CODEC_TYPE_SW},
+ {(void *)MM_PLAYER_CODEC_TYPE_HW},
MM_ATTRS_VALID_TYPE_INT_RANGE,
{.int_min = MM_PLAYER_CODEC_TYPE_HW},
{.int_max = MM_PLAYER_CODEC_TYPE_SW},
{.count = 0},
NULL,
},
+ {
+ MMPLAYER_ATTRS_AUDIO_ONLY,
+ (char *)"audio_only", /* MM_PLAYER_AUDIO_ONLY */
+ MM_ATTRS_TYPE_INT,
+ MM_ATTRS_FLAG_RW,
+ {(void *)FALSE},
+ MM_ATTRS_VALID_TYPE_INT_RANGE,
+ {.int_min = FALSE},
+ {.int_max = TRUE},
+ NULL,
+ },
};
MMPLAYER_RETURN_VAL_IF_FAIL(handle, 0);
return NULL;
}
+ /* alloc default attribute info */
+ player->default_attrs = (mmplayer_attrs_spec_t *)g_try_malloc(sizeof(mmplayer_attrs_spec_t) * num_of_attrs);
+ if (player->default_attrs == NULL) {
+ LOGE("failed to alloc default attribute info");
+ goto ERROR;
+ }
+
+ memcpy(player->default_attrs, player_attrs, sizeof(mmplayer_attrs_spec_t) * num_of_attrs);
+ __mmplayer_set_ini_to_valid_info(handle);
+
/* initialize values of attributes */
for (idx = 0; idx < num_of_attrs; idx++) {
- base[idx].name = player_attrs[idx].name;
- base[idx].value_type = player_attrs[idx].value_type;
- base[idx].flags = player_attrs[idx].flags;
- base[idx].default_value = player_attrs[idx].default_value.value_void; /* FIXME: need to consider the double data type */
+ base[idx].name = player->default_attrs[idx].name;
+ base[idx].value_type = player->default_attrs[idx].value_type;
+ base[idx].flags = player->default_attrs[idx].flags;
+ base[idx].default_value = player->default_attrs[idx].default_value.value_void; /* FIXME: need to consider the double data type */
}
result = mm_attrs_new(base, num_of_attrs, "mmplayer_attrs",
/* clean */
MMPLAYER_FREEIF(base);
- if (result) {
+ if (result != MM_ERROR_NONE) {
LOGE("failed to create player attrs");
- return NULL;
- }
-
- /* alloc default attribute info */
- player->default_attrs = (mmplayer_attrs_spec_t *)g_try_malloc(sizeof(mmplayer_attrs_spec_t) * num_of_attrs);
- if (player->default_attrs == NULL) {
- LOGE("failed to alloc default attribute info");
goto ERROR;
}
- memcpy(player->default_attrs, player_attrs, sizeof(mmplayer_attrs_spec_t) * num_of_attrs);
-
- __mmplayer_set_ini_to_valid_info(handle);
-
/* set validity type and range */
for (idx = 0; idx < num_of_attrs; idx++) {
mm_attrs_set_valid_type(attrs, idx, player->default_attrs[idx].valid_type);
return attrs;
ERROR:
+ MMPLAYER_FREEIF(base);
MMPLAYER_FREEIF(player->default_attrs);
if (attrs)