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(
29 std::shared_ptr<core::interface::Subscription> subscription) {}
30 virtual void OnPublicationUnsubscribed(
31 std::shared_ptr<core::interface::Subscription> subscription) {}
32 };
34 std::shared_ptr<core::interface::Channel> channel,
35 const model::Member& dto,
36 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory);
47 std::shared_ptr<core::interface::Subscription> Subscribe(const std::string& publication_id);
48
54 bool Unsubscribe(const std::string& subscription_id);
55
65 void OnSubscribedLocalPersonsPublication(
66 std::shared_ptr<core::interface::Publication> publication,
67 const SubscriptionId& subscription_id) override;
68
76 void OnUnsubscribedLocalPersonsPublication(
77 std::shared_ptr<core::interface::Publication> publication) override;
78
86 void OnLocalPersonSubscribed(
87 std::shared_ptr<core::interface::Subscription> subscription) override;
88
96 void OnLocalPersonUnsubscribed(
97 std::shared_ptr<core::interface::Subscription> subscription) override;
98
100 std::shared_ptr<core::interface::Subscription> subscription) override;
102 std::shared_ptr<core::interface::Subscription> subscription) override;
103
104 // core::interface::Member
105 void OnLeft() override;
106
107 void Dispose() override;
109
110private:
111 connection::P2PConnection* GetOrCreateConnection();
112 connection::P2PConnection* CreateConnection();
113 bool IsLocalPersonSubscribing();
114 bool IsSubscribingLocalPersonsPublication();
115 bool ShouldClose();
116 void CloseConnection();
117
118 std::mutex connection_mtx_;
119 std::unique_ptr<connection::P2PConnection> connection_;
120 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory_;
121 std::unique_ptr<core::interface::IceManager> ice_manager_;
122};
123
124} // namespace remote_person
125} // namespace plugin
126} // namespace skyway
127
128#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:65
virtual void OnPublicationUnsubscribed(std::shared_ptr< interface::Subscription > subscription)
PublicationがUnsubscribeされた時に発生するイベント
Definition remote_member.hpp:69
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