2021-06-27 20:44:35 +00:00
|
|
|
package org.webrtc;
|
|
|
|
|
|
|
|
import androidx.annotation.Nullable;
|
2021-11-08 18:25:28 +00:00
|
|
|
import h0.c.s0;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.Arrays;
|
|
|
|
import java.util.LinkedHashSet;
|
|
|
|
import org.webrtc.EglBase;
|
|
|
|
import org.webrtc.VideoEncoderFactory;
|
2022-03-02 20:59:20 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-06-27 20:44:35 +00:00
|
|
|
public class DefaultVideoEncoderFactory implements VideoEncoderFactory {
|
|
|
|
private final VideoEncoderFactory hardwareVideoEncoderFactory;
|
|
|
|
private final VideoEncoderFactory softwareVideoEncoderFactory = new SoftwareVideoEncoderFactory();
|
|
|
|
|
|
|
|
public DefaultVideoEncoderFactory(EglBase.Context context, boolean z2, boolean z3) {
|
|
|
|
this.hardwareVideoEncoderFactory = new HardwareVideoEncoderFactory(context, z2, z3);
|
|
|
|
}
|
|
|
|
|
|
|
|
public DefaultVideoEncoderFactory(VideoEncoderFactory videoEncoderFactory) {
|
|
|
|
this.hardwareVideoEncoderFactory = videoEncoderFactory;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // org.webrtc.VideoEncoderFactory
|
|
|
|
@Nullable
|
|
|
|
public VideoEncoder createEncoder(VideoCodecInfo videoCodecInfo) {
|
|
|
|
VideoEncoder createEncoder = this.softwareVideoEncoderFactory.createEncoder(videoCodecInfo);
|
|
|
|
VideoEncoder createEncoder2 = this.hardwareVideoEncoderFactory.createEncoder(videoCodecInfo);
|
|
|
|
return (createEncoder2 == null || createEncoder == null) ? createEncoder2 != null ? createEncoder2 : createEncoder : new VideoEncoderFallback(createEncoder, createEncoder2);
|
|
|
|
}
|
|
|
|
|
|
|
|
@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() {
|
|
|
|
LinkedHashSet linkedHashSet = new LinkedHashSet();
|
|
|
|
linkedHashSet.addAll(Arrays.asList(this.softwareVideoEncoderFactory.getSupportedCodecs()));
|
|
|
|
linkedHashSet.addAll(Arrays.asList(this.hardwareVideoEncoderFactory.getSupportedCodecs()));
|
|
|
|
return (VideoCodecInfo[]) linkedHashSet.toArray(new VideoCodecInfo[linkedHashSet.size()]);
|
|
|
|
}
|
|
|
|
}
|