GstAudioStreamAlign

GstAudioStreamAlign provides a helper object that helps tracking audio stream alignment and discontinuities, and detects discontinuities if possible.

See gst_audio_stream_align_new for a description of its parameters and gst_audio_stream_align_process for the details of the processing.

GstAudioStreamAlign

The opaque GstAudioStreamAlign data structure.


GstAudio.AudioStreamAlign

The opaque GstAudio.AudioStreamAlign data structure.


GstAudio.AudioStreamAlign

The opaque GstAudio.AudioStreamAlign data structure.


Constructors

gst_audio_stream_align_new

GstAudioStreamAlign *
gst_audio_stream_align_new (gint rate,
                            GstClockTime alignment_threshold,
                            GstClockTime discont_wait)

Allocate a new GstAudioStreamAlign with the given configuration. All processing happens according to sample rate rate, until gst_audio_stream_align_set_rate is called with a new rate. A negative rate can be used for reverse playback.

alignment_threshold gives the tolerance in nanoseconds after which a timestamp difference is considered a discontinuity. Once detected, discont_wait nanoseconds have to pass without going below the threshold again until the output buffer is marked as a discontinuity. These can later be re-configured with gst_audio_stream_align_set_alignment_threshold and gst_audio_stream_align_set_discont_wait.

Parameters:

rate

a sample rate

alignment_threshold

a alignment threshold in nanoseconds

discont_wait

discont wait in nanoseconds

Returns

a new GstAudioStreamAlign. free with gst_audio_stream_align_free.

Since : 1.14


GstAudio.AudioStreamAlign.new

def GstAudio.AudioStreamAlign.new (rate, alignment_threshold, discont_wait):
    #python wrapper for 'gst_audio_stream_align_new'

Allocate a new GstAudio.AudioStreamAlign with the given configuration. All processing happens according to sample rate rate, until GstAudio.AudioStreamAlign.set_rate is called with a new rate. A negative rate can be used for reverse playback.

alignment_threshold gives the tolerance in nanoseconds after which a timestamp difference is considered a discontinuity. Once detected, discont_wait nanoseconds have to pass without going below the threshold again until the output buffer is marked as a discontinuity. These can later be re-configured with GstAudio.AudioStreamAlign.set_alignment_threshold and GstAudio.AudioStreamAlign.set_discont_wait.

Parameters:

rate ( int ) –

a sample rate

alignment_threshold ( int ) –

a alignment threshold in nanoseconds

discont_wait ( int ) –

discont wait in nanoseconds

Since : 1.14


GstAudio.AudioStreamAlign.prototype.new

function GstAudio.AudioStreamAlign.prototype.new(rate: Number, alignment_threshold: Number, discont_wait: Number): {
    // javascript wrapper for 'gst_audio_stream_align_new'
}

Allocate a new GstAudio.AudioStreamAlign with the given configuration. All processing happens according to sample rate rate, until GstAudio.AudioStreamAlign.prototype.set_rate is called with a new rate. A negative rate can be used for reverse playback.

alignment_threshold gives the tolerance in nanoseconds after which a timestamp difference is considered a discontinuity. Once detected, discont_wait nanoseconds have to pass without going below the threshold again until the output buffer is marked as a discontinuity. These can later be re-configured with GstAudio.AudioStreamAlign.prototype.set_alignment_threshold and GstAudio.AudioStreamAlign.prototype.set_discont_wait.

Parameters:

rate ( Number ) –

a sample rate

alignment_threshold ( Number ) –

a alignment threshold in nanoseconds

discont_wait ( Number ) –

discont wait in nanoseconds

Since : 1.14


Methods

gst_audio_stream_align_copy

GstAudioStreamAlign *
gst_audio_stream_align_copy (const GstAudioStreamAlign * align)

Copy a GstAudioStreamAlign structure.

Parameters:

align

a GstAudioStreamAlign

Returns

