| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2017 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 MediaCodecUtils.COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka, | 41 MediaCodecUtils.COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka, |
| 42 MediaCodecUtils.COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m}; | 42 MediaCodecUtils.COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m}; |
| 43 | 43 |
| 44 // Color formats supported by hardware encoder - in order of preference. | 44 // Color formats supported by hardware encoder - in order of preference. |
| 45 static final int[] ENCODER_COLOR_FORMATS = { | 45 static final int[] ENCODER_COLOR_FORMATS = { |
| 46 MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar, | 46 MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420Planar, |
| 47 MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar, | 47 MediaCodecInfo.CodecCapabilities.COLOR_FormatYUV420SemiPlanar, |
| 48 MediaCodecInfo.CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar, | 48 MediaCodecInfo.CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar, |
| 49 MediaCodecUtils.COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m}; | 49 MediaCodecUtils.COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m}; |
| 50 | 50 |
| 51 // Color formats supported by texture mode encoding - in order of preference. |
| 52 static final int[] TEXTURE_COLOR_FORMATS = {MediaCodecInfo.CodecCapabilities.C
OLOR_FormatSurface}; |
| 53 |
| 51 static Integer selectColorFormat(int[] supportedColorFormats, CodecCapabilitie
s capabilities) { | 54 static Integer selectColorFormat(int[] supportedColorFormats, CodecCapabilitie
s capabilities) { |
| 52 for (int supportedColorFormat : supportedColorFormats) { | 55 for (int supportedColorFormat : supportedColorFormats) { |
| 53 for (int codecColorFormat : capabilities.colorFormats) { | 56 for (int codecColorFormat : capabilities.colorFormats) { |
| 54 if (codecColorFormat == supportedColorFormat) { | 57 if (codecColorFormat == supportedColorFormat) { |
| 55 return codecColorFormat; | 58 return codecColorFormat; |
| 56 } | 59 } |
| 57 } | 60 } |
| 58 } | 61 } |
| 59 return null; | 62 return null; |
| 60 } | 63 } |
| 61 | 64 |
| 62 static boolean codecSupportsType(MediaCodecInfo info, VideoCodecType type) { | 65 static boolean codecSupportsType(MediaCodecInfo info, VideoCodecType type) { |
| 63 for (String mimeType : info.getSupportedTypes()) { | 66 for (String mimeType : info.getSupportedTypes()) { |
| 64 if (type.mimeType().equals(mimeType)) { | 67 if (type.mimeType().equals(mimeType)) { |
| 65 return true; | 68 return true; |
| 66 } | 69 } |
| 67 } | 70 } |
| 68 return false; | 71 return false; |
| 69 } | 72 } |
| 70 | 73 |
| 71 private MediaCodecUtils() { | 74 private MediaCodecUtils() { |
| 72 // This class should not be instantiated. | 75 // This class should not be instantiated. |
| 73 } | 76 } |
| 74 } | 77 } |
| OLD | NEW |