Rabbit-R1/android (non root)/java/sources/androidx/media3/common/audio/AudioProcessor.java
2024-05-21 17:08:36 -04:00

73 lines
2.4 KiB
Java

package androidx.media3.common.audio;
import androidx.media3.common.util.Util;
import com.google.common.base.Objects;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
/* loaded from: classes2.dex */
public interface AudioProcessor {
public static final ByteBuffer EMPTY_BUFFER = ByteBuffer.allocateDirect(0).order(ByteOrder.nativeOrder());
AudioFormat configure(AudioFormat audioFormat) throws UnhandledAudioFormatException;
void flush();
ByteBuffer getOutput();
boolean isActive();
boolean isEnded();
void queueEndOfStream();
void queueInput(ByteBuffer byteBuffer);
void reset();
/* loaded from: classes2.dex */
public static final class AudioFormat {
public static final AudioFormat NOT_SET = new AudioFormat(-1, -1, -1);
public final int bytesPerFrame;
public final int channelCount;
public final int encoding;
public final int sampleRate;
public AudioFormat(int i, int i2, int i3) {
this.sampleRate = i;
this.channelCount = i2;
this.encoding = i3;
this.bytesPerFrame = Util.isEncodingLinearPcm(i3) ? Util.getPcmFrameSize(i3, i2) : -1;
}
public String toString() {
return "AudioFormat[sampleRate=" + this.sampleRate + ", channelCount=" + this.channelCount + ", encoding=" + this.encoding + ']';
}
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (!(obj instanceof AudioFormat)) {
return false;
}
AudioFormat audioFormat = (AudioFormat) obj;
return this.sampleRate == audioFormat.sampleRate && this.channelCount == audioFormat.channelCount && this.encoding == audioFormat.encoding;
}
public int hashCode() {
return Objects.hashCode(Integer.valueOf(this.sampleRate), Integer.valueOf(this.channelCount), Integer.valueOf(this.encoding));
}
}
/* loaded from: classes2.dex */
public static final class UnhandledAudioFormatException extends Exception {
public UnhandledAudioFormatException(AudioFormat audioFormat) {
this("Unhandled input format:", audioFormat);
}
public UnhandledAudioFormatException(String str, AudioFormat audioFormat) {
super(str + " " + audioFormat);
}
}
}