summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/ACodec.cpp
diff options
context:
space:
mode:
authorLajos Molnar <lajos@google.com>2014-09-25 00:28:22 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-09-25 00:28:23 +0000
commit4a34b9a4759d7dcc2d2ad5bd96ea8477915dd67a (patch)
treef31319bd0657974e241e47e819d2ca62544f5d21 /media/libstagefright/ACodec.cpp
parent70a250ab52079a4d02ff0687c07a73b2bd39feaf (diff)
parentb32ebac7e3afb49b41eeccf130c8a96c1dae85d1 (diff)
downloadframeworks_av-4a34b9a4759d7dcc2d2ad5bd96ea8477915dd67a.zip
frameworks_av-4a34b9a4759d7dcc2d2ad5bd96ea8477915dd67a.tar.gz
frameworks_av-4a34b9a4759d7dcc2d2ad5bd96ea8477915dd67a.tar.bz2
Merge "stagefright: use frame height if slice height is 0" into lmp-dev
Diffstat (limited to 'media/libstagefright/ACodec.cpp')
-rw-r--r--media/libstagefright/ACodec.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/media/libstagefright/ACodec.cpp b/media/libstagefright/ACodec.cpp
index 3c04859..4589ed1 100644
--- a/media/libstagefright/ACodec.cpp
+++ b/media/libstagefright/ACodec.cpp
@@ -2933,13 +2933,6 @@ bool ACodec::describeDefaultColorFormat(DescribeColorFormatParams &params) {
image.mNumPlanes = 0;
const OMX_COLOR_FORMATTYPE fmt = params.eColorFormat;
- // we need stride and slice-height to be non-zero
- if (params.nStride == 0 || params.nSliceHeight == 0) {
- ALOGW("cannot describe color format 0x%x = %d with stride=%u and sliceHeight=%u",
- fmt, fmt, params.nStride, params.nSliceHeight);
- return false;
- }
-
image.mWidth = params.nFrameWidth;
image.mHeight = params.nFrameHeight;
@@ -2952,6 +2945,20 @@ bool ACodec::describeDefaultColorFormat(DescribeColorFormatParams &params) {
return false;
}
+ // TEMPORARY FIX for some vendors that advertise sliceHeight as 0
+ if (params.nStride != 0 && params.nSliceHeight == 0) {
+ ALOGW("using sliceHeight=%u instead of what codec advertised (=0)",
+ params.nFrameHeight);
+ params.nSliceHeight = params.nFrameHeight;
+ }
+
+ // we need stride and slice-height to be non-zero
+ if (params.nStride == 0 || params.nSliceHeight == 0) {
+ ALOGW("cannot describe color format 0x%x = %d with stride=%u and sliceHeight=%u",
+ fmt, fmt, params.nStride, params.nSliceHeight);
+ return false;
+ }
+
// set-up YUV format
image.mType = MediaImage::MEDIA_IMAGE_TYPE_YUV;
image.mNumPlanes = 3;