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 definition.
15 * Author: zhangge
16 * Create: 2022-06-15
17 */
18
19#ifndef CAST_SESSION_H
20#define CAST_SESSION_H
21
22#include "cast_engine_common.h"
23#include "i_cast_session.h"
24#include "i_cast_session_impl.h"
25#include "oh_remote_control_event.h"
26
27namespace OHOS {
28namespace CastEngine {
29namespace CastEngineClient {
30class CastSession : public ICastSession {
31public:
32    CastSession(sptr<ICastSessionImpl> proxy) : proxy_(proxy) {};
33    ~CastSession() override;
34
35    int32_t RegisterListener(std::shared_ptr<ICastSessionListener> 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 SetSessionProperty(const CastSessionProperty &property) override;
42    int32_t SetSessionId(std::string sessionId);
43    int32_t CreateMirrorPlayer(std::shared_ptr<IMirrorPlayer> &mirrorPlayer) override;
44    int32_t CreateStreamPlayer(std::shared_ptr<IStreamPlayer> &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
49private:
50    sptr<ICastSessionImpl> proxy_;
51    std::string sessionId_{};
52};
53} // namespace CastEngineClient
54} // namespace CastEngine
55} // namespace OHOS
56
57#endif
58