• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 proxy class
15  * Author: zhangge
16  * Create: 2022-5-29
17  */
18 
19 #ifndef CAST_SESSION_MANAGER_SERVICE_PROXY_H
20 #define CAST_SESSION_MANAGER_SERVICE_PROXY_H
21 
22 #include "cast_engine_common.h"
23 #include "i_cast_session_manager_service.h"
24 #include "iremote_proxy.h"
25 
26 namespace OHOS {
27 namespace CastEngine {
28 namespace CastEngineClient {
29 class CastSessionManagerServiceProxy : public IRemoteProxy<ICastSessionManagerService> {
30 public:
CastSessionManagerServiceProxy(const sptr<IRemoteObject> & impl)31     explicit CastSessionManagerServiceProxy(const sptr<IRemoteObject> &impl)
32         : IRemoteProxy<ICastSessionManagerService>(impl)
33     {}
34 
35     int32_t RegisterListener(sptr<ICastServiceListenerImpl> listener) override;
36     int32_t UnregisterListener() override;
37     int32_t Release() override;
38 
39     int32_t CreateCastSession(const CastSessionProperty &property, sptr<ICastSessionImpl> &castSession) override;
40     int32_t SetLocalDevice(const CastLocalDevice &localDevice) override;
41     int32_t SetSinkSessionCapacity(int sessionCapacity) override;
42     int32_t SetDiscoverable(bool enable) override;
43 
44     int32_t StartDiscovery(int protocols, std::vector<std::string> drmSchemes) override;
45     int32_t StopDiscovery() override;
46     int32_t StartDeviceLogging(int32_t fd, uint32_t maxSize) override;
47 
48     sptr<IRemoteObject> GetSessionManagerService();
49     int32_t GetCastSession(std::string sessionId, sptr<ICastSessionImpl> &castSession) override;
50 
51 private:
52     static inline BrokerDelegator<CastSessionManagerServiceProxy> delegator_;
53 };
54 } // namespace CastEngineClient
55 } // namespace CastEngine
56 } // namespace OHOS
57 
58 
59 #endif // CAST_ENGINE_PROXY_H