Enable Android H264 High profile decoder

Based on Magnus's
https://codereview.webrtc.org/2646423002/

BUG=webrtc:6337

Review-Url: https://codereview.webrtc.org/2654003005
Cr-Commit-Position: refs/heads/master@{#16332}
This commit is contained in:
glaznev
2017-01-27 12:24:24 -08:00
committed by Commit bot
parent 62a5dd2181
commit 0c1d060b24
3 changed files with 39 additions and 2 deletions

View File

@ -73,6 +73,8 @@ public class MediaCodecVideoDecoder {
// List of supported HW H.264 decoders.
private static final String[] supportedH264HwCodecPrefixes = {
"OMX.qcom.", "OMX.Intel.", "OMX.Exynos."};
// List of supported HW H.264 high profile decoders.
private static final String[] supportedH264HighProfileHwCodecPrefixes = {"OMX.qcom."};
// NV12 color format supported by QCOM codec, but not declared in MediaCodec -
// see /hardware/qcom/media/mm-core/inc/OMX_QCOMExtns.h
@ -149,6 +151,12 @@ public class MediaCodecVideoDecoder {
&& (findDecoder(H264_MIME_TYPE, supportedH264HwCodecPrefixes) != null);
}
public static boolean isH264HighProfileHwSupported() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
&& !hwDecoderDisabledTypes.contains(H264_MIME_TYPE)
&& (findDecoder(H264_MIME_TYPE, supportedH264HighProfileHwCodecPrefixes) != null);
}
public static void printStackTrace() {
if (runningInstance != null && runningInstance.mediaCodecThread != null) {
StackTraceElement[] mediaCodecStackTraces = runningInstance.mediaCodecThread.getStackTrace();