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:
Anders Carlsson
2018-06-11 14:57:07 +02:00
committed by Commit Bot
parent 24db1c91a1
commit 80a0a4c482
5 changed files with 8 additions and 68 deletions

View File

@ -29,7 +29,6 @@ public class HardwareVideoDecoderFactory implements VideoDecoderFactory {
private static final String TAG = "HardwareVideoDecoderFactory";
private final EglBase.Context sharedContext;
private final boolean fallbackToSoftware;
/** Creates a HardwareVideoDecoderFactory that does not use surface textures. */
@Deprecated // Not removed yet to avoid breaking callers.
@ -42,12 +41,7 @@ public class HardwareVideoDecoderFactory implements VideoDecoderFactory {
* shared context. The context may be null. If it is null, then surface support is disabled.
*/
public HardwareVideoDecoderFactory(EglBase.Context sharedContext) {
this(sharedContext, true /* fallbackToSoftware */);
}
HardwareVideoDecoderFactory(EglBase.Context sharedContext, boolean fallbackToSoftware) {
this.sharedContext = sharedContext;
this.fallbackToSoftware = fallbackToSoftware;
}
@Nullable
@ -57,15 +51,7 @@ public class HardwareVideoDecoderFactory implements VideoDecoderFactory {
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) {
SoftwareVideoDecoderFactory softwareVideoDecoderFactory = new SoftwareVideoDecoderFactory();
return softwareVideoDecoderFactory.createDecoder(codecType);
} else {
return null;
}
return null;
}
CodecCapabilities capabilities = info.getCapabilitiesForType(type.mimeType());
@ -94,16 +80,6 @@ public class HardwareVideoDecoderFactory implements VideoDecoderFactory {
}
}
// TODO(andersc): This is for backwards compatibility. Remove when clients have migrated to
// new DefaultVideoEncoderFactory.
if (fallbackToSoftware) {
for (VideoCodecInfo info : SoftwareVideoDecoderFactory.supportedCodecs()) {
if (!supportedCodecInfos.contains(info)) {
supportedCodecInfos.add(info);
}
}
}
return supportedCodecInfos.toArray(new VideoCodecInfo[supportedCodecInfos.size()]);
}