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_DISTRIBUTED_CAMERA_SINK_PROXY_H 17 #define OHOS_DISTRIBUTED_CAMERA_SINK_PROXY_H 18 19 #include "idistributed_camera_sink.h" 20 21 #include "iremote_broker.h" 22 #include "iremote_proxy.h" 23 #include "refbase.h" 24 25 namespace OHOS { 26 namespace DistributedHardware { 27 class DistributedCameraSinkProxy : public IRemoteProxy<IDistributedCameraSink> { 28 public: DistributedCameraSinkProxy(const sptr<IRemoteObject> & impl)29 explicit DistributedCameraSinkProxy(const sptr<IRemoteObject>& impl) 30 : IRemoteProxy<IDistributedCameraSink>(impl) 31 { 32 } 33 ~DistributedCameraSinkProxy()34 ~DistributedCameraSinkProxy() {} 35 int32_t InitSink(const std::string& params, const sptr<IDCameraSinkCallback> &sinkCallback) override; 36 int32_t ReleaseSink() override; 37 int32_t SubscribeLocalHardware(const std::string& dhId, const std::string& parameters) override; 38 int32_t UnsubscribeLocalHardware(const std::string& dhId) override; 39 int32_t StopCapture(const std::string& dhId) override; 40 int32_t ChannelNeg(const std::string& dhId, std::string& channelInfo) override; 41 int32_t GetCameraInfo(const std::string& dhId, std::string& cameraInfo) override; 42 int32_t OpenChannel(const std::string& dhId, std::string& openInfo) override; 43 int32_t CloseChannel(const std::string& dhId) override; 44 int32_t PauseDistributedHardware(const std::string &networkId) override; 45 int32_t ResumeDistributedHardware(const std::string &networkId) override; 46 int32_t StopDistributedHardware(const std::string &networkId) override; 47 48 private: 49 static inline BrokerDelegator<DistributedCameraSinkProxy> delegator_; 50 51 const size_t DID_MAX_SIZE = 256; 52 const size_t PARAM_MAX_SIZE = 50 * 1024 * 1024; 53 }; 54 } // namespace DistributedHardware 55 } // namespace OHOS 56 #endif // OHOS_DISTRIBUTED_CAMERA_SINK_PROXY_H