1 /* 2 * Copyright (C) 2023-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 * Description: supply cast session implement proxy 15 * Author: zhangge 16 * Create: 2022-5-29 17 */ 18 19 #ifndef CAST_SESSION_IMPL_PROXY_H 20 #define CAST_SESSION_IMPL_PROXY_H 21 22 #include "cast_engine_common.h" 23 #include "i_cast_session_impl.h" 24 #include "iremote_proxy.h" 25 #include "oh_remote_control_event.h" 26 27 namespace OHOS { 28 namespace CastEngine { 29 namespace CastEngineClient { 30 class CastSessionImplProxy : public IRemoteProxy<ICastSessionImpl> { 31 public: CastSessionImplProxy(const sptr<IRemoteObject> &impl)32 explicit CastSessionImplProxy(const sptr<IRemoteObject> &impl) : IRemoteProxy<ICastSessionImpl>(impl) {} 33 ~CastSessionImplProxy() override; 34 35 int32_t RegisterListener(sptr<ICastSessionListenerImpl> listener) override; 36 int32_t UnregisterListener() override; 37 int32_t AddDevice(const CastRemoteDevice &remoteDevice) override; 38 int32_t RemoveDevice(const std::string &deviceId) override; 39 int32_t StartAuth(const AuthInfo &authInfo) override; 40 int32_t GetSessionId(std::string &sessionId) override; 41 int32_t GetDeviceState(const std::string &deviceId, DeviceState &deviceState) override; 42 int32_t SetSessionProperty(const CastSessionProperty &property) override; 43 int32_t CreateMirrorPlayer(sptr<IMirrorPlayerImpl> &mirrorPlayer) override; 44 int32_t CreateStreamPlayer(sptr<IStreamPlayerIpc> &streamPlayer) override; 45 int32_t Release() override; 46 int32_t NotifyEvent(EventId eventId, std::string &jsonParam) override; 47 int32_t SetCastMode(CastMode mode, std::string &jsonParam) override; 48 49 private: 50 static inline BrokerDelegator<CastSessionImplProxy> delegator_; 51 }; 52 } // namespace CastEngineClient 53 } // namespace CastEngine 54 } // namespace OHOS 55 56 #endif // CAST_ENGINE_PROXY_H