Back to development
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst / Buffer.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         public partial class Buffer : Gst.MiniObject {
13
14                 public Gst.BufferPool Pool {
15                         get {
16                                 unsafe {
17                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("pool"));
18                                         return GLib.Object.GetObject((*raw_ptr)) as Gst.BufferPool;
19                                 }
20                         }
21                         set {
22                                 unsafe {
23                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("pool"));
24                                         *raw_ptr = value == null ? IntPtr.Zero : value.Handle;
25                                 }
26                         }
27                 }
28
29                 public ulong Pts {
30                         get {
31                                 unsafe {
32                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("pts"));
33                                         return (*raw_ptr);
34                                 }
35                         }
36                         set {
37                                 unsafe {
38                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("pts"));
39                                         *raw_ptr = value;
40                                 }
41                         }
42                 }
43
44                 public ulong Dts {
45                         get {
46                                 unsafe {
47                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("dts"));
48                                         return (*raw_ptr);
49                                 }
50                         }
51                         set {
52                                 unsafe {
53                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("dts"));
54                                         *raw_ptr = value;
55                                 }
56                         }
57                 }
58
59                 public ulong Duration {
60                         get {
61                                 unsafe {
62                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("duration"));
63                                         return (*raw_ptr);
64                                 }
65                         }
66                         set {
67                                 unsafe {
68                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("duration"));
69                                         *raw_ptr = value;
70                                 }
71                         }
72                 }
73
74                 public ulong Offset {
75                         get {
76                                 unsafe {
77                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("offset"));
78                                         return (*raw_ptr);
79                                 }
80                         }
81                         set {
82                                 unsafe {
83                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("offset"));
84                                         *raw_ptr = value;
85                                 }
86                         }
87                 }
88
89                 public ulong OffsetEnd {
90                         get {
91                                 unsafe {
92                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("offset_end"));
93                                         return (*raw_ptr);
94                                 }
95                         }
96                         set {
97                                 unsafe {
98                                         ulong* raw_ptr = (ulong*)(((byte*)Handle) + abi_info.GetFieldOffset("offset_end"));
99                                         *raw_ptr = value;
100                                 }
101                         }
102                 }
103
104                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
105                 static extern IntPtr gst_buffer_get_type();
106
107                 public static GLib.GType GType { 
108                         get {
109                                 IntPtr raw_ret = gst_buffer_get_type();
110                                 GLib.GType ret = new GLib.GType(raw_ret);
111                                 return ret;
112                         }
113                 }
114
115                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
116                 static extern IntPtr gst_buffer_add_custom_meta(IntPtr raw, IntPtr name);
117
118                 public Gst.CustomMeta AddCustomMeta(string name) {
119                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
120                         IntPtr raw_ret = gst_buffer_add_custom_meta(Handle, native_name);
121                         Gst.CustomMeta ret = Gst.CustomMeta.New (raw_ret);
122                         GLib.Marshaller.Free (native_name);
123                         return ret;
124                 }
125
126                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
127                 static extern IntPtr gst_buffer_add_meta(IntPtr raw, IntPtr info, IntPtr parms);
128
129                 public Gst.Meta AddMeta(Gst.MetaInfo info, IntPtr parms) {
130                         IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
131                         IntPtr raw_ret = gst_buffer_add_meta(Handle, native_info, parms);
132                         Gst.Meta ret = Gst.Meta.New (raw_ret);
133                         Marshal.FreeHGlobal (native_info);
134                         return ret;
135                 }
136
137                 public Gst.Meta AddMeta(Gst.MetaInfo info) {
138                         return AddMeta (info, IntPtr.Zero);
139                 }
140
141                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
142                 static extern IntPtr gst_buffer_add_parent_buffer_meta(IntPtr raw, IntPtr reference);
143
144                 public Gst.ParentBufferMeta AddParentBufferMeta(Gst.Buffer reference) {
145                         IntPtr raw_ret = gst_buffer_add_parent_buffer_meta(Handle, reference == null ? IntPtr.Zero : reference.Handle);
146                         Gst.ParentBufferMeta ret = Gst.ParentBufferMeta.New (raw_ret);
147                         return ret;
148                 }
149
150                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
151                 static extern IntPtr gst_buffer_add_protection_meta(IntPtr raw, IntPtr info);
152
153                 public Gst.ProtectionMeta AddProtectionMeta(Gst.Structure info) {
154                         info.Owned = false;
155                         IntPtr raw_ret = gst_buffer_add_protection_meta(Handle, info == null ? IntPtr.Zero : info.Handle);
156                         Gst.ProtectionMeta ret = Gst.ProtectionMeta.New (raw_ret);
157                         return ret;
158                 }
159
160                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
161                 static extern IntPtr gst_buffer_add_reference_timestamp_meta(IntPtr raw, IntPtr reference, ulong timestamp, ulong duration);
162
163                 public Gst.ReferenceTimestampMeta AddReferenceTimestampMeta(Gst.Caps reference, ulong timestamp, ulong duration) {
164                         IntPtr raw_ret = gst_buffer_add_reference_timestamp_meta(Handle, reference == null ? IntPtr.Zero : reference.Handle, timestamp, duration);
165                         Gst.ReferenceTimestampMeta ret = Gst.ReferenceTimestampMeta.New (raw_ret);
166                         return ret;
167                 }
168
169                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
170                 static extern IntPtr gst_buffer_append(IntPtr raw, IntPtr buf2);
171
172                 public Gst.Buffer Append(Gst.Buffer buf2) {
173                         buf2.Owned = false;
174                         IntPtr raw_ret = gst_buffer_append(Handle, buf2 == null ? IntPtr.Zero : buf2.Handle);
175                         Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
176                         return ret;
177                 }
178
179                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
180                 static extern void gst_buffer_append_memory(IntPtr raw, IntPtr mem);
181
182                 public void AppendMemory(Gst.Memory mem) {
183                         mem.Owned = false;
184                         gst_buffer_append_memory(Handle, mem == null ? IntPtr.Zero : mem.Handle);
185                 }
186
187                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
188                 static extern IntPtr gst_buffer_append_region(IntPtr raw, IntPtr buf2, IntPtr offset, IntPtr size);
189
190                 public Gst.Buffer AppendRegion(Gst.Buffer buf2, long offset, long size) {
191                         buf2.Owned = false;
192                         IntPtr raw_ret = gst_buffer_append_region(Handle, buf2 == null ? IntPtr.Zero : buf2.Handle, new IntPtr (offset), new IntPtr (size));
193                         Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
194                         return ret;
195                 }
196
197                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
198                 static extern IntPtr gst_buffer_copy_deep(IntPtr raw);
199
200                 public Gst.Buffer CopyDeep() {
201                         IntPtr raw_ret = gst_buffer_copy_deep(Handle);
202                         Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
203                         return ret;
204                 }
205
206                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
207                 static extern bool gst_buffer_copy_into(IntPtr raw, IntPtr src, int flags, UIntPtr offset, UIntPtr size);
208
209                 public bool CopyInto(Gst.Buffer src, Gst.BufferCopyFlags flags, ulong offset, ulong size) {
210                         bool raw_ret = gst_buffer_copy_into(Handle, src == null ? IntPtr.Zero : src.Handle, (int) flags, new UIntPtr (offset), new UIntPtr (size));
211                         bool ret = raw_ret;
212                         return ret;
213                 }
214
215                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
216                 static extern IntPtr gst_buffer_copy_region(IntPtr raw, int flags, UIntPtr offset, UIntPtr size);
217
218                 public Gst.Buffer CopyRegion(Gst.BufferCopyFlags flags, ulong offset, ulong size) {
219                         IntPtr raw_ret = gst_buffer_copy_region(Handle, (int) flags, new UIntPtr (offset), new UIntPtr (size));
220                         Gst.Buffer ret = raw_ret == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Buffer), true);
221                         return ret;
222                 }
223
224                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
225                 static extern UIntPtr gst_buffer_fill(IntPtr raw, UIntPtr offset, byte[] src, UIntPtr n_length);
226
227                 public ulong Fill(ulong offset, byte[] src) {
228                         UIntPtr raw_ret = gst_buffer_fill(Handle, new UIntPtr (offset), src, new UIntPtr ((ulong) (src == null ? 0 : src.Length)));
229                         ulong ret = (ulong) raw_ret;
230                         return ret;
231                 }
232
233                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
234                 static extern bool gst_buffer_find_memory(IntPtr raw, UIntPtr offset, UIntPtr size, out uint idx, out uint length, out UIntPtr skip);
235
236                 public bool FindMemory(ulong offset, ulong size, out uint idx, out uint length, out ulong skip) {
237                         UIntPtr native_skip;
238                         bool raw_ret = gst_buffer_find_memory(Handle, new UIntPtr (offset), new UIntPtr (size), out idx, out length, out native_skip);
239                         bool ret = raw_ret;
240                         skip = (ulong) native_skip;
241                         return ret;
242                 }
243
244                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
245                 static extern IntPtr gst_buffer_get_all_memory(IntPtr raw);
246
247                 public Gst.Memory AllMemory { 
248                         get {
249                                 IntPtr raw_ret = gst_buffer_get_all_memory(Handle);
250                                 Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), true);
251                                 return ret;
252                         }
253                 }
254
255                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
256                 static extern IntPtr gst_buffer_get_custom_meta(IntPtr raw, IntPtr name);
257
258                 public Gst.CustomMeta GetCustomMeta(string name) {
259                         IntPtr native_name = GLib.Marshaller.StringToPtrGStrdup (name);
260                         IntPtr raw_ret = gst_buffer_get_custom_meta(Handle, native_name);
261                         Gst.CustomMeta ret = Gst.CustomMeta.New (raw_ret);
262                         GLib.Marshaller.Free (native_name);
263                         return ret;
264                 }
265
266                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
267                 static extern int gst_buffer_get_flags(IntPtr raw);
268
269                 public Gst.BufferFlags Flags { 
270                         get {
271                                 int raw_ret = gst_buffer_get_flags(Handle);
272                                 Gst.BufferFlags ret = (Gst.BufferFlags) raw_ret;
273                                 return ret;
274                         }
275                 }
276
277                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
278                 static extern IntPtr gst_buffer_get_memory(IntPtr raw, uint idx);
279
280                 public Gst.Memory GetMemory(uint idx) {
281                         IntPtr raw_ret = gst_buffer_get_memory(Handle, idx);
282                         Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), true);
283                         return ret;
284                 }
285
286                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
287                 static extern IntPtr gst_buffer_get_memory_range(IntPtr raw, uint idx, int length);
288
289                 public Gst.Memory GetMemoryRange(uint idx, int length) {
290                         IntPtr raw_ret = gst_buffer_get_memory_range(Handle, idx, length);
291                         Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), true);
292                         return ret;
293                 }
294
295                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
296                 static extern IntPtr gst_buffer_get_meta(IntPtr raw, IntPtr api);
297
298                 public Gst.Meta GetMeta(GLib.GType api) {
299                         IntPtr raw_ret = gst_buffer_get_meta(Handle, api.Val);
300                         Gst.Meta ret = Gst.Meta.New (raw_ret);
301                         return ret;
302                 }
303
304                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
305                 static extern uint gst_buffer_get_n_meta(IntPtr raw, IntPtr api_type);
306
307                 public uint GetNMeta(GLib.GType api_type) {
308                         uint raw_ret = gst_buffer_get_n_meta(Handle, api_type.Val);
309                         uint ret = raw_ret;
310                         return ret;
311                 }
312
313                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
314                 static extern IntPtr gst_buffer_get_reference_timestamp_meta(IntPtr raw, IntPtr reference);
315
316                 public Gst.ReferenceTimestampMeta GetReferenceTimestampMeta(Gst.Caps reference) {
317                         IntPtr raw_ret = gst_buffer_get_reference_timestamp_meta(Handle, reference == null ? IntPtr.Zero : reference.Handle);
318                         Gst.ReferenceTimestampMeta ret = Gst.ReferenceTimestampMeta.New (raw_ret);
319                         return ret;
320                 }
321
322                 public Gst.ReferenceTimestampMeta GetReferenceTimestampMeta() {
323                         return GetReferenceTimestampMeta (null);
324                 }
325
326                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
327                 static extern UIntPtr gst_buffer_get_size(IntPtr raw);
328
329                 public ulong Size { 
330                         get {
331                                 UIntPtr raw_ret = gst_buffer_get_size(Handle);
332                                 ulong ret = (ulong) raw_ret;
333                                 return ret;
334                         }
335                 }
336
337                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
338                 static extern UIntPtr gst_buffer_get_sizes(IntPtr raw, out UIntPtr offset, out UIntPtr maxsize);
339
340                 public ulong GetSizes(out ulong offset, out ulong maxsize) {
341                         UIntPtr native_offset;
342                         UIntPtr native_maxsize;
343                         UIntPtr raw_ret = gst_buffer_get_sizes(Handle, out native_offset, out native_maxsize);
344                         ulong ret = (ulong) raw_ret;
345                         offset = (ulong) native_offset;
346                         maxsize = (ulong) native_maxsize;
347                         return ret;
348                 }
349
350                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
351                 static extern UIntPtr gst_buffer_get_sizes_range(IntPtr raw, uint idx, int length, out UIntPtr offset, out UIntPtr maxsize);
352
353                 public ulong GetSizesRange(uint idx, int length, out ulong offset, out ulong maxsize) {
354                         UIntPtr native_offset;
355                         UIntPtr native_maxsize;
356                         UIntPtr raw_ret = gst_buffer_get_sizes_range(Handle, idx, length, out native_offset, out native_maxsize);
357                         ulong ret = (ulong) raw_ret;
358                         offset = (ulong) native_offset;
359                         maxsize = (ulong) native_maxsize;
360                         return ret;
361                 }
362
363                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
364                 static extern bool gst_buffer_has_flags(IntPtr raw, int flags);
365
366                 public bool HasFlags(Gst.BufferFlags flags) {
367                         bool raw_ret = gst_buffer_has_flags(Handle, (int) flags);
368                         bool ret = raw_ret;
369                         return ret;
370                 }
371
372                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
373                 static extern void gst_buffer_insert_memory(IntPtr raw, int idx, IntPtr mem);
374
375                 public void InsertMemory(int idx, Gst.Memory mem) {
376                         mem.Owned = false;
377                         gst_buffer_insert_memory(Handle, idx, mem == null ? IntPtr.Zero : mem.Handle);
378                 }
379
380                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
381                 static extern bool gst_buffer_is_all_memory_writable(IntPtr raw);
382
383                 public bool IsAllMemoryWritable { 
384                         get {
385                                 bool raw_ret = gst_buffer_is_all_memory_writable(Handle);
386                                 bool ret = raw_ret;
387                                 return ret;
388                         }
389                 }
390
391                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
392                 static extern bool gst_buffer_is_memory_range_writable(IntPtr raw, uint idx, int length);
393
394                 public bool IsMemoryRangeWritable(uint idx, int length) {
395                         bool raw_ret = gst_buffer_is_memory_range_writable(Handle, idx, length);
396                         bool ret = raw_ret;
397                         return ret;
398                 }
399
400                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
401                 static extern bool gst_buffer_map(IntPtr raw, IntPtr info, int flags);
402
403                 public bool Map(out Gst.MapInfo info, Gst.MapFlags flags) {
404                         IntPtr native_info = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.MapInfo)));
405                         bool raw_ret = gst_buffer_map(Handle, native_info, (int) flags);
406                         bool ret = raw_ret;
407                         info = Gst.MapInfo.New (native_info);
408                         Marshal.FreeHGlobal (native_info);
409                         return ret;
410                 }
411
412                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
413                 static extern bool gst_buffer_map_range(IntPtr raw, uint idx, int length, IntPtr info, int flags);
414
415                 public bool MapRange(uint idx, int length, out Gst.MapInfo info, Gst.MapFlags flags) {
416                         IntPtr native_info = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.MapInfo)));
417                         bool raw_ret = gst_buffer_map_range(Handle, idx, length, native_info, (int) flags);
418                         bool ret = raw_ret;
419                         info = Gst.MapInfo.New (native_info);
420                         Marshal.FreeHGlobal (native_info);
421                         return ret;
422                 }
423
424                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
425                 static extern int gst_buffer_memcmp(IntPtr raw, UIntPtr offset, byte[] mem, UIntPtr n_length);
426
427                 public int Memcmp(ulong offset, byte[] mem) {
428                         int raw_ret = gst_buffer_memcmp(Handle, new UIntPtr (offset), mem, new UIntPtr ((ulong) (mem == null ? 0 : mem.Length)));
429                         int ret = raw_ret;
430                         return ret;
431                 }
432
433                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
434                 static extern UIntPtr gst_buffer_memset(IntPtr raw, UIntPtr offset, byte val, UIntPtr size);
435
436                 public ulong Memset(ulong offset, byte val, ulong size) {
437                         UIntPtr raw_ret = gst_buffer_memset(Handle, new UIntPtr (offset), val, new UIntPtr (size));
438                         ulong ret = (ulong) raw_ret;
439                         return ret;
440                 }
441
442                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
443                 static extern uint gst_buffer_n_memory(IntPtr raw);
444
445                 public uint NMemory() {
446                         uint raw_ret = gst_buffer_n_memory(Handle);
447                         uint ret = raw_ret;
448                         return ret;
449                 }
450
451                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
452                 static extern IntPtr gst_buffer_peek_memory(IntPtr raw, uint idx);
453
454                 public Gst.Memory PeekMemory(uint idx) {
455                         IntPtr raw_ret = gst_buffer_peek_memory(Handle, idx);
456                         Gst.Memory ret = raw_ret == IntPtr.Zero ? null : (Gst.Memory) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Memory), false);
457                         return ret;
458                 }
459
460                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
461                 static extern void gst_buffer_prepend_memory(IntPtr raw, IntPtr mem);
462
463                 public void PrependMemory(Gst.Memory mem) {
464                         mem.Owned = false;
465                         gst_buffer_prepend_memory(Handle, mem == null ? IntPtr.Zero : mem.Handle);
466                 }
467
468                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
469                 static extern void gst_buffer_remove_all_memory(IntPtr raw);
470
471                 public void RemoveAllMemory() {
472                         gst_buffer_remove_all_memory(Handle);
473                 }
474
475                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
476                 static extern void gst_buffer_remove_memory(IntPtr raw, uint idx);
477
478                 public void RemoveMemory(uint idx) {
479                         gst_buffer_remove_memory(Handle, idx);
480                 }
481
482                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
483                 static extern void gst_buffer_remove_memory_range(IntPtr raw, uint idx, int length);
484
485                 public void RemoveMemoryRange(uint idx, int length) {
486                         gst_buffer_remove_memory_range(Handle, idx, length);
487                 }
488
489                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
490                 static extern bool gst_buffer_remove_meta(IntPtr raw, IntPtr meta);
491
492                 public bool RemoveMeta(Gst.Meta meta) {
493                         IntPtr native_meta = GLib.Marshaller.StructureToPtrAlloc (meta);
494                         bool raw_ret = gst_buffer_remove_meta(Handle, native_meta);
495                         bool ret = raw_ret;
496                         Marshal.FreeHGlobal (native_meta);
497                         return ret;
498                 }
499
500                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
501                 static extern void gst_buffer_replace_all_memory(IntPtr raw, IntPtr mem);
502
503                 public void ReplaceAllMemory(Gst.Memory mem) {
504                         mem.Owned = false;
505                         gst_buffer_replace_all_memory(Handle, mem == null ? IntPtr.Zero : mem.Handle);
506                 }
507
508                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
509                 static extern void gst_buffer_replace_memory(IntPtr raw, uint idx, IntPtr mem);
510
511                 public void ReplaceMemory(uint idx, Gst.Memory mem) {
512                         mem.Owned = false;
513                         gst_buffer_replace_memory(Handle, idx, mem == null ? IntPtr.Zero : mem.Handle);
514                 }
515
516                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
517                 static extern void gst_buffer_replace_memory_range(IntPtr raw, uint idx, int length, IntPtr mem);
518
519                 public void ReplaceMemoryRange(uint idx, int length, Gst.Memory mem) {
520                         mem.Owned = false;
521                         gst_buffer_replace_memory_range(Handle, idx, length, mem == null ? IntPtr.Zero : mem.Handle);
522                 }
523
524                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
525                 static extern void gst_buffer_resize(IntPtr raw, IntPtr offset, IntPtr size);
526
527                 public void Resize(long offset, long size) {
528                         gst_buffer_resize(Handle, new IntPtr (offset), new IntPtr (size));
529                 }
530
531                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
532                 static extern bool gst_buffer_resize_range(IntPtr raw, uint idx, int length, IntPtr offset, IntPtr size);
533
534                 public bool ResizeRange(uint idx, int length, long offset, long size) {
535                         bool raw_ret = gst_buffer_resize_range(Handle, idx, length, new IntPtr (offset), new IntPtr (size));
536                         bool ret = raw_ret;
537                         return ret;
538                 }
539
540                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
541                 static extern bool gst_buffer_set_flags(IntPtr raw, int flags);
542
543                 public bool SetFlags(Gst.BufferFlags flags) {
544                         bool raw_ret = gst_buffer_set_flags(Handle, (int) flags);
545                         bool ret = raw_ret;
546                         return ret;
547                 }
548
549                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
550                 static extern void gst_buffer_set_size(IntPtr raw, IntPtr size);
551
552                 public void SetSize(long size) {
553                         gst_buffer_set_size(Handle, new IntPtr (size));
554                 }
555
556                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
557                 static extern void gst_buffer_unmap(IntPtr raw, IntPtr info);
558
559                 public void Unmap(Gst.MapInfo info) {
560                         IntPtr native_info = GLib.Marshaller.StructureToPtrAlloc (info);
561                         gst_buffer_unmap(Handle, native_info);
562                         Marshal.FreeHGlobal (native_info);
563                 }
564
565                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
566                 static extern bool gst_buffer_unset_flags(IntPtr raw, int flags);
567
568                 public bool UnsetFlags(Gst.BufferFlags flags) {
569                         bool raw_ret = gst_buffer_unset_flags(Handle, (int) flags);
570                         bool ret = raw_ret;
571                         return ret;
572                 }
573
574                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
575                 static extern uint gst_buffer_get_max_memory();
576
577                 public static uint MaxMemory { 
578                         get {
579                                 uint raw_ret = gst_buffer_get_max_memory();
580                                 uint ret = raw_ret;
581                                 return ret;
582                         }
583                 }
584
585                 public Buffer(IntPtr raw) : base(raw) {}
586
587                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
588                 static extern IntPtr gst_buffer_new();
589
590                 public Buffer () 
591                 {
592                         Raw = gst_buffer_new();
593                 }
594
595                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
596                 static extern IntPtr gst_buffer_new_allocate(IntPtr allocator, UIntPtr size, IntPtr parms);
597
598                 public Buffer (Gst.Allocator allocator, ulong size, Gst.AllocationParams parms) 
599                 {
600                         IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
601                         Raw = gst_buffer_new_allocate(allocator == null ? IntPtr.Zero : allocator.Handle, new UIntPtr (size), native_parms);
602                         Marshal.FreeHGlobal (native_parms);
603                 }
604
605                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
606                 static extern IntPtr gst_buffer_new_wrapped_bytes(IntPtr bytes);
607
608                 public Buffer (GLib.Bytes bytes) 
609                 {
610                         Raw = gst_buffer_new_wrapped_bytes(bytes == null ? IntPtr.Zero : bytes.Handle);
611                 }
612
613                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
614                 static extern IntPtr gst_buffer_new_wrapped_full(int flags, byte[] data, UIntPtr maxsize, UIntPtr offset, UIntPtr size, IntPtr user_data, GLib.DestroyNotify notify);
615
616                 public Buffer (Gst.MemoryFlags flags, byte[] data, ulong maxsize, ulong offset, ulong size, IntPtr user_data, GLib.DestroyNotify notify) 
617                 {
618                         Raw = gst_buffer_new_wrapped_full((int) flags, data, new UIntPtr (maxsize), new UIntPtr (offset), new UIntPtr (size), user_data, notify);
619                 }
620
621                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
622                 static extern IntPtr gst_buffer_ref(IntPtr raw);
623
624                 protected override void Ref (IntPtr raw)
625                 {
626                         if (!Owned) {
627                                 gst_buffer_ref (raw);
628                                 Owned = true;
629                         }
630                 }
631
632                 [DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
633                 static extern void gst_buffer_unref(IntPtr raw);
634
635                 protected override void Unref (IntPtr raw)
636                 {
637                         if (Owned) {
638                                 gst_buffer_unref (raw);
639                                 Owned = false;
640                         }
641                 }
642
643                 protected override Action<IntPtr> DisposeUnmanagedFunc {
644                         get {
645                                 return gst_buffer_unref;
646                         }
647                 }
648
649
650                 // Internal representation of the wrapped structure ABI.
651                 static GLib.AbiStruct _abi_info = null;
652                 static public new GLib.AbiStruct abi_info {
653                         get {
654                                 if (_abi_info == null)
655                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
656                                                 new GLib.AbiField("pool"
657                                                         , Gst.MiniObject.abi_info.Fields
658                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // pool
659                                                         , null
660                                                         , "pts"
661                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
662                                                         , 0
663                                                         ),
664                                                 new GLib.AbiField("pts"
665                                                         , -1
666                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // pts
667                                                         , "pool"
668                                                         , "dts"
669                                                         , (long) Marshal.OffsetOf(typeof(GstBuffer_ptsAlign), "pts")
670                                                         , 0
671                                                         ),
672                                                 new GLib.AbiField("dts"
673                                                         , -1
674                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // dts
675                                                         , "pts"
676                                                         , "duration"
677                                                         , (long) Marshal.OffsetOf(typeof(GstBuffer_dtsAlign), "dts")
678                                                         , 0
679                                                         ),
680                                                 new GLib.AbiField("duration"
681                                                         , -1
682                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // duration
683                                                         , "dts"
684                                                         , "offset"
685                                                         , (long) Marshal.OffsetOf(typeof(GstBuffer_durationAlign), "duration")
686                                                         , 0
687                                                         ),
688                                                 new GLib.AbiField("offset"
689                                                         , -1
690                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // offset
691                                                         , "duration"
692                                                         , "offset_end"
693                                                         , (long) Marshal.OffsetOf(typeof(GstBuffer_offsetAlign), "offset")
694                                                         , 0
695                                                         ),
696                                                 new GLib.AbiField("offset_end"
697                                                         , -1
698                                                         , (uint) Marshal.SizeOf(typeof(ulong)) // offset_end
699                                                         , "offset"
700                                                         , null
701                                                         , (long) Marshal.OffsetOf(typeof(GstBuffer_offset_endAlign), "offset_end")
702                                                         , 0
703                                                         ),
704                                         });
705
706                                 return _abi_info;
707                         }
708                 }
709
710                 [StructLayout(LayoutKind.Sequential)]
711                 public struct GstBuffer_ptsAlign
712                 {
713                         sbyte f1;
714                         private ulong pts;
715                 }
716
717                 [StructLayout(LayoutKind.Sequential)]
718                 public struct GstBuffer_dtsAlign
719                 {
720                         sbyte f1;
721                         private ulong dts;
722                 }
723
724                 [StructLayout(LayoutKind.Sequential)]
725                 public struct GstBuffer_durationAlign
726                 {
727                         sbyte f1;
728                         private ulong duration;
729                 }
730
731                 [StructLayout(LayoutKind.Sequential)]
732                 public struct GstBuffer_offsetAlign
733                 {
734                         sbyte f1;
735                         private ulong offset;
736                 }
737
738                 [StructLayout(LayoutKind.Sequential)]
739                 public struct GstBuffer_offset_endAlign
740                 {
741                         sbyte f1;
742                         private ulong offset_end;
743                 }
744
745
746                 // End of the ABI representation.
747
748 #endregion
749         }
750 }