diff --git a/sources/custom/AudioFilter.cs b/sources/custom/AudioFilter.cs new file mode 100644 index 0000000000..fcbacd70a2 --- /dev/null +++ b/sources/custom/AudioFilter.cs @@ -0,0 +1,37 @@ +// +// AudioFilter.cs +// +// Authors: +// Stephan Sundermann +// +// 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 0000000000..01db65d63e --- /dev/null +++ b/sources/custom/DeviceProvider.cs @@ -0,0 +1,85 @@ +// +// DeviceProvider.cs +// +// Authors: +// Stephan Sundermann +// +// 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 6b010ce6b1..f4a4b54a06 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 5761ae286e..ed6dd6d790 100644 --- a/sources/gstreamer-sharp-api.raw +++ b/sources/gstreamer-sharp-api.raw @@ -2478,6 +2478,9 @@ + + missing glib:type-name + @@ -2485,6 +2488,9 @@ + + missing glib:type-name + @@ -2492,12 +2498,18 @@ + + missing glib:type-name + + + missing glib:type-name + @@ -2507,6 +2519,9 @@ + + missing glib:type-name + @@ -2670,6 +2685,9 @@ + + missing glib:type-name + @@ -2677,12 +2695,18 @@ + + missing glib:type-name + + + missing glib:type-name + @@ -2690,22 +2714,35 @@ + + missing glib:type-name + + + missing glib:type-name + - + + + missing glib:type-name + + + + missing glib:type-name + @@ -2715,6 +2752,9 @@ + + missing glib:type-name + @@ -11294,6 +11334,9 @@ + + missing glib:type-name + diff --git a/sources/gstreamer-sharp.metadata b/sources/gstreamer-sharp.metadata index 41860fdcc6..87794ac15a 100644 --- a/sources/gstreamer-sharp.metadata +++ b/sources/gstreamer-sharp.metadata @@ -206,6 +206,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA GSList* true guint64 + true true