GstAudioAggregator: GStreamer Base Plugins 1.0 Library Reference Manual

## GstAudioAggregator GstAudioAggregator — Base class that manages a set of audio input pads with the purpose of aggregating or mixing their raw audio input buffers |

## Functions

void | gst_audio_aggregator_set_sink_caps ()

## Properties

guint64 | alignment-threshold | Read / Write
guint64 | discont-wait | Read / Write
guint64 | output-buffer-duration | Read / Write
GstStructure * | converter-config | Read / Write

## Types and Values

struct | GstAudioAggregator
struct | GstAudioAggregatorClass
struct | GstAudioAggregatorPad
struct | GstAudioAggregatorPadClass
struct | GstAudioAggregatorConvertPad
struct | GstAudioAggregatorConvertPadClass

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GstObject
                ├── GstElement
                │   ╰── GstAggregator
                │       ╰── GstAudioAggregator
                ╰── GstPad
                    ╰── GstAggregatorPad
                        ╰── GstAudioAggregatorPad
                            ╰── GstAudioAggregatorConvertPad

## Includes

    #include <gst/audio/audio.h>

## Description

Subclasses must use (a subclass of) GstAudioAggregatorPad for both their source and sink pads, `gst_element_class_add_static_pad_template_with_gtype()` is a convenient helper.

GstAudioAggregator can perform conversion on the data arriving on its sink pads, based on the format expected downstream: in order to enable that behaviour, the GType of the sink pads must either be a (subclass of) GstAudioAggregatorConvertPad to use the default GstAudioConverter implementation, or a subclass of GstAudioAggregatorPad implementing GstAudioAggregatorPadClass.convert_buffer.

To allow for the output caps to change, the mechanism is the same as above, with the GType of the source pad.

See GstAudioMixer for an example.

When conversion is enabled, GstAudioAggregator will accept any type of raw audio caps and perform conversion on the data arriving on its sink pads, with whatever downstream expects as the target format.

In case downstream caps are not fully fixated, it will use the first configured sink pad to finish fixating its source pad caps.

A notable exception for now is the sample rate, sink pads must have the same sample rate as either the downstream requirement, or the first configured pad, or a combination of both (when downstream specifies a range or a set of acceptable rates).

## Functions

### gst_audio_aggregator_set_sink_caps ()

    void
    gst_audio_aggregator_set_sink_caps (GstAudioAggregator *aagg,
                                        GstAudioAggregatorPad *pad,
                                        GstCaps *caps);

## Types and Values

### struct GstAudioAggregator

    struct GstAudioAggregator {
      GstCaps                   *current_caps;
    };

GstAudioAggregator object

#### Members

GstCaps *`current_caps`; | The caps set by the subclass |

### struct GstAudioAggregatorClass

    struct GstAudioAggregatorClass {
      GstAggregatorClass   parent_class;

      GstBuffer * (* create_output_buffer) (GstAudioAggregator * aagg,
          guint num_frames);
      gboolean (* aggregate_one_buffer) (GstAudioAggregator * aagg,
          GstAudioAggregatorPad * pad, GstBuffer * inbuf, guint in_offset,
          GstBuffer * outbuf, guint out_offset, guint num_frames);
    };

#### Members

`create_output_buffer` () | Create a new output buffer contains num_frames frames. |
`aggregate_one_buffer` () | Aggregates one input buffer to the output buffer. The in_offset and out_offset are in "frames", which is the size of a sample times the number of channels. Returns TRUE if any non-silence was added to the buffer |

### struct GstAudioAggregatorPad

    struct GstAudioAggregatorPad {
      /* read-only, with OBJECT_LOCK */
      GstAudioInfo                      info;
    };

The default implementation of GstPad used with GstAudioAggregator

#### Members

GstAudioInfo `info`; | The audio info for this pad set from the incoming caps |

### struct GstAudioAggregatorPadClass

    struct GstAudioAggregatorPadClass {
      GstAggregatorPadClass   parent_class;

      GstBuffer * (* convert_buffer) (GstAudioAggregatorPad * pad,
                                      GstAudioInfo *in_info,
                                      GstAudioInfo *out_info,
                                      GstBuffer * buffer);

      void        (* update_conversion_info) (GstAudioAggregatorPad *pad);
    };

#### Members

`convert_buffer` () | Convert a buffer from one format to another. |
`update_conversion_info` () | Called when either the input or output formats have changed. |

### struct GstAudioAggregatorConvertPad

    struct GstAudioAggregatorConvertPad;

An implementation of GstPad that can be used with GstAudioAggregator.

See GstAudioAggregator for more details.

### struct GstAudioAggregatorConvertPadClass

    struct GstAudioAggregatorConvertPadClass {
      GstAudioAggregatorPadClass   parent_class;
    };

## Property Details

### The `“alignment-threshold”` property

      “alignment-threshold”      guint64

Timestamp alignment threshold in nanoseconds.

Flags: Read / Write

Allowed values: <= 18446744073709551614

Default value: 40000000

### The `“discont-wait”` property

      “discont-wait”             guint64

Window of time in nanoseconds to wait before creating a discontinuity.

Flags: Read / Write

Allowed values: <= 18446744073709551614

Default value: 1000000000

### The `“output-buffer-duration”` property

      “output-buffer-duration”   guint64

Output block size in nanoseconds.

Flags: Read / Write

Allowed values: >= 1

Default value: 10000000

### The `“converter-config”` property

      “converter-config”         GstStructure *

A GstStructure describing the configuration that should be used when converting this pad's audio buffers.

Flags: Read / Write

## See Also

GstAggregator, GstAudioMixer