1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 [StructLayout(LayoutKind.Sequential)]
13 public partial struct Meta : IEquatable<Meta> {
15 public Gst.MetaFlags Flags;
18 public Gst.MetaInfo info {
19 get { return Gst.MetaInfo.New (_info); }
22 public static Gst.Meta Zero = new Gst.Meta ();
24 public static Gst.Meta New(IntPtr raw) {
25 if (raw == IntPtr.Zero)
27 return (Gst.Meta) Marshal.PtrToStructure (raw, typeof (Gst.Meta));
30 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
31 static extern int gst_meta_compare_seqnum(IntPtr raw, IntPtr meta2);
33 public int CompareSeqnum(Gst.Meta meta2) {
34 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
35 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
36 IntPtr native_meta2 = GLib.Marshaller.StructureToPtrAlloc (meta2);
37 int raw_ret = gst_meta_compare_seqnum(this_as_native, native_meta2);
39 ReadNative (this_as_native, ref this);
40 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
41 Marshal.FreeHGlobal (native_meta2);
45 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
46 static extern ulong gst_meta_get_seqnum(IntPtr raw);
50 IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
51 System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
52 ulong raw_ret = gst_meta_get_seqnum(this_as_native);
54 ReadNative (this_as_native, ref this);
55 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
60 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
61 static extern bool gst_meta_api_type_has_tag(IntPtr api, uint tag);
63 public static bool ApiTypeHasTag(GLib.GType api, uint tag) {
64 bool raw_ret = gst_meta_api_type_has_tag(api.Val, tag);
69 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
70 static extern IntPtr gst_meta_api_type_register(IntPtr api, IntPtr[] tags);
72 public static GLib.GType ApiTypeRegister(string api, string[] tags) {
73 IntPtr native_api = GLib.Marshaller.StringToPtrGStrdup (api);
74 int cnt_tags = tags == null ? 0 : tags.Length;
75 IntPtr[] native_tags = new IntPtr [cnt_tags + 1];
76 for (int i = 0; i < cnt_tags; i++)
77 native_tags [i] = GLib.Marshaller.StringToPtrGStrdup(tags[i]);
78 native_tags [cnt_tags] = IntPtr.Zero;
79 IntPtr raw_ret = gst_meta_api_type_register(native_api, native_tags);
80 GLib.GType ret = new GLib.GType(raw_ret);
81 GLib.Marshaller.Free (native_api);
85 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
86 static extern IntPtr gst_meta_get_info(IntPtr impl);
88 public static Gst.MetaInfo GetInfo(string impl) {
89 IntPtr native_impl = GLib.Marshaller.StringToPtrGStrdup (impl);
90 IntPtr raw_ret = gst_meta_get_info(native_impl);
91 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
92 GLib.Marshaller.Free (native_impl);
96 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
97 static extern IntPtr gst_meta_register(IntPtr api, IntPtr impl, UIntPtr size, GstSharp.MetaInitFunctionNative init_func, GstSharp.MetaFreeFunctionNative free_func, GstSharp.MetaTransformFunctionNative transform_func);
99 public static Gst.MetaInfo Register(GLib.GType api, string impl, ulong size, Gst.MetaInitFunction init_func, Gst.MetaFreeFunction free_func, Gst.MetaTransformFunction transform_func) {
100 IntPtr native_impl = GLib.Marshaller.StringToPtrGStrdup (impl);
101 GstSharp.MetaInitFunctionWrapper init_func_wrapper = new GstSharp.MetaInitFunctionWrapper (init_func);
102 init_func_wrapper.PersistUntilCalled ();
103 GstSharp.MetaFreeFunctionWrapper free_func_wrapper = new GstSharp.MetaFreeFunctionWrapper (free_func);
104 free_func_wrapper.PersistUntilCalled ();
105 GstSharp.MetaTransformFunctionWrapper transform_func_wrapper = new GstSharp.MetaTransformFunctionWrapper (transform_func);
106 transform_func_wrapper.PersistUntilCalled ();
107 IntPtr raw_ret = gst_meta_register(api.Val, native_impl, new UIntPtr (size), init_func_wrapper.NativeDelegate, free_func_wrapper.NativeDelegate, transform_func_wrapper.NativeDelegate);
108 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
109 GLib.Marshaller.Free (native_impl);
113 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
114 static extern IntPtr gst_meta_register_custom(IntPtr name, IntPtr[] tags, GstSharp.CustomMetaTransformFunctionNative transform_func, IntPtr user_data, GLib.DestroyNotify destroy_data);
116 public static Gst.MetaInfo RegisterCustom(string name, string[] tags, Gst.CustomMetaTransformFunction transform_func) {
117 IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
118 int cnt_tags = tags == null ? 0 : tags.Length;
119 IntPtr[] native_tags = new IntPtr [cnt_tags + 1];
120 for (int i = 0; i < cnt_tags; i++)
121 native_tags [i] = GLib.Marshaller.StringToPtrGStrdup(tags[i]);
122 native_tags [cnt_tags] = IntPtr.Zero;
123 GstSharp.CustomMetaTransformFunctionWrapper transform_func_wrapper = new GstSharp.CustomMetaTransformFunctionWrapper (transform_func);
125 GLib.DestroyNotify destroy_data;
126 if (transform_func == null) {
127 user_data = IntPtr.Zero;
130 user_data = (IntPtr) GCHandle.Alloc (transform_func_wrapper);
131 destroy_data = GLib.DestroyHelper.NotifyHandler;
133 IntPtr raw_ret = gst_meta_register_custom(native_name, native_tags, transform_func_wrapper.NativeDelegate, user_data, destroy_data);
134 Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
135 GLib.Marshaller.Free (native_name);
139 public static Gst.MetaInfo RegisterCustom(string name, string[] tags) {
140 return RegisterCustom (name, tags, null);
143 static void ReadNative (IntPtr native, ref Gst.Meta target)
145 target = New (native);
148 public bool Equals (Meta other)
150 return true && Flags.Equals (other.Flags) && info.Equals (other.info);
153 public override bool Equals (object other)
155 return other is Meta && Equals ((Meta) other);
158 public override int GetHashCode ()
160 return this.GetType ().FullName.GetHashCode () ^ Flags.GetHashCode () ^ info.GetHashCode ();
163 private static GLib.GType GType {
164 get { return GLib.GType.Pointer; }