45 lines
1.5 KiB
Java
45 lines
1.5 KiB
Java
package org.webrtc;
|
|
|
|
import androidx.annotation.Nullable;
|
|
import h0.c.s0;
|
|
import java.util.ArrayList;
|
|
import java.util.HashMap;
|
|
import org.webrtc.VideoEncoderFactory;
|
|
public class SoftwareVideoEncoderFactory implements VideoEncoderFactory {
|
|
public static VideoCodecInfo[] supportedCodecs() {
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add(new VideoCodecInfo("VP8", new HashMap()));
|
|
if (LibvpxVp9Encoder.nativeIsSupported()) {
|
|
arrayList.add(new VideoCodecInfo("VP9", new HashMap()));
|
|
}
|
|
return (VideoCodecInfo[]) arrayList.toArray(new VideoCodecInfo[arrayList.size()]);
|
|
}
|
|
|
|
@Override // org.webrtc.VideoEncoderFactory
|
|
@Nullable
|
|
public VideoEncoder createEncoder(VideoCodecInfo videoCodecInfo) {
|
|
if (videoCodecInfo.name.equalsIgnoreCase("VP8")) {
|
|
return new LibvpxVp8Encoder();
|
|
}
|
|
if (!videoCodecInfo.name.equalsIgnoreCase("VP9") || !LibvpxVp9Encoder.nativeIsSupported()) {
|
|
return null;
|
|
}
|
|
return new LibvpxVp9Encoder();
|
|
}
|
|
|
|
@Override // org.webrtc.VideoEncoderFactory
|
|
public /* synthetic */ VideoEncoderFactory.VideoEncoderSelector getEncoderSelector() {
|
|
return s0.a(this);
|
|
}
|
|
|
|
@Override // org.webrtc.VideoEncoderFactory
|
|
public /* synthetic */ VideoCodecInfo[] getImplementations() {
|
|
return s0.b(this);
|
|
}
|
|
|
|
@Override // org.webrtc.VideoEncoderFactory
|
|
public VideoCodecInfo[] getSupportedCodecs() {
|
|
return supportedCodecs();
|
|
}
|
|
}
|