a new GstAudioStreamAlign. free with gst_audio_stream_align_free.

Since : 1.14


GstAudio.AudioStreamAlign.copy

def GstAudio.AudioStreamAlign.copy (self):
    #python wrapper for 'gst_audio_stream_align_copy'

Copy a GstAudioStreamAlign structure.

Returns ( GstAudio.AudioStreamAlign ) –

a new GstAudio.AudioStreamAlign. free with gst_audio_stream_align_free.

Since : 1.14


GstAudio.AudioStreamAlign.prototype.copy

function GstAudio.AudioStreamAlign.prototype.copy(): {
    // javascript wrapper for 'gst_audio_stream_align_copy'
}

Copy a GstAudioStreamAlign structure.

Returns ( GstAudio.AudioStreamAlign ) –

a new GstAudio.AudioStreamAlign. free with gst_audio_stream_align_free.

Since : 1.14


gst_audio_stream_align_free

gst_audio_stream_align_free (GstAudioStreamAlign * align)

Free a GstAudioStreamAlign structure previously allocated with gst_audio_stream_align_new or gst_audio_stream_align_copy.

Parameters:

align

a GstAudioStreamAlign

Since : 1.14


GstAudio.AudioStreamAlign.free

def GstAudio.AudioStreamAlign.free (self):
    #python wrapper for 'gst_audio_stream_align_free'

Free a GstAudioStreamAlign structure previously allocated with GstAudio.AudioStreamAlign.new or GstAudio.AudioStreamAlign.copy.

Since : 1.14


GstAudio.AudioStreamAlign.prototype.free

function GstAudio.AudioStreamAlign.prototype.free(): {
    // javascript wrapper for 'gst_audio_stream_align_free'
}

Free a GstAudioStreamAlign structure previously allocated with GstAudio.AudioStreamAlign.prototype.new or GstAudio.AudioStreamAlign.prototype.copy.

Since : 1.14


gst_audio_stream_align_get_alignment_threshold

GstClockTime
gst_audio_stream_align_get_alignment_threshold (GstAudioStreamAlign * align)

Gets the currently configured alignment threshold.

Parameters:

align

a GstAudioStreamAlign

Returns

The currently configured alignment threshold

Since : 1.14


GstAudio.AudioStreamAlign.get_alignment_threshold

def GstAudio.AudioStreamAlign.get_alignment_threshold (self):
    #python wrapper for 'gst_audio_stream_align_get_alignment_threshold'

Gets the currently configured alignment threshold.

Returns ( int ) –

The currently configured alignment threshold

Since : 1.14


GstAudio.AudioStreamAlign.prototype.get_alignment_threshold

function GstAudio.AudioStreamAlign.prototype.get_alignment_threshold(): {
    // javascript wrapper for 'gst_audio_stream_align_get_alignment_threshold'
}

Gets the currently configured alignment threshold.

Returns ( Number ) –

The currently configured alignment threshold

Since : 1.14


gst_audio_stream_align_get_discont_wait

GstClockTime
gst_audio_stream_align_get_discont_wait (GstAudioStreamAlign * align)

Gets the currently configured discont wait.

Parameters:

align

a GstAudioStreamAlign

Returns

The currently configured discont wait

Since : 1.14


GstAudio.AudioStreamAlign.get_discont_wait

def GstAudio.AudioStreamAlign.get_discont_wait (self):
    #python wrapper for 'gst_audio_stream_align_get_discont_wait'

Gets the currently configured discont wait.

Returns ( int ) –

The currently configured discont wait

Since : 1.14


GstAudio.AudioStreamAlign.prototype.get_discont_wait

function GstAudio.AudioStreamAlign.prototype.get_discont_wait(): {
    // javascript wrapper for 'gst_audio_stream_align_get_discont_wait'
}

Gets the currently configured discont wait.

Returns ( Number ) –

The currently configured discont wait

Since : 1.14


gst_audio_stream_align_get_rate

gint
gst_audio_stream_align_get_rate (GstAudioStreamAlign * align)

Gets the currently configured sample rate.

Parameters:

align

a GstAudioStreamAlign

Returns

The currently configured sample rate

Since : 1.14


GstAudio.AudioStreamAlign.get_rate

def GstAudio.AudioStreamAlign.get_rate (self):
    #python wrapper for 'gst_audio_stream_align_get_rate'

Gets the currently configured sample rate.

Returns ( int ) –

The currently configured sample rate

Since : 1.14


GstAudio.AudioStreamAlign.prototype.get_rate

function GstAudio.AudioStreamAlign.prototype.get_rate(): {
    // javascript wrapper for 'gst_audio_stream_align_get_rate'
}

Gets the currently configured sample rate.

Returns ( Number ) –

The currently configured sample rate

Since : 1.14


gst_audio_stream_align_get_samples_since_discont

guint64
gst_audio_stream_align_get_samples_since_discont (GstAudioStreamAlign * align)

Returns the number of samples that were processed since the last discontinuity was detected.

Parameters:

align

a GstAudioStreamAlign

Returns

The number of samples processed since the last discontinuity.

Since : 1.14


GstAudio.AudioStreamAlign.get_samples_since_discont

def GstAudio.AudioStreamAlign.get_samples_since_discont (self):
    #python wrapper for 'gst_audio_stream_align_get_samples_since_discont'

Returns the number of samples that were processed since the last discontinuity was detected.

Returns ( int ) –

The number of samples processed since the last discontinuity.

Since : 1.14


GstAudio.AudioStreamAlign.prototype.get_samples_since_discont

function GstAudio.AudioStreamAlign.prototype.get_samples_since_discont(): {
    // javascript wrapper for 'gst_audio_stream_align_get_samples_since_discont'
}

Returns the number of samples that were processed since the last discontinuity was detected.

Returns ( Number ) –

The number of samples processed since the last discontinuity.

Since : 1.14


gst_audio_stream_align_get_timestamp_at_discont

GstClockTime
gst_audio_stream_align_get_timestamp_at_discont (GstAudioStreamAlign * align)

Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.

Parameters:

align

a GstAudioStreamAlign

Returns

The last timestamp at when a discontinuity was detected

Since : 1.14


GstAudio.AudioStreamAlign.get_timestamp_at_discont

def GstAudio.AudioStreamAlign.get_timestamp_at_discont (self):
    #python wrapper for 'gst_audio_stream_align_get_timestamp_at_discont'

Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.

Returns ( int ) –

The last timestamp at when a discontinuity was detected

Since : 1.14


GstAudio.AudioStreamAlign.prototype.get_timestamp_at_discont

function GstAudio.AudioStreamAlign.prototype.get_timestamp_at_discont(): {
    // javascript wrapper for 'gst_audio_stream_align_get_timestamp_at_discont'
}

Timestamp that was passed when a discontinuity was detected, i.e. the first timestamp after the discontinuity.

Returns ( Number ) –

The last timestamp at when a discontinuity was detected

Since : 1.14


gst_audio_stream_align_mark_discont

gst_audio_stream_align_mark_discont (GstAudioStreamAlign * align)

Marks the next buffer as discontinuous and resets timestamp tracking.

Parameters:

align

a GstAudioStreamAlign

Since : 1.14


GstAudio.AudioStreamAlign.mark_discont

def GstAudio.AudioStreamAlign.mark_discont (self):
    #python wrapper for 'gst_audio_stream_align_mark_discont'

Marks the next buffer as discontinuous and resets timestamp tracking.

Since : 1.14


GstAudio.AudioStreamAlign.prototype.mark_discont

function GstAudio.AudioStreamAlign.prototype.mark_discont(): {
    // javascript wrapper for 'gst_audio_stream_align_mark_discont'
}

Marks the next buffer as discontinuous and resets timestamp tracking.

Since : 1.14


