Class BaseAudioProcessor
- java.lang.Object
- 
- com.google.android.exoplayer2.audio.BaseAudioProcessor
 
- 
- All Implemented Interfaces:
- AudioProcessor
 - Direct Known Subclasses:
- ChannelMixingAudioProcessor,- SilenceSkippingAudioProcessor,- TeeAudioProcessor,- ToInt16PcmAudioProcessor
 
 @Deprecated public abstract class BaseAudioProcessor extends Object implements AudioProcessor 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.Base class for audio processors that keep an output buffer and an internal buffer that is reused whenever input is queued. Subclasses should overrideonConfigure(AudioFormat)to return the output audio format for the processor if it's active.
- 
- 
Nested Class Summary- 
Nested classes/interfaces inherited from interface com.google.android.exoplayer2.audio.AudioProcessorAudioProcessor.AudioFormat, AudioProcessor.UnhandledAudioFormatException
 
- 
 - 
Field SummaryFields Modifier and Type Field Description protected AudioProcessor.AudioFormatinputAudioFormatDeprecated.The current input audio format.protected AudioProcessor.AudioFormatoutputAudioFormatDeprecated.The current output audio format.- 
Fields inherited from interface com.google.android.exoplayer2.audio.AudioProcessorEMPTY_BUFFER
 
- 
 - 
Constructor SummaryConstructors Constructor Description BaseAudioProcessor()Deprecated.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AudioProcessor.AudioFormatconfigure(AudioProcessor.AudioFormat inputAudioFormat)Deprecated.Configures the processor to process input audio with the specified format.voidflush()Deprecated.Clears any buffered data and pending output.ByteBuffergetOutput()Deprecated.Returns a buffer containing processed output data between its position and limit.protected booleanhasPendingOutput()Deprecated.Returns whether the current output buffer has any data remaining.booleanisActive()Deprecated.Returns whether the processor is configured and will process input buffers.booleanisEnded()Deprecated.Returns whether this processor will return no more output fromAudioProcessor.getOutput()untilAudioProcessor.flush()has been called and more input has been queued.protected AudioProcessor.AudioFormatonConfigure(AudioProcessor.AudioFormat inputAudioFormat)Deprecated.Called when the processor is configured for a new input format.protected voidonFlush()Deprecated.Called when the processor is flushed, directly or as part of resetting.protected voidonQueueEndOfStream()Deprecated.Called when the end-of-stream is queued to the processor.protected voidonReset()Deprecated.Called when the processor is reset.voidqueueEndOfStream()Deprecated.Queues an end of stream signal.protected ByteBufferreplaceOutputBuffer(int size)Deprecated.Replaces the current output buffer with a buffer of at leastsizebytes and returns it.voidreset()Deprecated.Resets the processor to its unconfigured state, releasing any resources.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface com.google.android.exoplayer2.audio.AudioProcessorqueueInput
 
- 
 
- 
- 
- 
Field Detail- 
inputAudioFormatprotected AudioProcessor.AudioFormat inputAudioFormat Deprecated.The current input audio format.
 - 
outputAudioFormatprotected AudioProcessor.AudioFormat outputAudioFormat Deprecated.The current output audio format.
 
- 
 - 
Method Detail- 
configure@CanIgnoreReturnValue public final AudioProcessor.AudioFormat configure(AudioProcessor.AudioFormat inputAudioFormat) throws AudioProcessor.UnhandledAudioFormatException Deprecated.Description copied from interface:AudioProcessorConfigures the processor to process input audio with the specified format. After calling this method, callAudioProcessor.isActive()to determine whether the audio processor is active. Returns the configured output audio format if this instance is active.After calling this method, it is necessary to AudioProcessor.flush()the processor to apply the new configuration. Before applying the new configuration, it is safe to queue input and get output in the old input/output formats. CallAudioProcessor.queueEndOfStream()when no more input will be supplied in the old input format.- Specified by:
- configurein interface- AudioProcessor
- Parameters:
- inputAudioFormat- The format of audio that will be queued after the next call to- AudioProcessor.flush().
- Returns:
- The configured output audio format if this instance is active.
- Throws:
- AudioProcessor.UnhandledAudioFormatException- Thrown if the specified format can't be handled as input.
 
 - 
isActivepublic boolean isActive() Deprecated.Description copied from interface:AudioProcessorReturns whether the processor is configured and will process input buffers.- Specified by:
- isActivein interface- AudioProcessor
 
 - 
queueEndOfStreampublic final void queueEndOfStream() Deprecated.Description copied from interface:AudioProcessorQueues an end of stream signal. After this method has been called,AudioProcessor.queueInput(ByteBuffer)may not be called until after the next call toAudioProcessor.flush(). CallingAudioProcessor.getOutput()will return any remaining output data. Multiple calls may be required to read all of the remaining output data.AudioProcessor.isEnded()will returntrueonce all remaining output data has been read.- Specified by:
- queueEndOfStreamin interface- AudioProcessor
 
 - 
getOutput@CallSuper public ByteBuffer getOutput() Deprecated.Description copied from interface:AudioProcessorReturns a buffer containing processed output data between its position and limit. The buffer will always be a direct byte buffer with native byte order. Calling this method invalidates any previously returned buffer. The buffer will be empty if no output is available.- Specified by:
- getOutputin interface- AudioProcessor
- Returns:
- A buffer containing processed output data between its position and limit.
 
 - 
isEnded@CallSuper public boolean isEnded() Deprecated.Description copied from interface:AudioProcessorReturns whether this processor will return no more output fromAudioProcessor.getOutput()untilAudioProcessor.flush()has been called and more input has been queued.- Specified by:
- isEndedin interface- AudioProcessor
 
 - 
flushpublic final void flush() Deprecated.Description copied from interface:AudioProcessorClears any buffered data and pending output. If the audio processor is active, also prepares the audio processor to receive a new stream of input in the last configured (pending) format.- Specified by:
- flushin interface- AudioProcessor
 
 - 
resetpublic final void reset() Deprecated.Description copied from interface:AudioProcessorResets the processor to its unconfigured state, releasing any resources.- Specified by:
- resetin interface- AudioProcessor
 
 - 
replaceOutputBufferprotected final ByteBuffer replaceOutputBuffer(int size) Deprecated.Replaces the current output buffer with a buffer of at leastsizebytes and returns it. Callers should write to the returned buffer thenByteBuffer.flip()it so it can be read viagetOutput().
 - 
hasPendingOutputprotected final boolean hasPendingOutput() Deprecated.Returns whether the current output buffer has any data remaining.
 - 
onConfigure@CanIgnoreReturnValue protected AudioProcessor.AudioFormat onConfigure(AudioProcessor.AudioFormat inputAudioFormat) throws AudioProcessor.UnhandledAudioFormatException Deprecated.Called when the processor is configured for a new input format.
 - 
onQueueEndOfStreamprotected void onQueueEndOfStream() Deprecated.Called when the end-of-stream is queued to the processor.
 - 
onFlushprotected void onFlush() Deprecated.Called when the processor is flushed, directly or as part of resetting.
 - 
onResetprotected void onReset() Deprecated.Called when the processor is reset.
 
- 
 
-