diff --git a/common/include/constants/distributed_camera_constants.h b/common/include/constants/distributed_camera_constants.h index 90d7acd..eddb2f5 100644 --- a/common/include/constants/distributed_camera_constants.h +++ b/common/include/constants/distributed_camera_constants.h @@ -58,9 +58,6 @@ typedef enum { DCAMERA_EVENT_START_CAPTURE_ERROR = -6, DCAMERA_EVENT_STOP_CAPTURE_ERROR = -7, DCAMERA_EVENT_UPDATE_SETTINGS_ERROR = -8, - DCAMERA_EVENT_DEVICE_PREEMPT = -9, - DCAMERA_EVENT_DEVICE_IN_USE = -10, - DCAMERA_EVENT_NO_PERMISSION = -11, } DCameraEventResult; typedef enum { diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp index 0cbf46a..8d980fd 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp @@ -31,13 +31,10 @@ void DCameraInputCallback::OnError(const int32_t errorType, const int32_t errorM DHLOGE("DCameraInputCallback::OnError StateCallback is null"); return; } + std::shared_ptr event = std::make_shared(); event->eventType_ = DCAMERA_MESSAGE; - if (errorType == CamServiceError::) { - event->eventResult_ = DCAMERA_DEVICE_PREEMPT; - } else { - event->eventResult_ = DCAMERA_EVENT_CAMERA_ERROR; - } + event->eventResult_ = DCAMERA_EVENT_CAMERA_ERROR; callback_->OnStateChanged(event); } } // namespace DistributedHardware diff --git a/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp b/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp index bbadae4..1ad5ca5 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_photo_callback.cpp @@ -49,7 +49,7 @@ void DCameraPhotoCallback::OnCaptureError(const int32_t captureId, const int32_t std::shared_ptr event = std::make_shared(); event->eventType_ = DCAMERA_MESSAGE; - event->eventResult_ = DCAMERA_DEVICE_ERROR; + event->eventResult_ = DCAMERA_EVENT_CAMERA_ERROR; callback_->OnStateChanged(event); } } // namespace DistributedHardware diff --git a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp index ecf5eb3..9501728 100644 --- a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp +++ b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp @@ -79,7 +79,7 @@ int32_t DCameraSinkController::StopCapture() if (ret != DCAMERA_OK) { DHLOGE("DCameraSinkController::StopCapture client stop capture failed, dhId: %s, ret: %d", GetAnonyString(dhId_).c_str(), ret); - DCameraNotifyInner(DCAMERA_MESSAGE, ret, std::string("operator stop capture failed")); + DCameraNotifyInner(DCAMERA_MESSAGE, DCAMERA_EVENT_CAMERA_ERROR, std::string("operator stop capture failed")); return ret; } @@ -87,7 +87,7 @@ int32_t DCameraSinkController::StopCapture() if (ret != DCAMERA_OK) { DHLOGE("DCameraSinkController::StopCapture output stop capture failed, dhId: %s, ret: %d", GetAnonyString(dhId_).c_str(), ret); - DCameraNotifyInner(DCAMERA_MESSAGE, ret, std::string("output stop capture failed")); + DCameraNotifyInner(DCAMERA_MESSAGE, DCAMERA_EVENT_CAMERA_ERROR, std::string("output stop capture failed")); return ret; } @@ -309,11 +309,7 @@ void DCameraSinkController::OnStateChanged(std::shared_ptr& event) { DHLOGI("DCameraSinkController::OnStateChanged dhId: %s, result: %d", GetAnonyString(dhId_).c_str(), event->eventResult_); - if (event->eventResult_ == CamServiceError::) { - DCameraNotifyInner(DCAMERA_MESSAGE, DCAMERA_EVENT_DEVICE_PREEMPT, std::string("camera preempted")); - } else { - DCameraNotifyInner(DCAMERA_MESSAGE, DCAMERA_EVENT_CAMERA_ERROR, std::string("camera error")); - } + DCameraNotifyInner(DCAMERA_MESSAGE, DCAMERA_EVENT_CAMERA_ERROR, std::string("camera error")); } void DCameraSinkController::OnMetadataResult() @@ -391,7 +387,7 @@ int32_t DCameraSinkController::StartCaptureInner(std::vector