gst_audio_stream_align_process

gboolean
gst_audio_stream_align_process (GstAudioStreamAlign * align,
                                gboolean discont,
                                GstClockTime timestamp,
                                guint n_samples,
                                GstClockTime * out_timestamp,
                                GstClockTime * out_duration,
                                guint64 * out_sample_position)

Processes data with timestamp and n_samples, and returns the output timestamp, duration and sample position together with a boolean to signal whether a discontinuity was detected or not. All non-discontinuous data will have perfect timestamps and durations.

A discontinuity is detected once the difference between the actual timestamp and the timestamp calculated from the sample count since the last discontinuity differs by more than the alignment threshold for a duration longer than discont wait.

Note: In reverse playback, every buffer is considered discontinuous in the context of buffer flags because the last sample of the previous buffer is discontinuous with the first sample of the current one. However for this function they are only considered discontinuous in reverse playback if the first sample of the previous buffer is discontinuous with the last sample of the current one.

Parameters:

align

a GstAudioStreamAlign

discont

if this data is considered to be discontinuous

timestamp

a GstClockTime of the start of the data

n_samples

number of samples to process

out_timestamp ( [out] ) –

output timestamp of the data

out_duration ( [out] ) –

output duration of the data

out_sample_position ( [out] ) –

output sample position of the start of the data

Returns

TRUE if a discontinuity was detected, FALSE otherwise.

Since : 1.14


GstAudio.AudioStreamAlign.process

def GstAudio.AudioStreamAlign.process (self, discont, timestamp, n_samples):
    #python wrapper for 'gst_audio_stream_align_process'

Processes data with timestamp and n_samples, and returns the output timestamp, duration and sample position together with a boolean to signal whether a discontinuity was detected or not. All non-discontinuous data will have perfect timestamps and durations.

A discontinuity is detected once the difference between the actual timestamp and the timestamp calculated from the sample count since the last discontinuity differs by more than the alignment threshold for a duration longer than discont wait.

Note: In reverse playback, every buffer is considered discontinuous in the context of buffer flags because the last sample of the previous buffer is discontinuous with the first sample of the current one. However for this function they are only considered discontinuous in reverse playback if the first sample of the previous buffer is discontinuous with the last sample of the current one.

Parameters:

discont ( bool ) –

if this data is considered to be discontinuous

timestamp ( int ) –

a int of the start of the data

n_samples ( int ) –

number of samples to process

Returns a tuple made of:

( bool ) –

True if a discontinuity was detected, False otherwise.

out_timestamp ( int ) –

True if a discontinuity was detected, False otherwise.

out_duration ( int ) –

True if a discontinuity was detected, False otherwise.

out_sample_position ( int ) –

True if a discontinuity was detected, False otherwise.

Since : 1.14


GstAudio.AudioStreamAlign.prototype.process

function GstAudio.AudioStreamAlign.prototype.process(discont: Number, timestamp: Number, n_samples: Number): {
    // javascript wrapper for 'gst_audio_stream_align_process'
}

Processes data with timestamp and n_samples, and returns the output timestamp, duration and sample position together with a boolean to signal whether a discontinuity was detected or not. All non-discontinuous data will have perfect timestamps and durations.

A discontinuity is detected once the difference between the actual timestamp and the timestamp calculated from the sample count since the last discontinuity differs by more than the alignment threshold for a duration longer than discont wait.

Note: In reverse playback, every buffer is considered discontinuous in the context of buffer flags because the last sample of the previous buffer is discontinuous with the first sample of the current one. However for this function they are only considered discontinuous in reverse playback if the first sample of the previous buffer is discontinuous with the last sample of the current one.

Parameters:

discont ( Number ) –

if this data is considered to be discontinuous

timestamp ( Number ) –

a Number of the start of the data

n_samples ( Number ) –

number of samples to process

Returns a tuple made of:

( Number ) –

true if a discontinuity was detected, false otherwise.

