summaryrefslogtreecommitdiff
path: root/gst/gstdynamictypefactory.h
diff options
context:
space:
mode:
authorJan Schmidt <jan@centricular.com>2015-05-14 00:25:21 +1000
committerJan Schmidt <jan@centricular.com>2016-11-02 11:21:37 +1100
commite1dc60524e31a5c52aff7fbb9b67e62b29c0ac66 (patch)
treec360aeca76216c48b2ed7a8a0ddece4da3cbc319 /gst/gstdynamictypefactory.h
parent812d4976f08de77a03b9a68ad7f44c191e2d4bc4 (diff)
dynamic types: Implement dynamic types in the registry
Implement GstDynamicTypeFactory as a new registry feature. GstDynamicTypeFactory provides a way of registering a GType into the registry, such that it will be registered as a dynamic type when the registry is loaded, and then automatically loaded if the type is needed during caps parsing. This allows using non-core types in pad templates, by loading a registry feature to create the GType on the fly. https://bugzilla.gnome.org/show_bug.cgi?id=750079
Diffstat (limited to 'gst/gstdynamictypefactory.h')
-rw-r--r--gst/gstdynamictypefactory.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/gst/gstdynamictypefactory.h b/gst/gstdynamictypefactory.h
new file mode 100644
index 000000000..42ec4e026
--- /dev/null
+++ b/gst/gstdynamictypefactory.h
@@ -0,0 +1,56 @@
+/* GStreamer
+ * Copyright (C) 2015 Jan Schmidt <jan@centricular.com>
+ *
+ * gstdynamictypefactory.h: Header for GstDynamicTypeFactory
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#ifndef __GST_DYNAMIC_TYPE_FACTORY_H__
+#define __GST_DYNAMIC_TYPE_FACTORY_H__
+
+/**
+ * GstDynamicTypeFactory:
+ *
+ * The opaque #GstDynamicTypeFactory data structure.
+ */
+typedef struct _GstDynamicTypeFactory GstDynamicTypeFactory;
+typedef struct _GstDynamicTypeFactoryClass GstDynamicTypeFactoryClass;
+
+#include <gst/gstconfig.h>
+#include <gst/gstplugin.h>
+#include <gst/gstpluginfeature.h>
+
+G_BEGIN_DECLS
+
+#define GST_TYPE_DYNAMIC_TYPE_FACTORY (gst_dynamic_type_factory_get_type())
+#define GST_DYNAMIC_TYPE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DYNAMIC_TYPE_FACTORY,\
+ GstDynamicTypeFactory))
+#define GST_DYNAMIC_TYPE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DYNAMIC_TYPE_FACTORY,\
+ GstDynamicTypeFactoryClass))
+#define GST_IS_DYNAMIC_TYPE_FACTORY(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DYNAMIC_TYPE_FACTORY))
+#define GST_IS_DYNAMIC_TYPE_FACTORY_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DYNAMIC_TYPE_FACTORY))
+#define GST_DYNAMIC_TYPE_FACTORY_CAST(obj) ((GstDynamicTypeFactory *)(obj))
+
+GType gst_dynamic_type_factory_get_type (void);
+
+GType gst_dynamic_type_factory_load (const gchar *factoryname);
+
+gboolean gst_dynamic_type_register (GstPlugin *plugin, GType type);
+
+G_END_DECLS
+
+#endif