From 7e6a53fd45dfa607d6d12e417dab5cf65ce03fd5 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Mon, 16 Dec 2024 17:37:54 +0800 Subject: [PATCH] =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: chen0088 --- .../client/src/callback/dcamera_input_callback.cpp | 4 ++-- .../cameraoperator/client/src/dcamera_client.cpp | 4 ++-- .../common/cameraoperator/dcamera_client_test.cpp | 12 ++++++------ 3 files changed, 10 insertions(+), 10 deletions(-) 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 b2344d3e..a5542310 100644 --- a/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp +++ b/services/cameraservice/cameraoperator/client/src/callback/dcamera_input_callback.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2022 Huawei Device Co., Ltd. + * Copyright (c) 2021-2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at @@ -35,7 +35,7 @@ void DCameraInputCallback::OnError(const int32_t errorType, const int32_t errorM std::shared_ptr event = std::make_shared(); event->eventType_ = DCAMERA_MESSAGE; - if (errorType == CameraStandard::CamServiceError::CAMERA_DEVICE_PREEMPTED) { + if (errorType == CameraStandard::CameraErrorCode::DEVICE_PREEMPTED) { event->eventResult_ = DCAMERA_EVENT_DEVICE_PREEMPT; } else { event->eventResult_ = DCAMERA_EVENT_DEVICE_ERROR; diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index f99a23e7..92503a61 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -208,9 +208,9 @@ int32_t DCameraClient::StartCapture(std::vectorOnFlashlightStatusChanged("", CameraStandard::FlashStatus::FLASH_STATUS_OFF); auto inputCallback = std::make_shared(nullptr); - inputCallback->OnError(CameraStandard::CamServiceError::CAMERA_DEVICE_BUSY, 0); + inputCallback->OnError(CameraStandard::CameraErrorCode::CONFLICT_CAMERA, 0); auto sessionCallback = std::make_shared(nullptr); sessionCallback->OnError(0); @@ -260,8 +260,8 @@ HWTEST_F(DCameraClientTest, dcamera_client_test_001, TestSize.Level1) std::shared_ptr stateCallback = std::make_shared(); inputCallback = std::make_shared(stateCallback); - inputCallback->OnError(CameraStandard::CamServiceError::CAMERA_DEVICE_BUSY, 0); - inputCallback->OnError(CameraStandard::CamServiceError::CAMERA_DEVICE_PREEMPTED, 0); + inputCallback->OnError(CameraStandard::CameraErrorCode::CONFLICT_CAMERA, 0); + inputCallback->OnError(CameraStandard::CameraErrorCode::DEVICE_PREEMPTED, 0); sessionCallback = std::make_shared(stateCallback); sessionCallback->OnError(0); @@ -536,13 +536,13 @@ HWTEST_F(DCameraClientTest, dcamera_client_test_008, TestSize.Level1) HWTEST_F(DCameraClientTest, dcamera_client_test_009, TestSize.Level1) { DHLOGI("DCameraClientTest dcamera_client_test_009: test cameraServiceErrorType"); - int32_t ret = client_->CameraServiceErrorType(CameraStandard::CamServiceError::CAMERA_OK); + int32_t ret = client_->CameraServiceErrorType(CameraStandard::CameraErrorCode::SUCCESS); EXPECT_EQ(DCAMERA_OK, ret); - ret = client_->CameraServiceErrorType(CameraStandard::CamServiceError::CAMERA_ALLOC_ERROR); + ret = client_->CameraServiceErrorType(CameraStandard::CameraErrorCode::SERVICE_FATL_ERROR); EXPECT_EQ(DCAMERA_ALLOC_ERROR, ret); - ret = client_->CameraServiceErrorType(CameraStandard::CamServiceError::CAMERA_DEVICE_BUSY); + ret = client_->CameraServiceErrorType(CameraStandard::CameraErrorCode::CONFLICT_CAMERA); EXPECT_EQ(DCAMERA_DEVICE_BUSY, ret); } -- Gitee