Loading services/camera/libcameraservice/camera2/CaptureSequencer.cpp +30 −7 Original line number Diff line number Diff line Loading @@ -308,9 +308,8 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart( } SharedParameters::Lock l(client->getParameters()); if (l.mParameters.playShutterSound) { client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); } /* warning: this also locks a SharedCameraClient */ shutterNotifyLocked(l.mParameters, client); mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; Loading Loading @@ -443,10 +442,8 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCapture( return DONE; } if (l.mParameters.playShutterSound && l.mParameters.state == Parameters::STILL_CAPTURE) { client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); } /* warning: this also locks a SharedCameraClient */ shutterNotifyLocked(l.mParameters, client); mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; Loading Loading @@ -632,6 +629,32 @@ status_t CaptureSequencer::updateCaptureRequest(const Parameters ¶ms, return OK; } /*static*/ void CaptureSequencer::shutterNotifyLocked(const Parameters ¶ms, sp<Camera2Client> client) { ATRACE_CALL(); if (params.state == Parameters::STILL_CAPTURE && params.playShutterSound) { client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); } { Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient); ALOGV("%s: Notifying of shutter close to client", __FUNCTION__); if (l.mCameraClient != 0) { // ShutterCallback l.mCameraClient->notifyCallback(CAMERA_MSG_SHUTTER, /*ext1*/0, /*ext2*/0); // RawCallback with null buffer l.mCameraClient->notifyCallback(CAMERA_MSG_RAW_IMAGE_NOTIFY, /*ext1*/0, /*ext2*/0); } else { ALOGV("%s: No client!", __FUNCTION__); } } } }; // namespace camera2 }; // namespace android services/camera/libcameraservice/camera2/CaptureSequencer.h +4 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,10 @@ class CaptureSequencer: status_t updateCaptureRequest(const Parameters ¶ms, sp<Camera2Client> &client); // Emit Shutter/Raw callback to java, and maybe play a shutter sound static void shutterNotifyLocked(const Parameters ¶ms, sp<Camera2Client> client); }; }; // namespace camera2 Loading Loading
services/camera/libcameraservice/camera2/CaptureSequencer.cpp +30 −7 Original line number Diff line number Diff line Loading @@ -308,9 +308,8 @@ CaptureSequencer::CaptureState CaptureSequencer::manageZslStart( } SharedParameters::Lock l(client->getParameters()); if (l.mParameters.playShutterSound) { client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); } /* warning: this also locks a SharedCameraClient */ shutterNotifyLocked(l.mParameters, client); mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; Loading Loading @@ -443,10 +442,8 @@ CaptureSequencer::CaptureState CaptureSequencer::manageStandardCapture( return DONE; } if (l.mParameters.playShutterSound && l.mParameters.state == Parameters::STILL_CAPTURE) { client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); } /* warning: this also locks a SharedCameraClient */ shutterNotifyLocked(l.mParameters, client); mTimeoutCount = kMaxTimeoutsForCaptureEnd; return STANDARD_CAPTURE_WAIT; Loading Loading @@ -632,6 +629,32 @@ status_t CaptureSequencer::updateCaptureRequest(const Parameters ¶ms, return OK; } /*static*/ void CaptureSequencer::shutterNotifyLocked(const Parameters ¶ms, sp<Camera2Client> client) { ATRACE_CALL(); if (params.state == Parameters::STILL_CAPTURE && params.playShutterSound) { client->getCameraService()->playSound(CameraService::SOUND_SHUTTER); } { Camera2Client::SharedCameraClient::Lock l(client->mSharedCameraClient); ALOGV("%s: Notifying of shutter close to client", __FUNCTION__); if (l.mCameraClient != 0) { // ShutterCallback l.mCameraClient->notifyCallback(CAMERA_MSG_SHUTTER, /*ext1*/0, /*ext2*/0); // RawCallback with null buffer l.mCameraClient->notifyCallback(CAMERA_MSG_RAW_IMAGE_NOTIFY, /*ext1*/0, /*ext2*/0); } else { ALOGV("%s: No client!", __FUNCTION__); } } } }; // namespace camera2 }; // namespace android
services/camera/libcameraservice/camera2/CaptureSequencer.h +4 −0 Original line number Diff line number Diff line Loading @@ -155,6 +155,10 @@ class CaptureSequencer: status_t updateCaptureRequest(const Parameters ¶ms, sp<Camera2Client> &client); // Emit Shutter/Raw callback to java, and maybe play a shutter sound static void shutterNotifyLocked(const Parameters ¶ms, sp<Camera2Client> client); }; }; // namespace camera2 Loading