alexandroid/decompiled/jadx/sources/androidx/camera/video/internal/DynamicRangeMatchedEncoderProfilesProvider.java
KaKi87 a47fad5135 📦 Add decompiled Alexa 2.2.730155.0 (jadx, apktool, Hermes strings)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-07 00:04:16 +01:00

65 lines
2.9 KiB
Java

package androidx.camera.video.internal;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.camera.core.DynamicRange;
import androidx.camera.core.impl.EncoderProfilesProvider;
import androidx.camera.core.impl.EncoderProfilesProxy;
import androidx.camera.video.internal.utils.DynamicRangeUtil;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
/* loaded from: classes.dex */
public class DynamicRangeMatchedEncoderProfilesProvider implements EncoderProfilesProvider {
private final DynamicRange mDynamicRange;
private final Map<Integer, EncoderProfilesProxy> mEncoderProfilesCache = new HashMap();
private final EncoderProfilesProvider mEncoderProfilesProvider;
public DynamicRangeMatchedEncoderProfilesProvider(@NonNull EncoderProfilesProvider encoderProfilesProvider, @NonNull DynamicRange dynamicRange) {
this.mEncoderProfilesProvider = encoderProfilesProvider;
this.mDynamicRange = dynamicRange;
}
@Nullable
private static EncoderProfilesProxy filterUnmatchedDynamicRange(@Nullable EncoderProfilesProxy encoderProfilesProxy, @NonNull DynamicRange dynamicRange) {
if (encoderProfilesProxy == null) {
return null;
}
ArrayList arrayList = new ArrayList();
for (EncoderProfilesProxy.VideoProfileProxy videoProfileProxy : encoderProfilesProxy.getVideoProfiles()) {
if (DynamicRangeUtil.isHdrSettingsMatched(videoProfileProxy, dynamicRange)) {
arrayList.add(videoProfileProxy);
}
}
if (arrayList.isEmpty()) {
return null;
}
return EncoderProfilesProxy.ImmutableEncoderProfilesProxy.create(encoderProfilesProxy.getDefaultDurationSeconds(), encoderProfilesProxy.getRecommendedFileFormat(), encoderProfilesProxy.getAudioProfiles(), arrayList);
}
@Nullable
private EncoderProfilesProxy getProfilesInternal(int i) {
if (this.mEncoderProfilesCache.containsKey(Integer.valueOf(i))) {
return this.mEncoderProfilesCache.get(Integer.valueOf(i));
}
if (!this.mEncoderProfilesProvider.hasProfile(i)) {
return null;
}
EncoderProfilesProxy filterUnmatchedDynamicRange = filterUnmatchedDynamicRange(this.mEncoderProfilesProvider.getAll(i), this.mDynamicRange);
this.mEncoderProfilesCache.put(Integer.valueOf(i), filterUnmatchedDynamicRange);
return filterUnmatchedDynamicRange;
}
@Override // androidx.camera.core.impl.EncoderProfilesProvider
@Nullable
public EncoderProfilesProxy getAll(int i) {
return getProfilesInternal(i);
}
@Override // androidx.camera.core.impl.EncoderProfilesProvider
public boolean hasProfile(int i) {
return this.mEncoderProfilesProvider.hasProfile(i) && getProfilesInternal(i) != null;
}
}