mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Transformer: Add 8k disabling workaround to avoid timeouts.
PiperOrigin-RevId: 545970477
This commit is contained in:
parent
bdbf3e29a1
commit
99a143a74e
1 changed files with 14 additions and 0 deletions
|
|
@ -132,6 +132,10 @@ 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 (deviceNeedsDisable8kWorkaround(format)) {
|
||||||
|
throw createExportException(
|
||||||
|
format, /* reason= */ "Decoding 8k is not supported on this device.");
|
||||||
|
}
|
||||||
|
|
||||||
MediaFormat mediaFormat = createMediaFormatFromFormat(format);
|
MediaFormat mediaFormat = createMediaFormatFromFormat(format);
|
||||||
if (decoderSupportsKeyAllowFrameDrop) {
|
if (decoderSupportsKeyAllowFrameDrop) {
|
||||||
|
|
@ -173,6 +177,16 @@ public final class DefaultDecoderFactory implements Codec.DecoderFactory {
|
||||||
return Pair.create(mediaFormat, mediaCodecName);
|
return Pair.create(mediaFormat, mediaCodecName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean deviceNeedsDisable8kWorkaround(Format format) {
|
||||||
|
// Fixed on API 31+. See http://b/278234847#comment40 for more information.
|
||||||
|
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 deviceNeedsDisableToneMappingWorkaround(
|
private static boolean deviceNeedsDisableToneMappingWorkaround(
|
||||||
@C.ColorTransfer int colorTransfer) {
|
@C.ColorTransfer int colorTransfer) {
|
||||||
if (Util.MANUFACTURER.equals("Google") && Build.ID.startsWith("TP1A")) {
|
if (Util.MANUFACTURER.equals("Google") && Build.ID.startsWith("TP1A")) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue