Commit c032f806 by kimvde Committed by Tofunmi Adigun-Hameed

Remove B-frame setting from DefaultEncoderFactory

This setting is buggy on some devices (for example sm-n960f)

PiperOrigin-RevId: 529712770
parent 7c28075c
......@@ -547,10 +547,10 @@ public final class DefaultEncoderFactory implements Codec.EncoderFactory {
EncoderUtil.findHighestSupportedEncodingLevel(
encoderInfo, mimeType, expectedEncodingProfile);
if (supportedEncodingLevel != EncoderUtil.LEVEL_UNSET) {
// Use the highest supported profile and use B-frames.
// Use the highest supported profile. Don't configure B-frames, because it doesn't work on
// some devices.
mediaFormat.setInteger(MediaFormat.KEY_PROFILE, expectedEncodingProfile);
mediaFormat.setInteger(MediaFormat.KEY_LEVEL, supportedEncodingLevel);
mediaFormat.setInteger(MediaFormat.KEY_MAX_B_FRAMES, 1);
}
} else if (Util.SDK_INT >= 26) {
int expectedEncodingProfile = MediaCodecInfo.CodecProfileLevel.AVCProfileHigh;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment