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 manager service base class. 15 * Author: zhangge 16 * Create: 2022-6-15 17 */ 18 19 #ifndef I_CAST_SESSION_MANAGER_SERVICE_H 20 #define I_CAST_SESSION_MANAGER_SERVICE_H 21 22 #include "cast_engine_common.h" 23 #include "i_cast_session_manager_listener.h" 24 #include "i_cast_session_impl.h" 25 #include "i_cast_service_listener_impl.h" 26 #include "iremote_broker.h" 27 28 namespace OHOS { 29 namespace CastEngine { 30 class ICastSessionManagerService : public IRemoteBroker { 31 public: 32 DECLARE_INTERFACE_DESCRIPTOR(u"OHOS.CastEngine.ICastSessionManagerService"); 33 34 ICastSessionManagerService() = default; 35 ICastSessionManagerService(const ICastSessionManagerService &) = delete; 36 ICastSessionManagerService &operator=(const ICastSessionManagerService &) = delete; 37 ICastSessionManagerService(ICastSessionManagerService &&) = delete; 38 ICastSessionManagerService &operator=(ICastSessionManagerService &&) = delete; 39 ~ICastSessionManagerService() override = default; 40 41 virtual int32_t RegisterListener(sptr<ICastServiceListenerImpl> listener) = 0; 42 virtual int32_t UnregisterListener() = 0; 43 virtual int32_t Release() = 0; 44 virtual int32_t SetLocalDevice(const CastLocalDevice &localDevice) = 0; 45 virtual int32_t CreateCastSession(const CastSessionProperty &property, sptr<ICastSessionImpl> &castSession) = 0; 46 virtual int32_t SetSinkSessionCapacity(int sessionCapacity) = 0; 47 virtual int32_t StartDiscovery(int protocols, std::vector<std::string> drmSchemes) = 0; 48 virtual int32_t SetDiscoverable(bool enable) = 0; 49 virtual int32_t StopDiscovery() = 0; 50 virtual int32_t StartDeviceLogging(int32_t fd, uint32_t maxSize) = 0; 51 virtual int32_t GetCastSession(std::string sessionId, sptr<ICastSessionImpl> &castSession) = 0; 52 53 protected: 54 enum { 55 REGISTER_LISTENER = 0, 56 UNREGISTER_LISTENER, 57 RELEASE, 58 SET_LOCAL_DEVICE, 59 CREATE_CAST_SESSION, 60 SET_SINK_SESSION_CAPACITY, 61 START_DISCOVERY, 62 SET_DISCOVERABLE, 63 STOP_DISCOVERY, 64 START_DEVICE_LOGGING, 65 GET_CAST_SESSION 66 }; 67 }; 68 } // namespace CastEngine 69 } // namespace OHOS 70 #endif