mirror of
https://github.com/VibedByKaKi/alexandroid.git
synced 2026-12-06 04:19:23 +01:00
28 lines
1.7 KiB
Java
28 lines
1.7 KiB
Java
package androidx.camera.video.internal.utils;
|
|
|
|
import android.util.Range;
|
|
import android.util.Size;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import androidx.camera.core.impl.EncoderProfilesProxy;
|
|
import androidx.camera.video.internal.config.VideoConfigUtil;
|
|
|
|
/* compiled from: r8-map-id-b9432e0f623b4a4bff4ba50a8a24c4aafad2c1e11092747b9fb5e6a22af5a940 */
|
|
/* loaded from: classes.dex */
|
|
public class EncoderProfilesUtil {
|
|
private EncoderProfilesUtil() {
|
|
}
|
|
|
|
@NonNull
|
|
public static EncoderProfilesProxy.VideoProfileProxy deriveVideoProfile(@NonNull EncoderProfilesProxy.VideoProfileProxy videoProfileProxy, @NonNull Size size, @NonNull Range<Integer> range) {
|
|
return EncoderProfilesProxy.VideoProfileProxy.create(videoProfileProxy.getCodec(), videoProfileProxy.getMediaType(), VideoConfigUtil.scaleAndClampBitrate(videoProfileProxy.getBitrate(), videoProfileProxy.getBitDepth(), videoProfileProxy.getBitDepth(), videoProfileProxy.getFrameRate(), videoProfileProxy.getFrameRate(), size.getWidth(), videoProfileProxy.getWidth(), size.getHeight(), videoProfileProxy.getHeight(), range), videoProfileProxy.getFrameRate(), size.getWidth(), size.getHeight(), videoProfileProxy.getProfile(), videoProfileProxy.getBitDepth(), videoProfileProxy.getChromaSubsampling(), videoProfileProxy.getHdrFormat());
|
|
}
|
|
|
|
@Nullable
|
|
public static EncoderProfilesProxy.VideoProfileProxy getFirstVideoProfile(@Nullable EncoderProfilesProxy encoderProfilesProxy) {
|
|
if (encoderProfilesProxy == null || encoderProfilesProxy.getVideoProfiles().isEmpty()) {
|
|
return null;
|
|
}
|
|
return encoderProfilesProxy.getVideoProfiles().get(0);
|
|
}
|
|
}
|