SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
remote_person.hpp
1//
2// © NTT DOCOMO BUSINESS, Inc. All Rights Reserved.
3//
4
5#ifndef SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_
6#define SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_
7
8#include "skyway/core/ice/ice_manager.hpp"
9#include "skyway/core/interface/channel.hpp"
10#include "skyway/core/interface/publication.hpp"
11#include "skyway/core/interface/remote_member.hpp"
12#include "skyway/core/interface/stream.hpp"
13#include "skyway/core/interface/subscription.hpp"
14#include "skyway/plugin/remote_person_plugin/connection/p2p_connection.hpp"
15
16namespace skyway {
17namespace plugin {
18namespace remote_person {
19
20using SubscriptionId = std::string;
21
25public:
27 public:
28 virtual void OnPublicationSubscribed(std::shared_ptr<core::interface::Subscription> subscription) {}
29 virtual void OnPublicationUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) {}
30 };
32 std::shared_ptr<core::interface::Channel> channel,
33 const model::Member& dto,
34 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory);
45 std::shared_ptr<core::interface::Subscription> Subscribe(const std::string& publication_id);
46
52 bool Unsubscribe(const std::string& subscription_id);
53
63 void OnSubscribedLocalPersonsPublication(std::shared_ptr<core::interface::Publication> publication,
64 const SubscriptionId& subscription_id) override;
65
73 void OnUnsubscribedLocalPersonsPublication(std::shared_ptr<core::interface::Publication> publication) override;
74
82 void OnLocalPersonSubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
83
91 void OnLocalPersonUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
92
93 void OnPublicationSubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
94 void OnPublicationUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
95
96 // core::interface::Member
97 void OnLeft() override;
98
99 void Dispose() override;
101
102private:
103 connection::P2PConnection* GetOrCreateConnection();
104 connection::P2PConnection* CreateConnection();
105 bool IsLocalPersonSubscribing();
106 bool IsSubscribingLocalPersonsPublication();
107 bool ShouldClose();
108 void CloseConnection();
109
110 std::mutex connection_mtx_;
111 std::unique_ptr<connection::P2PConnection> connection_;
112 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory_;
113 std::unique_ptr<core::interface::IceManager> ice_manager_;
114};
115
116} // namespace remote_person
117} // namespace plugin
118} // namespace skyway
119
120#endif /* SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_ */
イベントリスナ
Definition member.hpp:30
このSDK以外で生成されたメンバ
Definition remote_member.hpp:28
virtual void OnPublicationSubscribed(std::shared_ptr< interface::Subscription > subscription)
PublicationがSubscribeされた時に発生するイベント
Definition remote_member.hpp:62
virtual void OnPublicationUnsubscribed(std::shared_ptr< interface::Subscription > subscription)
PublicationがUnsubscribeされた時に発生するイベント
Definition remote_member.hpp:66
RemotePersonの機能を持つメンバー
Definition remote_person.hpp:24
bool Unsubscribe(const std::string &subscription_id)
Subscribeを中止させます。
std::shared_ptr< core::interface::Subscription > Subscribe(const std::string &publication_id)
Subscribeをさせます。
メンバー情報
Definition domain.hpp:53