diff --git a/services/cameraservice/cameraoperator/client/include/dcamera_client.h b/services/cameraservice/cameraoperator/client/include/dcamera_client.h index 1df19c7b12cc643a9d4ab797ea0c095b6d78ed35..6c6162c7f71d25c656218cb927fc5f6c5f220dcb 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 90daa089d4f0084af5a70fe942c5311045e1b863..3a34e1d7be292d26ec443a09049e03e201e5319a 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 099cf53a91c9acbf4d678b085604cb7c7f6774ff..5ce68a62141707bd8d43f96ad201a547521b3ad9 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 8462e787a15126bdc868e6c7cbdfec441d1a0b30..089bbfcec5989e3a9eb65e3a5cb6a973ae9f8e06 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 17d510b2cd621d1b37d62bb2af6b6b82f808a0e9..9c33224a93eb48e027b563d5d177515f55b36db7 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 2a712d6af2937495e90ad5c70b45a6ab8a6bb0d5..23a849277defdaa380198130db63c9d7ec299761 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