Only allow MediaTek H264 HW Codec for O_MR1 or later

Bug: webrtc:8761
Change-Id: I3e5a1d97a5e89cb95bb94c2e892be1f3e63e9383
Reviewed-on: https://webrtc-review.googlesource.com/48200
Reviewed-by: Alex Glaznev <glaznev@webrtc.org>
Commit-Queue: Sami Kalliomäki <sakal@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#21900}
This commit is contained in:
Alex Leung
2018-02-05 13:42:48 -08:00
committed by Commit Bot
parent 57daeb7ac7
commit 28e710798e
2 changed files with 4 additions and 4 deletions

View File

@ -104,7 +104,7 @@ public class MediaCodecVideoDecoder {
supportedPrefixes.add("OMX.Intel.");
supportedPrefixes.add("OMX.Exynos.");
if (PeerConnectionFactory.fieldTrialsFindFullName("WebRTC-MediaTekH264").equals("Enabled")
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1) {
supportedPrefixes.add("OMX.MTK.");
}
return supportedPrefixes.toArray(new String[supportedPrefixes.size()]);
@ -210,9 +210,9 @@ public class MediaCodecVideoDecoder {
!= null) {
return true;
}
// Support H.264 HP decoding on MediaTek chips for Android O and above
// Support H.264 HP decoding on MediaTek chips for Android O_MR1 and above
if (PeerConnectionFactory.fieldTrialsFindFullName("WebRTC-MediaTekH264").equals("Enabled")
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
&& Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1
&& findDecoder(H264_MIME_TYPE, new String[] {supportedMediaTekH264HighProfileHwCodecPrefix})
!= null) {
return true;

View File

@ -177,7 +177,7 @@ public class MediaCodecVideoEncoder {
private static final MediaCodecProperties exynosH264HwProperties = new MediaCodecProperties(
"OMX.Exynos.", Build.VERSION_CODES.LOLLIPOP, BitrateAdjustmentType.FRAMERATE_ADJUSTMENT);
private static final MediaCodecProperties mediatekH264HwProperties = new MediaCodecProperties(
"OMX.MTK.", Build.VERSION_CODES.O, BitrateAdjustmentType.FRAMERATE_ADJUSTMENT);
"OMX.MTK.", Build.VERSION_CODES.O_MR1, BitrateAdjustmentType.FRAMERATE_ADJUSTMENT);
private static final MediaCodecProperties[] h264HwList() {
final ArrayList<MediaCodecProperties> supported_codecs = new ArrayList<MediaCodecProperties>();
supported_codecs.add(qcomH264HwProperties);