31 void AddInternalListener(interface::Subscription::InternalListener* listener)
override;
32 void RemoveInternalListener(interface::Subscription::InternalListener* listener)
override;
35 std::string
Id()
const override;
37 std::shared_ptr<interface::Publication>
Publication()
const override;
38 std::shared_ptr<interface::Member>
Subscriber()
const override;
39 interface::SubscriptionState
State()
override;
41 std::shared_ptr<interface::RemoteStream>
Stream()
override;
46 std::optional<model::WebRTCStats>
GetStats()
override;
48 void AddGetStatsCallback(Callback* callback)
override;
49 void RemoveGetStatsCallback()
override;
51 void SetStream(std::shared_ptr<interface::RemoteStream> stream)
override;
52 void SetPreferredEncodingId(
const std::string&
id)
override;
54 void OnCanceled()
override;
55 void OnConnectionStateChanged(
const core::ConnectionState new_state)
override;
58 std::weak_ptr<interface::Channel> channel_;
60 model::ContentType content_type_;
61 std::atomic<interface::SubscriptionState> state_;
62 std::weak_ptr<interface::Member> subscriber_;
63 std::mutex stream_mtx_;
64 std::shared_ptr<interface::RemoteStream> stream_;
65 std::optional<std::string> preferred_encoding_id_;
67 std::mutex listeners_mtx_;
68 std::unordered_set<interface::Subscription::EventListener*> listeners_;
69 std::mutex internal_listeners_mtx_;
70 std::unordered_set<interface::Subscription::InternalListener*> internal_listeners_;
71 std::mutex get_stats_callback_mutex_;
72 Callback* get_stats_callback_;
76 friend class CoreSubscriptionTest;