summaryrefslogtreecommitdiffstats
path: root/libcamera
diff options
context:
space:
mode:
authorWu-cheng Li <wuchengli@google.com>2011-08-25 14:46:38 +0800
committerWu-cheng Li <wuchengli@google.com>2011-08-25 16:36:24 +0800
commit3e01e0673a9b6d52ec402bf7e4daa9e4070d660f (patch)
tree7ff9a1cfa05e505ed10679d31a0a44d57349a2df /libcamera
parent9bd4f740c08b0c473a565b8e961e492a68eb9e55 (diff)
downloaddevice_samsung_crespo-3e01e0673a9b6d52ec402bf7e4daa9e4070d660f.zip
device_samsung_crespo-3e01e0673a9b6d52ec402bf7e4daa9e4070d660f.tar.gz
device_samsung_crespo-3e01e0673a9b6d52ec402bf7e4daa9e4070d660f.tar.bz2
Send RawPictureCallback when CAMERA_MSG_RAW_IMAGE_NOTIFY is enabled.
bug:4967771 Change-Id: I1e77ed60cb741dd5e82ed8a6de92bd06f23f5f87
Diffstat (limited to 'libcamera')
-rwxr-xr-xlibcamera/SecCameraHWInterface.cpp62
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) {