SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
room_subscription.hpp
1#ifndef SKYWAY_ROOM_ROOM_SUBSCRIPTION_HPP
2#define SKYWAY_ROOM_ROOM_SUBSCRIPTION_HPP
3
4#include <mutex>
5
6#include <skyway/core/interface/subscription.hpp>
7
8#include "skyway/room/interface/room_domain_factory.hpp"
9#include "skyway/room/interface/room_subscription.hpp"
10
11namespace skyway {
12namespace room {
13
16public:
18 RoomSubscription(std::shared_ptr<core::interface::Subscription> core,
19 interface::RoomDomainFactory* factory);
21
23 std::string Id() override;
25 std::shared_ptr<interface::RoomPublication> Publication() override;
26 std::shared_ptr<interface::RoomMember> Subscriber() override;
28 std::shared_ptr<media::stream::interface::remote::RemoteStream> Stream() override;
29 std::optional<std::string> PreferredEncodingId() override;
30
33 bool ChangePreferredEncoding(const std::string& id) override;
34 std::optional<WebRTCStats> GetStats() override;
35
36private:
37 class CoreEventListenerAdapter : public core::interface::Subscription::EventListener {
38 public:
39 CoreEventListenerAdapter(RoomSubscription* outer);
40 void OnCanceled();
41 void OnConnectionStateChanged(const core::ConnectionState state);
42 void OnStreamAttached(std::shared_ptr<core::interface::RemoteStream> stream);
43
44 private:
45 RoomSubscription* outer_;
46 };
47
48 void SetStream();
49 void OnCanceled();
50 void OnConnectionStateChanged(const core::ConnectionState state);
51 void OnStreamAttached(std::shared_ptr<core::interface::RemoteStream> stream);
52 SubscriptionState ConvertToPlatformSubscriptionState(core::interface::SubscriptionState state);
53
54 std::mutex stream_mtx_;
55 std::shared_ptr<media::stream::interface::remote::RemoteStream> stream_;
56
57 std::shared_ptr<core::interface::Subscription> core_;
58 interface::RoomDomainFactory* factory_;
59 std::unique_ptr<CoreEventListenerAdapter> core_event_listener_adapter_;
60 std::mutex listener_mtx_;
62};
63
64} // namespace room
65} // namespace skyway
66
67#endif /* SKYWAY_ROOM_ROOM_SUBSCRIPTION_HPP */
RoomSubscriptionの操作を行うクラス
Definition room_subscription.hpp:15
std::optional< WebRTCStats > GetStats() override
統計情報を取得します。
domain::ContentType ContentType() override
ContentType(VideoかAudioかDataか)を取得します。
std::shared_ptr< interface::RoomMember > Subscriber() override
このSubscriptionを購読しているMemberを取得します。
void AddEventListener(interface::RoomSubscription::EventListener *listener) override
イベントを購読します。
void RemoveEventListener(interface::RoomSubscription::EventListener *listener) override
イベントの購読を中止します。
std::string Id() override
Idを取得します。
SubscriptionState State() override
State(公開状態がEnableかDisabelかCancelか)を取得します。
bool ChangePreferredEncoding(const std::string &id) override
受信するエンコード設定を切り替えます。
std::shared_ptr< media::stream::interface::remote::RemoteStream > Stream() override
Publisherが持つStreamを取得します。
std::shared_ptr< interface::RoomPublication > Publication() override
このSubscriptionに紐づくPublicationを取得します。
std::optional< std::string > PreferredEncodingId() override
このSubscriptionの優先エンコーディングIDを取得します。
イベントリスナ
Definition room_subscription.hpp:20
RoomのSubscriptionを操作するインタフェース
Definition room_subscription.hpp:17
ContentType
コンテンツの種類
Definition domain.hpp:22
SubscriptionState
Subscriptionの購読状態
Definition types.hpp:33