SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
room_publication.hpp
1//
2// © NTT DOCOMO BUSINESS, Inc. All Rights Reserved.
3//
4
5#ifndef SKYWAY_ROOM_ROOM_PUBLICATION_HPP
6#define SKYWAY_ROOM_ROOM_PUBLICATION_HPP
7
8#include <mutex>
9
10#include <skyway/core/interface/publication.hpp>
11
12#include "skyway/room/interface/room_domain_factory.hpp"
13#include "skyway/room/interface/room_publication.hpp"
14
15namespace skyway {
16namespace room {
17
21public:
22 RoomPublication(std::shared_ptr<core::interface::Publication> core,
23 interface::RoomDomainFactory* factory);
25 std::string Id() override;
26 model::PublicationType Type() override;
27 std::shared_ptr<interface::RoomMember> Publisher() override;
28 std::vector<std::shared_ptr<interface::RoomSubscription>> Subscriptions() override;
29 model::ContentType ContentType() override;
30 std::optional<std::string> Metadata() override;
31 std::vector<model::Codec> CodecCapabilities() override;
32 std::vector<model::Encoding> Encodings() override;
33 core::interface::PublicationState State() override;
34 std::shared_ptr<core::interface::LocalStream> Stream() override;
37 bool UpdateMetadata(const std::string& metadata) override;
38 bool UpdateEncodings(std::vector<model::Encoding> encodings) override;
39 bool ReplaceStream(std::shared_ptr<core::interface::LocalStream> stream) override;
40 bool Cancel() override;
41 bool Enable() override;
42 bool Disable() override;
43 std::optional<model::WebRTCStats> GetStats(const std::string& selector) override;
44
45private:
46 class OriginEventPropagater : public core::interface::Publication::EventListener {
47 public:
48 OriginEventPropagater(RoomPublication* outer);
49 void OnMetadataUpdated(const std::string& metadata) override;
50
51 private:
52 RoomPublication* outer_;
53 };
54
55 // core::interface::Publication::EventListener
56 void OnUnpublished() override;
57 void OnSubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
58 void OnUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription) override;
59 void OnSubscriptionListChanged() override;
60 void OnMetadataUpdated(const std::string& metadata) override;
61 void OnEnabled() override;
62 void OnDisabled() override;
63 void OnStateChanged() override;
64 void OnConnectionStateChanged(const core::ConnectionState new_state) override;
65
66 std::shared_ptr<core::interface::Publication> core_;
67 interface::RoomDomainFactory* factory_;
68
69 std::mutex listener_mtx_;
71 OriginEventPropagater* origin_event_propagater_;
72};
73
74} // namespace room
75} // namespace skyway
76
77#endif /* SKYWAY_ROOM_ROOM_PUBLICATION_HPP */
イベントリスナ
Definition publication.hpp:31
RoomPublicationの操作を行うクラス
Definition room_publication.hpp:20
bool ReplaceStream(std::shared_ptr< core::interface::LocalStream > stream) override
公開しているStreamを変更します。
std::optional< std::string > Metadata() override
Metadataを取得します。
std::shared_ptr< core::interface::LocalStream > Stream() override
Publisherが持つStreamを取得します。
void AddEventListener(interface::RoomPublication::EventListener *listener) override
イベントを購読します。
std::vector< model::Encoding > Encodings() override
このPublicationのエンコーディング設定の一覧を取得します。
bool UpdateMetadata(const std::string &metadata) override
Metadataを更新します。
bool Disable() override
Publicationの公開を一時停止します。
std::optional< model::WebRTCStats > GetStats(const std::string &selector) override
統計情報を取得します。
bool Enable() override
Publicationの公開を開始します。disableによって停止していた場合は再開します。
std::vector< model::Codec > CodecCapabilities() override
このPublicationのコーデック一覧を取得します。
bool UpdateEncodings(std::vector< model::Encoding > encodings) override
エンコーディング設定を更新します。
std::shared_ptr< interface::RoomMember > Publisher() override
このPublicationを公開しているMemberを取得します。
void RemoveEventListener(interface::RoomPublication::EventListener *listener) override
イベントの購読を中止します。
model::ContentType ContentType() override
ContentType(VideoかAudioかDataか)を取得します。
core::interface::PublicationState State() override
State(公開状態がEnableかDisabelかCancelか)を取得します。
std::vector< std::shared_ptr< interface::RoomSubscription > > Subscriptions() override
このPublicationを購読しているSubsciptionの一覧を取得します。
model::PublicationType Type() override
PublicationのTypeを取得します。
bool Cancel() override
Publishを中止します。
std::string Id() override
Idを取得します。
イベントリスナ
Definition room_publication.hpp:22
RoomのPublicationを操作するインタフェース
Definition room_publication.hpp:19