gst_ffmpegcsp_register (GstPlugin *plugin)
{
GstCaps *caps;
- GstPadTemplate *srctempl, *sinktempl;
/* template caps */
caps = gst_ffmpeg_codectype_to_caps (CODEC_TYPE_VIDEO, NULL);
GST_PAD_SRC,
GST_PAD_ALWAYS,
caps, NULL);
- gst_caps_ref (caps);
+ gst_caps_ref (caps); /* FIXME: pad_template_new refs the caps, doesn't it? */
sinktempl = gst_pad_template_new ("sink",
GST_PAD_SINK,
GST_PAD_ALWAYS,
params = g_hash_table_lookup (global_plugins,
GINT_TO_POINTER (G_OBJECT_CLASS_TYPE (gobject_class)));
+ if (!params)
+ params = g_hash_table_lookup (global_plugins,
+ GINT_TO_POINTER (0));
+ g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
goto next;
}
+ params = g_new0 (GstFFMpegDecClassParams, 1);
+ params->in_plugin = in_plugin;
+ params->srccaps = srccaps;
+ params->sinkcaps = sinkcaps;
+ g_hash_table_insert (global_plugins,
+ GINT_TO_POINTER (0),
+ (gpointer) params);
+
/* create the gtype now */
type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
if (!gst_element_register (plugin, type_name, GST_RANK_MARGINAL, type))
return FALSE;
- params = g_new0 (GstFFMpegDecClassParams, 1);
- params->in_plugin = in_plugin;
- params->srccaps = srccaps;
- params->sinkcaps = sinkcaps;
g_hash_table_insert (global_plugins,
GINT_TO_POINTER (type),
(gpointer) params);
next:
in_plugin = in_plugin->next;
}
+ g_hash_table_remove (global_plugins, GINT_TO_POINTER (0));
return TRUE;
}
params = g_hash_table_lookup (global_plugins,
GINT_TO_POINTER (G_OBJECT_CLASS_TYPE (gobject_class)));
+ if (!params)
+ params = g_hash_table_lookup (global_plugins,
+ GINT_TO_POINTER (0));
+ g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
g_free(type_name);
goto next;
}
-
- /* create the type now */
- type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
-
+
/* create a cache for these properties */
params = g_new0 (GstFFMpegDemuxClassParams, 1);
params->in_plugin = in_plugin;
params->audiosrccaps = audiosrccaps;
g_hash_table_insert (global_plugins,
+ GINT_TO_POINTER (0),
+ (gpointer) params);
+
+ /* create the type now */
+ type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
+
+ g_hash_table_insert (global_plugins,
GINT_TO_POINTER (type),
(gpointer) params);
next:
in_plugin = in_plugin->next;
}
+ g_hash_table_remove (global_plugins, GINT_TO_POINTER (0));
return TRUE;
}
params = g_hash_table_lookup (enc_global_plugins,
GINT_TO_POINTER (G_OBJECT_CLASS_TYPE (gobject_class)));
+ /* HACK: if we don't have a GType yet, our params are stored at position 0 */
+ if (!params) {
+ params = g_hash_table_lookup (enc_global_plugins,
+ GINT_TO_POINTER (0));
+ }
+ g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
goto next;
}
- /* create the glib type now */
- type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
- if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type))
- return FALSE;
-
params = g_new0 (GstFFMpegEncClassParams, 1);
params->in_plugin = in_plugin;
params->srccaps = srccaps;
params->sinkcaps = sinkcaps;
g_hash_table_insert (enc_global_plugins,
+ GINT_TO_POINTER (0),
+ (gpointer) params);
+
+ /* create the glib type now */
+ type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
+ if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type))
+ return FALSE;
+
+ g_hash_table_insert (enc_global_plugins,
GINT_TO_POINTER (type),
(gpointer) params);
next:
in_plugin = in_plugin->next;
}
+ g_hash_table_remove (enc_global_plugins, GINT_TO_POINTER (0));
return TRUE;
}
params = g_hash_table_lookup (global_plugins,
GINT_TO_POINTER (G_OBJECT_CLASS_TYPE (gobject_class)));
+ if (!params)
+ params = g_hash_table_lookup (global_plugins,
+ GINT_TO_POINTER (0));
+ g_assert (params);
/* construct the element details struct */
details = g_new0 (GstElementDetails, 1);
goto next;
}
- /* create the type now */
- type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
- if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type))
- return FALSE;
-
/* create a cache for these properties */
params = g_new0 (GstFFMpegMuxClassParams, 1);
params->in_plugin = in_plugin;
params->audiosinkcaps = audiosinkcaps;
g_hash_table_insert (global_plugins,
+ GINT_TO_POINTER (0),
+ (gpointer) params);
+
+ /* create the type now */
+ type = g_type_register_static(GST_TYPE_ELEMENT, type_name , &typeinfo, 0);
+ if (!gst_element_register (plugin, type_name, GST_RANK_NONE, type))
+ return FALSE;
+
+ g_hash_table_insert (global_plugins,
GINT_TO_POINTER (type),
(gpointer) params);
next:
in_plugin = in_plugin->next;
}
+ g_hash_table_remove (global_plugins, GINT_TO_POINTER (0));
return TRUE;
}