SkyWay for Linux
読み取り中…
検索中…
一致する文字列を見つけられません
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 RemoteMemberInterface = core::interface::RemoteMember;
25using PublicationInterface = core::interface::Publication;
26using SubscriptionInterface = core::interface::Subscription;
27using MemberInterface = core::interface::Member;
28using SubscriptionId = std::string;
29
33 public core::interface::Channel::InternalEventListener {
34public:
36 public:
37 virtual void OnPublicationSubscribed(SubscriptionInterface* subscription) {}
38 virtual void OnPublicationUnsubscribed(SubscriptionInterface* subscription) {}
39 };
42 const model::Member& dto,
43 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory);
54 SubscriptionInterface* Subscribe(const std::string& publication_id);
55
61 bool Unsubscribe(const std::string& subscription_id);
62
72 void OnSubscribedLocalPersonsPublication(PublicationInterface* publication,
73 const SubscriptionId& subscription_id) override;
74
82 void OnUnsubscribedLocalPersonsPublication(PublicationInterface* publication) override;
83
91 void OnLocalPersonSubscribed(SubscriptionInterface* subscription) override;
92
100 void OnLocalPersonUnsubscribed(SubscriptionInterface* subscription) override;
101
102 // core::interface::Member
103 void OnLeft() override;
104
105 // core::interface::Channel::InternalEventListener
106 void OnPublicationSubscribed(SubscriptionInterface* subscription) override;
107 void OnPublicationUnsubscribed(SubscriptionInterface* subscription) override;
108
109 void Dispose() override;
111
112private:
113 connection::P2PConnection* GetOrCreateConnection();
114 connection::P2PConnection* CreateConnection();
115 bool IsLocalPersonSubscribing();
116 bool IsSubscribingLocalPersonsPublication();
117 bool ShouldClose();
118 void CloseConnection();
119
120 std::mutex connection_mtx_;
121 std::unique_ptr<connection::P2PConnection> connection_;
122 rtc::scoped_refptr<webrtc::PeerConnectionFactoryInterface> peer_connection_factory_;
123 std::unique_ptr<core::interface::IceManager> ice_manager_;
124 std::unique_ptr<global::interface::Worker> worker_ = std::make_unique<global::Worker>();
125};
126
127} // namespace remote_person
128} // namespace plugin
129} // namespace skyway
130
131#endif /* SKYWAY_PLUGIN_REMOTE_PERSON_PLUGIN_REMOTE_PERSON_HPP_ */
Channelのインターフェース
Definition channel.hpp:28
イベントリスナ
Definition member.hpp:35
Publicationのインターフェース
Definition publication.hpp:29
このSDK以外で生成されたメンバ
Definition remote_member.hpp:32
Subscriptionのインターフェース
Definition subscription.hpp:27
RemotePersonの機能を持つメンバー
Definition remote_person.hpp:33
bool Unsubscribe(const std::string &subscription_id)
Subscribeを中止させます。
SubscriptionInterface * Subscribe(const std::string &publication_id)
Subscribeをさせます。
メンバー情報
Definition domain.hpp:54