diff --git a/gst/gsttypefind.c b/gst/gsttypefind.c index bc4f85b545..2cfb8d0cfa 100644 --- a/gst/gsttypefind.c +++ b/gst/gsttypefind.c @@ -47,8 +47,8 @@ G_DEFINE_POINTER_TYPE (GstTypeFind, gst_type_find); * @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 @@ -64,7 +64,7 @@ G_DEFINE_POINTER_TYPE (GstTypeFind, gst_type_find); */ gboolean gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, - GstTypeFindFunction func, gchar ** extensions, + GstTypeFindFunction func, const gchar * extensions, GstCaps * possible_caps, gpointer data, GDestroyNotify data_notify) { GstTypeFindFactory *factory; @@ -80,9 +80,12 @@ 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, possible_caps); factory->function = func; diff --git a/gst/gsttypefind.h b/gst/gsttypefind.h index 4dcdc8549b..31a0a2ec55 100644 --- a/gst/gsttypefind.h +++ b/gst/gsttypefind.h @@ -114,7 +114,7 @@ gboolean gst_type_find_register (GstPlugin * plugin, const gchar * name, guint rank, GstTypeFindFunction func, - gchar ** extensions, + const gchar * extensions, GstCaps * possible_caps, gpointer data, GDestroyNotify data_notify); diff --git a/tests/check/libs/typefindhelper.c b/tests/check/libs/typefindhelper.c index 8a55f84755..3798094ff0 100644 --- a/tests/check/libs/typefindhelper.c +++ b/tests/check/libs/typefindhelper.c @@ -42,14 +42,12 @@ static GstStaticCaps foobar_caps = GST_STATIC_CAPS ("foo/x-bar"); /* make sure the entire data in the buffer is available for peeking */ GST_START_TEST (test_buffer_range) { - static gchar *foobar_exts[] = { (char *) "foobar", NULL }; - GstStructure *s; GstBuffer *buf; GstCaps *caps; fail_unless (gst_type_find_register (NULL, "foo/x-bar", - GST_RANK_PRIMARY + 50, foobar_typefind, (gchar **) foobar_exts, + GST_RANK_PRIMARY + 50, foobar_typefind, "foobar", FOOBAR_CAPS, NULL, NULL)); buf = gst_buffer_new ();