summaryrefslogtreecommitdiff
path: root/sources/generated/Gst/BufferPool.cs
blob: d8a4dfb2f6fd3705890e750f91300ab7ed38cc74 (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
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
// 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 BufferPool : Gst.Object {

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

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

		public BufferPool () : base (IntPtr.Zero)
		{
			if (GetType () != typeof (BufferPool)) {
				CreateNativeObject (new string [0], new GLib.Value[0]);
				return;
			}
			Raw = gst_buffer_pool_new();
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_buffer_pool_set_flushing(IntPtr raw, bool flushing);

		public bool Flushing {
			get {
				unsafe {
					bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("flushing"));
					return (*raw_ptr);
				}
			}
			set  {
				gst_buffer_pool_set_flushing(Handle, value);
			}
		}

		static GetOptionsNativeDelegate GetOptions_cb_delegate;
		static GetOptionsNativeDelegate GetOptionsVMCallback {
			get {
				if (GetOptions_cb_delegate == null)
					GetOptions_cb_delegate = new GetOptionsNativeDelegate (GetOptions_cb);
				return GetOptions_cb_delegate;
			}
		}

		static void OverrideGetOptions (GLib.GType gtype)
		{
			OverrideGetOptions (gtype, GetOptionsVMCallback);
		}

		static void OverrideGetOptions (GLib.GType gtype, GetOptionsNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("get_options"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate IntPtr GetOptionsNativeDelegate (IntPtr inst);

		static IntPtr GetOptions_cb (IntPtr inst)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				string[] __result;
				__result = __obj.OnGetOptions ();
				return GLib.Marshaller.StringArrayToNullTermStrvPointer (__result);
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideGetOptions")]
		protected virtual string[] OnGetOptions ()
		{
			return InternalGetOptions ();
		}

		private string[] InternalGetOptions ()
		{
			GetOptionsNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("get_options"));
				unmanaged = (GetOptionsNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(GetOptionsNativeDelegate));
			}
			if (unmanaged == null) return null;

			IntPtr __result = unmanaged (this.Handle);
			return GLib.Marshaller.NullTermPtrToStringArray (__result, false);
		}

		static SetConfigNativeDelegate SetConfig_cb_delegate;
		static SetConfigNativeDelegate SetConfigVMCallback {
			get {
				if (SetConfig_cb_delegate == null)
					SetConfig_cb_delegate = new SetConfigNativeDelegate (SetConfig_cb);
				return SetConfig_cb_delegate;
			}
		}

		static void OverrideSetConfig (GLib.GType gtype)
		{
			OverrideSetConfig (gtype, SetConfigVMCallback);
		}

		static void OverrideSetConfig (GLib.GType gtype, SetConfigNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("set_config"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool SetConfigNativeDelegate (IntPtr inst, IntPtr config);

		static bool SetConfig_cb (IntPtr inst, IntPtr config)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				bool __result;
				__result = __obj.OnSetConfig (config == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (config, typeof (Gst.Structure), true));
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideSetConfig")]
		protected virtual bool OnSetConfig (Gst.Structure config)
		{
			return InternalSetConfig (config);
		}

		private bool InternalSetConfig (Gst.Structure config)
		{
			SetConfigNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("set_config"));
				unmanaged = (SetConfigNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetConfigNativeDelegate));
			}
			if (unmanaged == null) return false;

			config.Owned = false;
			bool __result = unmanaged (this.Handle, config == null ? IntPtr.Zero : config.Handle);
			return __result;
		}

		static StartNativeDelegate Start_cb_delegate;
		static StartNativeDelegate StartVMCallback {
			get {
				if (Start_cb_delegate == null)
					Start_cb_delegate = new StartNativeDelegate (Start_cb);
				return Start_cb_delegate;
			}
		}

		static void OverrideStart (GLib.GType gtype)
		{
			OverrideStart (gtype, StartVMCallback);
		}

		static void OverrideStart (GLib.GType gtype, StartNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool StartNativeDelegate (IntPtr inst);

		static bool Start_cb (IntPtr inst)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				bool __result;
				__result = __obj.OnStart ();
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideStart")]
		protected virtual bool OnStart ()
		{
			return InternalStart ();
		}

		private bool InternalStart ()
		{
			StartNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("start"));
				unmanaged = (StartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StartNativeDelegate));
			}
			if (unmanaged == null) return false;

			bool __result = unmanaged (this.Handle);
			return __result;
		}

		static StopNativeDelegate Stop_cb_delegate;
		static StopNativeDelegate StopVMCallback {
			get {
				if (Stop_cb_delegate == null)
					Stop_cb_delegate = new StopNativeDelegate (Stop_cb);
				return Stop_cb_delegate;
			}
		}

		static void OverrideStop (GLib.GType gtype)
		{
			OverrideStop (gtype, StopVMCallback);
		}

		static void OverrideStop (GLib.GType gtype, StopNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate bool StopNativeDelegate (IntPtr inst);

		static bool Stop_cb (IntPtr inst)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				bool __result;
				__result = __obj.OnStop ();
				return __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideStop")]
		protected virtual bool OnStop ()
		{
			return InternalStop ();
		}

		private bool InternalStop ()
		{
			StopNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("stop"));
				unmanaged = (StopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(StopNativeDelegate));
			}
			if (unmanaged == null) return false;

			bool __result = unmanaged (this.Handle);
			return __result;
		}

		static AcquireBufferNativeDelegate AcquireBuffer_cb_delegate;
		static AcquireBufferNativeDelegate AcquireBufferVMCallback {
			get {
				if (AcquireBuffer_cb_delegate == null)
					AcquireBuffer_cb_delegate = new AcquireBufferNativeDelegate (AcquireBuffer_cb);
				return AcquireBuffer_cb_delegate;
			}
		}

		static void OverrideAcquireBuffer (GLib.GType gtype)
		{
			OverrideAcquireBuffer (gtype, AcquireBufferVMCallback);
		}

		static void OverrideAcquireBuffer (GLib.GType gtype, AcquireBufferNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire_buffer"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int AcquireBufferNativeDelegate (IntPtr inst, out IntPtr buffer, IntPtr parms);

		static int AcquireBuffer_cb (IntPtr inst, out IntPtr buffer, IntPtr parms)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				Gst.FlowReturn __result;
				Gst.Buffer mybuffer;
				__result = __obj.OnAcquireBuffer (out mybuffer, Gst.BufferPoolAcquireParams.New (parms));
				buffer = mybuffer == null ? IntPtr.Zero : mybuffer.Handle;
				return (int) __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideAcquireBuffer")]
		protected virtual Gst.FlowReturn OnAcquireBuffer (out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
		{
			return InternalAcquireBuffer (out buffer, parms);
		}

		private Gst.FlowReturn InternalAcquireBuffer (out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
		{
			AcquireBufferNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire_buffer"));
				unmanaged = (AcquireBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcquireBufferNativeDelegate));
			}
			if (unmanaged == null) throw new InvalidOperationException ("No base method to invoke");

			IntPtr native_buffer;
			IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
			int __result = unmanaged (this.Handle, out native_buffer, native_parms);
			buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), true);
			Marshal.FreeHGlobal (native_parms);
			return (Gst.FlowReturn) __result;
		}

		static AllocBufferNativeDelegate AllocBuffer_cb_delegate;
		static AllocBufferNativeDelegate AllocBufferVMCallback {
			get {
				if (AllocBuffer_cb_delegate == null)
					AllocBuffer_cb_delegate = new AllocBufferNativeDelegate (AllocBuffer_cb);
				return AllocBuffer_cb_delegate;
			}
		}

		static void OverrideAllocBuffer (GLib.GType gtype)
		{
			OverrideAllocBuffer (gtype, AllocBufferVMCallback);
		}

		static void OverrideAllocBuffer (GLib.GType gtype, AllocBufferNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("alloc_buffer"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate int AllocBufferNativeDelegate (IntPtr inst, IntPtr buffer, IntPtr parms);

		static int AllocBuffer_cb (IntPtr inst, IntPtr buffer, IntPtr parms)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				Gst.FlowReturn __result;
				__result = __obj.OnAllocBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false), Gst.BufferPoolAcquireParams.New (parms));
				return (int) __result;
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, true);
				// NOTREACHED: above call does not return.
				throw e;
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideAllocBuffer")]
		protected virtual Gst.FlowReturn OnAllocBuffer (Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
		{
			return InternalAllocBuffer (buffer, parms);
		}

		private Gst.FlowReturn InternalAllocBuffer (Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms)
		{
			AllocBufferNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("alloc_buffer"));
				unmanaged = (AllocBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AllocBufferNativeDelegate));
			}
			if (unmanaged == null) return (Gst.FlowReturn) 0;

			IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
			int __result = unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle, native_parms);
			Marshal.FreeHGlobal (native_parms);
			return (Gst.FlowReturn) __result;
		}

		static ResetBufferNativeDelegate ResetBuffer_cb_delegate;
		static ResetBufferNativeDelegate ResetBufferVMCallback {
			get {
				if (ResetBuffer_cb_delegate == null)
					ResetBuffer_cb_delegate = new ResetBufferNativeDelegate (ResetBuffer_cb);
				return ResetBuffer_cb_delegate;
			}
		}

		static void OverrideResetBuffer (GLib.GType gtype)
		{
			OverrideResetBuffer (gtype, ResetBufferVMCallback);
		}

		static void OverrideResetBuffer (GLib.GType gtype, ResetBufferNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("reset_buffer"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void ResetBufferNativeDelegate (IntPtr inst, IntPtr buffer);

		static void ResetBuffer_cb (IntPtr inst, IntPtr buffer)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				__obj.OnResetBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideResetBuffer")]
		protected virtual void OnResetBuffer (Gst.Buffer buffer)
		{
			InternalResetBuffer (buffer);
		}

		private void InternalResetBuffer (Gst.Buffer buffer)
		{
			ResetBufferNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("reset_buffer"));
				unmanaged = (ResetBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ResetBufferNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
		}

		static ReleaseBufferNativeDelegate ReleaseBuffer_cb_delegate;
		static ReleaseBufferNativeDelegate ReleaseBufferVMCallback {
			get {
				if (ReleaseBuffer_cb_delegate == null)
					ReleaseBuffer_cb_delegate = new ReleaseBufferNativeDelegate (ReleaseBuffer_cb);
				return ReleaseBuffer_cb_delegate;
			}
		}

		static void OverrideReleaseBuffer (GLib.GType gtype)
		{
			OverrideReleaseBuffer (gtype, ReleaseBufferVMCallback);
		}

		static void OverrideReleaseBuffer (GLib.GType gtype, ReleaseBufferNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("release_buffer"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void ReleaseBufferNativeDelegate (IntPtr inst, IntPtr buffer);

		static void ReleaseBuffer_cb (IntPtr inst, IntPtr buffer)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				__obj.OnReleaseBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), true));
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideReleaseBuffer")]
		protected virtual void OnReleaseBuffer (Gst.Buffer buffer)
		{
			InternalReleaseBuffer (buffer);
		}

		private void InternalReleaseBuffer (Gst.Buffer buffer)
		{
			ReleaseBufferNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("release_buffer"));
				unmanaged = (ReleaseBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReleaseBufferNativeDelegate));
			}
			if (unmanaged == null) return;

			buffer.Owned = false;
			unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
		}

		static FreeBufferNativeDelegate FreeBuffer_cb_delegate;
		static FreeBufferNativeDelegate FreeBufferVMCallback {
			get {
				if (FreeBuffer_cb_delegate == null)
					FreeBuffer_cb_delegate = new FreeBufferNativeDelegate (FreeBuffer_cb);
				return FreeBuffer_cb_delegate;
			}
		}

		static void OverrideFreeBuffer (GLib.GType gtype)
		{
			OverrideFreeBuffer (gtype, FreeBufferVMCallback);
		}

		static void OverrideFreeBuffer (GLib.GType gtype, FreeBufferNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("free_buffer"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void FreeBufferNativeDelegate (IntPtr inst, IntPtr buffer);

		static void FreeBuffer_cb (IntPtr inst, IntPtr buffer)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				__obj.OnFreeBuffer (buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (buffer, typeof (Gst.Buffer), false));
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideFreeBuffer")]
		protected virtual void OnFreeBuffer (Gst.Buffer buffer)
		{
			InternalFreeBuffer (buffer);
		}

		private void InternalFreeBuffer (Gst.Buffer buffer)
		{
			FreeBufferNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("free_buffer"));
				unmanaged = (FreeBufferNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FreeBufferNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
		}

		static FlushStartNativeDelegate FlushStart_cb_delegate;
		static FlushStartNativeDelegate FlushStartVMCallback {
			get {
				if (FlushStart_cb_delegate == null)
					FlushStart_cb_delegate = new FlushStartNativeDelegate (FlushStart_cb);
				return FlushStart_cb_delegate;
			}
		}

		static void OverrideFlushStart (GLib.GType gtype)
		{
			OverrideFlushStart (gtype, FlushStartVMCallback);
		}

		static void OverrideFlushStart (GLib.GType gtype, FlushStartNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_start"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void FlushStartNativeDelegate (IntPtr inst);

		static void FlushStart_cb (IntPtr inst)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				__obj.OnFlushStart ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideFlushStart")]
		protected virtual void OnFlushStart ()
		{
			InternalFlushStart ();
		}

		private void InternalFlushStart ()
		{
			FlushStartNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_start"));
				unmanaged = (FlushStartNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushStartNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}

		static FlushStopNativeDelegate FlushStop_cb_delegate;
		static FlushStopNativeDelegate FlushStopVMCallback {
			get {
				if (FlushStop_cb_delegate == null)
					FlushStop_cb_delegate = new FlushStopNativeDelegate (FlushStop_cb);
				return FlushStop_cb_delegate;
			}
		}

		static void OverrideFlushStop (GLib.GType gtype)
		{
			OverrideFlushStop (gtype, FlushStopVMCallback);
		}

		static void OverrideFlushStop (GLib.GType gtype, FlushStopNativeDelegate callback)
		{
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_stop"));
				*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
			}
		}

		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
		delegate void FlushStopNativeDelegate (IntPtr inst);

		static void FlushStop_cb (IntPtr inst)
		{
			try {
				BufferPool __obj = GLib.Object.GetObject (inst, false) as BufferPool;
				__obj.OnFlushStop ();
			} catch (Exception e) {
				GLib.ExceptionManager.RaiseUnhandledException (e, false);
			}
		}

		[GLib.DefaultSignalHandler(Type=typeof(Gst.BufferPool), ConnectionMethod="OverrideFlushStop")]
		protected virtual void OnFlushStop ()
		{
			InternalFlushStop ();
		}

		private void InternalFlushStop ()
		{
			FlushStopNativeDelegate unmanaged = null;
			unsafe {
				IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("flush_stop"));
				unmanaged = (FlushStopNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(FlushStopNativeDelegate));
			}
			if (unmanaged == null) return;

			unmanaged (this.Handle);
		}


		// Internal representation of the wrapped structure ABI.
		static GLib.AbiStruct _class_abi = null;
		static public new GLib.AbiStruct class_abi {
			get {
				if (_class_abi == null)
					_class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
						new GLib.AbiField("get_options"
							, Gst.Object.class_abi.Fields
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // get_options
							, null
							, "set_config"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("set_config"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // set_config
							, "get_options"
							, "start"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("start"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // start
							, "set_config"
							, "stop"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("stop"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
							, "start"
							, "acquire_buffer"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("acquire_buffer"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // acquire_buffer
							, "stop"
							, "alloc_buffer"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("alloc_buffer"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // alloc_buffer
							, "acquire_buffer"
							, "reset_buffer"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("reset_buffer"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // reset_buffer
							, "alloc_buffer"
							, "release_buffer"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("release_buffer"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // release_buffer
							, "reset_buffer"
							, "free_buffer"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("free_buffer"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // free_buffer
							, "release_buffer"
							, "flush_start"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("flush_start"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // flush_start
							, "free_buffer"
							, "flush_stop"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("flush_stop"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // flush_stop
							, "flush_start"
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 2 // _gst_reserved
							, "flush_stop"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _class_abi;
			}
		}


		// End of the ABI representation.

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

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

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_buffer_pool_config_add_option(IntPtr config, IntPtr option);

		public static void ConfigAddOption(Gst.Structure config, string option) {
			IntPtr native_option = GLib.Marshaller.StringToPtrGStrdup (option);
			gst_buffer_pool_config_add_option(config == null ? IntPtr.Zero : config.Handle, native_option);
			GLib.Marshaller.Free (native_option);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_config_get_allocator(IntPtr config, out IntPtr allocator, IntPtr parms);

		public static bool ConfigGetAllocator(Gst.Structure config, out Gst.Allocator allocator, out Gst.AllocationParams parms) {
			IntPtr native_allocator;
			IntPtr native_parms = Marshal.AllocHGlobal (Marshal.SizeOf (typeof (Gst.AllocationParams)));
			bool raw_ret = gst_buffer_pool_config_get_allocator(config == null ? IntPtr.Zero : config.Handle, out native_allocator, native_parms);
			bool ret = raw_ret;
			allocator = GLib.Object.GetObject(native_allocator) as Gst.Allocator;
			parms = Gst.AllocationParams.New (native_parms);
			Marshal.FreeHGlobal (native_parms);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern IntPtr gst_buffer_pool_config_get_option(IntPtr config, uint index);

		public static string ConfigGetOption(Gst.Structure config, uint index) {
			IntPtr raw_ret = gst_buffer_pool_config_get_option(config == null ? IntPtr.Zero : config.Handle, index);
			string ret = GLib.Marshaller.Utf8PtrToString (raw_ret);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_config_get_params(IntPtr config, out IntPtr caps, out uint size, out uint min_buffers, out uint max_buffers);

		public static bool ConfigGetParams(Gst.Structure config, out Gst.Caps caps, out uint size, out uint min_buffers, out uint max_buffers) {
			IntPtr native_caps;
			bool raw_ret = gst_buffer_pool_config_get_params(config == null ? IntPtr.Zero : config.Handle, out native_caps, out size, out min_buffers, out max_buffers);
			bool ret = raw_ret;
			caps = native_caps == IntPtr.Zero ? null : (Gst.Caps) GLib.Opaque.GetOpaque (native_caps, typeof (Gst.Caps), false);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_config_has_option(IntPtr config, IntPtr option);

		public static bool ConfigHasOption(Gst.Structure config, string option) {
			IntPtr native_option = GLib.Marshaller.StringToPtrGStrdup (option);
			bool raw_ret = gst_buffer_pool_config_has_option(config == null ? IntPtr.Zero : config.Handle, native_option);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_option);
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern uint gst_buffer_pool_config_n_options(IntPtr config);

		public static uint ConfigNOptions(Gst.Structure config) {
			uint raw_ret = gst_buffer_pool_config_n_options(config == null ? IntPtr.Zero : config.Handle);
			uint ret = raw_ret;
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_buffer_pool_config_set_allocator(IntPtr config, IntPtr allocator, IntPtr parms);

		public static void ConfigSetAllocator(Gst.Structure config, Gst.Allocator allocator, Gst.AllocationParams parms) {
			IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
			gst_buffer_pool_config_set_allocator(config == null ? IntPtr.Zero : config.Handle, allocator == null ? IntPtr.Zero : allocator.Handle, native_parms);
			Marshal.FreeHGlobal (native_parms);
		}

		public static void ConfigSetAllocator(Gst.Structure config) {
			ConfigSetAllocator (config, null, Gst.AllocationParams.Zero);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_buffer_pool_config_set_params(IntPtr config, IntPtr caps, uint size, uint min_buffers, uint max_buffers);

		public static void ConfigSetParams(Gst.Structure config, Gst.Caps caps, uint size, uint min_buffers, uint max_buffers) {
			gst_buffer_pool_config_set_params(config == null ? IntPtr.Zero : config.Handle, caps == null ? IntPtr.Zero : caps.Handle, size, min_buffers, max_buffers);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_config_validate_params(IntPtr config, IntPtr caps, uint size, uint min_buffers, uint max_buffers);

		public static bool ConfigValidateParams(Gst.Structure config, Gst.Caps caps, uint size, uint min_buffers, uint max_buffers) {
			bool raw_ret = gst_buffer_pool_config_validate_params(config == null ? IntPtr.Zero : config.Handle, caps == null ? IntPtr.Zero : caps.Handle, size, min_buffers, max_buffers);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern int gst_buffer_pool_acquire_buffer(IntPtr raw, out IntPtr buffer, IntPtr parms);

		public Gst.FlowReturn AcquireBuffer(out Gst.Buffer buffer, Gst.BufferPoolAcquireParams parms) {
			IntPtr native_buffer;
			IntPtr native_parms = GLib.Marshaller.StructureToPtrAlloc (parms);
			int raw_ret = gst_buffer_pool_acquire_buffer(Handle, out native_buffer, native_parms);
			Gst.FlowReturn ret = (Gst.FlowReturn) raw_ret;
			buffer = native_buffer == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (native_buffer, typeof (Gst.Buffer), true);
			Marshal.FreeHGlobal (native_parms);
			return ret;
		}

		public Gst.FlowReturn AcquireBuffer(out Gst.Buffer buffer) {
			return AcquireBuffer (out buffer, Gst.BufferPoolAcquireParams.Zero);
		}

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

		public Gst.Structure Config { 
			get {
				IntPtr raw_ret = gst_buffer_pool_get_config(Handle);
				Gst.Structure ret = raw_ret == IntPtr.Zero ? null : (Gst.Structure) GLib.Opaque.GetOpaque (raw_ret, typeof (Gst.Structure), true);
				return ret;
			}
		}

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

		public string[] Options { 
			get {
				IntPtr raw_ret = gst_buffer_pool_get_options(Handle);
				string[] ret = GLib.Marshaller.NullTermPtrToStringArray (raw_ret, false);
				return ret;
			}
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_has_option(IntPtr raw, IntPtr option);

		public bool HasOption(string option) {
			IntPtr native_option = GLib.Marshaller.StringToPtrGStrdup (option);
			bool raw_ret = gst_buffer_pool_has_option(Handle, native_option);
			bool ret = raw_ret;
			GLib.Marshaller.Free (native_option);
			return ret;
		}

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

		public bool IsActive { 
			get {
				bool raw_ret = gst_buffer_pool_is_active(Handle);
				bool ret = raw_ret;
				return ret;
			}
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern void gst_buffer_pool_release_buffer(IntPtr raw, IntPtr buffer);

		public void ReleaseBuffer(Gst.Buffer buffer) {
			buffer.Owned = false;
			gst_buffer_pool_release_buffer(Handle, buffer == null ? IntPtr.Zero : buffer.Handle);
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_set_active(IntPtr raw, bool active);

		public bool SetActive(bool active) {
			bool raw_ret = gst_buffer_pool_set_active(Handle, active);
			bool ret = raw_ret;
			return ret;
		}

		[DllImport("gstreamer-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
		static extern bool gst_buffer_pool_set_config(IntPtr raw, IntPtr config);

		public bool SetConfig(Gst.Structure config) {
			config.Owned = false;
			bool raw_ret = gst_buffer_pool_set_config(Handle, config == null ? IntPtr.Zero : config.Handle);
			bool ret = raw_ret;
			return ret;
		}


		// 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("flushing"
							, Gst.Object.abi_info.Fields
							, (uint) Marshal.SizeOf(typeof(bool)) // flushing
							, null
							, "priv"
							, (long) Marshal.OffsetOf(typeof(GstBufferPool_flushingAlign), "flushing")
							, 0
							),
						new GLib.AbiField("priv"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
							, "flushing"
							, "_gst_reserved"
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
						new GLib.AbiField("_gst_reserved"
							, -1
							, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
							, "priv"
							, null
							, (uint) Marshal.SizeOf(typeof(IntPtr))
							, 0
							),
					});

				return _abi_info;
			}
		}

		[StructLayout(LayoutKind.Sequential)]
		public struct GstBufferPool_flushingAlign
		{
			sbyte f1;
			private bool flushing;
		}


		// End of the ABI representation.

#endregion
	}
}