summaryrefslogtreecommitdiff
path: root/sources/generated/Gst/Meta.cs
blob: b6d205dc9d7bef202ece6de1a02b16c8b395b14c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
// This file was generated by the Gtk# code generator.
// Any changes made will be lost if regenerated.

namespace Gst {

	using System;
	using System.Collections;
	using System.Collections.Generic;
	using System.Runtime.InteropServices;

#region Autogenerated code
	[StructLayout(LayoutKind.Sequential)]
	public partial struct Meta : IEquatable<Meta> {

		public Gst.MetaFlags Flags;
		private IntPtr _info;

		public Gst.MetaInfo info {
			get { return Gst.MetaInfo.New (_info); }
		}

		public static Gst.Meta Zero = new Gst.Meta ();

		public static Gst.Meta New(IntPtr raw) {
			if (raw == IntPtr.Zero)
				return Gst.Meta.Zero;
			return (Gst.Meta) Marshal.PtrToStructure (raw, typeof (Gst.Meta));
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_meta_compare_seqnum(IntPtr raw, IntPtr meta2);

		public int CompareSeqnum(Gst.Meta meta2) {
			IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
			System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
			IntPtr native_meta2 = GLib.Marshaller.StructureToPtrAlloc (meta2);
			int raw_ret = gst_meta_compare_seqnum(this_as_native, native_meta2);
			int ret = raw_ret;
			ReadNative (this_as_native, ref this);
			System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
			Marshal.FreeHGlobal (native_meta2);
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern ulong gst_meta_get_seqnum(IntPtr raw);

		public ulong Seqnum { 
			get {
				IntPtr this_as_native = System.Runtime.InteropServices.Marshal.AllocHGlobal (System.Runtime.InteropServices.Marshal.SizeOf (this));
				System.Runtime.InteropServices.Marshal.StructureToPtr (this, this_as_native, false);
				ulong raw_ret = gst_meta_get_seqnum(this_as_native);
				ulong ret = raw_ret;
				ReadNative (this_as_native, ref this);
				System.Runtime.InteropServices.Marshal.FreeHGlobal (this_as_native);
				return ret;
			}
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_meta_api_type_get_tags(IntPtr api);

		public static string[] ApiTypeGetTags(GLib.GType api) {
			IntPtr raw_ret = gst_meta_api_type_get_tags(api.Val);
			string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, false);
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_meta_api_type_has_tag(IntPtr api, uint tag);

		public static bool ApiTypeHasTag(GLib.GType api, uint tag) {
			bool raw_ret = gst_meta_api_type_has_tag(api.Val, tag);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_meta_api_type_register(IntPtr api, IntPtr[] tags);

		public static GLib.GType ApiTypeRegister(string api, string[] tags) {
			IntPtr native_api = GLib.Marshaller.StringToPtrGStrdup (api);
			int cnt_tags = tags == null ? 0 : tags.Length;
			IntPtr[] native_tags = new IntPtr [cnt_tags + 1];
			for (int i = 0; i < cnt_tags; i++)
				native_tags [i] = GLib.Marshaller.StringToPtrGStrdup (tags[i]);
			native_tags [cnt_tags] = IntPtr.Zero;
			IntPtr raw_ret = gst_meta_api_type_register(native_api, native_tags);
			GLib.GType ret = new GLib.GType(raw_ret);
			GLib.Marshaller.Free (native_api);
			for (int i = 0; i < native_tags.Length - 1; i++) {
				tags [i] = GLib.Marshaller.Utf8PtrToString (native_tags[i]);
				GLib.Marshaller.Free (native_tags[i]);
			}
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_meta_get_info(IntPtr impl);

		public static Gst.MetaInfo GetInfo(string impl) {
			IntPtr native_impl = GLib.Marshaller.StringToPtrGStrdup (impl);
			IntPtr raw_ret = gst_meta_get_info(native_impl);
			Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
			GLib.Marshaller.Free (native_impl);
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_meta_register(IntPtr api, IntPtr impl, UIntPtr size, GstSharp.MetaInitFunctionNative init_func, GstSharp.MetaFreeFunctionNative free_func, GstSharp.MetaTransformFunctionNative transform_func);

		public static Gst.MetaInfo Register(GLib.GType api, string impl, ulong size, Gst.MetaInitFunction init_func, Gst.MetaFreeFunction free_func, Gst.MetaTransformFunction transform_func) {
			IntPtr native_impl = GLib.Marshaller.StringToPtrGStrdup (impl);
			GstSharp.MetaInitFunctionWrapper init_func_wrapper = new GstSharp.MetaInitFunctionWrapper (init_func);
			init_func_wrapper.PersistUntilCalled ();
			GstSharp.MetaFreeFunctionWrapper free_func_wrapper = new GstSharp.MetaFreeFunctionWrapper (free_func);
			free_func_wrapper.PersistUntilCalled ();
			GstSharp.MetaTransformFunctionWrapper transform_func_wrapper = new GstSharp.MetaTransformFunctionWrapper (transform_func);
			transform_func_wrapper.PersistUntilCalled ();
			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);
			Gst.MetaInfo ret = Gst.MetaInfo.New (raw_ret);
			GLib.Marshaller.Free (native_impl);
			return ret;
		}

		static void ReadNative (IntPtr native, ref Gst.Meta target)
		{
			target = New (native);
		}

		public bool Equals (Meta other)
		{
			return true && Flags.Equals (other.Flags) && info.Equals (other.info);
		}

		public override bool Equals (object other)
		{
			return other is Meta && Equals ((Meta) other);
		}

		public override int GetHashCode ()
		{
			return this.GetType ().FullName.GetHashCode () ^ Flags.GetHashCode () ^ info.GetHashCode ();
		}

		private static GLib.GType GType {
			get { return GLib.GType.Pointer; }
		}
#endregion
	}
}