mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
1537 lines
45 KiB
C#
1537 lines
45 KiB
C#
// This file was generated by the Gtk# code generator.
|
|
// Any changes made will be lost if regenerated.
|
|
|
|
namespace Gst.Audio {
|
|
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
|
|
#region Autogenerated code
|
|
public partial class AudioRingBuffer : Gst.Object {
|
|
|
|
protected AudioRingBuffer (IntPtr raw) : base(raw) {}
|
|
|
|
protected AudioRingBuffer() : base(IntPtr.Zero)
|
|
{
|
|
CreateNativeObject (new string [0], new GLib.Value [0]);
|
|
}
|
|
|
|
public GLib.Cond Cond {
|
|
get {
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("cond"));
|
|
return new GLib.Cond((*raw_ptr));
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool Open {
|
|
get {
|
|
unsafe {
|
|
bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("open"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool Acquired {
|
|
get {
|
|
unsafe {
|
|
bool* raw_ptr = (bool*)(((byte*)Handle) + abi_info.GetFieldOffset("acquired"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public byte Memory {
|
|
get {
|
|
unsafe {
|
|
byte* raw_ptr = (byte*)(((byte*)Handle) + abi_info.GetFieldOffset("memory"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public ulong Size {
|
|
get {
|
|
unsafe {
|
|
UIntPtr* raw_ptr = (UIntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("size"));
|
|
return (ulong) (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public Gst.Audio.AudioRingBufferSpec Spec {
|
|
get {
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((byte*)Handle) + abi_info.GetFieldOffset("spec"));
|
|
return (*raw_ptr) == IntPtr.Zero ? null : (Gst.Audio.AudioRingBufferSpec) GLib.Opaque.GetOpaque ((*raw_ptr), typeof (Gst.Audio.AudioRingBufferSpec), false);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int SamplesPerSeg {
|
|
get {
|
|
unsafe {
|
|
int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("samples_per_seg"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public byte EmptySeg {
|
|
get {
|
|
unsafe {
|
|
byte* raw_ptr = (byte*)(((byte*)Handle) + abi_info.GetFieldOffset("empty_seg"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int State {
|
|
get {
|
|
unsafe {
|
|
int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("state"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int Segdone {
|
|
get {
|
|
unsafe {
|
|
int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("segdone"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int Segbase {
|
|
get {
|
|
unsafe {
|
|
int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("segbase"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public int Waiting {
|
|
get {
|
|
unsafe {
|
|
int* raw_ptr = (int*)(((byte*)Handle) + abi_info.GetFieldOffset("waiting"));
|
|
return (*raw_ptr);
|
|
}
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_set_flushing(IntPtr raw, bool flushing);
|
|
|
|
public bool Flushing {
|
|
set {
|
|
gst_audio_ring_buffer_set_flushing(Handle, value);
|
|
}
|
|
}
|
|
|
|
static OpenDeviceNativeDelegate OpenDevice_cb_delegate;
|
|
static OpenDeviceNativeDelegate OpenDeviceVMCallback {
|
|
get {
|
|
if (OpenDevice_cb_delegate == null)
|
|
OpenDevice_cb_delegate = new OpenDeviceNativeDelegate (OpenDevice_cb);
|
|
return OpenDevice_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideOpenDevice (GLib.GType gtype)
|
|
{
|
|
OverrideOpenDevice (gtype, OpenDeviceVMCallback);
|
|
}
|
|
|
|
static void OverrideOpenDevice (GLib.GType gtype, OpenDeviceNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("open_device"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool OpenDeviceNativeDelegate (IntPtr inst);
|
|
|
|
static bool OpenDevice_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnOpenDevice ();
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideOpenDevice")]
|
|
protected virtual bool OnOpenDevice ()
|
|
{
|
|
return InternalOpenDevice ();
|
|
}
|
|
|
|
private bool InternalOpenDevice ()
|
|
{
|
|
OpenDeviceNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("open_device"));
|
|
unmanaged = (OpenDeviceNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(OpenDeviceNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return false;
|
|
|
|
bool __result = unmanaged (this.Handle);
|
|
return __result;
|
|
}
|
|
|
|
static AcquireNativeDelegate Acquire_cb_delegate;
|
|
static AcquireNativeDelegate AcquireVMCallback {
|
|
get {
|
|
if (Acquire_cb_delegate == null)
|
|
Acquire_cb_delegate = new AcquireNativeDelegate (Acquire_cb);
|
|
return Acquire_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideAcquire (GLib.GType gtype)
|
|
{
|
|
OverrideAcquire (gtype, AcquireVMCallback);
|
|
}
|
|
|
|
static void OverrideAcquire (GLib.GType gtype, AcquireNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool AcquireNativeDelegate (IntPtr inst, IntPtr spec);
|
|
|
|
static bool Acquire_cb (IntPtr inst, IntPtr spec)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnAcquire (spec == IntPtr.Zero ? null : (Gst.Audio.AudioRingBufferSpec) GLib.Opaque.GetOpaque (spec, typeof (Gst.Audio.AudioRingBufferSpec), false));
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideAcquire")]
|
|
protected virtual bool OnAcquire (Gst.Audio.AudioRingBufferSpec spec)
|
|
{
|
|
return InternalAcquire (spec);
|
|
}
|
|
|
|
private bool InternalAcquire (Gst.Audio.AudioRingBufferSpec spec)
|
|
{
|
|
AcquireNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("acquire"));
|
|
unmanaged = (AcquireNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(AcquireNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return false;
|
|
|
|
bool __result = unmanaged (this.Handle, spec == null ? IntPtr.Zero : spec.Handle);
|
|
return __result;
|
|
}
|
|
|
|
static ReleaseNativeDelegate Release_cb_delegate;
|
|
static ReleaseNativeDelegate ReleaseVMCallback {
|
|
get {
|
|
if (Release_cb_delegate == null)
|
|
Release_cb_delegate = new ReleaseNativeDelegate (Release_cb);
|
|
return Release_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideRelease (GLib.GType gtype)
|
|
{
|
|
OverrideRelease (gtype, ReleaseVMCallback);
|
|
}
|
|
|
|
static void OverrideRelease (GLib.GType gtype, ReleaseNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("release"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool ReleaseNativeDelegate (IntPtr inst);
|
|
|
|
static bool Release_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnRelease ();
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideRelease")]
|
|
protected virtual bool OnRelease ()
|
|
{
|
|
return InternalRelease ();
|
|
}
|
|
|
|
private bool InternalRelease ()
|
|
{
|
|
ReleaseNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("release"));
|
|
unmanaged = (ReleaseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ReleaseNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return false;
|
|
|
|
bool __result = unmanaged (this.Handle);
|
|
return __result;
|
|
}
|
|
|
|
static CloseDeviceNativeDelegate CloseDevice_cb_delegate;
|
|
static CloseDeviceNativeDelegate CloseDeviceVMCallback {
|
|
get {
|
|
if (CloseDevice_cb_delegate == null)
|
|
CloseDevice_cb_delegate = new CloseDeviceNativeDelegate (CloseDevice_cb);
|
|
return CloseDevice_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideCloseDevice (GLib.GType gtype)
|
|
{
|
|
OverrideCloseDevice (gtype, CloseDeviceVMCallback);
|
|
}
|
|
|
|
static void OverrideCloseDevice (GLib.GType gtype, CloseDeviceNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("close_device"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool CloseDeviceNativeDelegate (IntPtr inst);
|
|
|
|
static bool CloseDevice_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnCloseDevice ();
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideCloseDevice")]
|
|
protected virtual bool OnCloseDevice ()
|
|
{
|
|
return InternalCloseDevice ();
|
|
}
|
|
|
|
private bool InternalCloseDevice ()
|
|
{
|
|
CloseDeviceNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("close_device"));
|
|
unmanaged = (CloseDeviceNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CloseDeviceNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return false;
|
|
|
|
bool __result = unmanaged (this.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 {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
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.Audio.AudioRingBuffer), 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 PauseNativeDelegate Pause_cb_delegate;
|
|
static PauseNativeDelegate PauseVMCallback {
|
|
get {
|
|
if (Pause_cb_delegate == null)
|
|
Pause_cb_delegate = new PauseNativeDelegate (Pause_cb);
|
|
return Pause_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverridePause (GLib.GType gtype)
|
|
{
|
|
OverridePause (gtype, PauseVMCallback);
|
|
}
|
|
|
|
static void OverridePause (GLib.GType gtype, PauseNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("pause"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool PauseNativeDelegate (IntPtr inst);
|
|
|
|
static bool Pause_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnPause ();
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverridePause")]
|
|
protected virtual bool OnPause ()
|
|
{
|
|
return InternalPause ();
|
|
}
|
|
|
|
private bool InternalPause ()
|
|
{
|
|
PauseNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("pause"));
|
|
unmanaged = (PauseNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(PauseNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return false;
|
|
|
|
bool __result = unmanaged (this.Handle);
|
|
return __result;
|
|
}
|
|
|
|
static ResumeNativeDelegate Resume_cb_delegate;
|
|
static ResumeNativeDelegate ResumeVMCallback {
|
|
get {
|
|
if (Resume_cb_delegate == null)
|
|
Resume_cb_delegate = new ResumeNativeDelegate (Resume_cb);
|
|
return Resume_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideResume (GLib.GType gtype)
|
|
{
|
|
OverrideResume (gtype, ResumeVMCallback);
|
|
}
|
|
|
|
static void OverrideResume (GLib.GType gtype, ResumeNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("resume"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool ResumeNativeDelegate (IntPtr inst);
|
|
|
|
static bool Resume_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnResume ();
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideResume")]
|
|
protected virtual bool OnResume ()
|
|
{
|
|
return InternalResume ();
|
|
}
|
|
|
|
private bool InternalResume ()
|
|
{
|
|
ResumeNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("resume"));
|
|
unmanaged = (ResumeNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ResumeNativeDelegate));
|
|
}
|
|
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 {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
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.Audio.AudioRingBuffer), 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 DelayNativeDelegate Delay_cb_delegate;
|
|
static DelayNativeDelegate DelayVMCallback {
|
|
get {
|
|
if (Delay_cb_delegate == null)
|
|
Delay_cb_delegate = new DelayNativeDelegate (Delay_cb);
|
|
return Delay_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideDelay (GLib.GType gtype)
|
|
{
|
|
OverrideDelay (gtype, DelayVMCallback);
|
|
}
|
|
|
|
static void OverrideDelay (GLib.GType gtype, DelayNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("delay"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate uint DelayNativeDelegate (IntPtr inst);
|
|
|
|
static uint Delay_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
uint __result;
|
|
__result = __obj.OnDelay ();
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideDelay")]
|
|
protected virtual uint OnDelay ()
|
|
{
|
|
return InternalDelay ();
|
|
}
|
|
|
|
private uint InternalDelay ()
|
|
{
|
|
DelayNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("delay"));
|
|
unmanaged = (DelayNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(DelayNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return 0;
|
|
|
|
uint __result = unmanaged (this.Handle);
|
|
return __result;
|
|
}
|
|
|
|
static ActivateNativeDelegate Activate_cb_delegate;
|
|
static ActivateNativeDelegate ActivateVMCallback {
|
|
get {
|
|
if (Activate_cb_delegate == null)
|
|
Activate_cb_delegate = new ActivateNativeDelegate (Activate_cb);
|
|
return Activate_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideActivate (GLib.GType gtype)
|
|
{
|
|
OverrideActivate (gtype, ActivateVMCallback);
|
|
}
|
|
|
|
static void OverrideActivate (GLib.GType gtype, ActivateNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("activate"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate bool ActivateNativeDelegate (IntPtr inst, bool active);
|
|
|
|
static bool Activate_cb (IntPtr inst, bool active)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
bool __result;
|
|
__result = __obj.OnActivate (active);
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideActivate")]
|
|
protected virtual bool OnActivate (bool active)
|
|
{
|
|
return InternalActivate (active);
|
|
}
|
|
|
|
private bool InternalActivate (bool active)
|
|
{
|
|
ActivateNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("activate"));
|
|
unmanaged = (ActivateNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ActivateNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return false;
|
|
|
|
bool __result = unmanaged (this.Handle, active);
|
|
return __result;
|
|
}
|
|
|
|
static CommitNativeDelegate Commit_cb_delegate;
|
|
static CommitNativeDelegate CommitVMCallback {
|
|
get {
|
|
if (Commit_cb_delegate == null)
|
|
Commit_cb_delegate = new CommitNativeDelegate (Commit_cb);
|
|
return Commit_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideCommit (GLib.GType gtype)
|
|
{
|
|
OverrideCommit (gtype, CommitVMCallback);
|
|
}
|
|
|
|
static void OverrideCommit (GLib.GType gtype, CommitNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("commit"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate uint CommitNativeDelegate (IntPtr inst, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum);
|
|
|
|
static uint Commit_cb (IntPtr inst, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
uint __result;
|
|
__result = __obj.OnCommit (sample, data, in_samples, out_samples, ref accum);
|
|
return __result;
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, true);
|
|
// NOTREACHED: above call does not return.
|
|
throw e;
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideCommit")]
|
|
protected virtual uint OnCommit (ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
|
|
{
|
|
return InternalCommit (sample, data, in_samples, out_samples, ref accum);
|
|
}
|
|
|
|
private uint InternalCommit (ulong sample, byte[] data, int in_samples, int out_samples, ref int accum)
|
|
{
|
|
CommitNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("commit"));
|
|
unmanaged = (CommitNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(CommitNativeDelegate));
|
|
}
|
|
if (unmanaged == null) return 0;
|
|
|
|
uint __result = unmanaged (this.Handle, sample, data, in_samples, out_samples, ref accum);
|
|
return __result;
|
|
}
|
|
|
|
static ClearAllNativeDelegate ClearAll_cb_delegate;
|
|
static ClearAllNativeDelegate ClearAllVMCallback {
|
|
get {
|
|
if (ClearAll_cb_delegate == null)
|
|
ClearAll_cb_delegate = new ClearAllNativeDelegate (ClearAll_cb);
|
|
return ClearAll_cb_delegate;
|
|
}
|
|
}
|
|
|
|
static void OverrideClearAll (GLib.GType gtype)
|
|
{
|
|
OverrideClearAll (gtype, ClearAllVMCallback);
|
|
}
|
|
|
|
static void OverrideClearAll (GLib.GType gtype, ClearAllNativeDelegate callback)
|
|
{
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) gtype.GetClassPtr()) + (long) class_abi.GetFieldOffset("clear_all"));
|
|
*raw_ptr = Marshal.GetFunctionPointerForDelegate((Delegate) callback);
|
|
}
|
|
}
|
|
|
|
[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
|
|
delegate void ClearAllNativeDelegate (IntPtr inst);
|
|
|
|
static void ClearAll_cb (IntPtr inst)
|
|
{
|
|
try {
|
|
AudioRingBuffer __obj = GLib.Object.GetObject (inst, false) as AudioRingBuffer;
|
|
__obj.OnClearAll ();
|
|
} catch (Exception e) {
|
|
GLib.ExceptionManager.RaiseUnhandledException (e, false);
|
|
}
|
|
}
|
|
|
|
[GLib.DefaultSignalHandler(Type=typeof(Gst.Audio.AudioRingBuffer), ConnectionMethod="OverrideClearAll")]
|
|
protected virtual void OnClearAll ()
|
|
{
|
|
InternalClearAll ();
|
|
}
|
|
|
|
private void InternalClearAll ()
|
|
{
|
|
ClearAllNativeDelegate unmanaged = null;
|
|
unsafe {
|
|
IntPtr* raw_ptr = (IntPtr*)(((long) this.LookupGType().GetThresholdType().GetClassPtr()) + (long) class_abi.GetFieldOffset("clear_all"));
|
|
unmanaged = (ClearAllNativeDelegate) Marshal.GetDelegateForFunctionPointer(*raw_ptr, typeof(ClearAllNativeDelegate));
|
|
}
|
|
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("open_device"
|
|
, Gst.Object.class_abi.Fields
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // open_device
|
|
, null
|
|
, "acquire"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("acquire"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // acquire
|
|
, "open_device"
|
|
, "release"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("release"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // release
|
|
, "acquire"
|
|
, "close_device"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("close_device"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // close_device
|
|
, "release"
|
|
, "start"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("start"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // start
|
|
, "close_device"
|
|
, "pause"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("pause"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // pause
|
|
, "start"
|
|
, "resume"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("resume"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // resume
|
|
, "pause"
|
|
, "stop"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("stop"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // stop
|
|
, "resume"
|
|
, "delay"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("delay"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // delay
|
|
, "stop"
|
|
, "activate"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("activate"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // activate
|
|
, "delay"
|
|
, "commit"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("commit"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // commit
|
|
, "activate"
|
|
, "clear_all"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("clear_all"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // clear_all
|
|
, "commit"
|
|
, "_gst_reserved"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("_gst_reserved"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) * 4 // _gst_reserved
|
|
, "clear_all"
|
|
, null
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
});
|
|
|
|
return _class_abi;
|
|
}
|
|
}
|
|
|
|
|
|
// End of the ABI representation.
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern IntPtr gst_audio_ring_buffer_get_type();
|
|
|
|
public static new GLib.GType GType {
|
|
get {
|
|
IntPtr raw_ret = gst_audio_ring_buffer_get_type();
|
|
GLib.GType ret = new GLib.GType(raw_ret);
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_debug_spec_buff(IntPtr spec);
|
|
|
|
public static void DebugSpecBuff(Gst.Audio.AudioRingBufferSpec spec) {
|
|
gst_audio_ring_buffer_debug_spec_buff(spec == null ? IntPtr.Zero : spec.Handle);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_debug_spec_caps(IntPtr spec);
|
|
|
|
public static void DebugSpecCaps(Gst.Audio.AudioRingBufferSpec spec) {
|
|
gst_audio_ring_buffer_debug_spec_caps(spec == null ? IntPtr.Zero : spec.Handle);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_parse_caps(IntPtr spec, IntPtr caps);
|
|
|
|
public static bool ParseCaps(Gst.Audio.AudioRingBufferSpec spec, Gst.Caps caps) {
|
|
bool raw_ret = gst_audio_ring_buffer_parse_caps(spec == null ? IntPtr.Zero : spec.Handle, caps == null ? IntPtr.Zero : caps.Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_acquire(IntPtr raw, IntPtr spec);
|
|
|
|
public bool Acquire(Gst.Audio.AudioRingBufferSpec spec) {
|
|
bool raw_ret = gst_audio_ring_buffer_acquire(Handle, spec == null ? IntPtr.Zero : spec.Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_activate(IntPtr raw, bool active);
|
|
|
|
public bool Activate(bool active) {
|
|
bool raw_ret = gst_audio_ring_buffer_activate(Handle, active);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_advance(IntPtr raw, uint advance);
|
|
|
|
public void Advance(uint advance) {
|
|
gst_audio_ring_buffer_advance(Handle, advance);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_clear(IntPtr raw, int segment);
|
|
|
|
public void Clear(int segment) {
|
|
gst_audio_ring_buffer_clear(Handle, segment);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_clear_all(IntPtr raw);
|
|
|
|
public void ClearAll() {
|
|
gst_audio_ring_buffer_clear_all(Handle);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_close_device(IntPtr raw);
|
|
|
|
public bool CloseDevice() {
|
|
bool raw_ret = gst_audio_ring_buffer_close_device(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern uint gst_audio_ring_buffer_commit(IntPtr raw, ulong sample, byte[] data, int in_samples, int out_samples, ref int accum);
|
|
|
|
public uint Commit(ulong sample, byte[] data, int in_samples, int out_samples, ref int accum) {
|
|
uint raw_ret = gst_audio_ring_buffer_commit(Handle, sample, data, in_samples, out_samples, ref accum);
|
|
uint ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_convert(IntPtr raw, int src_fmt, long src_val, int dest_fmt, out long dest_val);
|
|
|
|
public bool Convert(Gst.Format src_fmt, long src_val, Gst.Format dest_fmt, out long dest_val) {
|
|
bool raw_ret = gst_audio_ring_buffer_convert(Handle, (int) src_fmt, src_val, (int) dest_fmt, out dest_val);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern uint gst_audio_ring_buffer_delay(IntPtr raw);
|
|
|
|
public uint Delay() {
|
|
uint raw_ret = gst_audio_ring_buffer_delay(Handle);
|
|
uint ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_device_is_open(IntPtr raw);
|
|
|
|
public bool DeviceIsOpen() {
|
|
bool raw_ret = gst_audio_ring_buffer_device_is_open(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_is_acquired(IntPtr raw);
|
|
|
|
public bool IsAcquired {
|
|
get {
|
|
bool raw_ret = gst_audio_ring_buffer_is_acquired(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_is_active(IntPtr raw);
|
|
|
|
public bool IsActive {
|
|
get {
|
|
bool raw_ret = gst_audio_ring_buffer_is_active(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_is_flushing(IntPtr raw);
|
|
|
|
public bool IsFlushing {
|
|
get {
|
|
bool raw_ret = gst_audio_ring_buffer_is_flushing(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_may_start(IntPtr raw, bool allowed);
|
|
|
|
public void MayStart(bool allowed) {
|
|
gst_audio_ring_buffer_may_start(Handle, allowed);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_open_device(IntPtr raw);
|
|
|
|
public bool OpenDevice() {
|
|
bool raw_ret = gst_audio_ring_buffer_open_device(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_pause(IntPtr raw);
|
|
|
|
public bool Pause() {
|
|
bool raw_ret = gst_audio_ring_buffer_pause(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern uint gst_audio_ring_buffer_read(IntPtr raw, ulong sample, byte[] data, uint len, out ulong timestamp);
|
|
|
|
public uint Read(ulong sample, byte[] data, uint len, out ulong timestamp) {
|
|
uint raw_ret = gst_audio_ring_buffer_read(Handle, sample, data, len, out timestamp);
|
|
uint ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_release(IntPtr raw);
|
|
|
|
public bool Release() {
|
|
bool raw_ret = gst_audio_ring_buffer_release(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern ulong gst_audio_ring_buffer_samples_done(IntPtr raw);
|
|
|
|
public ulong SamplesDone() {
|
|
ulong raw_ret = gst_audio_ring_buffer_samples_done(Handle);
|
|
ulong ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_set_callback_full(IntPtr raw, Gst.AudioSharp.AudioRingBufferCallbackNative cb, IntPtr user_data, GLib.DestroyNotify notify);
|
|
|
|
public Gst.Audio.AudioRingBufferCallback CallbackFull {
|
|
set {
|
|
Gst.AudioSharp.AudioRingBufferCallbackWrapper value_wrapper = new Gst.AudioSharp.AudioRingBufferCallbackWrapper (value);
|
|
IntPtr user_data;
|
|
GLib.DestroyNotify notify;
|
|
if (value == null) {
|
|
user_data = IntPtr.Zero;
|
|
notify = null;
|
|
} else {
|
|
user_data = (IntPtr) GCHandle.Alloc (value_wrapper);
|
|
notify = GLib.DestroyHelper.NotifyHandler;
|
|
}
|
|
gst_audio_ring_buffer_set_callback_full(Handle, value_wrapper.NativeDelegate, user_data, notify);
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_set_channel_positions(IntPtr raw, int[] position);
|
|
|
|
public Gst.Audio.AudioChannelPosition[] ChannelPositions {
|
|
set {
|
|
int cnt_value = value == null ? 0 : value.Length;
|
|
int[] native_value = new int [cnt_value];
|
|
for (int i = 0; i < cnt_value; i++)
|
|
native_value [i] = (int) value[i];
|
|
gst_audio_ring_buffer_set_channel_positions(Handle, native_value);
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_set_sample(IntPtr raw, ulong sample);
|
|
|
|
public ulong Sample {
|
|
set {
|
|
gst_audio_ring_buffer_set_sample(Handle, value);
|
|
}
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern void gst_audio_ring_buffer_set_timestamp(IntPtr raw, int readseg, ulong timestamp);
|
|
|
|
public void SetTimestamp(int readseg, ulong timestamp) {
|
|
gst_audio_ring_buffer_set_timestamp(Handle, readseg, timestamp);
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_start(IntPtr raw);
|
|
|
|
public bool Start() {
|
|
bool raw_ret = gst_audio_ring_buffer_start(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
[DllImport("gstaudio-1.0-0.dll", CallingConvention = CallingConvention.Cdecl)]
|
|
static extern bool gst_audio_ring_buffer_stop(IntPtr raw);
|
|
|
|
public bool Stop() {
|
|
bool raw_ret = gst_audio_ring_buffer_stop(Handle);
|
|
bool ret = raw_ret;
|
|
return ret;
|
|
}
|
|
|
|
|
|
static AudioRingBuffer ()
|
|
{
|
|
GtkSharp.GstreamerSharp.ObjectManager.Initialize ();
|
|
}
|
|
|
|
// 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("cond"
|
|
, Gst.Object.abi_info.Fields
|
|
, (uint) Marshal.SizeOf(typeof(GLib.Cond.ABI)) // cond
|
|
, null
|
|
, "open"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_condAlign), "cond")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("open"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(bool)) // open
|
|
, "cond"
|
|
, "acquired"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_openAlign), "open")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("acquired"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(bool)) // acquired
|
|
, "open"
|
|
, "memory"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_acquiredAlign), "acquired")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("memory"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(byte)) // memory
|
|
, "acquired"
|
|
, "size"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_memoryAlign), "memory")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("size"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(ulong)) // size
|
|
, "memory"
|
|
, "timestamps"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_sizeAlign), "size")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("timestamps"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(ulong)) // timestamps
|
|
, "size"
|
|
, "spec"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_timestampsAlign), "timestamps")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("spec"
|
|
, -1
|
|
, Gst.Audio.AudioRingBufferSpec.abi_info.Size // spec
|
|
, "timestamps"
|
|
, "samples_per_seg"
|
|
, Gst.Audio.AudioRingBufferSpec.abi_info.Align
|
|
, 0
|
|
),
|
|
new GLib.AbiField("samples_per_seg"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) // samples_per_seg
|
|
, "spec"
|
|
, "empty_seg"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_samples_per_segAlign), "samples_per_seg")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("empty_seg"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // empty_seg
|
|
, "samples_per_seg"
|
|
, "state"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("state"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) // state
|
|
, "empty_seg"
|
|
, "segdone"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_stateAlign), "state")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("segdone"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) // segdone
|
|
, "state"
|
|
, "segbase"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_segdoneAlign), "segdone")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("segbase"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) // segbase
|
|
, "segdone"
|
|
, "waiting"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_segbaseAlign), "segbase")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("waiting"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) // waiting
|
|
, "segbase"
|
|
, "callback"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_waitingAlign), "waiting")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("callback"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // callback
|
|
, "waiting"
|
|
, "cb_data"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("cb_data"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // cb_data
|
|
, "callback"
|
|
, "need_reorder"
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
new GLib.AbiField("need_reorder"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(bool)) // need_reorder
|
|
, "cb_data"
|
|
, "channel_reorder_map"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_need_reorderAlign), "need_reorder")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("channel_reorder_map"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) * 64 // channel_reorder_map
|
|
, "need_reorder"
|
|
, "flushing"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_channel_reorder_mapAlign), "channel_reorder_map")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("flushing"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(bool)) // flushing
|
|
, "channel_reorder_map"
|
|
, "may_start"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_flushingAlign), "flushing")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("may_start"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(int)) // may_start
|
|
, "flushing"
|
|
, "active"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_may_startAlign), "may_start")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("active"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(bool)) // active
|
|
, "may_start"
|
|
, "cb_data_notify"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_activeAlign), "active")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("cb_data_notify"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) // cb_data_notify
|
|
, "active"
|
|
, "_gst_reserved"
|
|
, (long) Marshal.OffsetOf(typeof(GstAudioRingBuffer_cb_data_notifyAlign), "cb_data_notify")
|
|
, 0
|
|
),
|
|
new GLib.AbiField("_gst_reserved"
|
|
, -1
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr)) * 3 // _gst_reserved
|
|
, "cb_data_notify"
|
|
, null
|
|
, (uint) Marshal.SizeOf(typeof(IntPtr))
|
|
, 0
|
|
),
|
|
});
|
|
|
|
return _abi_info;
|
|
}
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_condAlign
|
|
{
|
|
sbyte f1;
|
|
private GLib.Cond.ABI cond;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_openAlign
|
|
{
|
|
sbyte f1;
|
|
private bool open;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_acquiredAlign
|
|
{
|
|
sbyte f1;
|
|
private bool acquired;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_memoryAlign
|
|
{
|
|
sbyte f1;
|
|
private byte memory;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_sizeAlign
|
|
{
|
|
sbyte f1;
|
|
private UIntPtr size;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_timestampsAlign
|
|
{
|
|
sbyte f1;
|
|
private ulong timestamps;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_samples_per_segAlign
|
|
{
|
|
sbyte f1;
|
|
private int samples_per_seg;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_stateAlign
|
|
{
|
|
sbyte f1;
|
|
private int state;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_segdoneAlign
|
|
{
|
|
sbyte f1;
|
|
private int segdone;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_segbaseAlign
|
|
{
|
|
sbyte f1;
|
|
private int segbase;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_waitingAlign
|
|
{
|
|
sbyte f1;
|
|
private int waiting;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_need_reorderAlign
|
|
{
|
|
sbyte f1;
|
|
private bool need_reorder;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_channel_reorder_mapAlign
|
|
{
|
|
sbyte f1;
|
|
[MarshalAs (UnmanagedType.ByValArray, SizeConst=64)]
|
|
private int[] channel_reorder_map;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_flushingAlign
|
|
{
|
|
sbyte f1;
|
|
private bool flushing;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_may_startAlign
|
|
{
|
|
sbyte f1;
|
|
private int may_start;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_activeAlign
|
|
{
|
|
sbyte f1;
|
|
private bool active;
|
|
}
|
|
|
|
[StructLayout(LayoutKind.Sequential)]
|
|
public struct GstAudioRingBuffer_cb_data_notifyAlign
|
|
{
|
|
sbyte f1;
|
|
private GLib.DestroyNotify cb_data_notify;
|
|
}
|
|
|
|
|
|
// End of the ABI representation.
|
|
|
|
#endregion
|
|
}
|
|
}
|