Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Side by Side Diff: webrtc/api/android/java/src/org/webrtc/MediaCodecVideoDecoder.java

Issue 2349843002: Support more QCOM specific color formats for Android HW decoder. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright 2014 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 private static final String H264_MIME_TYPE = "video/avc"; 71 private static final String H264_MIME_TYPE = "video/avc";
72 // List of supported HW VP8 decoders. 72 // List of supported HW VP8 decoders.
73 private static final String[] supportedVp8HwCodecPrefixes = 73 private static final String[] supportedVp8HwCodecPrefixes =
74 {"OMX.qcom.", "OMX.Nvidia.", "OMX.Exynos.", "OMX.Intel." }; 74 {"OMX.qcom.", "OMX.Nvidia.", "OMX.Exynos.", "OMX.Intel." };
75 // List of supported HW VP9 decoders. 75 // List of supported HW VP9 decoders.
76 private static final String[] supportedVp9HwCodecPrefixes = 76 private static final String[] supportedVp9HwCodecPrefixes =
77 {"OMX.qcom.", "OMX.Exynos." }; 77 {"OMX.qcom.", "OMX.Exynos." };
78 // List of supported HW H.264 decoders. 78 // List of supported HW H.264 decoders.
79 private static final String[] supportedH264HwCodecPrefixes = 79 private static final String[] supportedH264HwCodecPrefixes =
80 {"OMX.qcom.", "OMX.Intel.", "OMX.Exynos." }; 80 {"OMX.qcom.", "OMX.Intel.", "OMX.Exynos." };
81
81 // NV12 color format supported by QCOM codec, but not declared in MediaCodec - 82 // NV12 color format supported by QCOM codec, but not declared in MediaCodec -
82 // see /hardware/qcom/media/mm-core/inc/OMX_QCOMExtns.h 83 // see /hardware/qcom/media/mm-core/inc/OMX_QCOMExtns.h
83 private static final int 84 private static final int COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka = 0x7FA 30C01;
84 COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m = 0x7FA30C04; 85 private static final int COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka = 0x7FA 30C02;
86 private static final int COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03;
87 private static final int COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m = 0x7FA30C 04;
85 // Allowable color formats supported by codec - in order of preference. 88 // Allowable color formats supported by codec - in order of preference.
86 private static final List<Integer> supportedColorList = Arrays.asList( 89 private static final List<Integer> supportedColorList = Arrays.asList(
87 CodecCapabilities.COLOR_FormatYUV420Planar, 90 CodecCapabilities.COLOR_FormatYUV420Planar,
88 CodecCapabilities.COLOR_FormatYUV420SemiPlanar, 91 CodecCapabilities.COLOR_FormatYUV420SemiPlanar,
89 CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar, 92 CodecCapabilities.COLOR_QCOM_FormatYUV420SemiPlanar,
93 COLOR_QCOM_FORMATYVU420PackedSemiPlanar32m4ka,
94 COLOR_QCOM_FORMATYVU420PackedSemiPlanar16m4ka,
95 COLOR_QCOM_FORMATYVU420PackedSemiPlanar64x32Tile2m8ka,
90 COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m); 96 COLOR_QCOM_FORMATYUV420PackedSemiPlanar32m);
97
91 private int colorFormat; 98 private int colorFormat;
92 private int width; 99 private int width;
93 private int height; 100 private int height;
94 private int stride; 101 private int stride;
95 private int sliceHeight; 102 private int sliceHeight;
96 private boolean hasDecodedFirstFrame; 103 private boolean hasDecodedFirstFrame;
97 private final Queue<TimeStamps> decodeStartTimeMs = new LinkedList<TimeStamps> (); 104 private final Queue<TimeStamps> decodeStartTimeMs = new LinkedList<TimeStamps> ();
98 private boolean useSurface; 105 private boolean useSurface;
99 106
100 // The below variables are only used when decoding to a Surface. 107 // The below variables are only used when decoding to a Surface.
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after
713 // MediaCodec.CodecException upon codec error. 720 // MediaCodec.CodecException upon codec error.
714 private void returnDecodedOutputBuffer(int index) 721 private void returnDecodedOutputBuffer(int index)
715 throws IllegalStateException, MediaCodec.CodecException { 722 throws IllegalStateException, MediaCodec.CodecException {
716 checkOnMediaCodecThread(); 723 checkOnMediaCodecThread();
717 if (useSurface) { 724 if (useSurface) {
718 throw new IllegalStateException("returnDecodedOutputBuffer() called for su rface decoding."); 725 throw new IllegalStateException("returnDecodedOutputBuffer() called for su rface decoding.");
719 } 726 }
720 mediaCodec.releaseOutputBuffer(index, false /* render */); 727 mediaCodec.releaseOutputBuffer(index, false /* render */);
721 } 728 }
722 } 729 }
OLDNEW
« no previous file with comments | « no previous file | webrtc/api/android/jni/androidmediacodeccommon.h » ('j') | webrtc/api/android/jni/androidmediacodeccommon.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698