30 void AddInternalListener(InternalListener* listener)
override;
31 void RemoveInternalListener(InternalListener* listener)
override;
34 std::string
Id()
const override;
35 std::shared_ptr<interface::Member>
Publisher()
const override;
36 std::vector<std::shared_ptr<interface::Subscription>>
Subscriptions()
const override;
38 std::optional<std::string>
Metadata()
const override;
39 std::shared_ptr<interface::Publication>
Origin()
const override;
41 std::vector<model::Encoding>
Encodings()
const override;
42 interface::PublicationState
State()
override;
44 std::shared_ptr<interface::LocalStream>
Stream()
const override;
48 bool ReplaceStream(std::shared_ptr<interface::LocalStream> stream)
override;
53 std::optional<model::WebRTCStats>
GetStats(
const std::string& selector)
override;
55 void AddGetStatsCallback(
const std::string& remote_member_id, Callback* callback)
override;
56 void RemoveGetStatsCallback(
const std::string& remote_member_id)
override;
58 void SetCodecCapabilities(std::vector<model::Codec> codec_capabilities)
override;
59 void SetEncodings(std::vector<model::Encoding> encodings)
override;
60 void SetStream(std::shared_ptr<interface::LocalStream> stream)
override;
61 bool IsEnabling()
override;
62 void Dispose()
override;
64 void OnUnpublished()
override;
65 void OnSubscribed(std::shared_ptr<interface::Subscription> subscription)
override;
66 void OnUnsubscribed(std::shared_ptr<interface::Subscription> subscription)
override;
67 void OnMetadataUpdated(
const std::string& metadata)
override;
68 void OnEnabled()
override;
69 void OnDisabled()
override;
70 void OnConnectionStateChanged(
const ConnectionState new_state)
override;
74 std::weak_ptr<interface::Channel> channel_;
76 std::atomic<interface::PublicationState> state_;
77 std::vector<model::Codec> codec_capabilities_;
78 std::vector<model::Encoding> encodings_;
80 std::weak_ptr<interface::Member> publisher_;
81 std::shared_ptr<interface::LocalStream> stream_;
83 std::mutex listeners_mtx_;
84 std::mutex internal_listeners_mtx_;
85 std::unordered_set<interface::Publication::EventListener*> listeners_;
86 std::unordered_set<interface::Publication::InternalListener*> internal_listeners_;
87 std::atomic<bool> metadata_updated_;
89 std::mutex get_stats_callback_mutex_;
90 std::unordered_map<std::string, Callback*> get_stats_callbacks_;