docs/doc/reference/com/google/android/exoplayer2/audio/AudioProcessingPipeline.html
Package com.google.android.exoplayer2.audio
[@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:
configure(AudioFormat) with the AudioProcessor.AudioFormat of the input data. This method will give back the AudioProcessor.AudioFormat that will be output from the pipeline when this configuration is in use.flush() to apply the pending configuration.isOperational(). If not, then the pipeline can not be used to process buffers in the current configuration. This is because none of the underlying AudioProcessor instances are active.isOperational(), queueInput(ByteBuffer) then getOutput() to process buffers.queueEndOfStream() to inform the pipeline the current input stream is at an end.getOutput() and handle those buffers until isEnded() returns true.reset() to release underlying resources.If underlying AudioProcessor instances have pending configuration changes, or the AudioProcessor.AudioFormat of the input is changing:
Call configure(AudioFormat) to configure the pipeline for the new input stream. You can still queueInput(ByteBuffer) and getOutput() in the old setup at this time.
queueEndOfStream() to inform the pipeline the current input stream is at an end.
Repeatedly call getOutput() until isEnded() returns true.
Call flush() to apply the new configuration and flush the pipeline.
Begin queuing input and handling the output in the new configuration.
Constructors | Constructor | Description |
| --- | --- |
| AudioProcessingPipeline(ImmutableList<AudioProcessor> audioProcessors) |
Deprecated.
Creates an instance. |
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.
|
-
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
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.
-
@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.
-
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.
-
public[AudioProcessor.AudioFormat](AudioProcessor.AudioFormat.html "class in com.google.android.exoplayer2.audio")getOutputAudioFormat()
Deprecated.
Returns the AudioProcessor.AudioFormat currently being output.
-
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.
-
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.
-
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.
-
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.
-
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.
-
public void reset()
Deprecated.
Resets the pipeline and its underlying AudioProcessor instances to their unconfigured state, releasing any resources.
-
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
-
public int hashCode()
Deprecated.
Overrides:hashCode in class Object