gulong pad_removed_id;
gulong no_more_pads_id;
gulong notify_source_id;
+ gulong source_setup_id;
gulong drained_id;
gulong autoplug_factories_id;
gulong autoplug_select_id;
GST_OBJECT_UNLOCK (playbin);
g_object_notify (G_OBJECT (playbin), "source");
+}
+
+static void
+source_setup_cb (GstElement * uridecodebin, GstElement * source,
+ GstSourceGroup * group)
+{
+ GstPlayBin *playbin;
+
+ playbin = group->playbin;
- g_signal_emit (playbin, gst_play_bin_signals[SIGNAL_SOURCE_SETUP],
- 0, playbin->source);
+ g_signal_emit (playbin, gst_play_bin_signals[SIGNAL_SOURCE_SETUP], 0, source);
}
/* must be called with the group lock */
G_CALLBACK (no_more_pads_cb), group);
group->notify_source_id = g_signal_connect (uridecodebin, "notify::source",
G_CALLBACK (notify_source_cb), group);
+ group->source_setup_id = g_signal_connect (uridecodebin, "source-setup",
+ G_CALLBACK (source_setup_cb), group);
/* we have 1 pending no-more-pads */
group->pending = 1;
REMOVE_SIGNAL (group->uridecodebin, group->pad_removed_id);
REMOVE_SIGNAL (group->uridecodebin, group->no_more_pads_id);
REMOVE_SIGNAL (group->uridecodebin, group->notify_source_id);
+ REMOVE_SIGNAL (group->uridecodebin, group->source_setup_id);
REMOVE_SIGNAL (group->uridecodebin, group->drained_id);
REMOVE_SIGNAL (group->uridecodebin, group->autoplug_factories_id);
REMOVE_SIGNAL (group->uridecodebin, group->autoplug_select_id);
REMOVE_SIGNAL (group->uridecodebin, group->pad_removed_id);
REMOVE_SIGNAL (group->uridecodebin, group->no_more_pads_id);
REMOVE_SIGNAL (group->uridecodebin, group->notify_source_id);
+ REMOVE_SIGNAL (group->uridecodebin, group->source_setup_id);
REMOVE_SIGNAL (group->uridecodebin, group->drained_id);
REMOVE_SIGNAL (group->uridecodebin, group->autoplug_factories_id);
REMOVE_SIGNAL (group->uridecodebin, group->autoplug_select_id);
GST_LOG_OBJECT (decoder, "found source type %s", G_OBJECT_TYPE_NAME (source));
- decoder->is_stream = IS_STREAM_URI (decoder->uri);
-
- query = gst_query_new_scheduling ();
- if (gst_element_query (source, query)) {
- gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL);
- if ((flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED))
- decoder->is_stream = TRUE;
- }
- gst_query_unref (query);
-
- GST_LOG_OBJECT (decoder, "source is stream: %d", decoder->is_stream);
-
- decoder->need_queue = IS_QUEUE_URI (decoder->uri);
- GST_LOG_OBJECT (decoder, "source needs queue: %d", decoder->need_queue);
-
source_class = G_OBJECT_GET_CLASS (source);
pspec = g_object_class_find_property (source_class, "connection-speed");
"setting subtitle-encoding=%s to source element", decoder->encoding);
g_object_set (source, "subtitle-encoding", decoder->encoding, NULL);
}
+
+ g_signal_emit (decoder, gst_uri_decode_bin_signals[SIGNAL_SOURCE_SETUP],
+ 0, source);
+
+ decoder->is_stream = IS_STREAM_URI (decoder->uri);
+
+ query = gst_query_new_scheduling ();
+ if (gst_element_query (source, query)) {
+ gst_query_parse_scheduling (query, &flags, NULL, NULL, NULL);
+ if ((flags & GST_SCHEDULING_FLAG_BANDWIDTH_LIMITED))
+ decoder->is_stream = TRUE;
+ }
+ gst_query_unref (query);
+
+ GST_LOG_OBJECT (decoder, "source is stream: %d", decoder->is_stream);
+
+ decoder->need_queue = IS_QUEUE_URI (decoder->uri);
+ GST_LOG_OBJECT (decoder, "source needs queue: %d", decoder->need_queue);
+
return source;
/* ERRORS */
/* notify of the new source used */
g_object_notify (G_OBJECT (decoder), "source");
- g_signal_emit (decoder, gst_uri_decode_bin_signals[SIGNAL_SOURCE_SETUP],
- 0, decoder->source);
-
if (is_live_source (decoder->source))
decoder->is_stream = FALSE;