Gjsify LogoGjsify Logo

Index

Enumerations

Classes

Interfaces

Variables

Functions

Variables

AUDIO_CHANNELS_RANGE: string

Maximum range of allowed channels, for use in template caps strings.

AUDIO_CONVERTER_OPT_DITHER_METHOD: string

#GstAudioDitherMethod, The dither method to use when changing bit depth. Default is #GST_AUDIO_DITHER_NONE.

AUDIO_CONVERTER_OPT_DITHER_THRESHOLD: string

Threshold for the output bit depth at/below which to apply dithering.

Default is 20 bit.

AUDIO_CONVERTER_OPT_MIX_MATRIX: string

#GST_TYPE_LIST, The channel mapping matrix.

The matrix coefficients must be between -1 and 1: the number of rows is equal to the number of output channels and the number of columns is equal to the number of input channels.

Example matrix generation code

To generate the matrix using code:

|[ GValue v = G_VALUE_INIT; GValue v2 = G_VALUE_INIT; GValue v3 = G_VALUE_INIT;

g_value_init (&v2, GST_TYPE_ARRAY); g_value_init (&v3, G_TYPE_DOUBLE); g_value_set_double (&v3, 1); gst_value_array_append_value (&v2, &v3); g_value_unset (&v3); [ Repeat for as many double as your input channels - unset and reinit v3 ] g_value_init (&v, GST_TYPE_ARRAY); gst_value_array_append_value (&v, &v2); g_value_unset (&v2); [ Repeat for as many v2's as your output channels - unset and reinit v2] g_object_set_property (G_OBJECT (audiomixmatrix), "matrix", &v); g_value_unset (&v);


AUDIO_CONVERTER_OPT_NOISE_SHAPING_METHOD: string

#GstAudioNoiseShapingMethod, The noise shaping method to use to mask noise from quantization errors. Default is #GST_AUDIO_NOISE_SHAPING_NONE.

AUDIO_CONVERTER_OPT_QUANTIZATION: string

#G_TYPE_UINT, The quantization amount. Components will be quantized to multiples of this value. Default is 1

AUDIO_CONVERTER_OPT_RESAMPLER_METHOD: string

#GstAudioResamplerMethod, The resampler method to use when changing sample rates. Default is #GST_AUDIO_RESAMPLER_METHOD_BLACKMAN_NUTTALL.

AUDIO_DECODER_MAX_ERRORS: number

Default maximum number of errors tolerated before signaling error.

AUDIO_DECODER_SINK_NAME: string

The name of the templates for the sink pad.

AUDIO_DECODER_SRC_NAME: string

The name of the templates for the source pad.

AUDIO_DEF_CHANNELS: number

Standard number of channels used in consumer audio.

AUDIO_DEF_FORMAT: string

Standard format used in consumer audio.

AUDIO_DEF_RATE: number

Standard sampling rate used in consumer audio.

AUDIO_ENCODER_SINK_NAME: string

the name of the templates for the sink pad

AUDIO_ENCODER_SRC_NAME: string

the name of the templates for the source pad

AUDIO_FORMATS_ALL: string

List of all audio formats, for use in template caps strings.

Formats are sorted by decreasing "quality", using these criteria by priority:

  • depth
  • width
  • Float > Signed > Unsigned
  • native endianness preferred
AUDIO_RATE_RANGE: string

Maximum range of allowed sample rates, for use in template caps strings.

AUDIO_RESAMPLER_OPT_CUBIC_B: string

G_TYPE_DOUBLE, B parameter of the cubic filter. Values between 0.0 and 2.0 are accepted. 1.0 is the default.

Below are some values of popular filters: B C Hermite 0.0 0.0 Spline 1.0 0.0 Catmull-Rom 0.0 1/2

AUDIO_RESAMPLER_OPT_CUBIC_C: string

G_TYPE_DOUBLE, C parameter of the cubic filter. Values between 0.0 and 2.0 are accepted. 0.0 is the default.

See #GST_AUDIO_RESAMPLER_OPT_CUBIC_B for some more common values

AUDIO_RESAMPLER_OPT_CUTOFF: string

G_TYPE_DOUBLE, Cutoff parameter for the filter. 0.940 is the default.

AUDIO_RESAMPLER_OPT_FILTER_INTERPOLATION: string

GST_TYPE_AUDIO_RESAMPLER_INTERPOLATION: how the filter coefficients should be interpolated. GST_AUDIO_RESAMPLER_FILTER_INTERPOLATION_CUBIC is default.

AUDIO_RESAMPLER_OPT_FILTER_MODE: string

GST_TYPE_AUDIO_RESAMPLER_FILTER_MODE: how the filter tables should be constructed. GST_AUDIO_RESAMPLER_FILTER_MODE_AUTO is the default.

AUDIO_RESAMPLER_OPT_FILTER_MODE_THRESHOLD: string

G_TYPE_UINT: the amount of memory to use for full filter tables before switching to interpolated filter tables. 1048576 is the default.

AUDIO_RESAMPLER_OPT_FILTER_OVERSAMPLE: string

G_TYPE_UINT, oversampling to use when interpolating filters 8 is the default.

AUDIO_RESAMPLER_OPT_MAX_PHASE_ERROR: string

G_TYPE_DOUBLE: The maximum allowed phase error when switching sample rates. 0.1 is the default.

AUDIO_RESAMPLER_OPT_N_TAPS: string

G_TYPE_INT: the number of taps to use for the filter. 0 is the default and selects the taps automatically.

AUDIO_RESAMPLER_OPT_STOP_ATTENUATION: string

G_TYPE_DOUBLE, stopband attenuation in decibels. The attenuation after the stopband for the kaiser window. 85 dB is the default.

AUDIO_RESAMPLER_OPT_TRANSITION_BANDWIDTH: string

G_TYPE_DOUBLE, transition bandwidth. The width of the transition band for the kaiser window. 0.087 is the default.

AUDIO_RESAMPLER_QUALITY_DEFAULT: number
AUDIO_RESAMPLER_QUALITY_MAX: number
AUDIO_RESAMPLER_QUALITY_MIN: number
META_TAG_AUDIO_CHANNELS_STR: string

This metadata stays relevant as long as channels are unchanged.

META_TAG_AUDIO_RATE_STR: string

This metadata stays relevant as long as sample rate is unchanged.

META_TAG_AUDIO_STR: string

This metadata is relevant for audio streams.

Functions

  • Clip the buffer to the given %GstSegment.

    After calling this function the caller does not own a reference to buffer anymore.

    Parameters

    • buffer: Gst.Buffer

      The buffer to clip.

    • segment: Gst.Segment

      Segment in %GST_FORMAT_TIME or %GST_FORMAT_DEFAULT to which the buffer should be clipped.

    • rate: number

      sample rate.

    • bpf: number

      size of one audio frame in bytes. This is the size of one sample * number of channels.

    Returns Gst.Buffer

  • Maps an audio gstbuffer so that it can be read or written and stores the result of the map operation in buffer.

    This is especially useful when the gstbuffer is in non-interleaved (planar) layout, in which case this function will use the information in the gstbuffer's attached #GstAudioMeta in order to map each channel in a separate "plane" in #GstAudioBuffer. If a #GstAudioMeta is not attached on the gstbuffer, then it must be in interleaved layout.

    If a #GstAudioMeta is attached, then the #GstAudioInfo on the meta is checked against info. Normally, they should be equal, but in case they are not, a g_critical will be printed and the #GstAudioInfo from the meta will be used.

    In non-interleaved buffers, it is possible to have each channel on a separate #GstMemory. In this case, each memory will be mapped separately to avoid copying their contents in a larger memory area. Do note though that it is not supported to have a single channel spanning over two or more different #GstMemory objects. Although the map operation will likely succeed in this case, it will be highly sub-optimal and it is recommended to merge all the memories in the buffer before calling this function.

    Note: The actual #GstBuffer is not ref'ed, but it is required to stay valid as long as it's mapped.

    Parameters

    • info: AudioInfo

      the audio properties of the buffer

    • gstbuffer: Gst.Buffer

      the #GstBuffer to be mapped

    • flags: Gst.MapFlags

      the access mode for the memory

    Returns [boolean, AudioBuffer]

  • audio_buffer_truncate(buffer: Gst.Buffer, bpf: number, trim: number, samples: number): Gst.Buffer
  • Truncate the buffer to finally have samples number of samples, removing the necessary amount of samples from the end and trim number of samples from the beginning.

    This function does not know the audio rate, therefore the caller is responsible for re-setting the correct timestamp and duration to the buffer. However, timestamp will be preserved if trim == 0, and duration will also be preserved if there is no trimming to be done. Offset and offset end will be preserved / updated.

    After calling this function the caller does not own a reference to buffer anymore.

    Parameters

    • buffer: Gst.Buffer

      The buffer to truncate.

    • bpf: number

      size of one audio frame in bytes. This is the size of one sample * number of channels.

    • trim: number

      the number of samples to remove from the beginning of the buffer

    • samples: number

      the final number of samples that should exist in this buffer or -1 to use all the remaining samples if you are only removing samples from the beginning.

    Returns Gst.Buffer

  • audio_channel_get_fallback_mask(channels: number): number
  • Get the fallback channel-mask for the given number of channels.

    This function returns a reasonable fallback channel-mask and should be called as a last resort when the specific channel map is unknown.

    Parameters

    • channels: number

      the number of channels

    Returns number

  • Convert the channels present in channel_mask to a position array (which should have at least channels entries ensured by caller). If channel_mask is set to 0, it is considered as 'not present' for purpose of conversion. A partially valid channel_mask with less bits set than the number of channels is considered valid.

    Parameters

    Returns boolean

  • Convert the position array of channels channels to a bitmask.

    If force_order is %TRUE it additionally checks if the channels are in the order required by GStreamer.

    Parameters

    Returns [boolean, number]

  • Checks if position contains valid channel positions for channels channels. If force_order is %TRUE it additionally checks if the channels are in the order required by GStreamer.

    Parameters

    • position: GstAudio.AudioChannelPosition[]

      The %GstAudioChannelPositions to check.

    • force_order: boolean

      Only consider the GStreamer channel order.

    Returns boolean

  • audio_clipping_meta_api_get_type(): GType
  • audio_downmix_meta_api_get_type(): GType
  • audio_format_build_integer(sign: boolean, endianness: number, width: number, depth: number): GstAudio.AudioFormat
  • Construct a #GstAudioFormat with given parameters.

    Parameters

    • sign: boolean

      signed or unsigned format

    • endianness: number

      G_LITTLE_ENDIAN or G_BIG_ENDIAN

    • width: number

      amount of bits used per sample

    • depth: number

      amount of used bits in width

    Returns GstAudio.AudioFormat

  • audio_format_info_get_type(): GType
  • Returns a reorder map for from to to that can be used in custom channel reordering code, e.g. to convert from or to the GStreamer channel order. from and to must contain the same number of positions and the same positions, only in a different order.

    The resulting reorder_map can be used for reordering by assigning channel i of the input to channel reorder_map[i] of the output.

    Parameters

    Returns boolean

  • audio_iec61937_payload(src: Uint8Array, dst: Uint8Array, spec: AudioRingBufferSpec, endianness: number): boolean
  • Payloads src in the form specified by IEC 61937 for the type from spec and stores the result in dst. src must contain exactly one frame of data and the frame is not checked for errors.

    Parameters

    • src: Uint8Array

      a buffer containing the data to payload

    • dst: Uint8Array

      the destination buffer to store the payloaded contents in. Should not overlap with src

    • spec: AudioRingBufferSpec

      the ringbufer spec for src

    • endianness: number

      the expected byte order of the payloaded data

    Returns boolean

  • audio_level_meta_api_get_type(): GType
  • Return a generic raw audio caps for formats defined in formats. If formats is %NULL returns a caps for all the supported raw audio formats, see gst_audio_formats_raw().

    Parameters

    Returns Gst.Caps

  • audio_meta_api_get_type(): GType
  • Reorders data from the channel positions from to the channel positions to. from and to must contain the same number of positions and the same positions, only in a different order.

    Note: this function assumes the audio data is in interleaved layout

    Parameters

    Returns boolean

  • Set the parameters for resampling from in_rate to out_rate using method for quality in options.

    Parameters

    • method: AudioResamplerMethod

      a #GstAudioResamplerMethod

    • quality: number

      the quality

    • in_rate: number

      the input rate

    • out_rate: number

      the output rate

    • options: Gst.Structure

      a #GstStructure

    Returns void

  • Attaches #GstAudioClippingMeta metadata to buffer with the given parameters.

    Parameters

    • buffer: Gst.Buffer

      a #GstBuffer

    • format: Gst.Format

      GstFormat of start and stop, GST_FORMAT_DEFAULT is samples

    • start: number

      Amount of audio to clip from start of buffer

    • end: number

      Amount of to clip from end of buffer

    Returns AudioClippingMeta

  • Attaches #GstAudioDownmixMeta metadata to buffer with the given parameters.

    matrix is an two-dimensional array of to_channels times from_channels coefficients, i.e. the i-th output channels is constructed by multiplicating the input channels with the coefficients in matrix[i] and taking the sum of the results.

    Parameters

    Returns AudioDownmixMeta

  • Attaches audio level information to buffer. (RFC 6464)

    Parameters

    • buffer: Gst.Buffer

      a #GstBuffer

    • level: number

      the -dBov from 0-127 (127 is silence).

    • voice_activity: boolean

      whether the buffer contains voice activity.

    Returns AudioLevelMeta | null

  • Allocates and attaches a #GstAudioMeta on buffer, which must be writable for that purpose. The fields of the #GstAudioMeta are directly populated from the arguments of this function.

    When info->layout is %GST_AUDIO_LAYOUT_NON_INTERLEAVED and offsets is %NULL, the offsets are calculated with a formula that assumes the planes are tightly packed and in sequence: offsets[channel] = channel * samples * sample_stride

    It is not allowed for channels to overlap in memory, i.e. for each i in [0, channels), the range [offsets[i], offsets[i] + samples * sample_stride) must not overlap with any other such range. This function will assert if the parameters specified cause this restriction to be violated.

    It is, obviously, also not allowed to specify parameters that would cause out-of-bounds memory access on buffer. This is also checked, which means that you must add enough memory on the buffer before adding this meta.

    Parameters

    • buffer: Gst.Buffer

      a #GstBuffer

    • info: AudioInfo

      the audio properties of the buffer

    • samples: number

      the number of valid samples in the buffer

    • offsets: number

      the offsets (in bytes) where each channel plane starts in the buffer or %NULL to calculate it (see below); must be %NULL also when info->layout is %GST_AUDIO_LAYOUT_INTERLEAVED

    Returns AudioMeta

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method