Remove software fallback in Android hardware codec factories.
Remove backwards compatiblity. Users who need software codecs should migrate to the DefaultVideoCodecFactories. Bug: webrtc:7925 Change-Id: Ifb41c9511d53c17c83222422c221b595bc056cb2 Reviewed-on: https://webrtc-review.googlesource.com/82920 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Anders Carlsson <andersc@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23563}
This commit is contained in:

committed by
Commit Bot

parent
24db1c91a1
commit
80a0a4c482
@ -42,16 +42,9 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||
@Nullable private final EglBase14.Context sharedContext;
|
||||
private final boolean enableIntelVp8Encoder;
|
||||
private final boolean enableH264HighProfile;
|
||||
private final boolean fallbackToSoftware;
|
||||
|
||||
public HardwareVideoEncoderFactory(
|
||||
EglBase.Context sharedContext, boolean enableIntelVp8Encoder, boolean enableH264HighProfile) {
|
||||
this(
|
||||
sharedContext, enableIntelVp8Encoder, enableH264HighProfile, true /* fallbackToSoftware */);
|
||||
}
|
||||
|
||||
HardwareVideoEncoderFactory(EglBase.Context sharedContext, boolean enableIntelVp8Encoder,
|
||||
boolean enableH264HighProfile, boolean fallbackToSoftware) {
|
||||
// Texture mode requires EglBase14.
|
||||
if (sharedContext instanceof EglBase14.Context) {
|
||||
this.sharedContext = (EglBase14.Context) sharedContext;
|
||||
@ -61,7 +54,6 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||
}
|
||||
this.enableIntelVp8Encoder = enableIntelVp8Encoder;
|
||||
this.enableH264HighProfile = enableH264HighProfile;
|
||||
this.fallbackToSoftware = fallbackToSoftware;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
@ -76,15 +68,7 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||
MediaCodecInfo info = findCodecForType(type);
|
||||
|
||||
if (info == null) {
|
||||
// No hardware support for this type.
|
||||
// TODO(andersc): This is for backwards compatibility. Remove when clients have migrated to
|
||||
// new DefaultVideoEncoderFactory.
|
||||
if (fallbackToSoftware) {
|
||||
SoftwareVideoEncoderFactory softwareVideoEncoderFactory = new SoftwareVideoEncoderFactory();
|
||||
return softwareVideoEncoderFactory.createEncoder(input);
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
String codecName = info.getName();
|
||||
@ -133,16 +117,6 @@ public class HardwareVideoEncoderFactory implements VideoEncoderFactory {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(andersc): This is for backwards compatibility. Remove when clients have migrated to
|
||||
// new DefaultVideoEncoderFactory.
|
||||
if (fallbackToSoftware) {
|
||||
for (VideoCodecInfo info : SoftwareVideoEncoderFactory.supportedCodecs()) {
|
||||
if (!supportedCodecInfos.contains(info)) {
|
||||
supportedCodecInfos.add(info);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return supportedCodecInfos.toArray(new VideoCodecInfo[supportedCodecInfos.size()]);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user