gstaudio.audio_ring_buffer
Module for [AudioRingBuffer] class
Types 3
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.
Methods
AudioRingBufferGidBuilder builder() static nothrowGet builder for [gstaudio.audio_ring_buffer.AudioRingBuffer] Returns: New builder objectvoid debugSpecBuff(gstaudio.audio_ring_buffer_spec.AudioRingBufferSpec spec) static nothrowPrint debug info about the buffer sized in spec to the debug log.void debugSpecCaps(gstaudio.audio_ring_buffer_spec.AudioRingBufferSpec spec) static nothrowPrint debug info about the parsed caps in spec to the debug log.bool parseCaps(gstaudio.audio_ring_buffer_spec.AudioRingBufferSpec spec, gst.caps.Caps caps) static nothrowParse caps into spec.bool acquire(gstaudio.audio_ring_buffer_spec.AudioRingBufferSpec spec) nothrowAllocate the resources for the ringbuffer. This function fills in the data pointer of the ring buffer with a valid #GstBuffer to which samples can be written.void advance(uint advance) nothrowSubclasses should call this function to notify the fact that advance segments are now processed by the device.void clear(int segment) nothrowClear the given segment of the buffer with silence samples. This function is used by subclasses.bool closeDevice() nothrowClose the audio device associated with the ring buffer. The ring buffer should already have been released via [gstaudio.audio_ring_buffer.AudioRingBuffer.release]. Returns: TRUE if the device could...uint commit(ref ulong sample, ubyte[] data, int outSamples, ref int accum) nothrowCommit in_samples samples pointed to by data to the ringbuffer buf.bool convert(gst.types.Format srcFmt, long srcVal, gst.types.Format destFmt, out long destVal) nothrowConvert src_val in src_fmt to the equivalent value in dest_fmt. The result will be put in dest_val.uint delay() nothrowGet the number of samples queued in the audio device. This is usually less than the segment size but can be bigger when the implementation uses another internal buffer between the audio device.bool deviceIsOpen() nothrowChecks the status of the device associated with the ring buffer. Returns: TRUE if the device was open, FALSE if it was closed.bool isAcquired() nothrowCheck if the ringbuffer is acquired and ready to use. Returns: TRUE if the ringbuffer is acquired, FALSE on error.void mayStart(bool allowed) nothrowTell the ringbuffer that it is allowed to start playback when the ringbuffer is filled with samples.bool openDevice() nothrowOpen the audio device associated with the ring buffer. Does not perform any setup on the device. You must open the device before acquiring the ring buffer. Returns: TRUE if the device could be open...bool pause() nothrowPause processing samples from the ringbuffer. Returns: TRUE if the device could be paused, FALSE on error.bool prepareRead(out int segment, out ubyte[] readptr) nothrowReturns a pointer to memory where the data from segment segment can be found. This function is mostly used by subclasses.uint read(ulong sample, ubyte[] data, out gst.types.ClockTime timestamp) nothrowRead len samples from the ringbuffer into the memory pointed to by data. The first sample should be read from position sample in the ringbuffer.bool release() nothrowFree the resources of the ringbuffer. Returns: TRUE if the device could be released, FALSE on error.ulong samplesDone() nothrowGet the number of samples that were processed by the ringbuffer since it was last started. This does not include the number of samples not yet processed (see [gstaudio.audio_ring_buffer.AudioRingBu...void setCallback(gstaudio.types.AudioRingBufferCallback cb = null) nothrowSets the given callback function on the buffer. This function will be called every time a segment has been written to a device.void setSample(ulong sample) nothrowMake sure that the next sample written to the device is accounted for as being the sample sample written to the device. This value will be used in reporting the current sample position of the ringb...void setTimestamp(int readseg, gst.types.ClockTime timestamp) nothrowbool start() nothrowStart processing samples from the ringbuffer. Returns: TRUE if the device could be started, FALSE on error.bool stop() nothrowStop processing samples from the ringbuffer. Returns: TRUE if the device could be stopped, FALSE on error.Fluent builder implementation template for gstaudio.audio_ring_buffer.AudioRingBuffer
Fluent builder for gstaudio.audio_ring_buffer.AudioRingBuffer
Methods