Support more QCOM specific color formats for Android HW decoder.
BUG=b/31483393
Review-Url: https://codereview.webrtc.org/2349843002
Cr-Commit-Position: refs/heads/master@{#14359}
diff --git a/webrtc/api/android/java/src/org/webrtc/MediaCodecVideoDecoder.java b/webrtc/api/android/java/src/org/webrtc/MediaCodecVideoDecoder.java
index 9583667..053780b 100644
--- a/webrtc/api/android/java/src/org/webrtc/MediaCodecVideoDecoder.java
+++ b/webrtc/api/android/java/src/org/webrtc/MediaCodecVideoDecoder.java
@@ -78,16 +78,23 @@
// List of supported HW H.264 decoders.
private static final String[] supportedH264HwCodecPrefixes =
{"OMX.qcom.", "OMX.Intel.", "OMX.Exynos." };
+
// NV12 color format supported by QCOM codec, but not declared in MediaCodec -
// see /hardware/qcom/media/mm-core/inc/OMX_QCOMExtns.h
- private static final int
- COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m = 0x7FA30C04;
+ private static final int COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka = 0x7FA30C01;
+ private static final int COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka = 0x7FA30C02;
+ private static final int COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03;
+ private static final int COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m = 0x7FA30C04;
// Allowable color formats supported by codec - in order of preference.
private static final List<Integer> supportedColorList = Arrays.asList(
CodecCapabilities.COLOR_FormatYUV420Planar,
CodecCapabilities.COLOR_FormatYUV420SemiPlanar,
CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar,
+ COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka,
+ COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka,
+ COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka,
COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m);
+
private int colorFormat;
private int width;
private int height;
diff --git a/webrtc/api/android/jni/androidmediacodeccommon.h b/webrtc/api/android/jni/androidmediacodeccommon.h
index 4aa938d..528e166 100644
--- a/webrtc/api/android/jni/androidmediacodeccommon.h
+++ b/webrtc/api/android/jni/androidmediacodeccommon.h
@@ -28,8 +28,10 @@
#define TAG_COMMON "MediaCodecVideo"
-// Color formats supported by encoder - should mirror supportedColorList
-// from MediaCodecVideoEncoder.java
+// Color formats supported by encoder or decoder - should include all
+// colors from supportedColorList in MediaCodecVideoEncoder.java and
+// MediaCodecVideoDecoder.java. Supported color format set in encoder
+// and decoder could be different.
enum COLOR_FORMATTYPE {
COLOR_FormatYUV420Planar = 0x13,
COLOR_FormatYUV420SemiPlanar = 0x15,
@@ -38,6 +40,9 @@
// see /hardware/qcom/media/mm-core/inc/OMX_QCOMExtns.h
// This format is presumably similar to COLOR_FormatYUV420SemiPlanar,
// but requires some (16, 32?) byte alignment.
+ COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka = 0x7FA30C01,
+ COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka = 0x7FA30C02,
+ COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m = 0x7FA30C04
};