static void __mmplayer_gst_create_sinkbin(GstElement *decodebin, GstPad *pad, gpointer data);
static gboolean __mmplayer_is_midi_type(gchar *str_caps);
static gboolean __mmplayer_is_only_mp3_type(gchar *str_caps);
-static void __mmplayer_set_audio_attrs(mmplayer_t *player, GstCaps *caps);
static gboolean __mmplayer_update_subtitle(GstElement *object, GstBuffer *buffer, GstPad *pad, gpointer data);
static void __mmplayer_release_misc(mmplayer_t *player);
return MM_ERROR_PLAYER_NO_OP;
}
-static int __mmplayer_acquire_hw_resource(mmplayer_t *player, mmplayer_resource_type_e type)
+int _mmplayer_acquire_hw_resource(mmplayer_t *player, mmplayer_resource_type_e type)
{
int rm_ret = MM_RESOURCE_MANAGER_ERROR_NONE;
mm_resource_manager_res_type_e rm_res_type = MM_RESOURCE_MANAGER_RES_TYPE_MAX;
LOGD("display_surface_type (%d)", surface_type);
if ((surface_type == MM_DISPLAY_SURFACE_OVERLAY) &&
- (__mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY) != MM_ERROR_NONE)) {
+ (_mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY) != MM_ERROR_NONE)) {
LOGE("failed to acquire video overlay resource");
goto ERROR;
}
goto ERROR;
}
} else {
- if (__mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY) != MM_ERROR_NONE) {
+ if (_mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_OVERLAY) != MM_ERROR_NONE) {
LOGE("failed to acquire video overlay resource");
goto ERROR;
}
return FALSE;
}
-static void
-__mmplayer_set_audio_attrs(mmplayer_t *player, GstCaps *caps)
+void
+_mmplayer_set_audio_attrs(mmplayer_t *player, GstCaps *caps)
{
GstStructure *caps_structure = NULL;
gint samplerate = 0;
}
gst_object_unref(factory);
- if (__mmplayer_acquire_hw_resource(player,
+ if (_mmplayer_acquire_hw_resource(player,
MMPLAYER_RESOURCE_TYPE_AUDIO_OFFLOAD) != MM_ERROR_NONE) {
LOGE("failed to acquire audio offload decoder resource");
goto DONE;
/* set stream information */
if (!player->audiodec_linked)
- __mmplayer_set_audio_attrs(player, caps);
+ _mmplayer_set_audio_attrs(player, caps);
/* update codec info */
player->not_supported_codec &= MISSING_PLUGIN_VIDEO;
goto DONE;
}
- if (__mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_DECODER) != MM_ERROR_NONE) {
+ if (_mmplayer_acquire_hw_resource(player, MMPLAYER_RESOURCE_TYPE_VIDEO_DECODER) != MM_ERROR_NONE) {
LOGE("failed to acquire video decoder resource");
ret = GST_AUTOPLUG_SELECT_SKIP;
goto DONE;
gchar *selected = NULL;
selected = g_strdup(GST_ELEMENT_NAME(element));
player->audio_decoders = g_list_append(player->audio_decoders, selected);
+
+ /* update codec info */
+ player->not_supported_codec &= MISSING_PLUGIN_VIDEO;
+ player->can_support_codec |= FOUND_PLUGIN_AUDIO;
+ player->audiodec_linked = 1;
+ } else if (g_strrstr(klass, "Codec/Decoder/Video")) {
+ /* update codec info */
+ player->not_supported_codec &= MISSING_PLUGIN_AUDIO;
+ player->can_support_codec |= FOUND_PLUGIN_VIDEO;
+ player->videodec_linked = 1;
}
if (g_strrstr(klass, "Demuxer/Adaptive")) {
GstStream *stream = NULL;
GList *streams = NULL;
GstEvent *ev = NULL;
+ GstCaps *caps = NULL;
LOGD("Switching Streams... type: %d, index: %d", type, index);
stream = g_ptr_array_index(player->track[i].streams, active_idx);
streams = g_list_append (streams, (gchar *)gst_stream_get_stream_id(stream));
LOGD("Selecting %d type stream : %s\n", i, gst_stream_get_stream_id(stream));
+
+ if (i == MM_PLAYER_TRACK_TYPE_AUDIO) {
+ caps = gst_stream_get_caps(stream);
+ if (caps) {
+ _mmplayer_set_audio_attrs(player, caps);
+ gst_caps_unref(caps);
+ }
+ }
}
}
gst_object_unref(sinkpad);
if (type == MM_PLAYER_TRACK_TYPE_AUDIO)
- __mmplayer_set_audio_attrs(player, caps);
+ _mmplayer_set_audio_attrs(player, caps);
+
+ if (caps)
+ gst_caps_unref(caps);
EXIT:
MMPLAYER_FREEIF(change_pad_name);