caps: small docs update
[platform/upstream/gstreamer.git] / gst / gsttypefindfactory.c
index 6b65461..aca0698 100644 (file)
 GST_DEBUG_CATEGORY (type_find_debug);
 #define GST_CAT_DEFAULT type_find_debug
 
-static void gst_type_find_factory_class_init (gpointer g_class,
-    gpointer class_data);
-static void gst_type_find_factory_init (GTypeInstance * instance,
-    gpointer g_class);
 static void gst_type_find_factory_dispose (GObject * object);
 
-static GstPluginFeatureClass *parent_class = NULL;
-
-GType
-gst_type_find_factory_get_type (void)
-{
-  static GType typefind_type = 0;
-
-  if (G_UNLIKELY (typefind_type == 0)) {
-    static const GTypeInfo typefind_info = {
-      sizeof (GstTypeFindFactoryClass),
-      NULL,
-      NULL,
-      gst_type_find_factory_class_init,
-      NULL,
-      NULL,
-      sizeof (GstTypeFindFactory),
-      0,
-      gst_type_find_factory_init,
-      NULL
-    };
-
-    typefind_type = g_type_register_static (GST_TYPE_PLUGIN_FEATURE,
-        "GstTypeFindFactory", &typefind_info, 0);
-    GST_DEBUG_CATEGORY_INIT (type_find_debug, "GST_TYPEFIND",
-        GST_DEBUG_FG_GREEN, "typefinding subsystem");
-  }
-
-  return typefind_type;
+#define _do_init \
+{ \
+  GST_DEBUG_CATEGORY_INIT (type_find_debug, "GST_TYPEFIND", \
+      GST_DEBUG_FG_GREEN, "typefinding subsystem"); \
 }
 
+#define gst_type_find_factory_parent_class parent_class
+G_DEFINE_TYPE_WITH_CODE (GstTypeFindFactory, gst_type_find_factory,
+    GST_TYPE_PLUGIN_FEATURE, _do_init);
+
 static void
-gst_type_find_factory_class_init (gpointer g_class, gpointer class_data)
+gst_type_find_factory_class_init (GstTypeFindFactoryClass * klass)
 {
-  GObjectClass *object_class = G_OBJECT_CLASS (g_class);
-
-  parent_class = g_type_class_peek_parent (g_class);
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
 
   object_class->dispose = gst_type_find_factory_dispose;
 }
 
 static void
-gst_type_find_factory_init (GTypeInstance * instance, gpointer g_class)
+gst_type_find_factory_init (GstTypeFindFactory * factory)
 {
-  GstTypeFindFactory *factory = GST_TYPE_FIND_FACTORY (instance);
-
   factory->user_data = factory;
   factory->user_data_notify = NULL;
 }
@@ -169,14 +141,20 @@ gst_type_find_factory_dispose (GObject * object)
  * gst_type_find_factory_get_list:
  *
  * Gets the list of all registered typefind factories. You must free the
- * list using gst_plugin_feature_list_free.
+ * list using gst_plugin_feature_list_free().
+ *
+ * The returned factories are sorted by highest rank first, and then by
+ * factory name. (behaviour change since 0.10.26)
+ *
+ * Free-function: gst_plugin_feature_list_free
  *
- * Returns: the list of all registered #GstTypeFindFactory.
+ * Returns: (transfer full) (element-type Gst.TypeFindFactory): the list of all
+ *     registered #GstTypeFindFactory.
  */
 GList *
 gst_type_find_factory_get_list (void)
 {
-  return gst_registry_get_feature_list (gst_registry_get_default (),
+  return gst_registry_get_feature_list (gst_registry_get (),
       GST_TYPE_TYPE_FIND_FACTORY);
 }
 
@@ -186,7 +164,7 @@ gst_type_find_factory_get_list (void)
  *
  * Gets the #GstCaps associated with a typefind factory.
  *
- * Returns: The #GstCaps associated with this factory
+ * Returns: (transfer none): the #GstCaps associated with this factory
  */
 GstCaps *
 gst_type_find_factory_get_caps (GstTypeFindFactory * factory)
@@ -202,10 +180,11 @@ gst_type_find_factory_get_caps (GstTypeFindFactory * factory)
  *
  * Gets the extensions associated with a #GstTypeFindFactory. The returned
  * array should not be changed. If you need to change stuff in it, you should
- * copy it using g_stdupv().  This function may return NULL to indicate
+ * copy it using g_strdupv().  This function may return NULL to indicate
  * a 0-length list.
  *
- * Returns: a NULL-terminated array of extensions associated with this factory
+ * Returns: (transfer none) (array zero-terminated=1) (element-type utf8): a
+ *     NULL-terminated array of extensions associated with this factory
  */
 gchar **
 gst_type_find_factory_get_extensions (GstTypeFindFactory * factory)
@@ -218,8 +197,8 @@ gst_type_find_factory_get_extensions (GstTypeFindFactory * factory)
 /**
  * gst_type_find_factory_call_function:
  * @factory: A #GstTypeFindFactory
- * @find: A properly setup #GstTypeFind entry. The get_data and suggest_type
- *        members must be set.
+ * @find: (transfer none): a properly setup #GstTypeFind entry. The get_data
+ *     and suggest_type members must be set.
  *
  * Calls the #GstTypeFindFunction associated with this factory.
  */