diff options
author | Tyler Luu <tluu@ti.com> | 2012-06-05 17:39:03 -0500 |
---|---|---|
committer | Daniel Levin <dendy@ti.com> | 2012-11-26 18:41:38 +0200 |
commit | 2a358c2f010664425dc8ba4695cc1132ef2affc9 (patch) | |
tree | b066fe95165da3b21a9820dd7b8c57f1bc763581 /camera/BufferSourceAdapter.cpp | |
parent | 08e7c5cbe3852cae76ea7af23b91e37d03da1c4d (diff) | |
download | hardware_ti_omap4-2a358c2f010664425dc8ba4695cc1132ef2affc9.tar.gz hardware_ti_omap4-2a358c2f010664425dc8ba4695cc1132ef2affc9.tar.bz2 hardware_ti_omap4-2a358c2f010664425dc8ba4695cc1132ef2affc9.zip |
camera: bsa: Set crop before enqueueing
- Set the crop rectangle for surface texture, so
surface texture can compute transform matrix
that will be used by applications.
Change-Id: I6e245c99ac3196518d8a9ee83c162d3ce380b7e9
Signed-off-by: Tyler Luu <tluu@ti.com>
Signed-off-by: Vladimir Petrov <vppetrov@mm-sol.com>
Diffstat (limited to 'camera/BufferSourceAdapter.cpp')
-rw-r--r-- | camera/BufferSourceAdapter.cpp | 9 |
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 ) { |