File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,7 +162,11 @@ class LIVEKIT_API Room {
162162 RemoteParticipant* remoteParticipant (const std::string& identity) const ;
163163
164164 // / Returns a snapshot of all current remote participants.
165- std::vector<std::shared_ptr<RemoteParticipant>> remoteParticipants () const ;
165+ // /
166+ // / @return Vector of non-null pointers to the current remote participants.
167+ // / The pointers are owned by the Room and remain valid until the
168+ // / corresponding participant disconnects.
169+ std::vector<RemoteParticipant*> remoteParticipants () const ;
166170
167171 // / Returns the current connection state of the room.
168172 ConnectionState connectionState () const ;
Original file line number Diff line number Diff line change @@ -246,12 +246,12 @@ RemoteParticipant* Room::remoteParticipant(const std::string& identity) const {
246246 return it == remote_participants_.end () ? nullptr : it->second .get ();
247247}
248248
249- std::vector<std::shared_ptr< RemoteParticipant> > Room::remoteParticipants () const {
249+ std::vector<RemoteParticipant* > Room::remoteParticipants () const {
250250 const std::scoped_lock<std::mutex> guard (lock_);
251- std::vector<std::shared_ptr< RemoteParticipant> > out;
251+ std::vector<RemoteParticipant* > out;
252252 out.reserve (remote_participants_.size ());
253253 for (const auto & kv : remote_participants_) {
254- out.push_back (kv.second );
254+ out.push_back (kv.second . get () );
255255 }
256256 return out;
257257}
You can’t perform that action at this time.
0 commit comments