summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2009-04-30 15:40:17 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2009-04-30 15:40:17 +0200
commitf536534214f2cdc17f253af3e42854986393d56e (patch)
treea14d0c32b1fca5aa9e2bb82820ded98defdd85e6
parentc42ef5f916225f11bd15c8cde4f68ed06e615c34 (diff)
Add convenience function to register Gst.Index types with the default registry
-rw-r--r--gstreamer-sharp/Index.custom13
-rw-r--r--gstreamer-sharp/glue/Makefile.am3
-rw-r--r--gstreamer-sharp/glue/indexfactory.c12
3 files changed, 27 insertions, 1 deletions
diff --git a/gstreamer-sharp/Index.custom b/gstreamer-sharp/Index.custom
index 60b3529..aaaebf9 100644
--- a/gstreamer-sharp/Index.custom
+++ b/gstreamer-sharp/Index.custom
@@ -10,3 +10,16 @@ public bool IsWritable {
10 return ( ( (uint) Flags) & ( (uint) Gst.IndexFlags.Writable)) != 0; 10 return ( ( (uint) Flags) & ( (uint) Gst.IndexFlags.Writable)) != 0;
11 } 11 }
12} 12}
13
14[DllImport ("gstreamersharpglue-0.10") ]
15static extern void gstsharp_gst_index_factory_set_plugin (IntPtr factory, IntPtr plugin);
16
17public static bool Register (Gst.Plugin plugin, string name, string longdesc, GLib.GType gtype) {
18 Gst.IndexFactory factory = new Gst.IndexFactory (name, longdesc, gtype);
19 gstsharp_gst_index_factory_set_plugin (factory.Handle, (plugin != null) ? plugin.Handle : IntPtr.Zero);
20
21 Gst.Registry.Default.AddFeature (factory);
22
23 return true;
24}
25
diff --git a/gstreamer-sharp/glue/Makefile.am b/gstreamer-sharp/glue/Makefile.am
index c8d4a59..2a583aa 100644
--- a/gstreamer-sharp/glue/Makefile.am
+++ b/gstreamer-sharp/glue/Makefile.am
@@ -15,7 +15,8 @@ libgstreamersharpglue_0_10_la_SOURCES = \
15 pad.c \ 15 pad.c \
16 gobject.c \ 16 gobject.c \
17 typefind.c \ 17 typefind.c \
18 indexentry.c 18 indexentry.c \
19 indexfactory.c
19 20
20nodist_libgstreamersharpglue_0_10_la_SOURCES = generated.c 21nodist_libgstreamersharpglue_0_10_la_SOURCES = generated.c
21 22
diff --git a/gstreamer-sharp/glue/indexfactory.c b/gstreamer-sharp/glue/indexfactory.c
new file mode 100644
index 0000000..8949989
--- /dev/null
+++ b/gstreamer-sharp/glue/indexfactory.c
@@ -0,0 +1,12 @@
1#include <gst/gst.h>
2
3void
4gstsharp_gst_index_factory_set_plugin (GstIndexFactory * factory,
5 GstPlugin * plugin)
6{
7 if (!plugin)
8 return;
9
10 GST_PLUGIN_FEATURE (factory)->plugin_name = g_strdup (plugin->desc.name);
11 GST_PLUGIN_FEATURE (factory)->loaded = TRUE;
12}