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

Properties

Types and Values

Object Hierarchy

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

Includes

#include <gst/audio/audio.h>

Description

GstAudioAggregator will perform conversion on the data arriving on its sink pads, based on the format expected downstream.

Subclasses can opt out of the conversion behaviour by setting GstAudioAggregatorClass.convert_buffer() to NULL.

Subclasses that wish to use the default conversion implementation should use a (subclass of) GstAudioAggregatorConvertPad as their GstAggregatorClass.sinkpads_type, as it will cache the created GstAudioConverter and install a property allowing to configure it, “converter-config”.

Subclasses that wish to perform custom conversion should override GstAudioAggregatorClass.convert_buffer().

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.

Additionally, handling audio conversion directly in the element means that this base class supports safely reconfiguring its source pad.

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;

GstAudioAggregator object

Members


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);
  GstBuffer * (* convert_buffer) (GstAudioAggregator *aagg,
                                  GstPad * pad,
                                  GstAudioInfo *in_info,
                                  GstAudioInfo *out_info,
                                  GstBuffer * buffer);
};

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

 

convert_buffer ()

Convert a buffer from one format to another. The pad is either a sinkpad, when converting an input buffer, or the source pad, when converting the output buffer after a downstream format change is requested.

 

struct GstAudioAggregatorPad

struct GstAudioAggregatorPad;

The default implementation of GstPad used with GstAudioAggregator

Members


struct GstAudioAggregatorPadClass

struct GstAudioAggregatorPadClass {
  GstAggregatorPadClass   parent_class;
};

struct GstAudioAggregatorConvertPad

struct GstAudioAggregatorConvertPad;

An implementation of GstPad that can be used with GstAudioAggregator.

See GstAudioAggregator for more details.

Members


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