1 /*
2  * Copyright (c) 2021-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 OHOS_DCAMERA_SINK_DEV_H
17 #define OHOS_DCAMERA_SINK_DEV_H
18 
19 #include <cstdint>
20 #include <memory>
21 #include <string>
22 
23 #include "icamera_controller.h"
24 #include "icamera_sink_access_control.h"
25 #include "idcamera_sink_callback.h"
26 
27 namespace OHOS {
28 namespace DistributedHardware {
29 class DCameraSinkDev {
30 public:
31     explicit DCameraSinkDev(const std::string& dhId, const sptr<IDCameraSinkCallback> &sinkCallback);
32     ~DCameraSinkDev();
33 
34     int32_t Init();
35     int32_t UnInit();
36     int32_t SubscribeLocalHardware(const std::string& parameters);
37     int32_t UnsubscribeLocalHardware();
38     int32_t StopCapture();
39     int32_t ChannelNeg(std::string& channelInfo);
40     int32_t GetCameraInfo(std::string& cameraInfo);
41     int32_t OpenChannel(std::string& openInfo);
42     int32_t CloseChannel();
43     std::string GetDhid();
44     int32_t PauseDistributedHardware(const std::string &networkId);
45     int32_t ResumeDistributedHardware(const std::string &networkId);
46     int32_t StopDistributedHardware(const std::string &networkId);
47 
48 private:
49     bool isInit_;
50     std::string dhId_;
51     std::shared_ptr<ICameraController> controller_;
52     std::shared_ptr<ICameraSinkAccessControl> accessControl_;
53     sptr<IDCameraSinkCallback> sinkCallback_;
54 };
55 } // namespace DistributedHardware
56 } // namespace OHOS
57 #endif // OHOS_DCAMERA_SINK_DEV_H