1 /* 2 * Copyright (c) 2021 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 26 namespace OHOS { 27 namespace DistributedHardware { 28 class DCameraSinkDev { 29 public: 30 explicit DCameraSinkDev(const std::string& dhId); 31 ~DCameraSinkDev(); 32 33 int32_t Init(); 34 int32_t UnInit(); 35 int32_t SubscribeLocalHardware(const std::string& parameters); 36 int32_t UnsubscribeLocalHardware(); 37 int32_t StopCapture(); 38 int32_t ChannelNeg(std::string& channelInfo); 39 int32_t GetCameraInfo(std::string& cameraInfo); 40 int32_t OpenChannel(std::string& openInfo); 41 int32_t CloseChannel(); 42 std::string GetDhid(); 43 44 private: 45 bool isInit_; 46 std::string dhId_; 47 std::shared_ptr<ICameraController> controller_; 48 std::shared_ptr<ICameraSinkAccessControl> accessControl_; 49 }; 50 } // namespace DistributedHardware 51 } // namespace OHOS 52 #endif // OHOS_DCAMERA_SINK_DEV_H