SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
remote_person.hpp
1//
2// remote_person.hpp
3// skyway
4//
5// Created by sandabu on 2021/12/21.
6// Copyright © 2021 NTT Communications. All rights reserved.
7//
8
9#ifndef SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_
10#define SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_
11
12#include "skyway/core/ice/ice_manager.hpp"
13#include "skyway/core/interface/channel.hpp"
14#include "skyway/core/interface/publication.hpp"
15#include "skyway/core/interface/remote_member.hpp"
16#include "skyway/core/interface/stream.hpp"
17#include "skyway/core/interface/subscription.hpp"
18#include "skyway/plugin/remote_person_plugin/connection/p2p_connection.hpp"
19
20namespace skyway {
21namespace plugin {
22namespace remote_person {
23
24using SubscriptionId = std::string;
25
29public:
31 public:
32 virtual void OnPublicationSubscribed(std::shared_ptr<core::interface::Subscription> subscription) {}
33 virtual void OnPublicationUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) {}
34 };
36 std::shared_ptr<core::interface::Channel> channel,
37 const model::Member& dto,
38 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory);
49 std::shared_ptr<core::interface::Subscription> Subscribe(const std::string& publication_id);
50
56 bool Unsubscribe(const std::string& subscription_id);
57
67 void OnSubscribedLocalPersonsPublication(std::shared_ptr<core::interface::Publication> publication,
68 const SubscriptionId& subscription_id) override;
69
77 void OnUnsubscribedLocalPersonsPublication(std::shared_ptr<core::interface::Publication> publication) override;
78
86 void OnLocalPersonSubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
87
95 void OnLocalPersonUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
96
97 void OnPublicationSubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
98 void OnPublicationUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
99
100 // core::interface::Member
101 void OnLeft() override;
102
103 void Dispose() override;
105
106private:
107 connection::P2PConnection* GetOrCreateConnection();
108 connection::P2PConnection* CreateConnection();
109 bool IsLocalPersonSubscribing();
110 bool IsSubscribingLocalPersonsPublication();
111 bool ShouldClose();
112 void CloseConnection();
113
114 std::mutex connection_mtx_;
115 std::unique_ptr<connection::P2PConnection> connection_;
116 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory_;
117 std::unique_ptr<core::interface::IceManager> ice_manager_;
118};
119
120} // namespace remote_person
121} // namespace plugin
122} // namespace skyway
123
124#endif /* SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_ */
イベントリスナ
Definition member.hpp:34
このSDK以外で生成されたメンバ
Definition remote_member.hpp:32
virtual void OnPublicationSubscribed(std::shared_ptr< interface::Subscription > subscription)
PublicationがSubscribeされた時に発生するイベント
Definition remote_member.hpp:66
virtual void OnPublicationUnsubscribed(std::shared_ptr< interface::Subscription > subscription)
PublicationがUnsubscribeされた時に発生するイベント
Definition remote_member.hpp:70
RemotePersonの機能を持つメンバー
Definition remote_person.hpp:28
bool Unsubscribe(const std::string &subscription_id)
Subscribeを中止させます。
std::shared_ptr< core::interface::Subscription > Subscribe(const std::string &publication_id)
Subscribeをさせます。
メンバー情報
Definition domain.hpp:54