From cdcdfb7fa07bb655f6ec0eed3b7ea1ef5d1074b6 Mon Sep 17 00:00:00 2001 From: chen0088 Date: Mon, 26 May 2025 14:45:07 +0800 Subject: [PATCH] delete prelaunchCamera Signed-off-by: chen0088 --- .../client/include/dcamera_client.h | 3 +-- .../client/include/icamera_operator.h | 3 +-- .../cameraoperator/client/src/dcamera_client.cpp | 16 +--------------- .../dcamera_sink_controller.cpp | 4 ---- .../dcamera_sink_output_test.cpp | 14 +------------- .../distributedcameramgr/mock_camera_operator.h | 7 +------ 6 files changed, 5 insertions(+), 42 deletions(-) diff --git a/services/cameraservice/cameraoperator/client/include/dcamera_client.h b/services/cameraservice/cameraoperator/client/include/dcamera_client.h index 1df19c7b..6c6162c7 100644 --- a/services/cameraservice/cameraoperator/client/include/dcamera_client.h +++ b/services/cameraservice/cameraoperator/client/include/dcamera_client.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -49,7 +49,6 @@ public: int32_t SetResultCallback(std::shared_ptr& callback) override; int32_t PauseCapture() override; int32_t ResumeCapture() override; - int32_t PrelaunchCamera() override; private: int32_t ConfigCaptureSession(std::vector>& captureInfos, int32_t sceneMode); diff --git a/services/cameraservice/cameraoperator/client/include/icamera_operator.h b/services/cameraservice/cameraoperator/client/include/icamera_operator.h index 90daa089..3a34e1d7 100644 --- a/services/cameraservice/cameraoperator/client/include/icamera_operator.h +++ b/services/cameraservice/cameraoperator/client/include/icamera_operator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -64,7 +64,6 @@ public: virtual int32_t SetResultCallback(std::shared_ptr& callback) = 0; virtual int32_t PauseCapture() = 0; virtual int32_t ResumeCapture() = 0; - virtual int32_t PrelaunchCamera() = 0; }; } // namespace DistributedHardware } // namespace OHOS diff --git a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp index 099cf53a..5ce68a62 100644 --- a/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp +++ b/services/cameraservice/cameraoperator/client/src/dcamera_client.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -665,19 +665,5 @@ int32_t DCameraClient::ResumeCapture() } return ret; } - -int32_t DCameraClient::PrelaunchCamera() -{ - if (cameraManager_ == nullptr) { - DHLOGE("DCameraClient cameraManager_ is nullptr."); - return DCAMERA_BAD_VALUE; - } - int32_t ret = cameraManager_->PrelaunchCamera(); - if (ret != DCAMERA_OK) { - DHLOGE("DCameraClient PrelaunchCamera Start failed, cameraId: %{public}s, ret: %{public}d", - GetAnonyString(cameraId_).c_str(), ret); - } - return ret; -} } // namespace DistributedHardware } // namespace OHOS diff --git a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp index 8462e787..089bbfce 100644 --- a/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp +++ b/services/cameraservice/sinkservice/src/distributedcameramgr/dcamera_sink_controller.cpp @@ -544,10 +544,6 @@ void DCameraSinkController::OnSessionState(int32_t state, std::string networkId) DHLOGE("operator_ is nullptr"); break; } - int32_t ret = operator_->PrelaunchCamera(); - if (ret != DCAMERA_OK) { - DHLOGE("operator_ PrelaunchCamera error. ret %{public}d.", ret); - } break; } case DCAMERA_CHANNEL_STATE_DISCONNECTED: diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_output_test.cpp b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_output_test.cpp index 17d510b2..9c33224a 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_output_test.cpp +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/dcamera_sink_output_test.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -290,18 +290,6 @@ HWTEST_F(DCameraSinkOutputTest, dcamera_sink_output_test_008, TestSize.Level1) EXPECT_NE(DCAMERA_OK, ret); } -/** - * @tc.name: dcamera_sink_output_test_009 - * @tc.desc: Verify the PrelaunchCamera function. - * @tc.type: FUNC - * @tc.require: I5N1JI - */ -HWTEST_F(DCameraSinkOutputTest, dcamera_sink_output_test_009, TestSize.Level1) -{ - int32_t ret = operator_->PrelaunchCamera(); - EXPECT_EQ(DCAMERA_OK, ret); -} - /** * @tc.name: dcamera_sink_output_test_010 * @tc.desc: Verify the UnInit function. diff --git a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h index 2a712d6a..23a84927 100644 --- a/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h +++ b/services/cameraservice/sinkservice/test/unittest/common/distributedcameramgr/mock_camera_operator.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021-2024 Huawei Device Co., Ltd. + * Copyright (c) 2021-2025 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 @@ -110,11 +110,6 @@ public: } return DCAMERA_OK; } - - int32_t PrelaunchCamera() - { - return DCAMERA_OK; - } }; } // namespace DistributedHardware } // namespace OHOS -- Gitee