CameraService: Adds support for longshot mode
- This change introduces additional functionality inside
CameraClient for supporting continuous compressed data
callbacks. This is needed for 'Burst/Long shot' mode
where we could have indefinite number of callbacks after
capture is triggered.
CRs-Fixed: 514199
Change-Id: I8b155e305a836729b071e5388a7046c6347bb9f3
diff --git a/services/camera/libcameraservice/api1/CameraClient.cpp b/services/camera/libcameraservice/api1/CameraClient.cpp
index 5ab99ba..d557794 100644
--- a/services/camera/libcameraservice/api1/CameraClient.cpp
+++ b/services/camera/libcameraservice/api1/CameraClient.cpp
@@ -693,6 +693,12 @@
enableMsgType(CAMERA_MSG_META_DATA);
} else if (cmd == CAMERA_CMD_METADATA_OFF) {
disableMsgType(CAMERA_MSG_META_DATA);
+ } else if ( cmd == CAMERA_CMD_LONGSHOT_ON ) {
+ mLongshotEnabled = true;
+ } else if ( cmd == CAMERA_CMD_LONGSHOT_OFF ) {
+ mLongshotEnabled = false;
+ disableMsgType(CAMERA_MSG_SHUTTER);
+ disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);
#endif
}
@@ -871,7 +877,9 @@
c->notifyCallback(CAMERA_MSG_SHUTTER, 0, 0);
if (!lockIfMessageWanted(CAMERA_MSG_SHUTTER)) return;
}
- disableMsgType(CAMERA_MSG_SHUTTER);
+ if ( !mLongshotEnabled ) {
+ disableMsgType(CAMERA_MSG_SHUTTER);
+ }
mLock.unlock();
}
@@ -954,7 +962,7 @@
if (mBurstCnt)
mBurstCnt--;
- if (!mBurstCnt) {
+ if (!mBurstCnt && !mLongshotEnabled) {
LOG1("handleCompressedPicture mBurstCnt = %d", mBurstCnt);
#endif
disableMsgType(CAMERA_MSG_COMPRESSED_IMAGE);