/* FIXME: use the requested name for the pad */
- gst_object_ref (GST_OBJECT (templ));
- GST_PAD_PAD_TEMPLATE (returnpad) = templ;
+ gst_object_replace ((GstObject **) &returnpad->padtemplate, (GstObject *) templ);
gst_bin_add (GST_BIN (element), GST_ELEMENT (identity));
}
if ((GstElement *) spider->sink_ident == conn->current)
{
- gboolean restart = FALSE;
- /* check if restarting is necessary */
- if (gst_element_get_state ((GstElement *) spider) == GST_STATE_PLAYING)
- {
- restart = TRUE;
- gst_element_set_state ((GstElement *) spider, GST_STATE_PAUSED);
- }
gst_spider_plug (conn);
- /* restart if needed */
- if (restart)
- {
- gst_element_set_state ((GstElement *) spider, GST_STATE_PLAYING);
- }
}
}
}
element = (GstElement *) (endelements == NULL ? conn->src : endelements->data);
} else {
element = gst_element_factory_create ((GstElementFactory *) plugpath->data, NULL);
+ GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "Adding element %s of type %s and syncing state with autoplugger",
+ GST_ELEMENT_NAME (element), GST_PLUGIN_FEATURE_NAME (plugpath->data));
gst_bin_add (GST_BIN (spider), element);
gst_element_sync_state_with_parent (element);
}
GST_DEBUG_PAD_NAME (srcpad), GST_ELEMENT_NAME (conn->src));
/* find a path from src to sink */
- /* FIXME: make that if go away and work anyway */
- if (srcpad == spider->sink_ident->src)
- {
- g_assert (GST_RPAD_PEER (spider->sink_ident->sink) != NULL);
- plugpath = gst_autoplug_sp (gst_pad_get_caps ((GstPad *) GST_RPAD_PEER (spider->sink_ident->sink)), gst_pad_get_caps (conn->src->sink), spider->factories);
- } else {
- plugpath = gst_autoplug_sp (gst_pad_get_caps (srcpad), gst_pad_get_caps (conn->src->sink), spider->factories);
- }
+ plugpath = gst_autoplug_sp (gst_pad_get_caps (srcpad), gst_pad_get_caps (conn->src->sink), spider->factories);
/* prints out the path that was found for plugging */
/* g_print ("found path from %s to %s:\n", GST_ELEMENT_NAME (conn->current), GST_ELEMENT_NAME (conn->src));
"gstspider",
plugin_init
};
-
-
-
GstTypeFactory *factory = GST_TYPE_FACTORY (factories->data);
GstTypeFindFunc typefindfunc = (GstTypeFindFunc)factory->typefindfunc;
- GST_DEBUG (0, "trying typefind function %s", GST_PLUGIN_FEATURE_NAME (factory));
+ GST_DEBUG (GST_CAT_AUTOPLUG_ATTEMPT, "trying typefind function %s", GST_PLUGIN_FEATURE_NAME (factory));
if (typefindfunc && (caps = typefindfunc (buf, factory))) {
- if (gst_pad_try_set_caps (ident->sink, caps) <= 0) {
+ GST_INFO (GST_CAT_AUTOPLUG_ATTEMPT, "typefind function %s found caps", GST_PLUGIN_FEATURE_NAME (factory));
+ if (gst_pad_try_set_caps (ident->src, caps) <= 0) {
g_warning ("typefind: found type but peer didn't accept it");
gst_caps_sink (caps);
} else {
return res;
}
-
-