summaryrefslogtreecommitdiffstats
path: root/camera
diff options
context:
space:
mode:
Diffstat (limited to 'camera')
-rw-r--r--camera/BufferSourceAdapter.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/camera/BufferSourceAdapter.cpp b/camera/BufferSourceAdapter.cpp
index d0c3fd9..d6de80c 100644
--- a/camera/BufferSourceAdapter.cpp
+++ b/camera/BufferSourceAdapter.cpp
@@ -673,6 +673,7 @@ void BufferSourceAdapter::handleFrameCallback(CameraFrame* frame)
status_t ret = NO_ERROR;
buffer_handle_t *handle = NULL;
int i;
+ uint32_t x, y;
android::GraphicBufferMapper &mapper = android::GraphicBufferMapper::get();
android::AutoMutex lock(mLock);
@@ -699,6 +700,14 @@ void BufferSourceAdapter::handleFrameCallback(CameraFrame* frame)
return;
}
+ CameraHal::getXYFromOffset(&x, &y, frame->mOffset, frame->mAlignment, mPixelFormat);
+ CAMHAL_LOGVB("offset = %u left = %d top = %d right = %d bottom = %d",
+ frame->mOffset, x, y, x + frame->mWidth, y + frame->mHeight);
+ ret = mBufferSource->set_crop(mBufferSource, x, y, x + frame->mWidth, y + frame->mHeight);
+ if (NO_ERROR != ret) {
+ CAMHAL_LOGE("mBufferSource->set_crop returned error %d", ret);
+ }
+
if ( NULL != frame->mMetaData.get() ) {
camera_memory_t *extMeta = frame->mMetaData->getExtendedMetadata();
if ( NULL != extMeta ) {