RingBuffer
Object Hierarchy:
Description:
[ CCode ( type_id = "gst_audio_ring_buffer_get_type ()" ) ]
[ GIR ( name = "AudioRingBuffer" ) ]
public abstract class RingBuffer : Object
[ GIR ( name = "AudioRingBuffer" ) ]
public abstract class RingBuffer : Object
This object is the base class for audio ringbuffers used by the base audio source and sink classes.
The ringbuffer abstracts a circular buffer of data. One reader and one writer can operate on the data from different threads in a lockfree manner. The base class is sufficiently flexible to be used as an abstraction for DMA based ringbuffers as well as a pure software implementations.
Namespace: Gst.Audio
Package: gstreamer-audio-1.0
Content:
Static methods:
- public static void debug_spec_buff (RingBufferSpec spec)
Print debug info about the buffer sized in
spec
to the debug log. - public static void debug_spec_caps (RingBufferSpec spec)
Print debug info about the parsed caps in
spec
to the debug log. - public static bool parse_caps (RingBufferSpec spec, Caps caps)
Parse
caps
intospec
.
Creation methods:
- protected RingBuffer ()
Methods:
- public virtual bool acquire (RingBufferSpec spec)
Allocate the resources for the ringbuffer.
- public virtual bool activate (bool active)
Activate this to start or stop pulling data.
- public void advance (uint advance)
Subclasses should call this function to notify the fact that
advance
segments are now processed by the device. - public void clear (int segment)
Clear the given segment of the buffer with silence samples.
- public virtual void clear_all ()
Clear all samples from the ringbuffer.
- public virtual bool close_device ()
Close the audio device associated with the ring buffer.
- public virtual uint commit (ref uint64 sample, uint8[] data, int out_samples, ref int accum)
Commit
data.length
samples pointed to bydata
to the ringbuffer this. - public bool convert (Format src_fmt, int64 src_val, Format dest_fmt, out int64 dest_val)
Convert
src_val
insrc_fmt
to the equivalent value indest_fmt
. - public virtual uint delay ()
Get the number of samples queued in the audio device.
- public bool device_is_open ()
Checks the status of the device associated with the ring buffer.
- public bool is_acquired ()
Check if the ringbuffer is acquired and ready to use.
- public bool is_active ()
Check if this is activated.
- public bool is_flushing ()
Check if this is flushing.
- public void may_start (bool allowed)
Tell the ringbuffer that it is allowed to start playback when the ringbuffer is filled with samples.
- public virtual bool open_device ()
Open the audio device associated with the ring buffer.
- public virtual bool pause ()
Pause processing samples from the ringbuffer.
- public bool prepare_read (out int segment, out uint8[] readptr)
Returns a pointer to memory where the data from segment
segment
can be found. - public uint read (uint64 sample, uint8[] data, out ClockTime timestamp)
Read
data.length
samples from the ringbuffer into the memory pointed to bydata
. - public virtual bool release ()
Free the resources of the ringbuffer.
- public virtual bool resume ()
- public uint64 samples_done ()
Get the number of samples that were processed by the ringbuffer since it was last started.
- public void set_callback_full (owned RingBufferCallback? cb)
Sets the given callback function on the buffer.
- public void set_channel_positions (ChannelPosition[] position)
Tell the ringbuffer about the device's channel positions.
- public void set_flushing (bool flushing)
Set the ringbuffer to flushing mode or normal mode.
- public void set_sample (uint64 sample)
Make sure that the next sample written to the device is accounted for as being the
sample
sample written to the device. - public void set_timestamp (int readseg, ClockTime timestamp)
- public virtual bool start ()
Start processing samples from the ringbuffer.
- public virtual bool stop ()
Stop processing samples from the ringbuffer.
Fields:
- public bool acquired
- public Cond cond
- public uint8 empty_seg
- public uint8 memory
- public bool open
- public int samples_per_seg
- public int segbase
- public int segdone
- public size_t size
- public RingBufferSpec spec
- public int state
- public int waiting
Inherited Members:
All known members inherited from class Gst.Object
All known members inherited from class GLib.Object