summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Sundermann <ssundermann@gnome.org>2014-08-06 00:55:58 +0200
committerStephan Sundermann <ssundermann@gnome.org>2014-08-06 00:55:58 +0200
commit6d80e4208a6076355910d708745e9da31e40d1d0 (patch)
tree7b853202c509bcd27911c802a4b6c5181e09021c
parent62b75d93d3f4e457c4fd2c9fac014e823d5a82cb (diff)
Add bindings for class struct methods
-rw-r--r--sources/custom/AudioFilter.cs37
-rw-r--r--sources/custom/DeviceProvider.cs85
-rw-r--r--sources/custom/Element.cs91
-rw-r--r--sources/gstreamer-sharp-api.raw45
-rw-r--r--sources/gstreamer-sharp.metadata1
5 files changed, 258 insertions, 1 deletions
diff --git a/sources/custom/AudioFilter.cs b/sources/custom/AudioFilter.cs
new file mode 100644
index 0000000..fcbacd7
--- /dev/null
+++ b/sources/custom/AudioFilter.cs
@@ -0,0 +1,37 @@
+//
+// AudioFilter.cs
+//
+// Authors:
+// Stephan Sundermann <stephansundermann@gmail.com>
+//
+// Copyright (C) 2014 Stephan Sundermann
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301 USA
+
+namespace Gst.Audio {
+ using System;
+ using System.Runtime.InteropServices;
+
+ partial class AudioFilter
+ {
+ [DllImport("libgstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_audio_filter_class_add_pad_templates(IntPtr klass, IntPtr allowed_caps);
+
+ public void AddPadTemplates(Gst.Caps allowed_caps) {
+ gst_audio_filter_class_add_pad_templates(LookupGType().GetClassPtr (), allowed_caps == null ? IntPtr.Zero : allowed_caps.Handle);
+ }
+ }
+}
diff --git a/sources/custom/DeviceProvider.cs b/sources/custom/DeviceProvider.cs
new file mode 100644
index 0000000..01db65d
--- /dev/null
+++ b/sources/custom/DeviceProvider.cs
@@ -0,0 +1,85 @@
+//
+// DeviceProvider.cs
+//
+// Authors:
+// Stephan Sundermann <stephansundermann@gmail.com>
+//
+// Copyright (C) 2014 Stephan Sundermann
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 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
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+// 02110-1301 USA
+
+namespace Gst {
+ using System;
+ using System.Runtime.InteropServices;
+
+ partial class DeviceProvider
+ {
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_device_provider_class_add_metadata(IntPtr klass, IntPtr key, IntPtr value);
+
+ public void AddMetadata(string key, string value) {
+ IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+ IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
+ gst_device_provider_class_add_metadata(LookupGType().GetClassPtr (), native_key, native_value);
+ GLib.Marshaller.Free (native_key);
+ GLib.Marshaller.Free (native_value);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_device_provider_class_add_static_metadata(IntPtr klass, IntPtr key, IntPtr value);
+
+ public void AddStaticMetadata(string key, string value) {
+ IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+ gst_device_provider_class_add_static_metadata(LookupGType().GetClassPtr (), native_key, GLib.Marshaller.StringToPtrGStrdup(value));
+ GLib.Marshaller.Free (native_key);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gst_device_provider_class_get_metadata(IntPtr klass, IntPtr key);
+
+ public string GetMetadata(string key) {
+ IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+ IntPtr raw_ret = gst_device_provider_class_get_metadata(LookupGType().GetClassPtr (), native_key);
+ string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
+ GLib.Marshaller.Free (native_key);
+ return ret;
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_device_provider_class_set_metadata(IntPtr klass, IntPtr longname, IntPtr classification, IntPtr description, IntPtr author);
+
+ public void SetMetadata(string longname, string classification, string description, string author) {
+ IntPtr native_longname = GLib.Marshaller.StringToPtrGStrdup (longname);
+ IntPtr native_classification = GLib.Marshaller.StringToPtrGStrdup (classification);
+ IntPtr native_description = GLib.Marshaller.StringToPtrGStrdup (description);
+ IntPtr native_author = GLib.Marshaller.StringToPtrGStrdup (author);
+ gst_device_provider_class_set_metadata(LookupGType().GetClassPtr (), native_longname, native_classification, native_description, native_author);
+ GLib.Marshaller.Free (native_longname);
+ GLib.Marshaller.Free (native_classification);
+ GLib.Marshaller.Free (native_description);
+ GLib.Marshaller.Free (native_author);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_device_provider_class_set_static_metadata(IntPtr klass, IntPtr longname, IntPtr classification, IntPtr description, IntPtr author);
+
+ public void SetStaticMetadata(string longname, string classification, string description, string author) {
+ gst_device_provider_class_set_static_metadata(LookupGType().GetClassPtr (), GLib.Marshaller.StringToPtrGStrdup(longname), GLib.Marshaller.StringToPtrGStrdup(classification), GLib.Marshaller.StringToPtrGStrdup(description), GLib.Marshaller.StringToPtrGStrdup(author));
+ }
+
+
+ }
+}
diff --git a/sources/custom/Element.cs b/sources/custom/Element.cs
index 6b010ce..f4a4b54 100644
--- a/sources/custom/Element.cs
+++ b/sources/custom/Element.cs
@@ -45,5 +45,96 @@ namespace Gst {
elements[i].Unlink (elements[i+1]);
}
}
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_element_class_add_metadata(IntPtr klass, IntPtr key, IntPtr value);
+
+ public void AddMetadata(string key, string value) {
+ IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+ IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
+ gst_element_class_add_metadata(LookupGType().GetClassPtr (), native_key, native_value);
+ GLib.Marshaller.Free (native_key);
+ GLib.Marshaller.Free (native_value);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_element_class_add_pad_template(IntPtr klass, IntPtr templ);
+
+ public void AddPadTemplate(Gst.PadTemplate templ) {
+ gst_element_class_add_pad_template(LookupGType().GetClassPtr (), templ == null ? IntPtr.Zero : templ.OwnedHandle);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_element_class_add_static_metadata(IntPtr klass, IntPtr key, IntPtr value);
+
+ public void AddStaticMetadata(string key, string value) {
+ IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+ IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (value);
+ gst_element_class_add_static_metadata(LookupGType().GetClassPtr (), native_key, native_value);
+ GLib.Marshaller.Free (native_key);
+ GLib.Marshaller.Free (native_value);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gst_element_class_get_metadata(IntPtr klass, IntPtr key);
+
+ public string GetMetadata(string key) {
+ IntPtr native_key = GLib.Marshaller.StringToPtrGStrdup (key);
+ IntPtr raw_ret = gst_element_class_get_metadata(LookupGType().GetClassPtr (), native_key);
+ string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
+ GLib.Marshaller.Free (native_key);
+ return ret;
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gst_element_class_get_pad_template(IntPtr element_class, IntPtr name);
+
+ public Gst.PadTemplate GetPadTemplate(string name) {
+ IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
+ IntPtr raw_ret = gst_element_class_get_pad_template(LookupGType().GetClassPtr (), native_name);
+ Gst.PadTemplate ret = GLib.Object.GetObject(raw_ret) as Gst.PadTemplate;
+ GLib.Marshaller.Free (native_name);
+ return ret;
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern IntPtr gst_element_class_get_pad_template_list(IntPtr element_class);
+
+ public Gst.PadTemplate[] GetPadTemplateList() {
+ IntPtr raw_ret = gst_element_class_get_pad_template_list(LookupGType().GetClassPtr ());
+ Gst.PadTemplate[] ret = (Gst.PadTemplate[]) GLib.Marshaller.ListPtrToArray (raw_ret, typeof(GLib.List), false, false, typeof(Gst.PadTemplate));
+ return ret;
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_element_class_set_metadata(IntPtr klass, IntPtr longname, IntPtr classification, IntPtr description, IntPtr author);
+
+ public void SetMetadata(string longname, string classification, string description, string author) {
+ IntPtr native_longname = GLib.Marshaller.StringToPtrGStrdup (longname);
+ IntPtr native_classification = GLib.Marshaller.StringToPtrGStrdup (classification);
+ IntPtr native_description = GLib.Marshaller.StringToPtrGStrdup (description);
+ IntPtr native_author = GLib.Marshaller.StringToPtrGStrdup (author);
+ gst_element_class_set_metadata(LookupGType().GetClassPtr (), native_longname, native_classification, native_description, native_author);
+ GLib.Marshaller.Free (native_longname);
+ GLib.Marshaller.Free (native_classification);
+ GLib.Marshaller.Free (native_description);
+ GLib.Marshaller.Free (native_author);
+ }
+
+ [DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
+ static extern void gst_element_class_set_static_metadata(IntPtr klass, IntPtr longname, IntPtr classification, IntPtr description, IntPtr author);
+
+ public void SetStaticMetadata(string longname, string classification, string description, string author) {
+ IntPtr native_longname = GLib.Marshaller.StringToPtrGStrdup (longname);
+ IntPtr native_classification = GLib.Marshaller.StringToPtrGStrdup (classification);
+ IntPtr native_description = GLib.Marshaller.StringToPtrGStrdup (description);
+ IntPtr native_author = GLib.Marshaller.StringToPtrGStrdup (author);
+ gst_element_class_set_static_metadata(LookupGType().GetClassPtr (), native_longname, native_classification, native_description, native_author);
+ GLib.Marshaller.Free (native_longname);
+ GLib.Marshaller.Free (native_classification);
+ GLib.Marshaller.Free (native_description);
+ GLib.Marshaller.Free (native_author);
+ }
+
}
}
diff --git a/sources/gstreamer-sharp-api.raw b/sources/gstreamer-sharp-api.raw
index 5761ae2..ed6dd6d 100644
--- a/sources/gstreamer-sharp-api.raw
+++ b/sources/gstreamer-sharp-api.raw
@@ -2478,6 +2478,9 @@
<method name="AddMetadata" cname="gst_device_provider_class_add_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstDeviceProviderClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="key" type="const-gchar*"/>
<parameter name="value" type="const-gchar*"/>
</parameters>
@@ -2485,6 +2488,9 @@
<method name="AddStaticMetadata" cname="gst_device_provider_class_add_static_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstDeviceProviderClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="key" type="const-gchar*"/>
<parameter name="value" type="gchar*" owned="true"/>
</parameters>
@@ -2492,12 +2498,18 @@
<method name="GetMetadata" cname="gst_device_provider_class_get_metadata" shared="true">
<return-type type="const-gchar*"/>
<parameters>
+ <parameter name="klass" type="GstDeviceProviderClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="key" type="const-gchar*"/>
</parameters>
</method>
<method name="SetMetadata" cname="gst_device_provider_class_set_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstDeviceProviderClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="longname" type="const-gchar*"/>
<parameter name="classification" type="const-gchar*"/>
<parameter name="description" type="const-gchar*"/>
@@ -2507,6 +2519,9 @@
<method name="SetStaticMetadata" cname="gst_device_provider_class_set_static_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstDeviceProviderClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="longname" type="gchar*" owned="true"/>
<parameter name="classification" type="gchar*" owned="true"/>
<parameter name="description" type="gchar*" owned="true"/>
@@ -2670,6 +2685,9 @@
<method name="AddMetadata" cname="gst_element_class_add_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="key" type="const-gchar*"/>
<parameter name="value" type="const-gchar*"/>
</parameters>
@@ -2677,12 +2695,18 @@
<method name="AddPadTemplate" cname="gst_element_class_add_pad_template" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="templ" type="GstPadTemplate*" owned="true"/>
</parameters>
</method>
<method name="AddStaticMetadata" cname="gst_element_class_add_static_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="key" type="const-gchar*"/>
<parameter name="value" type="const-gchar*"/>
</parameters>
@@ -2690,22 +2714,35 @@
<method name="GetMetadata" cname="gst_element_class_get_metadata" shared="true">
<return-type type="const-gchar*"/>
<parameters>
+ <parameter name="klass" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="key" type="const-gchar*"/>
</parameters>
</method>
<method name="GetPadTemplate" cname="gst_element_class_get_pad_template" shared="true">
<return-type type="GstPadTemplate*"/>
<parameters>
+ <parameter name="element_class" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="name" type="const-gchar*"/>
</parameters>
</method>
<method name="GetPadTemplateList" cname="gst_element_class_get_pad_template_list" shared="true">
<return-type type="GList*" element_type="GstPadTemplate*"/>
- <parameters/>
+ <parameters>
+ <parameter name="element_class" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
+ </parameters>
</method>
<method name="SetMetadata" cname="gst_element_class_set_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="longname" type="const-gchar*"/>
<parameter name="classification" type="const-gchar*"/>
<parameter name="description" type="const-gchar*"/>
@@ -2715,6 +2752,9 @@
<method name="SetStaticMetadata" cname="gst_element_class_set_static_metadata" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstElementClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="longname" type="const-gchar*"/>
<parameter name="classification" type="const-gchar*"/>
<parameter name="description" type="const-gchar*"/>
@@ -11294,6 +11334,9 @@
<method name="AddPadTemplates" cname="gst_audio_filter_class_add_pad_templates" shared="true">
<return-type type="void"/>
<parameters>
+ <parameter name="klass" type="GstAudioFilterClass*">
+ <warning>missing glib:type-name</warning>
+ </parameter>
<parameter name="allowed_caps" type="GstCaps*"/>
</parameters>
</method>
diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata
index 41860fd..87794ac 100644
--- a/sources/gstreamer-sharp.metadata
+++ b/sources/gstreamer-sharp.metadata
@@ -206,6 +206,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
<attr path="//*[@type='const GSList*']" name="type">GSList*</attr>
<attr path="//object/field[@cname='object' and @type='GstObject*']" name="hidden">true</attr>
<attr path="//constant[@name='CLOCK_TIME_NONE']" name="ctype">guint64</attr>
+ <attr path="//method[parameters/parameter[contains(@type, 'Class*')]]" name="hidden">true</attr>
<!-- No way to correctly generate these without the element type -->
<attr path="//boxed[@cname='GstMpegtsDescriptor']//method[parameters/parameter[@type='GArray***']]" name="hidden">true</attr>