Use Android Q API to test if MediaCodecInfo is HW Accelerated
Also, add the prefix of SW Codecs in Codec2.0. Bug: None Change-Id: Ifc7a079a68506975cd9e52ddaf6da69744ac0614 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/177800 Reviewed-by: Sami Kalliomäki <sakal@webrtc.org> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#31723}
This commit is contained in:

committed by
Commit Bot

parent
84bb634238
commit
80d2159ff4
@ -18,18 +18,9 @@ import java.util.Arrays;
|
||||
public class HardwareVideoDecoderFactory extends MediaCodecVideoDecoderFactory {
|
||||
private final static Predicate<MediaCodecInfo> defaultAllowedPredicate =
|
||||
new Predicate<MediaCodecInfo>() {
|
||||
private String[] prefixBlocklist =
|
||||
Arrays.copyOf(MediaCodecUtils.SOFTWARE_IMPLEMENTATION_PREFIXES,
|
||||
MediaCodecUtils.SOFTWARE_IMPLEMENTATION_PREFIXES.length);
|
||||
@Override
|
||||
public boolean test(MediaCodecInfo arg) {
|
||||
final String name = arg.getName();
|
||||
for (String prefix : prefixBlocklist) {
|
||||
if (name.startsWith(prefix)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return MediaCodecUtils.isHardwareAccelerated(arg);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user