summaryrefslogtreecommitdiff
authorjiyu.yang <jiyu.yang@amlogic.com>2014-12-03 08:29:02 (GMT)
committer jiyu.yang <jiyu.yang@amlogic.com>2014-12-03 08:29:02 (GMT)
commit641571da25df00c69627525245965755df1716f4 (patch)
tree17e851a50ef0e38a738508b944a0ebdbeec0853f
parent59886baa71c3c1a620d4bca6f03c7620d414d172 (diff)
downloadcamera-641571da25df00c69627525245965755df1716f4.zip
camera-641571da25df00c69627525245965755df1716f4.tar.gz
camera-641571da25df00c69627525245965755df1716f4.tar.bz2
change GRALLOC usage in camerahal instead of gralloc
Change-Id: I744c715a659396402bac4908562758f08e18380d
Diffstat
-rwxr-xr-xv3/EmulatedFakeCamera3.cpp6
-rwxr-xr-xv3/fake-pipeline2/Sensor.cpp8
2 files changed, 10 insertions, 4 deletions
diff --git a/v3/EmulatedFakeCamera3.cpp b/v3/EmulatedFakeCamera3.cpp
index 0d6fedd..42e5245 100755
--- a/v3/EmulatedFakeCamera3.cpp
+++ b/v3/EmulatedFakeCamera3.cpp
@@ -1203,7 +1203,8 @@ status_t EmulatedFakeCamera3::processCaptureRequest(
android_ycbcr ycbcr = android_ycbcr();
res = GraphicBufferMapper::get().lockYCbCr(
*(destBuf.buffer),
- GRALLOC_USAGE_HW_CAMERA_WRITE, rect,
+ GRALLOC_USAGE_SW_READ_MASK | GRALLOC_USAGE_SW_WRITE_MASK
+ , rect,
&ycbcr);
// This is only valid because we know that emulator's
// YCbCr_420_888 is really contiguous NV21 under the hood
@@ -1215,7 +1216,8 @@ status_t EmulatedFakeCamera3::processCaptureRequest(
}
} else {
res = GraphicBufferMapper::get().lock(*(destBuf.buffer),
- GRALLOC_USAGE_HW_CAMERA_WRITE, rect,
+ GRALLOC_USAGE_SW_READ_MASK | GRALLOC_USAGE_SW_WRITE_MASK
+ , rect,
(void**)&(destBuf.img));
}
if (res != OK) {
diff --git a/v3/fake-pipeline2/Sensor.cpp b/v3/fake-pipeline2/Sensor.cpp
index cd2bce7..b034f4f 100755
--- a/v3/fake-pipeline2/Sensor.cpp
+++ b/v3/fake-pipeline2/Sensor.cpp
@@ -192,7 +192,10 @@ uint32_t Sensor::getStreamUsage(int stream_type)
if ((mSensorType == SENSOR_MMAP)
|| (mSensorType == SENSOR_USB)) {
usage = (GRALLOC_USAGE_HW_TEXTURE
- | GRALLOC_USAGE_HW_RENDER);
+ | GRALLOC_USAGE_HW_RENDER
+ | GRALLOC_USAGE_SW_READ_MASK
+ | GRALLOC_USAGE_SW_WRITE_MASK
+ );
}
return usage;
@@ -1068,7 +1071,8 @@ int Sensor::captureNewImage() {
break;
}
}
- if(!isjpeg) {
+ if(!isjpeg) { //jpeg buffer that is rgb888 has been save in the different buffer struct;
+ // whose buffer putback separately.
putback_frame(vinfo);
}
mKernelBuffer = NULL;