Move files from gstreamer-sharp into the "subprojects/gstreamer-sharp/" subdir
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst / Meta.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst {
5
6         using System;
7         using System.Collections;
8         using System.Collections.Generic;
9         using System.Runtime.InteropServices;
10
11 #region Autogenerated code
12         [StructLayout(LayoutKind.Sequential)]
13         public partial struct Meta : IEquatable<Meta> {
14
15                 public Gst.MetaFlags Flags;
16                 private IntPtr _info;
17
18                 public Gst.MetaInfo info {
19                         get { return Gst.MetaInfo.New (_info); }
20                 }
21
22                 public static Gst.Meta Zero = new Gst.Meta ();
23
24                 public static Gst.Meta New(IntPtr raw) {
25                         if (raw == IntPtr.Zero)
26                                 return Gst.Meta.Zero;
27                         return (Gst.Meta) Marshal.PtrToStructure (raw, typeof (Gst.Meta));
28                 }
29
30                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
31                 static extern int gst_meta_compare_seqnum(IntPtr raw, IntPtr meta2);
32
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);
38                         int ret = raw_ret;
39                         ReadNative (this_as_native, ref this);
40                         System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
41                         Marshal.FreeHGlobal (native_meta2);
42                         return ret;
43                 }
44
45                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
46                 static extern ulong gst_meta_get_seqnum(IntPtr raw);
47
48                 public ulong Seqnum { 
49                         get {
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);
53                                 ulong ret = raw_ret;
54                                 ReadNative (this_as_native, ref this);
55                                 System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
56                                 return ret;
57                         }
58                 }
59
60                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
61                 static extern bool gst_meta_api_type_has_tag(IntPtr api, uint tag);
62
63                 public static bool ApiTypeHasTag(GLib.GType api, uint tag) {
64                         bool raw_ret = gst_meta_api_type_has_tag(api.Val, tag);
65                         bool ret = raw_ret;
66                         return ret;
67                 }
68
69                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
70                 static extern IntPtr gst_meta_api_type_register(IntPtr api, IntPtr[] tags);
71
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);
82                         return ret;
83                 }
84
85                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
86                 static extern IntPtr gst_meta_get_info(IntPtr impl);
87
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);
93                         return ret;
94                 }
95
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);
98
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);
110                         return ret;
111                 }
112
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);
115
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);
124                         IntPtr user_data;
125                         GLib.DestroyNotify destroy_data;
126                         if (transform_func == null) {
127                                 user_data = IntPtr.Zero;
128                                 destroy_data = null;
129                         } else {
130                                 user_data = (IntPtr) GCHandle.Alloc (transform_func_wrapper);
131                                 destroy_data = GLib.DestroyHelper.NotifyHandler;
132                         }
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);
136                         return ret;
137                 }
138
139                 public static Gst.MetaInfo RegisterCustom(string name, string[] tags) {
140                         return RegisterCustom (name, tags, null);
141                 }
142
143                 static void ReadNative (IntPtr native, ref Gst.Meta target)
144                 {
145                         target = New (native);
146                 }
147
148                 public bool Equals (Meta other)
149                 {
150                         return true && Flags.Equals (other.Flags) && info.Equals (other.info);
151                 }
152
153                 public override bool Equals (object other)
154                 {
155                         return other is Meta && Equals ((Meta) other);
156                 }
157
158                 public override int GetHashCode ()
159                 {
160                         return this.GetType ().FullName.GetHashCode () ^ Flags.GetHashCode () ^ info.GetHashCode ();
161                 }
162
163                 private static GLib.GType GType {
164                         get { return GLib.GType.Pointer; }
165                 }
166 #endregion
167         }
168 }