Opaque #GstAudioClock.
Create a new #GstAudioClock instance. Whenever the clock time should be
calculated it will call @func with @user_data. When @func returns
#GST_CLOCK_TIME_NONE, the clock will return the last reported time.
a new #GstAudioClock casted to a #GstClock.
the name of the clock
a function
user data
Create a new #GstAudioClock instance. Whenever the clock time should be
calculated it will call @func with @user_data. When @func returns
#GST_CLOCK_TIME_NONE, the clock will return the last reported time.
a new #GstAudioClock casted to a #GstClock.
the name of the clock
a function
user data
#GDestroyNotify for @user_data
Adjust @time with the internal offset of the audio clock.
@time adjusted with the internal offset.
a #GstAudioClock
a #GstClockTime
Report the time as returned by the #GstAudioClockGetTimeFunc without applying
any offsets.
the time as reported by the time function of the audio clock
a #GstAudioClock
Invalidate the clock function. Call this function when the provided
#GstAudioClockGetTimeFunc cannot be called anymore, for example, when the
user_data becomes invalid.
After calling this function, @clock will return the last returned time for
the rest of its lifetime.
a #GstAudioClock
Inform @clock that future calls to #GstAudioClockGetTimeFunc will return values
starting from @time. The clock will update an internal offset to make sure that
future calls to internal_time will return an increasing result as required by
the #GstClock object.
a #GstClockTime
This function will be called whenever the current clock time needs to be
calculated. If this function returns #GST_CLOCK_TIME_NONE, the last reported
time will be returned by the clock.
be used.
the current time or #GST_CLOCK_TIME_NONE if the previous time should
the #GstAudioClock
user data
Do not use anymore.
Base class for audio filters with the same format for input and output.
In addition to the @setup virtual function, you should also override the
GstBaseTransform::transform and/or GstBaseTransform::transform_ip virtual
function.
Convenience function to add pad templates to this element class, with
This function is usually used from within a GObject base_init function.
what formats the filter can handle, as #GstCaps
Function that will be called by gst_audio_default_registry_mixer_filter()
so the caller can decide which mixer elements should be kept and returned.
When the mixer element is passed to the callback function, it is opened
and in READY state. If you decide to keep the element, you need to set it
back to NULL state yourself (unless you want to keep it opened of course).
TRUE if the element should be kept, FALSE otherwise.
a #GstElement implementing the #GstMixer interface
user data
Opaque #GstAudioSink.
#GstAudioSink class. Override the vmethods to implement functionality.
Base class for simple audio sources.
#GstAudioSrc class. Override the vmethod to implement
functionality.
Opaque #GstBaseAudioSink.
Create and return the #GstRingBuffer for @sink. This function will call the
::create_ringbuffer vmethod and will set @sink as the parent of the returned
buffer (see gst_object_set_parent()).
The new ringbuffer of @sink.
Create and return the #GstRingBuffer for @sink. This function will call the
::create_ringbuffer vmethod and will set @sink as the parent of the returned
buffer (see gst_object_set_parent()).
The new ringbuffer of @sink.
Queries whether @sink will provide a clock or not. See also
gst_base_audio_sink_set_provide_clock.
%TRUE if @sink will provide a clock.
Get the current slave method used by @sink.
The current slave method used by @sink.
Controls the sink's drift tolerance.
the new drift tolerance in microseconds
Controls whether @sink will provide a clock or not. If @provide is %TRUE,
gst_element_provide_clock() will return a clock that reflects the datarate
of @sink. If @provide is %FALSE, gst_element_provide_clock() will return NULL.
new state
Controls how clock slaving will be performed in @sink.
the new slave method
#GstBaseAudioSink class. Override the vmethod to implement
functionality.
The new ringbuffer of @sink.
Different possible clock slaving algorithms used when the internal audio
clock is not selected as the pipeline master clock.
Opaque #GstBaseAudioSrc.
Create and return the #GstRingBuffer for @src. This function will call the
::create_ringbuffer vmethod and will set @src as the parent of the returned
buffer (see gst_object_set_parent()).
The new ringbuffer of @src.
Create and return the #GstRingBuffer for @src. This function will call the
::create_ringbuffer vmethod and will set @src as the parent of the returned
buffer (see gst_object_set_parent()).
The new ringbuffer of @src.
Queries whether @src will provide a clock or not. See also
gst_base_audio_src_set_provide_clock.
%TRUE if @src will provide a clock.
Get the current slave method used by @src.
The current slave method used by @src.
Controls whether @src will provide a clock or not. If @provide is %TRUE,
gst_element_provide_clock() will return a clock that reflects the datarate
of @src. If @provide is %FALSE, gst_element_provide_clock() will return NULL.
new state
Controls how clock slaving will be performed in @src.
the new slave method
Actual configured size of audio buffer in microseconds.
Actual configured audio latency in microseconds.
#GstBaseAudioSrc class. Override the vmethod to implement
functionality.
The new ringbuffer of @src.
Different possible clock slaving algorithms when the internal audio clock was
not selected as the pipeline clock.
The format of the samples in the ringbuffer.
The ringbuffer base class structure.
Print debug info about the buffer sized in @spec to the debug log.
the spec to debug
Print debug info about the parsed caps in @spec to the debug log.
the spec to debug
Parse @caps into @spec.
TRUE if the caps could be parsed.
a spec
a #GstCaps
Allocate 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.
MT safe.
TRUE if the device could be acquired, FALSE on error.
the specs of the buffer
Activate @buf to start or stop pulling data.
MT safe.
FALSE on error.
TRUE if the device could be activated in the requested mode,
the new mode
Fill the ringbuffer with silence.
MT safe.
Close the audio device associated with the ring buffer. The ring buffer
should already have been released via gst_ring_buffer_release().
MT safe.
TRUE if the device could be closed, FALSE on error.
Get 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.
For playback ringbuffers this is the amount of samples transfered from the
ringbuffer to the device but still not played.
For capture ringbuffers this is the amount of samples in the device that are
not yet transfered to the ringbuffer.
MT safe.
The number of samples queued in the audio device.
Open 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.
MT safe.
TRUE if the device could be opened, FALSE on error.
Pause processing samples from the ringbuffer.
MT safe.
TRUE if the device could be paused, FALSE on error.
Free the resources of the ringbuffer.
MT safe.
TRUE if the device could be released, FALSE on error.
Start processing samples from the ringbuffer.
MT safe.
TRUE if the device could be started, FALSE on error.
Stop processing samples from the ringbuffer.
MT safe.
TRUE if the device could be stopped, FALSE on error.
Allocate 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.
MT safe.
TRUE if the device could be acquired, FALSE on error.
the specs of the buffer
Activate @buf to start or stop pulling data.
MT safe.
FALSE on error.
TRUE if the device could be activated in the requested mode,
the new mode
Subclasses should call this function to notify the fact that
MT safe.
the number of segments written
Clear the given segment of the buffer with silence samples.
This function is used by subclasses.
MT safe.
the segment to clear
Fill the ringbuffer with silence.
MT safe.
Close the audio device associated with the ring buffer. The ring buffer
should already have been released via gst_ring_buffer_release().
MT safe.
TRUE if the device could be closed, FALSE on error.
Same as gst_ring_buffer_commit_full() but with a in_samples and out_samples
equal to @len, ignoring accum.
error.
MT safe.
The number of samples written to the ringbuffer or -1 on
the sample position of the data
the data to commit
the number of samples in the data to commit
Commit @in_samples samples pointed to by @data to the ringbuffer @buf.
samples in @data. For negative rates, @out_samples must be negative and
When @out_samples is positive, the first sample will be written at position @sample
in the ringbuffer. When @out_samples is negative, the last sample will be written to
although it is recommended for optimal performance.
set to 0 when this function is first called. In case the commit operation is
interrupted, one can resume the processing by passing the previously returned
MT safe.
number of samples written can be less than @out_samples when @buf was interrupted
with a flush or stop.
The number of samples written to the ringbuffer or -1 on error. The
the sample position of the data
the data to commit
the number of samples in the data to commit
the number of samples to write to the ringbuffer
accumulator for rate conversion.
Convert @src_val in @src_fmt to the equivalent value in @dest_fmt. The result
will be put in @dest_val.
TRUE if the conversion succeeded.
the source format
the source value
the destination format
a location to store the converted value
Get 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.
For playback ringbuffers this is the amount of samples transfered from the
ringbuffer to the device but still not played.
For capture ringbuffers this is the amount of samples in the device that are
not yet transfered to the ringbuffer.
MT safe.
The number of samples queued in the audio device.
Checks the status of the device associated with the ring buffer.
MT safe.
TRUE if the device was open, FALSE if it was closed.
Check if the ringbuffer is acquired and ready to use.
MT safe.
TRUE if the ringbuffer is acquired, FALSE on error.
Check if @buf is activated.
MT safe.
TRUE if the device is active.
Tell the ringbuffer that it is allowed to start playback when
the ringbuffer is filled with samples.
MT safe.
the new value
Open 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.
MT safe.
TRUE if the device could be opened, FALSE on error.
Pause processing samples from the ringbuffer.
MT safe.
TRUE if the device could be paused, FALSE on error.
Returns a pointer to memory where the data from segment @segment
can be found. This function is mostly used by subclasses.
MT safe.
FALSE if the buffer is not started.
the segment to read
the pointer to the memory where samples can be read
the number of bytes to read
Read @len samples from the ringbuffer into the memory pointed
to by @data.
The first sample should be read from position @sample in
the ringbuffer.
although it is recommended.
error.
MT safe.
The number of samples read from the ringbuffer or -1 on
the sample position of the data
where the data should be read
the number of samples in data to read
Free the resources of the ringbuffer.
MT safe.
TRUE if the device could be released, FALSE on error.
Get 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 gst_ring_buffer_delay()).
MT safe.
The number of samples processed by the ringbuffer.
Sets the given callback function on the buffer. This function
will be called every time a segment has been written to a device.
MT safe.
the callback to set
user data passed to the callback
Set the ringbuffer to flushing mode or normal mode.
MT safe.
the new mode
Make 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 ringbuffer.
This function will also clear the buffer with silence.
MT safe.
the sample number to set
Start processing samples from the ringbuffer.
MT safe.
TRUE if the device could be started, FALSE on error.
Stop processing samples from the ringbuffer.
MT safe.
TRUE if the device could be stopped, FALSE on error.
This function is set with gst_ring_buffer_set_callback() and is
called to fill the memory at @data with @len bytes of samples.
a #GstRingBuffer
target to fill
amount to fill
user data
The vmethods that subclasses can override to implement the ringbuffer.
TRUE if the device could be opened, FALSE on error.
TRUE if the device could be acquired, FALSE on error.
the specs of the buffer
TRUE if the device could be released, FALSE on error.
TRUE if the device could be closed, FALSE on error.
TRUE if the device could be started, FALSE on error.
TRUE if the device could be paused, FALSE on error.
TRUE if the device could be stopped, FALSE on error.
The number of samples queued in the audio device.
TRUE if the device could be activated in the requested mode,
the new mode
The state of a segment in the ringbuffer.
The structure containing the format specification of the ringbuffer.
The state of the ringbuffer.
Clip the the buffer to the given %GstSegment.
After calling this function the caller does not own a reference to
otherwise the clipped buffer is returned.
If the buffer has no timestamp, it is assumed to be inside the segment and
is not clipped
%NULL if the buffer is completely outside the configured segment,
The buffer to clip.
Segment in %GST_FORMAT_TIME or %GST_FORMAT_DEFAULT to which the buffer should be clipped.
sample rate.
size of one audio frame in bytes.
This functions checks if the given channel positions are valid. Channel
positions are valid if:
<itemizedlist>
<listitem><para>No channel positions appears twice or all positions are %GST_AUDIO_CHANNEL_POSITION_NONE.
</para></listitem>
<listitem><para>Either all or none of the channel positions are %GST_AUDIO_CHANNEL_POSITION_NONE.
</para></listitem>
<listitem><para>%GST_AUDIO_CHANNEL_POSITION_FRONT_MONO and %GST_AUDIO_CHANNEL_POSITION_FRONT_LEFT or %GST_AUDIO_CHANNEL_POSITION_FRONT_RIGHT don't appear together in the given positions.
</para></listitem>
</itemizedlist>
and %FALSE otherwise.
%TRUE if the given channel positions are valid
An array of #GstAudioChannelPosition.
The number of elements in @pos.
Utility function to find audio mixer elements.
Will traverse the default plugin registry in order of plugin rank and
find usable audio mixer elements. The caller may optionally fine-tune
the selection by specifying a filter function.
element in the list by setting it to NULL state and calling
gst_object_unref(). After that the list itself should be freed
using g_list_free().
a #GList of audio mixer #GstElement<!-- -->s. You must free each
filter function, or #NULL
set to #TRUE if you only want the first suitable mixer element
user data to pass to the filter function
Calculate length in nanoseconds of audio buffer @buf based on capabilities of
the length.
the #GstPad to get the caps from
the #GstBuffer
Custom fixate function. Elements that implement some sort of
channel conversion algorithm should use this function for
fixating on GstAudioChannelPosition properties. It will take
care of equal channel positioning (left/right). Caller g_free()s
the return value. The input properties may be (and are supposed
to be) unfixed.
Note that this function is mostly a hack because we currently
have no way to add default fixation functions for new GTypes.
set of #GstAudioChannelPosition values.
fixed values that the caller could use as a fixed
a #GstStructure containing a (possibly unfixed) "channel-positions" field.
Calculate byte size of an audio frame.
the byte size, or 0 if there was an error
the #GstPad to get the caps from
Calculate length of buffer in frames.
0 if there's an error, or the number of frames if everything's ok
the #GstPad to get the caps from
the #GstBuffer
Retrieves a number of (fixed!) audio channel positions from
the provided #GstStructure and returns it as a newly allocated
array. The caller should g_free () this array. The caller
should also check that the members in this #GstStructure are
indeed "fixed" before calling this function.
positions as provided in the given #GstStructure. Returns
NULL on error.
a newly allocated array containing the channel
A #GstStructure to retrieve channel positions from.
Check if the buffer size is a whole multiple of the frame size.
%TRUE if buffer size is multiple.
the #GstPad to get the caps from
the #GstBuffer
Sets a (possibly non-fixed) list of possible audio channel
positions (given in pos) on the given caps. Each of the
structures of the caps, after this function has been called,
will contain a "channel-positions" field with an array.
Each value in the array will contain each of the values given
in the pos array. Note that the size of the caps might be
increased by this, since each structure with a "channel-
positions" field needs to have a fixed "channels" field.
The input caps is not required to have this.
#GstCaps to set the list of channel positions on.
the array containing one or more possible audio channel positions that we should add in each value of the array in the given structure.
the number of values in pos.
Adds a "channel-positions" field to the given #GstStructure,
which will represent the channel positions as given in the
provided #GstAudioChannelPosition array.
A #GstStructure to set channel positions on.
an array of channel positions. The number of members in this array should be equal to the (fixed!) number of the "channels" field in the given #GstStructure.
Sets a (possibly non-fixed) list of possible audio channel
positions (given in pos) on the given structure. The
structure, after this function has been called, will contain
a "channel-positions" field with an array of the size of
the "channels" field value in the given structure (note
that this means that the channels field in the provided
structure should be fixed!). Each value in the array will
contain each of the values given in the pos array.
#GstStructure to set the list of channel positions on.
the array containing one or more possible audio channel positions that we should add in each value of the array in the given structure.
the number of values in pos.
Do not use anymore.
a #GstStructure
a set of #GstAudioFieldFlag