diff options
Diffstat (limited to 'gst/gsttypefind.c')
-rw-r--r-- | gst/gsttypefind.c | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c index 1f0b16d..24c4730 100644 --- a/gst/gsttypefind.c +++ b/gst/gsttypefind.c @@ -38,16 +38,7 @@ GST_DEBUG_CATEGORY_EXTERN (type_find_debug); #define GST_CAT_DEFAULT type_find_debug -GType -gst_type_find_get_type (void) -{ - static GType typefind_type = 0; - - if (G_UNLIKELY (typefind_type == 0)) { - typefind_type = g_pointer_type_register_static ("GstTypeFind"); - } - return typefind_type; -} +G_DEFINE_POINTER_TYPE (GstTypeFind, gst_type_find); /** * gst_type_find_register: @@ -56,8 +47,8 @@ gst_type_find_get_type (void) * @name: The name for registering * @rank: The rank (or importance) of this typefind function * @func: The #GstTypeFindFunction to use - * @extensions: (transfer none) (array zero-terminated=1) (element-type utf8): - * Optional extensions that could belong to this type + * @extensions: (allow-none): Optional comma-separated list of extensions + * that could belong to this type * @possible_caps: Optionally the caps that could be returned when typefinding * succeeds * @data: Optional user data. This user data must be available until the plugin @@ -73,8 +64,8 @@ gst_type_find_get_type (void) */ gboolean gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, - GstTypeFindFunction func, gchar ** extensions, - const GstCaps * possible_caps, gpointer data, GDestroyNotify data_notify) + GstTypeFindFunction func, const gchar * extensions, + GstCaps * possible_caps, gpointer data, GDestroyNotify data_notify) { GstTypeFindFactory *factory; @@ -89,11 +80,14 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, gst_plugin_feature_set_name (GST_PLUGIN_FEATURE_CAST (factory), name); gst_plugin_feature_set_rank (GST_PLUGIN_FEATURE_CAST (factory), rank); - if (factory->extensions) + if (factory->extensions) { g_strfreev (factory->extensions); - factory->extensions = g_strdupv (extensions); + factory->extensions = NULL; + } + if (extensions) + factory->extensions = g_strsplit (extensions, ",", -1); - gst_caps_replace (&factory->caps, (GstCaps *) possible_caps); + gst_caps_replace (&factory->caps, possible_caps); factory->function = func; factory->user_data = data; factory->user_data_notify = data_notify; @@ -108,7 +102,7 @@ gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, } GST_PLUGIN_FEATURE_CAST (factory)->loaded = TRUE; - gst_registry_add_feature (gst_registry_get_default (), + gst_registry_add_feature (gst_registry_get (), GST_PLUGIN_FEATURE_CAST (factory)); return TRUE; @@ -151,8 +145,7 @@ gst_type_find_peek (GstTypeFind * find, gint64 offset, guint size) * It is up to the caller of the #GstTypeFindFunction to interpret these values. */ void -gst_type_find_suggest (GstTypeFind * find, guint probability, - const GstCaps * caps) +gst_type_find_suggest (GstTypeFind * find, guint probability, GstCaps * caps) { g_return_if_fail (find->suggest != NULL); g_return_if_fail (probability <= 100); |