diff options
Diffstat (limited to 'sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java')
-rw-r--r-- | sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java b/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java index ed70d228ef..4de39dcdba 100644 --- a/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java +++ b/sdk/android/api/org/webrtc/SoftwareVideoEncoderFactory.java @@ -18,13 +18,20 @@ import java.util.List; public class SoftwareVideoEncoderFactory implements VideoEncoderFactory { @Nullable @Override - public VideoEncoder createEncoder(VideoCodecInfo info) { - if (info.name.equalsIgnoreCase("VP8")) { + public VideoEncoder createEncoder(VideoCodecInfo codecInfo) { + String codecName = codecInfo.getName(); + + if (codecName.equalsIgnoreCase(VideoCodecMimeType.VP8.toSdpCodecName())) { return new LibvpxVp8Encoder(); } - if (info.name.equalsIgnoreCase("VP9") && LibvpxVp9Encoder.nativeIsSupported()) { + if (codecName.equalsIgnoreCase(VideoCodecMimeType.VP9.toSdpCodecName()) + && LibvpxVp9Encoder.nativeIsSupported()) { return new LibvpxVp9Encoder(); } + if (codecName.equalsIgnoreCase(VideoCodecMimeType.AV1.toSdpCodecName()) + && LibaomAv1Encoder.nativeIsSupported()) { + return new LibaomAv1Encoder(); + } return null; } @@ -37,9 +44,12 @@ public class SoftwareVideoEncoderFactory implements VideoEncoderFactory { static VideoCodecInfo[] supportedCodecs() { List<VideoCodecInfo> codecs = new ArrayList<VideoCodecInfo>(); - codecs.add(new VideoCodecInfo("VP8", new HashMap<>())); + codecs.add(new VideoCodecInfo(VideoCodecMimeType.VP8.toSdpCodecName(), new HashMap<>())); if (LibvpxVp9Encoder.nativeIsSupported()) { - codecs.add(new VideoCodecInfo("VP9", new HashMap<>())); + codecs.add(new VideoCodecInfo(VideoCodecMimeType.VP9.toSdpCodecName(), new HashMap<>())); + } + if (LibaomAv1Encoder.nativeIsSupported()) { + codecs.add(new VideoCodecInfo(VideoCodecMimeType.AV1.toSdpCodecName(), new HashMap<>())); } return codecs.toArray(new VideoCodecInfo[codecs.size()]); |