LOGD("GST_MESSAGE_STREAMS_SELECTED");
player->no_more_pad = TRUE;
+ _mmplayer_set_reconfigure_state(player, FALSE);
_mmplayer_pipeline_complete(NULL, player);
retval = TRUE;
break;
_mmplayer_add_signal_connection(player, G_OBJECT(uridecodebin3),
MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "select-stream", G_CALLBACK(__mmplayer_gst_select_stream), (gpointer)player);
-/* FIXME: need to be added for gapless playback
- _mmplayer_add_signal_connection(player, G_OBJECT(element),
- MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "about-to-finish", G_CALLBACK(_mmplayer_gst_decode_drained), (gpointer)player);
-*/
+ _mmplayer_add_signal_connection(player, G_OBJECT(uridecodebin3),
+ MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "about-to-finish", G_CALLBACK(_mmplayer_gst_about_to_finish), (gpointer)player);
_mmplayer_add_signal_connection(player, G_OBJECT(uridecodebin3),
MM_PLAYER_SIGNAL_TYPE_AUTOPLUG, "deep-element-added", G_CALLBACK(__mmplayer_gst_deep_element_added), (gpointer)player);
void
_mmplayer_activate_next_source(mmplayer_t *player, GstState target)
{
+ int ret = MM_ERROR_NONE;
mmplayer_gst_element_t *mainbin = NULL;
MMMessageParamType msg_param = {0,};
GstElement *element = NULL;
goto ERROR;
}
+ if (!MMPLAYER_USE_DECODEBIN(player)) {
+ ret = _mmplayer_gst_build_pipeline_with_src(player);
+ if (ret != MM_ERROR_NONE)
+ goto ERROR;
+
+ if (gst_element_set_state(mainbin[MMPLAYER_M_AUTOPLUG].gst, target) == GST_STATE_CHANGE_FAILURE) {
+ LOGE("Failed to change state of uridecodebin3 element");
+ goto ERROR;
+ }
+ goto DONE;
+ }
+
element = _mmplayer_gst_create_source(player);
if (!element) {
LOGE("no source element was created");
}
if (gst_bin_add(GST_BIN(mainbin[MMPLAYER_M_PIPE].gst), element) == FALSE) {
- LOGE("failed to add sinkbin to pipeline");
+ LOGE("failed to add %s to pipeline", GST_ELEMENT_NAME(element));
gst_object_unref(GST_OBJECT(element));
element = NULL;
goto ERROR;
goto ERROR;
}
+DONE:
player->gapless.stream_changed = TRUE;
player->gapless.running = TRUE;
MMPLAYER_FLEAVE();