30 void AddInternalListener(InternalListener* listener)
override;
31 void RemoveInternalListener(InternalListener* listener)
override;
34 std::string
Id()
const override;
38 boost::optional<std::string>
Metadata()
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 boost::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;
67 void OnMetadataUpdated(
const std::string& metadata)
override;
68 void OnEnabled()
override;
69 void OnDisabled()
override;
70 void OnConnectionStateChanged(
const ConnectionState new_state)
override;
76 std::atomic<interface::PublicationState> state_;
77 std::vector<model::Codec> codec_capabilities_;
78 std::vector<model::Encoding> encodings_;
80 std::shared_ptr<interface::LocalStream> stream_;
82 std::mutex listeners_mtx_;
83 std::mutex internal_listeners_mtx_;
84 std::unordered_set<interface::Publication::EventListener*> listeners_;
85 std::unordered_set<interface::Publication::InternalListener*> internal_listeners_;
86 std::atomic<bool> metadata_updated_;
88 std::mutex get_stats_callback_mutex_;
89 std::unordered_map<std::string, Callback*> get_stats_callbacks_;