diff options
Diffstat (limited to 'sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java')
-rw-r--r-- | sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java b/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java index 7abe3505a6..c59db3b47b 100644 --- a/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java +++ b/sdk/android/api/org/webrtc/SoftwareVideoDecoderFactory.java @@ -16,22 +16,22 @@ import java.util.HashMap; import java.util.List; public class SoftwareVideoDecoderFactory implements VideoDecoderFactory { - @Deprecated @Nullable @Override - public VideoDecoder createDecoder(String codecType) { - return createDecoder(new VideoCodecInfo(codecType, new HashMap<>())); - } + public VideoDecoder createDecoder(VideoCodecInfo codecInfo) { + String codecName = codecInfo.getName(); - @Nullable - @Override - public VideoDecoder createDecoder(VideoCodecInfo codecType) { - if (codecType.getName().equalsIgnoreCase("VP8")) { + if (codecName.equalsIgnoreCase(VideoCodecMimeType.VP8.toSdpCodecName())) { return new LibvpxVp8Decoder(); } - if (codecType.getName().equalsIgnoreCase("VP9") && LibvpxVp9Decoder.nativeIsSupported()) { + if (codecName.equalsIgnoreCase(VideoCodecMimeType.VP9.toSdpCodecName()) + && LibvpxVp9Decoder.nativeIsSupported()) { return new LibvpxVp9Decoder(); } + if (codecName.equalsIgnoreCase(VideoCodecMimeType.AV1.toSdpCodecName()) + && LibaomAv1Decoder.nativeIsSupported()) { + return new LibaomAv1Decoder(); + } return null; } @@ -44,9 +44,12 @@ public class SoftwareVideoDecoderFactory implements VideoDecoderFactory { 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 (LibvpxVp9Decoder.nativeIsSupported()) { - codecs.add(new VideoCodecInfo("VP9", new HashMap<>())); + codecs.add(new VideoCodecInfo(VideoCodecMimeType.VP9.toSdpCodecName(), new HashMap<>())); + } + if (LibaomAv1Decoder.nativeIsSupported()) { + codecs.add(new VideoCodecInfo(VideoCodecMimeType.AV1.toSdpCodecName(), new HashMap<>())); } return codecs.toArray(new VideoCodecInfo[codecs.size()]); |