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);
static int __mmplayer_get_array_count(MMHandleType handle, int type)
{
- mmplayer_t *player = (mmplayer_t *)handle;
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
int count = 0;
int i = 0;
static media_format_mimetype_e __mmplayer_get_supported_format_mimetype(MMHandleType handle, int type, int i)
{
- char *name = NULL;
+ mmplayer_t *player = MM_PLAYER_CAST(handle);
media_format_mimetype_e format = MEDIA_FORMAT_MAX;
-
- mmplayer_t *player = (mmplayer_t *)handle;
+ char *name = NULL;
if (type == KEYWORD_A_OFFLOAD_MEDIA_FORMAT) {
name = player->ini.audio_offload_media_format[i];
format = MEDIA_FORMAT_PCM_F32LE;
else if (!strcmp(name, "PCM_F32BE"))
format = MEDIA_FORMAT_PCM_F32BE;
- else if (!strcmp(name, "PCM_S16LE"))
+ else if (!strcmp(name, "PCM_U16LE"))
format = MEDIA_FORMAT_PCM_U16LE;
else if (!strcmp(name, "PCM_U24LE"))
format = MEDIA_FORMAT_PCM_U24LE;
player->default_attrs[MMPLAYER_ATTRS_MEDIA_STREAM_INPUT_FORMAT].validity_value_2.count = total_count;
}
+ /* 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_DEFAULT},
+ {.int_min = MM_PLAYER_CODEC_TYPE_HW},
{.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_DEFAULT},
+ {(void *)MM_PLAYER_CODEC_TYPE_HW},
MM_ATTRS_VALID_TYPE_INT_RANGE,
- {.int_min = MM_PLAYER_CODEC_TYPE_DEFAULT},
+ {.int_min = MM_PLAYER_CODEC_TYPE_HW},
{.int_max = MM_PLAYER_CODEC_TYPE_SW},
NULL,
},
{.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)