• 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_ICAMERA_SERVICE_H
17 #define OHOS_CAMERA_ICAMERA_SERVICE_H
18 
19 #include "camera_metadata_info.h"
20 #include "icamera_service_callback.h"
21 #include "icamera_device_service.h"
22 #include "icapture_session.h"
23 #include "iremote_broker.h"
24 #include "istream_capture.h"
25 #include "istream_metadata.h"
26 #include "istream_repeat.h"
27 #include "surface.h"
28 
29 namespace OHOS {
30 namespace CameraStandard {
31 class ICameraService : public IRemoteBroker {
32 public:
33     virtual int32_t CreateCameraDevice(std::string cameraId, sptr<ICameraDeviceService>& device) = 0;
34 
35     virtual int32_t SetCallback(sptr<ICameraServiceCallback>& callback) = 0;
36 
37     virtual int32_t SetMuteCallback(sptr<ICameraMuteServiceCallback>& callback) = 0;
38 
39     virtual int32_t GetCameras(std::vector<std::string> &cameraIds,
40         std::vector<std::shared_ptr<OHOS::Camera::CameraMetadata>> &cameraAbilityList) = 0;
41 
42     virtual int32_t CreateCaptureSession(sptr<ICaptureSession> &session) = 0;
43 
44     virtual int32_t CreatePhotoOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
45                                       int32_t width, int32_t height, sptr<IStreamCapture> &photoOutput) = 0;
46 
47     virtual int32_t CreatePreviewOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
48                                         int32_t width, int32_t height, sptr<IStreamRepeat> &previewOutput) = 0;
49 
50     virtual int32_t CreateDeferredPreviewOutput(int32_t format, int32_t width, int32_t height,
51                                                 sptr<IStreamRepeat> &previewOutput) = 0;
52 
53     virtual int32_t CreateMetadataOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
54                                          sptr<IStreamMetadata> &metadataOutput) = 0;
55 
56     virtual int32_t CreateVideoOutput(const sptr<OHOS::IBufferProducer> &producer, int32_t format,
57                                       int32_t width, int32_t height, sptr<IStreamRepeat> &videoOutput) = 0;
58 
59     virtual int32_t SetListenerObject(const sptr<IRemoteObject> &object) = 0;
60 
61     virtual int32_t MuteCamera(bool muteMode) = 0;
62 
63     virtual int32_t PrelaunchCamera() = 0;
64 
65     virtual int32_t SetPrelaunchConfig(std::string cameraId) = 0;
66 
67     virtual int32_t IsCameraMuted(bool &muteMode) = 0;
68 
69     DECLARE_INTERFACE_DESCRIPTOR(u"ICameraService");
70 };
71 } // namespace CameraStandard
72 } // namespace OHOS
73 #endif // OHOS_CAMERA_ICAMERA_SERVICE_H
74