diff options
author | hoony.yu <hoony.yu@samsung.com> | 2010-09-26 12:59:33 -0700 |
---|---|---|
committer | Simon Wilson <simonwilson@google.com> | 2010-09-27 17:24:10 -0700 |
commit | 2eda346cfee98da0c0b7f8f55b0c9d4a6a562af5 (patch) | |
tree | 331ac74c41d2957ea31da90380dea284063dd03a /libcamera | |
parent | 8a356a66d178911edcba4292fe6ce012fe9ca54c (diff) | |
download | device_samsung_crespo-2eda346cfee98da0c0b7f8f55b0c9d4a6a562af5.zip device_samsung_crespo-2eda346cfee98da0c0b7f8f55b0c9d4a6a562af5.tar.gz device_samsung_crespo-2eda346cfee98da0c0b7f8f55b0c9d4a6a562af5.tar.bz2 |
S5PC11X: OVERLAY: Update libcamera
- add #if defined(BOARD_USES_OVERLAY) on postview
- remove global variable : buf_idx
- remove LOGE : ALL_BUFFERS_FLUSHED case is not error.
Change-Id: I1249b8c4ae25e4d4b6a493dcc54f451678dff964
Signed-off-by: hoony.yu <hoony.yu@samsung.com>
Diffstat (limited to 'libcamera')
-rw-r--r-- | libcamera/SecCameraHWInterface.cpp | 19 | ||||
-rw-r--r-- | libcamera/SecCameraHWInterface.h | 1 |
2 files changed, 8 insertions, 12 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index 3df798f..f01024a 100644 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -30,7 +30,6 @@ #include <ui/Overlay.h> #define CACHEABLE_BUFFERS 0x1 #define ALL_BUFFERS_FLUSHED -66 -int buf_idx = 0; #endif #ifdef SEND_YUV_RECORD_DATA @@ -76,6 +75,7 @@ CameraHardwareSec::CameraHardwareSec(int cameraId) mCurrentPreviewFrame(0), #if defined(BOARD_USES_OVERLAY) mUseOverlay(false), + mOverlayBufferIdx(0), #endif mRecordRunning(false) #ifdef JPEG_FROM_SENSOR @@ -448,14 +448,9 @@ int CameraHardwareSec::previewThread() #if defined(BOARD_USES_OVERLAY) if (mUseOverlay) { int ret; - - if (buf_idx == 0) - buf_idx = 1; - else - buf_idx = 0; - + mOverlayBufferIdx ^= 1; memcpy(static_cast<unsigned char*>(mPreviewHeap->base()) + offset + frame_size + sizeof(phyYAddr) + sizeof(phyCAddr), - &buf_idx, sizeof(buf_idx)); + &mOverlayBufferIdx, sizeof(mOverlayBufferIdx)); ret = mOverlay->queueBuffer((void*)(static_cast<unsigned char *>(mPreviewHeap->base()) + (offset + frame_size))); @@ -1207,14 +1202,15 @@ int CameraHardwareSec::pictureThread() #endif memcpy(mRawHeap->base(),PostviewHeap->base(), postviewHeapSize); +#if defined(BOARD_USES_OVERLAY) /* Put postview image to Overlay */ unsigned int index = 0; unsigned int offset = ((mPostViewWidth*mPostViewHeight*3/2) + 16) * index; unsigned int overlay_header[4]; - buf_idx ^= 1; + mOverlayBufferIdx ^= 1; overlay_header[0]= mSecCamera->getPhyAddrY(index); overlay_header[1]= overlay_header[0] + mPostViewWidth*mPostViewHeight; - overlay_header[2]= buf_idx; + overlay_header[2]= mOverlayBufferIdx; YUY2toNV21(mRawHeap->base(), (void*)(static_cast<unsigned char *>(mPreviewHeap->base()) + offset), mPostViewWidth, mPostViewHeight); @@ -1226,7 +1222,6 @@ int CameraHardwareSec::pictureThread() (mPostViewWidth*mPostViewHeight * 3 / 2))); if (ret == ALL_BUFFERS_FLUSHED) { - LOGE("%s ALL_BUFFERS_FLUSHED",__func__); goto PostviewOverlayEnd; } else if (ret == -1) { LOGE("ERR(%s):overlay queueBuffer fail", __func__); @@ -1237,7 +1232,6 @@ int CameraHardwareSec::pictureThread() ret = mOverlay->dequeueBuffer(&overlay_buffer); if (ret == ALL_BUFFERS_FLUSHED) { - LOGE("%s ALL_BUFFERS_FLUSHED",__func__); goto PostviewOverlayEnd; } else if (ret == -1) { LOGE("ERR(%s):overlay dequeueBuffer fail", __func__); @@ -1245,6 +1239,7 @@ int CameraHardwareSec::pictureThread() } PostviewOverlayEnd: +#endif if (mMsgEnabled & CAMERA_MSG_RAW_IMAGE) { mDataCb(CAMERA_MSG_RAW_IMAGE, buffer, mCallbackCookie); } diff --git a/libcamera/SecCameraHWInterface.h b/libcamera/SecCameraHWInterface.h index 7a151e7..fde5486 100644 --- a/libcamera/SecCameraHWInterface.h +++ b/libcamera/SecCameraHWInterface.h @@ -186,6 +186,7 @@ private: #if defined(BOARD_USES_OVERLAY) sp<Overlay> mOverlay; bool mUseOverlay; + int mOverlayBufferIdx; #endif // protected by mLock |