1 // This file was generated by the Gtk# code generator.
2 // Any changes made will be lost if regenerated.
4 namespace Gst.PbUtils {
7 using System.Collections;
8 using System.Collections.Generic;
9 using System.Runtime.InteropServices;
11 #region Autogenerated code
12 public partial class AudioVisualizer : Gst.Element {
14 protected AudioVisualizer (IntPtr raw) : base(raw) {}
16 protected AudioVisualizer() : base(IntPtr.Zero)
18 CreateNativeObject (new string [0], new GLib.Value [0]);
21 [GLib.Property ("shade-amount")]
22 public uint ShadeAmount {
24 GLib.Value val = GetProperty ("shade-amount");
25 uint ret = (uint) val;
30 GLib.Value val = new GLib.Value(value);
31 SetProperty("shade-amount", val);
36 [GLib.Property ("shader")]
37 public Gst.PbUtils.AudioVisualizerShader Shader {
39 GLib.Value val = GetProperty ("shader");
40 Gst.PbUtils.AudioVisualizerShader ret = (Gst.PbUtils.AudioVisualizerShader) (Enum) val;
45 GLib.Value val = new GLib.Value((Enum) value);
46 SetProperty("shader", val);
54 uint* raw_ptr = (uint*)(((byte*)Handle) + abi_info.GetFieldOffset("req_spf"));
60 public Gst.Video.VideoInfo Vinfo {
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);
69 public Gst.Audio.AudioInfo Ainfo {
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);
78 static SetupNativeDelegate Setup_cb_delegate;
79 static SetupNativeDelegate SetupVMCallback {
81 if (Setup_cb_delegate == null)
82 Setup_cb_delegate = new SetupNativeDelegate (Setup_cb);
83 return Setup_cb_delegate;
87 static void OverrideSetup (GLib.GType gtype)
89 OverrideSetup (gtype, SetupVMCallback);
92 static void OverrideSetup (GLib.GType gtype, SetupNativeDelegate callback)
95 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("setup"));
96 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
100 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
101 delegate bool SetupNativeDelegate (IntPtr inst);
103 static bool Setup_cb (IntPtr inst)
106 AudioVisualizer __obj = GLib.Object.GetObject (inst, false) as AudioVisualizer;
108 __result = __obj.OnSetup ();
110 } catch (Exception e) {
111 GLib.ExceptionManager.RaiseUnhandledException (e, true);
112 // NOTREACHED: above call does not return.
117 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.AudioVisualizer), ConnectionMethod="OverrideSetup")]
118 protected virtual bool OnSetup ()
120 return InternalSetup ();
123 private bool InternalSetup ()
125 SetupNativeDelegate unmanaged = null;
127 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("setup"));
128 unmanaged = (SetupNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(SetupNativeDelegate));
130 if (unmanaged == null) return false;
132 bool __result = unmanaged (this.Handle);
136 static RenderNativeDelegate Render_cb_delegate;
137 static RenderNativeDelegate RenderVMCallback {
139 if (Render_cb_delegate == null)
140 Render_cb_delegate = new RenderNativeDelegate (Render_cb);
141 return Render_cb_delegate;
145 static void OverrideRender (GLib.GType gtype)
147 OverrideRender (gtype, RenderVMCallback);
150 static void OverrideRender (GLib.GType gtype, RenderNativeDelegate callback)
153 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("render"));
154 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
158 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
159 delegate bool RenderNativeDelegate (IntPtr inst, IntPtr audio, IntPtr video);
161 static bool Render_cb (IntPtr inst, IntPtr audio, IntPtr video)
164 AudioVisualizer __obj = GLib.Object.GetObject (inst, false) as AudioVisualizer;
166 __result = __obj.OnRender (audio == IntPtr.Zero ? null : (Gst.Buffer) GLib.Opaque.GetOpaque (audio, typeof (Gst.Buffer), false), Gst.Video.VideoFrame.New (video));
168 } catch (Exception e) {
169 GLib.ExceptionManager.RaiseUnhandledException (e, true);
170 // NOTREACHED: above call does not return.
175 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.AudioVisualizer), ConnectionMethod="OverrideRender")]
176 protected virtual bool OnRender (Gst.Buffer audio, Gst.Video.VideoFrame video)
178 return InternalRender (audio, video);
181 private bool InternalRender (Gst.Buffer audio, Gst.Video.VideoFrame video)
183 RenderNativeDelegate unmanaged = null;
185 IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("render"));
186 unmanaged = (RenderNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(RenderNativeDelegate));
188 if (unmanaged == null) return false;
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);
196 static DecideAllocationNativeDelegate DecideAllocation_cb_delegate;
197 static DecideAllocationNativeDelegate DecideAllocationVMCallback {
199 if (DecideAllocation_cb_delegate == null)
200 DecideAllocation_cb_delegate = new DecideAllocationNativeDelegate (DecideAllocation_cb);
201 return DecideAllocation_cb_delegate;
205 static void OverrideDecideAllocation (GLib.GType gtype)
207 OverrideDecideAllocation (gtype, DecideAllocationVMCallback);
210 static void OverrideDecideAllocation (GLib.GType gtype, DecideAllocationNativeDelegate callback)
213 IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("decide_allocation"));
214 *raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
218 [UnmanagedFunctionPointer (CallingConvention.Cdecl)]
219 delegate bool DecideAllocationNativeDelegate (IntPtr inst, IntPtr query);
221 static bool DecideAllocation_cb (IntPtr inst, IntPtr query)
224 AudioVisualizer __obj = GLib.Object.GetObject (inst, false) as AudioVisualizer;
226 __result = __obj.OnDecideAllocation (query == IntPtr.Zero ? null : (Gst.Query) GLib.Opaque.GetOpaque (query, typeof (Gst.Query), false));
228 } catch (Exception e) {
229 GLib.ExceptionManager.RaiseUnhandledException (e, true);
230 // NOTREACHED: above call does not return.
235 [GLib.DefaultSignalHandler(Type=typeof(Gst.PbUtils.AudioVisualizer), ConnectionMethod="OverrideDecideAllocation")]
236 protected virtual bool OnDecideAllocation (Gst.Query query)
238 return InternalDecideAllocation (query);
241 private bool InternalDecideAllocation (Gst.Query query)
243 DecideAllocationNativeDelegate unmanaged = null;
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));
248 if (unmanaged == null) return false;
250 bool __result = unmanaged (this.Handle, query == null ? IntPtr.Zero : query.Handle);
255 // Internal representation of the wrapped structure ABI.
256 static GLib.AbiStruct _class_abi = null;
257 static public new GLib.AbiStruct class_abi {
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
266 , (uint) Marshal.SizeOf(typeof(IntPtr))
269 new GLib.AbiField("render"
271 , (uint) Marshal.SizeOf(typeof(IntPtr)) // render
273 , "decide_allocation"
274 , (uint) Marshal.SizeOf(typeof(IntPtr))
277 new GLib.AbiField("decide_allocation"
279 , (uint) Marshal.SizeOf(typeof(IntPtr)) // decide_allocation
282 , (uint) Marshal.SizeOf(typeof(IntPtr))
292 // End of the ABI representation.
294 [DllImport("gstpbutils-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
295 static extern IntPtr gst_audio_visualizer_get_type();
297 public static new GLib.GType GType {
299 IntPtr raw_ret = gst_audio_visualizer_get_type();
300 GLib.GType ret = new GLib.GType(raw_ret);
306 static AudioVisualizer ()
308 GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
311 // Internal representation of the wrapped structure ABI.
312 static GLib.AbiStruct _abi_info = null;
313 static public new GLib.AbiStruct abi_info {
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
322 , (long) Marshal.OffsetOf(typeof(GstAudioVisualizer_req_spfAlign), "req_spf")
325 new GLib.AbiField("vinfo"
327 , Gst.Video.VideoInfo.abi_info.Size // vinfo
330 , Gst.Video.VideoInfo.abi_info.Align
333 new GLib.AbiField("ainfo"
335 , Gst.Audio.AudioInfo.abi_info.Size // ainfo
338 , Gst.Audio.AudioInfo.abi_info.Align
341 new GLib.AbiField("priv"
343 , (uint) Marshal.SizeOf(typeof(IntPtr)) // priv
346 , (uint) Marshal.SizeOf(typeof(IntPtr))
355 [StructLayout(LayoutKind.Sequential)]
356 public struct GstAudioVisualizer_req_spfAlign
359 private uint req_spf;
363 // End of the ABI representation.