Loading services/camera/libcameraservice/api1/Camera2Client.cpp +34 −0 Original line number Diff line number Diff line Loading @@ -1710,6 +1710,40 @@ status_t Camera2Client::commandSetVideoBufferCountL(size_t count) { return mStreamingProcessor->setRecordingBufferCount(count); } void Camera2Client::notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCode, const CaptureResultExtras& resultExtras) { int32_t err = CAMERA_ERROR_UNKNOWN; switch(errorCode) { case ICameraDeviceCallbacks::ERROR_CAMERA_DISCONNECTED: err = CAMERA_ERROR_RELEASED; break; case ICameraDeviceCallbacks::ERROR_CAMERA_DEVICE: err = CAMERA_ERROR_UNKNOWN; break; case ICameraDeviceCallbacks::ERROR_CAMERA_SERVICE: err = CAMERA_ERROR_SERVER_DIED; break; case ICameraDeviceCallbacks::ERROR_CAMERA_REQUEST: case ICameraDeviceCallbacks::ERROR_CAMERA_RESULT: case ICameraDeviceCallbacks::ERROR_CAMERA_BUFFER: ALOGW("%s: Received recoverable error %d from HAL - ignoring, requestId %" PRId32, __FUNCTION__, errorCode, resultExtras.requestId); return; default: err = CAMERA_ERROR_UNKNOWN; break; } ALOGE("%s: Error condition %d reported by HAL, requestId %" PRId32, __FUNCTION__, errorCode, resultExtras.requestId); SharedCameraCallbacks::Lock l(mSharedCameraCallbacks); if (l.mRemoteCallback != nullptr) { l.mRemoteCallback->notifyCallback(CAMERA_MSG_ERROR, err, 0); } } /** Device-related methods */ void Camera2Client::notifyAutoFocus(uint8_t newState, int triggerId) { ALOGV("%s: Autofocus state now %d, last trigger %d", Loading services/camera/libcameraservice/api1/Camera2Client.h +2 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ public: virtual status_t setParameters(const String8& params); virtual String8 getParameters() const; virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2); virtual void notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCode, const CaptureResultExtras& resultExtras); /** * Interface used by CameraService Loading Loading
services/camera/libcameraservice/api1/Camera2Client.cpp +34 −0 Original line number Diff line number Diff line Loading @@ -1710,6 +1710,40 @@ status_t Camera2Client::commandSetVideoBufferCountL(size_t count) { return mStreamingProcessor->setRecordingBufferCount(count); } void Camera2Client::notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCode, const CaptureResultExtras& resultExtras) { int32_t err = CAMERA_ERROR_UNKNOWN; switch(errorCode) { case ICameraDeviceCallbacks::ERROR_CAMERA_DISCONNECTED: err = CAMERA_ERROR_RELEASED; break; case ICameraDeviceCallbacks::ERROR_CAMERA_DEVICE: err = CAMERA_ERROR_UNKNOWN; break; case ICameraDeviceCallbacks::ERROR_CAMERA_SERVICE: err = CAMERA_ERROR_SERVER_DIED; break; case ICameraDeviceCallbacks::ERROR_CAMERA_REQUEST: case ICameraDeviceCallbacks::ERROR_CAMERA_RESULT: case ICameraDeviceCallbacks::ERROR_CAMERA_BUFFER: ALOGW("%s: Received recoverable error %d from HAL - ignoring, requestId %" PRId32, __FUNCTION__, errorCode, resultExtras.requestId); return; default: err = CAMERA_ERROR_UNKNOWN; break; } ALOGE("%s: Error condition %d reported by HAL, requestId %" PRId32, __FUNCTION__, errorCode, resultExtras.requestId); SharedCameraCallbacks::Lock l(mSharedCameraCallbacks); if (l.mRemoteCallback != nullptr) { l.mRemoteCallback->notifyCallback(CAMERA_MSG_ERROR, err, 0); } } /** Device-related methods */ void Camera2Client::notifyAutoFocus(uint8_t newState, int triggerId) { ALOGV("%s: Autofocus state now %d, last trigger %d", Loading
services/camera/libcameraservice/api1/Camera2Client.h +2 −0 Original line number Diff line number Diff line Loading @@ -77,6 +77,8 @@ public: virtual status_t setParameters(const String8& params); virtual String8 getParameters() const; virtual status_t sendCommand(int32_t cmd, int32_t arg1, int32_t arg2); virtual void notifyError(ICameraDeviceCallbacks::CameraErrorCode errorCode, const CaptureResultExtras& resultExtras); /** * Interface used by CameraService Loading