Release 1.20.0
[platform/upstream/gstreamer.git] / subprojects / gstreamer-sharp / sources / generated / Gst.PbUtils / AudioVisualizer.cs
1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
3
4 namespace Gst.PbUtils {
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 AudioVisualizer : Gst.Element {
13
14                 protected AudioVisualizer (IntPtr raw) : base(raw) {}
15
16                 protected AudioVisualizer() : base(IntPtr.Zero)
17                 {
18                         CreateNativeObject (new string [0], new GLib.Value [0]);
19                 }
20
21                 [GLib.Property ("shade-amount")]
22                 public uint ShadeAmount {
23                         get {
24                                 GLib.Value val = GetProperty ("shade-amount");
25                                 uint ret = (uint) val;
26                                 val.Dispose ();
27                                 return ret;
28                         }
29                         set {
30                                 GLib.Value val = new GLib.Value(value);
31                                 SetProperty("shade-amount", val);
32                                 val.Dispose ();
33                         }
34                 }
35
36                 [GLib.Property ("shader")]
37                 public Gst.PbUtils.AudioVisualizerShader Shader {
38                         get {
39                                 GLib.Value val = GetProperty ("shader");
40                                 Gst.PbUtils.AudioVisualizerShader ret = (Gst.PbUtils.AudioVisualizerShader) (Enum) val;
41                                 val.Dispose ();
42                                 return ret;
43                         }
44                         set {
45                                 GLib.Value val = new GLib.Value((Enum) value);
46                                 SetProperty("shader", val);
47                                 val.Dispose ();
48                         }
49                 }
50
51                 public uint ReqSpf {
52                         get {
53                                 unsafe {
54                                         uint* raw_ptr = (uint*)(((byte*)Handle) + abi_info.GetFieldOffset("req_spf"));
55                                         return (*raw_ptr);
56                                 }
57                         }
58                 }
59
60                 public Gst.Video.VideoInfo Vinfo {
61                         get {
62                                 unsafe {
63                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("vinfo"));
64                                         return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Video.VideoInfo) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Video.VideoInfo), false);
65                                 }
66                         }
67                 }
68
69                 public Gst.Audio.AudioInfo Ainfo {
70                         get {
71                                 unsafe {
72                                         IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("ainfo"));
73                                         return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Audio.AudioInfo) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Audio.AudioInfo), false);
74                                 }
75                         }
76                 }
77
78                 static SetupNativeDelegate Setup_cb_delegate;
79                 static SetupNativeDelegate SetupVMCallback {
80                         get {
81                                 if (Setup_cb_delegate == null)
82                                         Setup_cb_delegate = new SetupNativeDelegate (Setup_cb);
83                                 return Setup_cb_delegate;
84                         }
85                 }
86
87                 static void OverrideSetup (GLib.GType gtype)
88                 {
89                         OverrideSetup (gtype, SetupVMCallback);
90                 }
91
92                 static void OverrideSetup (GLib.GType gtype, SetupNativeDelegate callback)
93                 {
94                         unsafe {
95                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("setup"));
96                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
97                         }
98                 }
99
100                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
101                 delegate bool SetupNativeDelegate (IntPtr inst);
102
103                 static bool Setup_cb (IntPtr inst)
104                 {
105                         try {
106                                 AudioVisualizer __obj = GLib.Object.GetObject (inst, false) as AudioVisualizer;
107                                 bool __result;
108                                 __result = __obj.OnSetup ();
109                                 return __result;
110                         } catch (Exception e) {
111                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
112                                 // NOTREACHED: above call does not return.
113                                 throw e;
114                         }
115                 }
116
117                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.AudioVisualizer), ConnectionMethod="OverrideSetup")]
118                 protected virtual bool OnSetup ()
119                 {
120                         return InternalSetup ();
121                 }
122
123                 private bool InternalSetup ()
124                 {
125                         SetupNativeDelegate unmanaged = null;
126                         unsafe {
127                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("setup"));
128                                 unmanaged = (SetupNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetupNativeDelegate));
129                         }
130                         if (unmanaged == null) return false;
131
132                         bool __result = unmanaged (this.Handle);
133                         return __result;
134                 }
135
136                 static RenderNativeDelegate Render_cb_delegate;
137                 static RenderNativeDelegate RenderVMCallback {
138                         get {
139                                 if (Render_cb_delegate == null)
140                                         Render_cb_delegate = new RenderNativeDelegate (Render_cb);
141                                 return Render_cb_delegate;
142                         }
143                 }
144
145                 static void OverrideRender (GLib.GType gtype)
146                 {
147                         OverrideRender (gtype, RenderVMCallback);
148                 }
149
150                 static void OverrideRender (GLib.GType gtype, RenderNativeDelegate callback)
151                 {
152                         unsafe {
153                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("render"));
154                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
155                         }
156                 }
157
158                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
159                 delegate bool RenderNativeDelegate (IntPtr inst, IntPtr audio, IntPtr video);
160
161                 static bool Render_cb (IntPtr inst, IntPtr audio, IntPtr video)
162                 {
163                         try {
164                                 AudioVisualizer __obj = GLib.Object.GetObject (inst, false) as AudioVisualizer;
165                                 bool __result;
166                                 __result = __obj.OnRender (audio == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (audio, typeof (Gst.Buffer), false), Gst.Video.VideoFrame.New (video));
167                                 return __result;
168                         } catch (Exception e) {
169                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
170                                 // NOTREACHED: above call does not return.
171                                 throw e;
172                         }
173                 }
174
175                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.AudioVisualizer), ConnectionMethod="OverrideRender")]
176                 protected virtual bool OnRender (Gst.Buffer audio, Gst.Video.VideoFrame video)
177                 {
178                         return InternalRender (audio, video);
179                 }
180
181                 private bool InternalRender (Gst.Buffer audio, Gst.Video.VideoFrame video)
182                 {
183                         RenderNativeDelegate unmanaged = null;
184                         unsafe {
185                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("render"));
186                                 unmanaged = (RenderNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(RenderNativeDelegate));
187                         }
188                         if (unmanaged == null) return false;
189
190                         IntPtr native_video = GLib.Marshaller.StructureToPtrAlloc (video);
191                         bool __result = unmanaged (this.Handle, audio == null ? IntPtr.Zero : audio.Handle, native_video);
192                         Marshal.FreeHGlobal (native_video);
193                         return __result;
194                 }
195
196                 static DecideAllocationNativeDelegate DecideAllocation_cb_delegate;
197                 static DecideAllocationNativeDelegate DecideAllocationVMCallback {
198                         get {
199                                 if (DecideAllocation_cb_delegate == null)
200                                         DecideAllocation_cb_delegate = new DecideAllocationNativeDelegate (DecideAllocation_cb);
201                                 return DecideAllocation_cb_delegate;
202                         }
203                 }
204
205                 static void OverrideDecideAllocation (GLib.GType gtype)
206                 {
207                         OverrideDecideAllocation (gtype, DecideAllocationVMCallback);
208                 }
209
210                 static void OverrideDecideAllocation (GLib.GType gtype, DecideAllocationNativeDelegate callback)
211                 {
212                         unsafe {
213                                 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("decide_allocation"));
214                                 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
215                         }
216                 }
217
218                 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
219                 delegate bool DecideAllocationNativeDelegate (IntPtr inst, IntPtr query);
220
221                 static bool DecideAllocation_cb (IntPtr inst, IntPtr query)
222                 {
223                         try {
224                                 AudioVisualizer __obj = GLib.Object.GetObject (inst, false) as AudioVisualizer;
225                                 bool __result;
226                                 __result = __obj.OnDecideAllocation (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
227                                 return __result;
228                         } catch (Exception e) {
229                                 GLib.ExceptionManager.RaiseUnhandledException (e, true);
230                                 // NOTREACHED: above call does not return.
231                                 throw e;
232                         }
233                 }
234
235                 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.AudioVisualizer), ConnectionMethod="OverrideDecideAllocation")]
236                 protected virtual bool OnDecideAllocation (Gst.Query query)
237                 {
238                         return InternalDecideAllocation (query);
239                 }
240
241                 private bool InternalDecideAllocation (Gst.Query query)
242                 {
243                         DecideAllocationNativeDelegate unmanaged = null;
244                         unsafe {
245                                 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("decide_allocation"));
246                                 unmanaged = (DecideAllocationNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DecideAllocationNativeDelegate));
247                         }
248                         if (unmanaged == null) return false;
249
250                         bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
251                         return __result;
252                 }
253
254
255                 // Internal representation of the wrapped structure ABI.
256                 static GLib.AbiStruct _class_abi = null;
257                 static public new GLib.AbiStruct class_abi {
258                         get {
259                                 if (_class_abi == null)
260                                         _class_abi = new GLib.AbiStruct (new List<GLib.AbiField>{ 
261                                                 new GLib.AbiField("setup"
262                                                         , Gst.Element.class_abi.Fields
263                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // setup
264                                                         , null
265                                                         , "render"
266                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
267                                                         , 0
268                                                         ),
269                                                 new GLib.AbiField("render"
270                                                         , -1
271                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // render
272                                                         , "setup"
273                                                         , "decide_allocation"
274                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
275                                                         , 0
276                                                         ),
277                                                 new GLib.AbiField("decide_allocation"
278                                                         , -1
279                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // decide_allocation
280                                                         , "render"
281                                                         , null
282                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
283                                                         , 0
284                                                         ),
285                                         });
286
287                                 return _class_abi;
288                         }
289                 }
290
291
292                 // End of the ABI representation.
293
294                 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
295                 static extern IntPtr gst_audio_visualizer_get_type();
296
297                 public static new GLib.GType GType { 
298                         get {
299                                 IntPtr raw_ret = gst_audio_visualizer_get_type();
300                                 GLib.GType ret = new GLib.GType(raw_ret);
301                                 return ret;
302                         }
303                 }
304
305
306                 static AudioVisualizer ()
307                 {
308                         GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
309                 }
310
311                 // Internal representation of the wrapped structure ABI.
312                 static GLib.AbiStruct _abi_info = null;
313                 static public new GLib.AbiStruct abi_info {
314                         get {
315                                 if (_abi_info == null)
316                                         _abi_info = new GLib.AbiStruct (new List<GLib.AbiField>{ 
317                                                 new GLib.AbiField("req_spf"
318                                                         , Gst.Element.abi_info.Fields
319                                                         , (uint) Marshal.SizeOf(typeof(uint)) // req_spf
320                                                         , null
321                                                         , "vinfo"
322                                                         , (long) Marshal.OffsetOf(typeof(GstAudioVisualizer_req_spfAlign), "req_spf")
323                                                         , 0
324                                                         ),
325                                                 new GLib.AbiField("vinfo"
326                                                         , -1
327                                                         , Gst.Video.VideoInfo.abi_info.Size // vinfo
328                                                         , "req_spf"
329                                                         , "ainfo"
330                                                         , Gst.Video.VideoInfo.abi_info.Align
331                                                         , 0
332                                                         ),
333                                                 new GLib.AbiField("ainfo"
334                                                         , -1
335                                                         , Gst.Audio.AudioInfo.abi_info.Size // ainfo
336                                                         , "vinfo"
337                                                         , "priv"
338                                                         , Gst.Audio.AudioInfo.abi_info.Align
339                                                         , 0
340                                                         ),
341                                                 new GLib.AbiField("priv"
342                                                         , -1
343                                                         , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
344                                                         , "ainfo"
345                                                         , null
346                                                         , (uint) Marshal.SizeOf(typeof(IntPtr))
347                                                         , 0
348                                                         ),
349                                         });
350
351                                 return _abi_info;
352                         }
353                 }
354
355                 [StructLayout(LayoutKind.Sequential)]
356                 public struct GstAudioVisualizer_req_spfAlign
357                 {
358                         sbyte f1;
359                         private uint req_spf;
360                 }
361
362
363                 // End of the ABI representation.
364
365 #endregion
366         }
367 }