20 interface::RoomDomainFactory* factory,
21 std::shared_ptr<media::stream::interface::local::LocalStream> stream);
25 std::string
Id()
override;
27 std::shared_ptr<interface::RoomMember>
Publisher()
override;
28 std::vector<std::shared_ptr<interface::RoomSubscription>>
Subscriptions()
override;
30 std::optional<std::string>
Metadata()
override;
34 std::shared_ptr<media::stream::interface::local::LocalStream>
Stream()
override;
40 std::shared_ptr<media::stream::interface::local::LocalStream> stream)
override;
43 std::optional<WebRTCStats>
GetStats(
const std::string& selector)
override;
46 class CoreEventListenerAdapter :
public core::interface::Publication::EventListener {
50 void OnSubscribed(std::shared_ptr<core::interface::Subscription> subscription)
override;
51 void OnUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription)
override;
52 void OnSubscriptionListChanged()
override;
53 void OnMetadataUpdated(
const std::string& metadata)
override;
54 void OnEnabled()
override;
55 void OnDisabled()
override;
56 void OnStateChanged()
override;
57 void OnConnectionStateChanged(std::shared_ptr<core::interface::RemoteMember> remote_member,
58 const core::ConnectionState new_state)
override;
64 class OriginEventListenerAdapter :
public core::interface::Publication::EventListener {
67 void OnMetadataUpdated(
const std::string& metadata)
override;
68 void OnConnectionStateChanged(std::shared_ptr<core::interface::RemoteMember> remote_member,
69 const core::ConnectionState new_state)
override;
76 void OnSubscribed(std::shared_ptr<core::interface::Subscription> subscription);
77 void OnUnsubscribed(std::shared_ptr<core::interface::Subscription> subscription);
78 void OnSubscriptionListChanged();
79 void OnMetadataUpdated(
const std::string& metadata);
82 void OnStateChanged();
83 void OnConnectionStateChanged(std::shared_ptr<core::interface::RemoteMember> remote_member,
84 const core::ConnectionState new_state);
85 void SetStream(std::shared_ptr<media::stream::interface::local::LocalStream> stream);
87 PublicationState ConvertToPlatformPublicationState(core::interface::PublicationState state);
88 std::mutex stream_mtx_;
89 std::shared_ptr<media::stream::interface::local::LocalStream> stream_;
90 std::shared_ptr<core::interface::Publication> core_;
91 interface::RoomDomainFactory* factory_;
92 std::unique_ptr<CoreEventListenerAdapter> core_event_listener_adapter_;
94 std::mutex listener_mtx_;
95 interface::RoomPublication::EventListener* listener_;
96 std::unique_ptr<OriginEventListenerAdapter> origin_event_listener_adapter_;