SkyWay Linux SDK
読み取り中…
検索中…
一致する文字列を見つけられません
publication.hpp
1//
2// © NTT DOCOMO BUSINESS, Inc. All Rights Reserved.
3//
4
5#ifndef SKYWAY_CORE_PUBLICATION_HPP_
6#define SKYWAY_CORE_PUBLICATION_HPP_
7
8#include "skyway/core/interface/channel.hpp"
9#include "skyway/core/interface/local_stream.hpp"
10
11namespace skyway {
12namespace core {
13
16public:
18 Publication(std::shared_ptr<interface::Channel> channel, const model::Publication& initial_dto);
21
24
26 void AddInternalListener(InternalListener* listener) override;
27 void RemoveInternalListener(InternalListener* listener) override;
29
30 std::string Id() const override;
31 std::shared_ptr<interface::Member> Publisher() const override;
32 std::vector<std::shared_ptr<interface::Subscription>> Subscriptions() const override;
33 model::PublicationType Type() const override;
34 model::ContentType ContentType() const override;
35 std::optional<std::string> Metadata() const override;
36 std::shared_ptr<interface::Publication> Origin() const override;
37 std::vector<model::Codec> CodecCapabilities() const override;
38 std::vector<model::Encoding> Encodings() const override;
39 interface::PublicationState State() override;
40
41 std::shared_ptr<interface::LocalStream> Stream() const override;
42
43 bool UpdateMetadata(const std::string& metadata) override;
44 bool UpdateEncodings(std::vector<model::Encoding> encodings) override;
45 bool ReplaceStream(std::shared_ptr<interface::LocalStream> stream) override;
46 bool Cancel() const override;
47 bool Enable() override;
48 bool Disable() const override;
49
50 std::optional<model::WebRTCStats> GetStats(const std::string& selector) override;
52 void AddGetStatsCallback(const std::string& remote_member_id, Callback* callback) override;
53 void RemoveGetStatsCallback(const std::string& remote_member_id) override;
54
55 void SetCodecCapabilities(std::vector<model::Codec> codec_capabilities) override;
56 void SetEncodings(std::vector<model::Encoding> encodings) override;
57 void SetStream(std::shared_ptr<interface::LocalStream> stream) override;
58 bool IsEnabling() override;
59 void Dispose() override;
60
61 void OnUnpublished() override;
62 void OnSubscribed(std::shared_ptr<interface::Subscription> subscription) override;
63 void OnUnsubscribed(std::shared_ptr<interface::Subscription> subscription) override;
64 void OnMetadataUpdated(const std::string& metadata) override;
65 void OnEnabled() override;
66 void OnDisabled() override;
67 void OnConnectionStateChanged(const ConnectionState new_state) override;
69
70private:
71 std::weak_ptr<interface::Channel> channel_;
72 model::Publication initial_dto_;
73 std::atomic<interface::PublicationState> state_;
74 std::vector<model::Codec> codec_capabilities_;
75 std::vector<model::Encoding> encodings_;
76
77 std::weak_ptr<interface::Member> publisher_;
78 std::shared_ptr<interface::LocalStream> stream_;
79
80 std::mutex listeners_mtx_;
81 std::mutex internal_listeners_mtx_;
82 std::unordered_set<interface::Publication::EventListener*> listeners_;
83 std::unordered_set<interface::Publication::InternalListener*> internal_listeners_;
84 std::atomic<bool> metadata_updated_;
85 bool is_enabling_;
86 std::mutex get_stats_callback_mutex_;
87 std::unordered_map<std::string, Callback*> get_stats_callbacks_;
88};
89
90} // namespace core
91} // namespace skyway
92
93#endif /* SKYWAY_CORE_PUBLICATION_HPP_ */
Publicationの実装クラス
Definition publication.hpp:15
interface::PublicationState State() override
State(公開状態がEnableかDisabelかCancelか)を取得します。
std::optional< std::string > Metadata() const override
Metadataを取得します。
std::vector< model::Encoding > Encodings() const override
このPublicationのエンコーディング設定の一覧を取得します。
void RemoveEventListener(interface::Publication::EventListener *listener) override
イベントの購読を中止します。
model::ContentType ContentType() const override
ContentType(VideoかAudioかDataか)を取得します。
std::vector< std::shared_ptr< interface::Subscription > > Subscriptions() const override
このPublicationを購読しているSubsciptionの一覧を取得します。
std::shared_ptr< interface::Member > Publisher() const override
このPublicationをPublishしているMemberを取得します。
std::shared_ptr< interface::Publication > Origin() const override
このPublicationのOriginを取得します。
bool UpdateEncodings(std::vector< model::Encoding > encodings) override
エンコーディング設定を更新します。
bool Disable() const override
Publicationの公開を一時停止します。
std::shared_ptr< interface::LocalStream > Stream() const override
Publisherが持つStreamを取得します。
bool Cancel() const override
Publishを中止します。
bool Enable() override
Publicationの公開を開始します。disableによって停止していた場合は再開します。
bool UpdateMetadata(const std::string &metadata) override
Metadataを更新します。
std::vector< model::Codec > CodecCapabilities() const override
このPublicationのコーデック一覧を取得します。
std::optional< model::WebRTCStats > GetStats(const std::string &selector) override
統計情報を取得します。
void AddEventListener(interface::Publication::EventListener *listener) override
イベントを購読します。
std::string Id() const override
Idを取得します。
イベントリスナ
Definition publication.hpp:30
Publicationのインターフェース
Definition publication.hpp:27
Publication情報
Definition domain.hpp:91