Remove VisibleForTesting visibility in 8k workaround.
PiperOrigin-RevId: 550843914
This commit is contained in:
parent
465e7c1277
commit
35bee3299c
@ -21,7 +21,7 @@ import static androidx.media3.common.MimeTypes.VIDEO_H264;
|
|||||||
import static androidx.media3.common.MimeTypes.VIDEO_H265;
|
import static androidx.media3.common.MimeTypes.VIDEO_H265;
|
||||||
import static androidx.media3.common.util.Assertions.checkNotNull;
|
import static androidx.media3.common.util.Assertions.checkNotNull;
|
||||||
import static androidx.media3.common.util.Assertions.checkState;
|
import static androidx.media3.common.util.Assertions.checkState;
|
||||||
import static androidx.media3.transformer.DefaultDecoderFactory.deviceNeedsDisableDecoding8kWorkaround;
|
import static androidx.media3.common.util.Util.SDK_INT;
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.graphics.Bitmap;
|
import android.graphics.Bitmap;
|
||||||
@ -855,7 +855,18 @@ public final class AndroidTestUtil {
|
|||||||
mediaFormat, MediaFormat.KEY_PROFILE, codecProfileAndLevel.first);
|
mediaFormat, MediaFormat.KEY_PROFILE, codecProfileAndLevel.first);
|
||||||
}
|
}
|
||||||
return EncoderUtil.findCodecForFormat(mediaFormat, /* isDecoder= */ true) != null
|
return EncoderUtil.findCodecForFormat(mediaFormat, /* isDecoder= */ true) != null
|
||||||
&& !deviceNeedsDisableDecoding8kWorkaround(format);
|
&& !deviceNeedsDisable8kWorkaround(format);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean deviceNeedsDisable8kWorkaround(Format format) {
|
||||||
|
// Fixed on API 31+. See http://b/278234847#comment40 for more information.
|
||||||
|
// Duplicate of DefaultDecoderFactory#deviceNeedsDisable8kWorkaround.
|
||||||
|
return SDK_INT < 31
|
||||||
|
&& format.width >= 7680
|
||||||
|
&& format.height >= 4320
|
||||||
|
&& format.sampleMimeType != null
|
||||||
|
&& format.sampleMimeType.equals(MimeTypes.VIDEO_H265)
|
||||||
|
&& (Util.MODEL.equals("SM-F711U1") || Util.MODEL.equals("SM-F926U1"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean canEncode(Format format) {
|
private static boolean canEncode(Format format) {
|
||||||
|
@ -114,7 +114,7 @@ public final class DefaultDecoderFactory implements Codec.DecoderFactory {
|
|||||||
format, /* reason= */ "Decoding HDR is not supported on this device.");
|
format, /* reason= */ "Decoding HDR is not supported on this device.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (deviceNeedsDisableDecoding8kWorkaround(format)) {
|
if (deviceNeedsDisable8kWorkaround(format)) {
|
||||||
throw createExportException(
|
throw createExportException(
|
||||||
format, /* reason= */ "Decoding 8k is not supported on this device.");
|
format, /* reason= */ "Decoding 8k is not supported on this device.");
|
||||||
}
|
}
|
||||||
@ -159,8 +159,7 @@ public final class DefaultDecoderFactory implements Codec.DecoderFactory {
|
|||||||
context, format, mediaFormat, mediaCodecName, /* isDecoder= */ true, outputSurface);
|
context, format, mediaFormat, mediaCodecName, /* isDecoder= */ true, outputSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
@VisibleForTesting
|
private static boolean deviceNeedsDisable8kWorkaround(Format format) {
|
||||||
public static boolean deviceNeedsDisableDecoding8kWorkaround(Format format) {
|
|
||||||
// Fixed on API 31+. See http://b/278234847#comment40 for more information.
|
// Fixed on API 31+. See http://b/278234847#comment40 for more information.
|
||||||
return SDK_INT < 31
|
return SDK_INT < 31
|
||||||
&& format.width >= 7680
|
&& format.width >= 7680
|
||||||
|
Loading…
x
Reference in New Issue
Block a user