2021-06-27 20:44:35 +00:00
|
|
|
package org.webrtc;
|
|
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-06-27 20:44:35 +00:00
|
|
|
public class SoftwareVideoDecoderFactory implements VideoDecoderFactory {
|
|
|
|
public static VideoCodecInfo[] supportedCodecs() {
|
|
|
|
ArrayList arrayList = new ArrayList();
|
|
|
|
arrayList.add(new VideoCodecInfo("VP8", new HashMap()));
|
|
|
|
if (LibvpxVp9Decoder.nativeIsSupported()) {
|
|
|
|
arrayList.add(new VideoCodecInfo("VP9", new HashMap()));
|
|
|
|
}
|
|
|
|
return (VideoCodecInfo[]) arrayList.toArray(new VideoCodecInfo[arrayList.size()]);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // org.webrtc.VideoDecoderFactory
|
|
|
|
@Nullable
|
|
|
|
@Deprecated
|
|
|
|
public VideoDecoder createDecoder(String str) {
|
|
|
|
return createDecoder(new VideoCodecInfo(str, new HashMap()));
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // org.webrtc.VideoDecoderFactory
|
|
|
|
@Nullable
|
|
|
|
public VideoDecoder createDecoder(VideoCodecInfo videoCodecInfo) {
|
|
|
|
if (videoCodecInfo.getName().equalsIgnoreCase("VP8")) {
|
|
|
|
return new LibvpxVp8Decoder();
|
|
|
|
}
|
|
|
|
if (!videoCodecInfo.getName().equalsIgnoreCase("VP9") || !LibvpxVp9Decoder.nativeIsSupported()) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
return new LibvpxVp9Decoder();
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // org.webrtc.VideoDecoderFactory
|
|
|
|
public VideoCodecInfo[] getSupportedCodecs() {
|
|
|
|
return supportedCodecs();
|
|
|
|
}
|
|
|
|
}
|