2004-01-22 Thomas Vander Stichele <thomas at apestaart dot org>
+ * gst-libs/gst/media-info/media-info-priv.c: (have_type_callback),
+ (deep_notify_callback), (gmi_set_decoder), (gmi_clear_decoder),
+ (gmip_find_type_pre):
+ * gst-libs/gst/media-info/media-info-priv.h:
+ * gst-libs/gst/media-info/media-info.c:
+ (gst_media_info_instance_init), (gst_media_info_read_idler):
+ add fakesink to get caps on decoder src pad again
+ fix callback prototype to match new have_type signal signature
+
+2004-01-22 Thomas Vander Stichele <thomas at apestaart dot org>
+
* gst/adder/gstadder.c: (gst_adder_link):
fix non-compile and cut-n-paste code
/* callbacks */
static void
-have_type_callback (GstElement *typefind, GstCaps *type, GstMediaInfoPriv *priv)
+have_type_callback (GstElement *typefind, guint probability, GstCaps *type, GstMediaInfoPriv *priv)
{
- priv->type = type;
+ g_print ("DEBUG: have_type: caps %p\n", type);
+ priv->type = gst_caps_copy (type);
+ /* FIXME: make sure we _free these somewhere */
}
void
{
GValue value = { 0, };
+ /* we only care about pad notifies */
+ if (!GST_IS_PAD (origin)) return;
+
+ GST_DEBUG ("DEBUG: deep_notify: have notify of %s from object %s:%s !",
+ pspec->name, gst_element_get_name (gst_pad_get_parent (GST_PAD (origin))),
+ gst_object_get_name (origin));
+
if (strcmp (pspec->name, "metadata") == 0)
{
GST_DEBUG ("DEBUG: deep_notify: have metadata !");
/* set up pipeline and connect signal handlers */
priv->decoder = decoder;
gst_bin_add (GST_BIN (priv->pipeline), decoder);
+ gst_bin_add (GST_BIN (priv->pipeline), priv->fakesink);
if (!gst_element_link (priv->source, decoder))
g_warning ("Couldn't connect source and decoder\n");
+ if (!gst_element_link (priv->decoder, priv->fakesink))
+ g_warning ("Couldn't connect decoder and fakesink\n");
/* FIXME: we should be connecting to ALL possible src pads */
if (!(priv->decoder_pad = gst_element_get_pad (decoder, "src")))
g_warning ("Couldn't get decoder pad\n");
/* FIXME: shouldn't need to set state here */
gst_element_set_state (info->priv->pipeline, GST_STATE_READY);
gst_element_unlink (info->priv->source, info->priv->decoder);
+ gst_element_unlink (info->priv->decoder, info->priv->fakesink);
gst_bin_remove (GST_BIN (info->priv->pipeline), info->priv->decoder);
+ gst_bin_remove (GST_BIN (info->priv->pipeline), info->priv->fakesink);
info->priv->decoder = NULL;
}
}
/* clear vars that need clearing */
if (priv->type)
{
- /* we don't need to unref, this is done inside gsttypefind.c
- gst_caps_free (priv->type);
- */
+ gst_caps_free (priv->type);
priv->type = NULL;
}
info->priv->pipeline = gst_pipeline_new ("media-info");
+ /* create the typefind element and make sure it stays around by reffing */
info->priv->typefind = gst_element_factory_make ("typefind", "typefind");
if (!GST_IS_ELEMENT (info->priv->typefind))
- /* FIXME */
g_error ("Cannot create typefind element !");
-
- /* ref it so it never goes away on removal out of bins */
gst_object_ref (GST_OBJECT (info->priv->typefind));
+ /* create the fakesink element and make sure it stays around by reffing */
+ info->priv->fakesink = gst_element_factory_make ("fakesink", "fakesink");
+ if (!GST_IS_ELEMENT (info->priv->fakesink))
+ g_error ("Cannot create fakesink element !");
+ gst_object_ref (GST_OBJECT (info->priv->fakesink));
+
+
/* use gnomevfssrc by default */
source = gst_element_factory_make ("gnomevfssrc", "source");
if (GST_IS_ELEMENT (source))
GST_DEBUG ("STATE_TYPEFIND");
if ((priv->type == NULL) && gst_bin_iterate (GST_BIN (priv->pipeline)))
{
+ GST_DEBUG ("iterating while in STATE_TYPEFIND");
GMI_DEBUG("?");
return TRUE;
}