• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021-2022 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 OHOS_CAMERA_HCAMERA_SERVICE_PROXY_H
17 #define OHOS_CAMERA_HCAMERA_SERVICE_PROXY_H
18 
19 #include "icamera_service.h"
20 #include "icamera_service_callback.h"
21 #include "iremote_proxy.h"
22 
23 namespace OHOS {
24 namespace CameraStandard {
25 class HCameraServiceProxy : public IRemoteProxy<ICameraService> {
26 public:
27     explicit HCameraServiceProxy(const sptr<IRemoteObject> &impl);
28 
29     virtual ~HCameraServiceProxy() = default;
30 
31     int32_t CreateCameraDevice(std::string cameraId, sptr<ICameraDeviceService>& device) override;
32 
33     int32_t SetCallback(sptr<ICameraServiceCallback>& callback) override;
34 
35     int32_t SetMuteCallback(sptr<ICameraMuteServiceCallback>& callback) override;
36 
37     int32_t GetCameras(std::vector<std::string> &cameraIds,
38         std::vector<std::shared_ptr<OHOS::Camera::CameraMetadata>> &cameraAbilityList) override;
39 
40     int32_t CreateCaptureSession(sptr<ICaptureSession>& session) override;
41 
42     int32_t CreatePhotoOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
43                               int32_t width, int32_t height, sptr<IStreamCapture> &photoOutput) override;
44 
45     int32_t CreatePreviewOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
46                                 int32_t width, int32_t height, sptr<IStreamRepeat> &previewOutput) override;
47 
48     int32_t CreateDeferredPreviewOutput(int32_t format, int32_t width, int32_t height,
49                                         sptr<IStreamRepeat> &previewOutput) override;
50 
51     int32_t CreateMetadataOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
52                                  sptr<IStreamMetadata>& metadataOutput) override;
53 
54     int32_t CreateVideoOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
55                               int32_t width, int32_t height, sptr<IStreamRepeat> &videoOutput) override;
56 
57     int32_t SetListenerObject(const sptr<IRemoteObject> &object) override;
58 
59     int32_t MuteCamera(bool muteMode) override;
60 
61     int32_t IsCameraMuted(bool &muteMode) override;
62 
63 private:
64     static inline BrokerDelegator<HCameraServiceProxy> delegator_;
65 };
66 } // namespace CameraStandard
67 } // namespace OHOS
68 #endif // OHOS_CAMERA_HCAMERA_SERVICE_PROXY_H
69