aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianmi Chen <tianmi.chen@intel.com>2015-07-10 08:38:07 +0800
committerPatrick Tjin <pattjin@google.com>2015-07-15 21:55:05 -0700
commitbaa033a1fcf511bd575c94cbd8a839c4c87a699e (patch)
tree81c03ebed6c0a8bdbd117137e1a52acac4b64fa0
parentd22539f0a4952ec4a631d603a6e737d98ea16ea0 (diff)
downloadandroid_hardware_intel_common_omx-components-baa033a1fcf511bd575c94cbd8a839c4c87a699e.tar.gz
android_hardware_intel_common_omx-components-baa033a1fcf511bd575c94cbd8a839c4c87a699e.tar.bz2
android_hardware_intel_common_omx-components-baa033a1fcf511bd575c94cbd8a839c4c87a699e.zip
correctly set SW_USAGE for HW codecs
this is to explicitly declare the capability to allow apps to read/write the video buffer. gralloc module will manage the cache flushing better when usage flags align between alloc() and lock(). Bug: 22183821 Change-Id: I185b14a2f97598f68a1c278309ecbffaf6e5c113 Signed-off-by: Tianmi Chen <tianmi.chen@intel.com>
-rw-r--r--videocodec/OMXVideoDecoderBase.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp
index 40859b4..6270cea 100644
--- a/videocodec/OMXVideoDecoderBase.cpp
+++ b/videocodec/OMXVideoDecoderBase.cpp
@@ -926,7 +926,10 @@ OMX_ERRORTYPE OMXVideoDecoderBase::GetNativeBufferUsageSpecific(OMX_PTR pStructu
OMX_ERRORTYPE ret;
GetAndroidNativeBufferUsageParams *param = (GetAndroidNativeBufferUsageParams*)pStructure;
CHECK_TYPE_HEADER(param);
- param->nUsage |= GRALLOC_USAGE_HW_TEXTURE;
+ // hardware usage: consumed by GLES and HWC
+ param->nUsage |= GRALLOC_USAGE_HW_TEXTURE | GRALLOC_USAGE_HW_COMPOSER;
+ // software usage: can be read/written by apps
+ param->nUsage |= GRALLOC_USAGE_SW_READ_RARELY | GRALLOC_USAGE_SW_WRITE_RARELY;
return OMX_ErrorNone;
}
OMX_ERRORTYPE OMXVideoDecoderBase::SetNativeBufferUsageSpecific(OMX_PTR) {