mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-04 03:28:54 +01:00
62 lines
2 KiB
Java
62 lines
2 KiB
Java
package androidx.camera.video;
|
|
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.annotation.OptIn;
|
|
import androidx.annotation.RestrictTo;
|
|
import com.google.auto.value.AutoValue;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.util.Arrays;
|
|
import java.util.Collections;
|
|
import java.util.HashSet;
|
|
import java.util.Set;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@AutoValue
|
|
/* loaded from: classes.dex */
|
|
public abstract class AudioStats {
|
|
public static final double AUDIO_AMPLITUDE_NONE = 0.0d;
|
|
public static final int AUDIO_STATE_ACTIVE = 0;
|
|
public static final int AUDIO_STATE_DISABLED = 1;
|
|
public static final int AUDIO_STATE_ENCODER_ERROR = 3;
|
|
public static final int AUDIO_STATE_MUTED = 5;
|
|
public static final int AUDIO_STATE_SOURCE_ERROR = 4;
|
|
public static final int AUDIO_STATE_SOURCE_SILENCED = 2;
|
|
private static final Set<Integer> ERROR_STATES = Collections.unmodifiableSet(new HashSet(Arrays.asList(2, 3, 4)));
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
@Retention(RetentionPolicy.SOURCE)
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public @interface AudioState {
|
|
}
|
|
|
|
@NonNull
|
|
public static AudioStats of(int i, @Nullable Throwable th, double d) {
|
|
return new AutoValue_AudioStats(i, d, th);
|
|
}
|
|
|
|
@OptIn(markerClass = {ExperimentalAudioApi.class})
|
|
public double getAudioAmplitude() {
|
|
if (getAudioState() == 1) {
|
|
return 0.0d;
|
|
}
|
|
return getAudioAmplitudeInternal();
|
|
}
|
|
|
|
@RestrictTo({RestrictTo.Scope.LIBRARY})
|
|
public abstract double getAudioAmplitudeInternal();
|
|
|
|
public abstract int getAudioState();
|
|
|
|
@Nullable
|
|
public abstract Throwable getErrorCause();
|
|
|
|
public boolean hasAudio() {
|
|
return getAudioState() == 0;
|
|
}
|
|
|
|
public boolean hasError() {
|
|
return ERROR_STATES.contains(Integer.valueOf(getAudioState()));
|
|
}
|
|
}
|