Back to Exoplayer

AudioProcessingPipeline (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/audio/AudioProcessingPipeline.html

latest12.4 KB
Original Source

Package com.google.android.exoplayer2.audio

Class AudioProcessingPipeline


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classAudioProcessingPipelineextends[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

Handles passing buffers through multiple AudioProcessor instances.

Two instances of AudioProcessingPipeline are considered equal if they have the same underlying AudioProcessor references, in the same order.

To make use of this class, the caller must:

If underlying AudioProcessor instances have pending configuration changes, or the AudioProcessor.AudioFormat of the input is changing:

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | AudioProcessingPipeline​(ImmutableList<AudioProcessor> audioProcessors) | Deprecated.

Creates an instance. |

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | AudioProcessor.AudioFormat | configure​(AudioProcessor.AudioFormat inputAudioFormat) | Deprecated.

Configures the pipeline to process input audio with the specified format. | | boolean | equals​(Object o) | Deprecated.

Indicates whether some other object is "equal to" this one. | | void | flush() | Deprecated.

Clears any buffered data and pending output. | | ByteBuffer | getOutput() | Deprecated.

Returns a ByteBuffer containing processed output data between its position and limit. | | AudioProcessor.AudioFormat | getOutputAudioFormat() | Deprecated.

Returns the AudioProcessor.AudioFormat currently being output. | | int | hashCode() | Deprecated. | | boolean | isEnded() | Deprecated.

Returns whether the pipeline has ended. | | boolean | isOperational() | Deprecated.

Whether the pipeline can be used for processing buffers. | | void | queueEndOfStream() | Deprecated.

Queues an end of stream signal. | | void | queueInput​(ByteBuffer inputBuffer) | Deprecated.

Queues audio data between the position and limit of the inputBuffer for processing. | | void | reset() | Deprecated.

Resets the pipeline and its underlying AudioProcessor instances to their unconfigured state, releasing any resources. |

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

AudioProcessingPipeline

public AudioProcessingPipeline​([ImmutableList](https://guava.dev/releases/31.1-android/api/docs/com/google/common/collect/ImmutableList.html?is-external=true "class or interface in com.google.common.collect")<[AudioProcessor](AudioProcessor.html "interface in com.google.android.exoplayer2.audio")> audioProcessors)

Deprecated.

Creates an instance. Parameters:audioProcessors - The AudioProcessor instances to be used for processing buffers.

Method Detail

- 

configure

@CanIgnoreReturnValue
public[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")configure​([AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")inputAudioFormat)
                                     throws[AudioProcessor.UnhandledAudioFormatException](AudioProcessor.UnhandledAudioFormatException.html "class in com.google.android.exoplayer2.audio")

Deprecated.

Configures the pipeline to process input audio with the specified format. Returns the configured output audio format.

To apply the new configuration for use, the pipeline must be flushed. Before applying the new configuration, it is safe to queue input and get output in the old input/output formats/configuration. Call queueEndOfStream() when no more input will be supplied for processing in the old configuration.

Parameters:inputAudioFormat - The format of audio that will be queued after the next call to flush().Returns:The configured output audio format.Throws:AudioProcessor.UnhandledAudioFormatException - If the specified format is not supported by the pipeline.

- 

flush

public void flush()

Deprecated.

Clears any buffered data and pending output. If any underlying audio processors are active, this also prepares them to receive a new stream of input in the last configured (pending) format.

configure(AudioFormat) must have been called at least once since the last call to reset() before calling this.

- 

getOutputAudioFormat

public[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")getOutputAudioFormat()

Deprecated.

Returns the AudioProcessor.AudioFormat currently being output.

- 

isOperational

public boolean isOperational()

Deprecated.

Whether the pipeline can be used for processing buffers.

For this to happen the pipeline must be configured, flushed and have activeunderlying audio processors that are ready to process buffers with the current configuration.

- 

queueInput

public void queueInput​([ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")inputBuffer)

Deprecated.

Queues audio data between the position and limit of the inputBuffer for processing. After calling this method, processed output may be available via getOutput(). Parameters:inputBuffer - The input buffer to process. It must be a direct ByteBuffer with native byte order. Its contents are treated as read-only. Its position will be advanced by the number of bytes consumed (which may be zero). The caller retains ownership of the provided buffer.

- 

getOutput

public[ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer.html "class or interface in java.nio")getOutput()

Deprecated.

Returns a ByteBuffer containing processed output data between its position and limit. The buffer will be empty if no output is available.

Buffers returned from this method are retained by pipeline, and it is necessary to consume the data (or copy it into another buffer) to allow the pipeline to progress.

Returns:A buffer containing processed output data between its position and limit.

- 

queueEndOfStream

public void queueEndOfStream()

Deprecated.

Queues an end of stream signal. After this method has been called, queueInput(ByteBuffer) should not be called until after the next call to flush(). Calling getOutput() will return any remaining output data. Multiple calls may be required to read all of the remaining output data. isEnded() will return true once all remaining output data has been read.

- 

isEnded

public boolean isEnded()

Deprecated.

Returns whether the pipeline has ended.

The pipeline is considered ended when:

  - End of stream has been [queued](#queueEndOfStream()). 
  - Every [input buffer](#queueInput(java.nio.ByteBuffer)) has been processed. 
  - Every [output buffer](#getOutput()) has been fully consumed. 

- 

reset

public void reset()

Deprecated.

Resets the pipeline and its underlying AudioProcessor instances to their unconfigured state, releasing any resources.

- 

equals

public boolean equals​(@Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")o)

Deprecated.

Indicates whether some other object is "equal to" this one.

Two instances of AudioProcessingPipeline are considered equal if they have the same underlying AudioProcessor references in the same order.

Overrides:equals in class Object

- 

hashCode

public int hashCode()

Deprecated. Overrides:hashCode in class Object