out_timestamp ( Number ) –

true if a discontinuity was detected, false otherwise.

out_duration ( Number ) –

true if a discontinuity was detected, false otherwise.

out_sample_position ( Number ) –

true if a discontinuity was detected, false otherwise.

Since : 1.14


gst_audio_stream_align_set_alignment_threshold

gst_audio_stream_align_set_alignment_threshold (GstAudioStreamAlign * align,
                                                GstClockTime alignment_threshold)

Sets alignment_treshold as new alignment threshold for the following processing.

Parameters:

align

a GstAudioStreamAlign

alignment_threshold

a new alignment threshold

Since : 1.14


GstAudio.AudioStreamAlign.set_alignment_threshold

def GstAudio.AudioStreamAlign.set_alignment_threshold (self, alignment_threshold):
    #python wrapper for 'gst_audio_stream_align_set_alignment_threshold'

Sets alignment_treshold as new alignment threshold for the following processing.

Parameters:

alignment_threshold ( int ) –

a new alignment threshold

Since : 1.14


GstAudio.AudioStreamAlign.prototype.set_alignment_threshold

function GstAudio.AudioStreamAlign.prototype.set_alignment_threshold(alignment_threshold: Number): {
    // javascript wrapper for 'gst_audio_stream_align_set_alignment_threshold'
}

Sets alignment_treshold as new alignment threshold for the following processing.

Parameters:

alignment_threshold ( Number ) –

a new alignment threshold

Since : 1.14


gst_audio_stream_align_set_discont_wait

gst_audio_stream_align_set_discont_wait (GstAudioStreamAlign * align,
                                         GstClockTime discont_wait)

Sets alignment_treshold as new discont wait for the following processing.

Parameters:

align

a GstAudioStreamAlign

discont_wait

a new discont wait

Since : 1.14


GstAudio.AudioStreamAlign.set_discont_wait

def GstAudio.AudioStreamAlign.set_discont_wait (self, discont_wait):
    #python wrapper for 'gst_audio_stream_align_set_discont_wait'

Sets alignment_treshold as new discont wait for the following processing.

Parameters:

discont_wait ( int ) –

a new discont wait

Since : 1.14


GstAudio.AudioStreamAlign.prototype.set_discont_wait

function GstAudio.AudioStreamAlign.prototype.set_discont_wait(discont_wait: Number): {
    // javascript wrapper for 'gst_audio_stream_align_set_discont_wait'
}

Sets alignment_treshold as new discont wait for the following processing.

Parameters:

discont_wait ( Number ) –

a new discont wait

Since : 1.14


gst_audio_stream_align_set_rate

gst_audio_stream_align_set_rate (GstAudioStreamAlign * align,
                                 gint rate)

Sets rate as new sample rate for the following processing. If the sample rate differs this implicitly marks the next data as discontinuous.

Parameters:

align

a GstAudioStreamAlign

rate

a new sample rate

Since : 1.14


GstAudio.AudioStreamAlign.set_rate

def GstAudio.AudioStreamAlign.set_rate (self, rate):
    #python wrapper for 'gst_audio_stream_align_set_rate'

Sets rate as new sample rate for the following processing. If the sample rate differs this implicitly marks the next data as discontinuous.

Parameters:

rate ( int ) –

a new sample rate

Since : 1.14


GstAudio.AudioStreamAlign.prototype.set_rate

function GstAudio.AudioStreamAlign.prototype.set_rate(rate: Number): {
    // javascript wrapper for 'gst_audio_stream_align_set_rate'
}

Sets rate as new sample rate for the following processing. If the sample rate differs this implicitly marks the next data as discontinuous.

Parameters:

rate ( Number ) –

a new sample rate

Since : 1.14


Constants

GST_TYPE_AUDIO_INFO_STREAM_ALIGN

#define GST_TYPE_AUDIO_INFO_STREAM_ALIGN (gst_audio_stream_align_get_type ())

The results of the search are