diff options
author | Wu-cheng Li <wuchengli@google.com> | 2011-08-25 01:56:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-08-25 01:56:14 -0700 |
commit | 9c703204d6a9790b4f1a8e06942e176ed686ae4c (patch) | |
tree | 62f53a4de71676243b8d3cf4c5fc8417765c9308 | |
parent | 481f418db1666a2d02836b667828a71f53b442a9 (diff) | |
parent | 3e01e0673a9b6d52ec402bf7e4daa9e4070d660f (diff) | |
download | device_samsung_crespo-9c703204d6a9790b4f1a8e06942e176ed686ae4c.zip device_samsung_crespo-9c703204d6a9790b4f1a8e06942e176ed686ae4c.tar.gz device_samsung_crespo-9c703204d6a9790b4f1a8e06942e176ed686ae4c.tar.bz2 |
Merge "Send RawPictureCallback when CAMERA_MSG_RAW_IMAGE_NOTIFY is enabled."
-rwxr-xr-x | libcamera/SecCameraHWInterface.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/libcamera/SecCameraHWInterface.cpp b/libcamera/SecCameraHWInterface.cpp index fb108bd..7922896 100755 --- a/libcamera/SecCameraHWInterface.cpp +++ b/libcamera/SecCameraHWInterface.cpp @@ -84,7 +84,7 @@ CameraHardwareSec::CameraHardwareSec(int cameraId, camera_device_t *dev) mDataCb(0), mDataCbTimestamp(0), mCallbackCookie(0), - mMsgEnabled(CAMERA_MSG_RAW_IMAGE), + mMsgEnabled(0), mRecordRunning(false), mPostViewWidth(0), mPostViewHeight(0), @@ -1087,43 +1087,41 @@ int CameraHardwareSec::pictureThread() sp<MemoryHeapBase> PostviewHeap = new MemoryHeapBase(mPostViewSize); sp<MemoryHeapBase> ThumbnailHeap = new MemoryHeapBase(mThumbSize); - if (mMsgEnabled & CAMERA_MSG_RAW_IMAGE) { - LOG_TIME_DEFINE(1) - LOG_TIME_START(1) + LOG_TIME_DEFINE(1) + LOG_TIME_START(1) - int picture_size, picture_width, picture_height; - mSecCamera->getSnapshotSize(&picture_width, &picture_height, &picture_size); - int picture_format = mSecCamera->getSnapshotPixelFormat(); + int picture_size, picture_width, picture_height; + mSecCamera->getSnapshotSize(&picture_width, &picture_height, &picture_size); + int picture_format = mSecCamera->getSnapshotPixelFormat(); - unsigned int phyAddr; + unsigned int phyAddr; - // Modified the shutter sound timing for Jpeg capture - if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK) - mSecCamera->setSnapshotCmd(); - if (mMsgEnabled & CAMERA_MSG_SHUTTER) { - mNotifyCb(CAMERA_MSG_SHUTTER, 0, 0, mCallbackCookie); - } + // Modified the shutter sound timing for Jpeg capture + if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK) + mSecCamera->setSnapshotCmd(); + if (mMsgEnabled & CAMERA_MSG_SHUTTER) { + mNotifyCb(CAMERA_MSG_SHUTTER, 0, 0, mCallbackCookie); + } - if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK){ - jpeg_data = mSecCamera->getJpeg(&jpeg_size, &phyAddr); - if (jpeg_data == NULL) { - LOGE("ERR(%s):Fail on SecCamera->getSnapshot()", __func__); - ret = UNKNOWN_ERROR; - goto out; - } - } else { - if (mSecCamera->getSnapshotAndJpeg((unsigned char*)PostviewHeap->base(), - (unsigned char*)JpegHeap->data, &output_size) < 0) { - ret = UNKNOWN_ERROR; - goto out; - } - LOGI("snapshotandjpeg done\n"); + if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK){ + jpeg_data = mSecCamera->getJpeg(&jpeg_size, &phyAddr); + if (jpeg_data == NULL) { + LOGE("ERR(%s):Fail on SecCamera->getSnapshot()", __func__); + ret = UNKNOWN_ERROR; + goto out; } - - LOG_TIME_END(1) - LOG_CAMERA("getSnapshotAndJpeg interval: %lu us", LOG_TIME(1)); + } else { + if (mSecCamera->getSnapshotAndJpeg((unsigned char*)PostviewHeap->base(), + (unsigned char*)JpegHeap->data, &output_size) < 0) { + ret = UNKNOWN_ERROR; + goto out; + } + LOGI("snapshotandjpeg done\n"); } + LOG_TIME_END(1) + LOG_CAMERA("getSnapshotAndJpeg interval: %lu us", LOG_TIME(1)); + if (mSecCamera->getCameraId() == SecCamera::CAMERA_ID_BACK) { isLSISensor = !strncmp((const char*)mCameraSensorName, "S5K4ECGX", 8); if(isLSISensor) { @@ -1154,6 +1152,8 @@ int CameraHardwareSec::pictureThread() if (mMsgEnabled & CAMERA_MSG_RAW_IMAGE) { mDataCb(CAMERA_MSG_RAW_IMAGE, mRawHeap, 0, NULL, mCallbackCookie); + } else if (mMsgEnabled & CAMERA_MSG_RAW_IMAGE_NOTIFY) { + mNotifyCb(CAMERA_MSG_RAW_IMAGE_NOTIFY, 0, 0, mCallbackCookie); } if (mMsgEnabled & CAMERA_MSG_COMPRESSED_IMAGE) { |