gstbaseaudiosrc

gstbaseaudiosrc — Base class for audio sources

Functions

Properties

gint64 actual-buffer-time Read
gint64 actual-latency-time Read
gint64 buffer-time Read / Write
gint64 latency-time Read / Write
gboolean provide-clock Read / Write
GstBaseAudioSrcSlaveMethod slave-method Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GstObject
        ╰── GstElement
            ╰── GstBaseSrc
                ╰── GstPushSrc
                    ╰── GstBaseAudioSrc
                        ╰── GstAudioSrc

Includes

#include <gst/audio/gstbaseaudiosrc.h>

Description

This is the base class for audio sources. Subclasses need to implement the ::create_ringbuffer vmethod. This base class will then take care of reading samples from the ringbuffer, synchronisation and flushing.

Last reviewed on 2006-09-27 (0.10.12)

Functions

GST_BASE_AUDIO_SRC_CLOCK()

#define GST_BASE_AUDIO_SRC_CLOCK(obj)    (GST_BASE_AUDIO_SRC (obj)->clock)

Get the GstClock of obj .

Parameters

obj

a GstBaseAudioSrc

 

GST_BASE_AUDIO_SRC_PAD()

#define GST_BASE_AUDIO_SRC_PAD(obj)      (GST_BASE_SRC (obj)->srcpad)

Get the source GstPad of obj .

Parameters

obj

a GstBaseAudioSrc

 

gst_base_audio_src_create_ringbuffer ()

GstRingBuffer *
gst_base_audio_src_create_ringbuffer (GstBaseAudioSrc *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()).

Parameters

src

a GstBaseAudioSrc.

 

Returns

The new ringbuffer of src .


gst_base_audio_src_set_provide_clock ()

void
gst_base_audio_src_set_provide_clock (GstBaseAudioSrc *src,
                                      gboolean provide);

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.

Parameters

src

a GstBaseAudioSrc

 

provide

new state

 

Since 0.10.16


gst_base_audio_src_get_provide_clock ()

gboolean
gst_base_audio_src_get_provide_clock (GstBaseAudioSrc *src);

Queries whether src will provide a clock or not. See also gst_base_audio_src_set_provide_clock.

Parameters

src

a GstBaseAudioSrc

 

Returns

TRUE if src will provide a clock.

Since 0.10.16


gst_base_audio_src_get_slave_method ()

GstBaseAudioSrcSlaveMethod
gst_base_audio_src_get_slave_method (GstBaseAudioSrc *src);

Get the current slave method used by src .

Parameters

src

a GstBaseAudioSrc

 

Returns

The current slave method used by src .

Since 0.10.20


gst_base_audio_src_set_slave_method ()

void
gst_base_audio_src_set_slave_method (GstBaseAudioSrc *src,
                                     GstBaseAudioSrcSlaveMethod method);

Controls how clock slaving will be performed in src .

Parameters

src

a GstBaseAudioSrc

 

method

the new slave method

 

Since 0.10.20

Types and Values

struct GstBaseAudioSrc

struct GstBaseAudioSrc;

Opaque GstBaseAudioSrc.


struct GstBaseAudioSrcClass

struct GstBaseAudioSrcClass {
  GstPushSrcClass parent_class;

  /* subclass ringbuffer allocation */
  GstRingBuffer* (*create_ringbuffer)  (GstBaseAudioSrc *src);
};

GstBaseAudioSrc class. Override the vmethod to implement functionality.

Members

GstPushSrcClass parent_class;

the parent class.

 

create_ringbuffer ()

create and return a GstRingBuffer to read from.

 

enum GstBaseAudioSrcSlaveMethod

Different possible clock slaving algorithms when the internal audio clock was not selected as the pipeline clock.

Members

GST_BASE_AUDIO_SRC_SLAVE_RESAMPLE

Resample to match the master clock.

 

GST_BASE_AUDIO_SRC_SLAVE_RETIMESTAMP

Retimestamp output buffers with master clock time.

 

GST_BASE_AUDIO_SRC_SLAVE_SKEW

Adjust capture pointer when master clock drifts too much.

 

GST_BASE_AUDIO_SRC_SLAVE_NONE

No adjustment is done.

 

Property Details

The “actual-buffer-time” property

  “actual-buffer-time”       gint64

Actual configured size of audio buffer in microseconds.

Flags: Read

Allowed values: >= -1

Default value: -1

Since 0.10.20


The “actual-latency-time” property

  “actual-latency-time”      gint64

Actual configured audio latency in microseconds.

Flags: Read

Allowed values: >= -1

Default value: -1

Since 0.10.20


The “buffer-time” property

  “buffer-time”              gint64

Size of audio buffer in microseconds.

Flags: Read / Write

Allowed values: >= 1

Default value: 200000


The “latency-time” property

  “latency-time”             gint64

Audio latency in microseconds.

Flags: Read / Write

Allowed values: >= 1

Default value: 10000


The “provide-clock” property

  “provide-clock”            gboolean

Provide a clock to be used as the global pipeline clock.

Flags: Read / Write

Default value: TRUE


The “slave-method” property

  “slave-method”             GstBaseAudioSrcSlaveMethod

Algorithm to use to match the rate of the masterclock.

Flags: Read / Write

Default value: GST_BASE_AUDIO_SRC_SLAVE_SKEW

See Also

GstAudioSrc, GstRingBuffer.