summaryrefslogtreecommitdiff
path: root/sources/generated/Gst/Memory.cs
blob: 1d969ec5c5576c9c7ab9dd324cfa4fc04841b3da (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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
// 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
	public partial class Memory : Gst.MiniObject {

		public Gst.Allocator Allocator {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("allocator"));
					return GLib.Object.GetObject((*raw_ptr)) as Gst.Allocator;
				}
			}
			set {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("allocator"));
					*raw_ptr = value == null ? IntPtr.Zero : value.Handle;
				}
			}
		}

		public Gst.Memory Parent {
			get {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("parent"));
					return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Memory), false);
				}
			}
			set {
				unsafe {
					IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("parent"));
					*raw_ptr = value == null ? IntPtr.Zero : value.Handle;
				}
			}
		}

		public ulong Maxsize {
			get {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("maxsize"));
					return (ulong) (*raw_ptr);
				}
			}
			set {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("maxsize"));
					*raw_ptr = new UIntPtr (value);
				}
			}
		}

		public ulong Align {
			get {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("align"));
					return (ulong) (*raw_ptr);
				}
			}
			set {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("align"));
					*raw_ptr = new UIntPtr (value);
				}
			}
		}

		public ulong Offset {
			get {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("offset"));
					return (ulong) (*raw_ptr);
				}
			}
			set {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("offset"));
					*raw_ptr = new UIntPtr (value);
				}
			}
		}

		public ulong Size {
			get {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("size"));
					return (ulong) (*raw_ptr);
				}
			}
			set {
				unsafe {
					UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("size"));
					*raw_ptr = new UIntPtr (value);
				}
			}
		}

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

		public static GLib.GType GType { 
			get {
				IntPtr raw_ret = gst_memory_get_type();
				GLib.GType ret = new GLib.GType(raw_ret);
				return ret;
			}
		}

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

		public Gst.Memory Copy(long offset, long size) {
			IntPtr raw_ret = gst_memory_copy(Handle, new IntPtr (offset), new IntPtr (size));
			Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), true);
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern UIntPtr gst_memory_get_sizes(IntPtr raw, out UIntPtr offset, out UIntPtr maxsize);

		public ulong GetSizes(out ulong offset, out ulong maxsize) {
			UIntPtr native_offset;
			UIntPtr native_maxsize;
			UIntPtr raw_ret = gst_memory_get_sizes(Handle, out native_offset, out native_maxsize);
			ulong ret = (ulong) raw_ret;
			offset = (ulong) native_offset;
			maxsize = (ulong) native_maxsize;
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_memory_is_span(IntPtr raw, IntPtr mem2, out UIntPtr offset);

		public bool IsSpan(Gst.Memory mem2, out ulong offset) {
			UIntPtr native_offset;
			bool raw_ret = gst_memory_is_span(Handle, mem2 == null ? IntPtr.Zero : mem2.Handle, out native_offset);
			bool ret = raw_ret;
			offset = (ulong) native_offset;
			return ret;
		}

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

		public bool IsType(string mem_type) {
			IntPtr native_mem_type = GLib.Marshaller.StringToPtrGStrdup (mem_type);
			bool raw_ret = gst_memory_is_type(Handle, native_mem_type);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_mem_type);
			return ret;
		}

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

		public Gst.Memory MakeMapped(out Gst.MapInfo info, Gst.MapFlags flags) {
			IntPtr native_info = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.MapInfo)));
			IntPtr raw_ret = gst_memory_make_mapped(Handle, native_info, (int) flags);
			Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), true);
			info = Gst.MapInfo.New (native_info);
			Marshal.FreeHGlobal (native_info);
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_memory_map(IntPtr raw, IntPtr info, int flags);

		public bool Map(out Gst.MapInfo info, Gst.MapFlags flags) {
			IntPtr native_info = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.MapInfo)));
			bool raw_ret = gst_memory_map(Handle, native_info, (int) flags);
			bool ret = raw_ret;
			info = Gst.MapInfo.New (native_info);
			Marshal.FreeHGlobal (native_info);
			return ret;
		}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_memory_resize(IntPtr raw, IntPtr offset, UIntPtr size);

		public void Resize(long offset, ulong size) {
			gst_memory_resize(Handle, new IntPtr (offset), new UIntPtr (size));
		}

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

		public Gst.Memory Share(long offset, long size) {
			IntPtr raw_ret = gst_memory_share(Handle, new IntPtr (offset), new IntPtr (size));
			Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), true);
			return ret;
		}

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

		public void Unmap(Gst.MapInfo info) {
			IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
			gst_memory_unmap(Handle, native_info);
			Marshal.FreeHGlobal (native_info);
		}

		public Memory(IntPtr raw) : base(raw) {}

		[DllImport("libgstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_memory_new_wrapped(int flags, byte[] data, UIntPtr maxsize, UIntPtr offset, UIntPtr size, IntPtr user_data, GLib.DestroyNotify notify);

		public Memory (Gst.MemoryFlags flags, byte[] data, ulong maxsize, ulong offset, ulong size, IntPtr user_data, GLib.DestroyNotify notify) 
		{
			Raw = gst_memory_new_wrapped((int) flags, data, new UIntPtr (maxsize), new UIntPtr (offset), new UIntPtr (size), user_data, notify);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _abi_info = null;
		static public new GLib.AbiStruct abi_info {
			get {
				if (_abi_info == null)
					_abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("allocator"
							, Gst.MiniObject.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // allocator
							, null
							, "parent"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("parent"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // parent
							, "allocator"
							, "maxsize"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("maxsize"
							, -1
							, (uint) Marshal.SizeOf(typeof(ulong)) // maxsize
							, "parent"
							, "align"
							, (long) Marshal.OffsetOf(typeof(GstMemory_maxsizeAlign), "maxsize")
							, 0
							),
						new GLib.AbiField("align"
							, -1
							, (uint) Marshal.SizeOf(typeof(ulong)) // align
							, "maxsize"
							, "offset"
							, (long) Marshal.OffsetOf(typeof(GstMemory_alignAlign), "align")
							, 0
							),
						new GLib.AbiField("offset"
							, -1
							, (uint) Marshal.SizeOf(typeof(ulong)) // offset
							, "align"
							, "size"
							, (long) Marshal.OffsetOf(typeof(GstMemory_offsetAlign), "offset")
							, 0
							),
						new GLib.AbiField("size"
							, -1
							, (uint) Marshal.SizeOf(typeof(ulong)) // size
							, "offset"
							, null
							, (long) Marshal.OffsetOf(typeof(GstMemory_sizeAlign), "size")
							, 0
							),
					});

				return _abi_info;
			}
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstMemory_maxsizeAlign
		{
			sbyte f1;
			private UIntPtr maxsize;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstMemory_alignAlign
		{
			sbyte f1;
			private UIntPtr align;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstMemory_offsetAlign
		{
			sbyte f1;
			private UIntPtr offset;
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstMemory_sizeAlign
		{
			sbyte f1;
			private UIntPtr size;
		}


		// End of the ABI representation.

#endregion
	}
}