1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef CAMERA_HOST_SERVICE_CALLBACK_H
17 #define CAMERA_HOST_SERVICE_CALLBACK_H
18 
19 #include "camera.h"
20 #include "v1_0/icamera_host_callback.h"
21 #include "v1_0/icamera_host_vdi_callback.h"
22 #include "v1_0/icamera_host_vdi.h"
23 #include "camera_host_service.h"
24 
25 namespace OHOS::Camera {
26 using namespace OHOS::HDI::Camera::V1_0;
27 using namespace OHOS::VDI::Camera::V1_0;
28 
29 class CameraHostServiceCallback : public ICameraHostVdiCallback {
30 public:
31 
32     CameraHostServiceCallback(OHOS::sptr<ICameraHostCallback> cameraHostCallback,
33         OHOS::sptr<ICameraHostVdi> cameraHostVdi, std::vector<CameraIdInfo> &cameraIdInfoList);
34 
35     CameraHostServiceCallback() = delete;
36 
37     virtual ~CameraHostServiceCallback() = default;
38 
39     int32_t OnCameraStatus(const std::string &cameraId, VdiCameraStatus status) override;
40 
41     int32_t OnFlashlightStatus(const std::string &cameraId, VdiFlashlightStatus status) override;
42 
43     int32_t OnCameraEvent(const std::string &cameraId, VdiCameraEvent event) override;
44 
45     const sptr<IRemoteObject> Remote() const override;
46 
47 private:
48     OHOS::sptr<ICameraHostCallback> cameraHostCallback_;
49     OHOS::sptr<ICameraHostVdi> cameraHostVdi_;
50     std::vector<CameraIdInfo> &cameraIdInfoList_;
51 };
52 
53 } // end namespace OHOS::Camera
54 #endif // CAMERA_HOST_SERVICE_CALLBACK_H
55