优化获取播放器列表相关功能

This commit is contained in:
xia-chu
2023-09-02 12:06:35 +08:00
parent d286ac1d73
commit 39dd886ec1
15 changed files with 68 additions and 27 deletions

View File

@@ -48,7 +48,11 @@ void WebRtcPlayer::onStartWebRTC() {
_reader = playSrc->getRing()->attach(getPoller(), true);
weak_ptr<WebRtcPlayer> weak_self = static_pointer_cast<WebRtcPlayer>(shared_from_this());
weak_ptr<Session> weak_session = static_pointer_cast<Session>(getSession());
_reader->setGetInfoCB([weak_session]() { return weak_session.lock(); });
_reader->setGetInfoCB([weak_session]() {
Any ret;
ret.set(static_pointer_cast<SockInfo>(weak_session.lock()));
return ret;
});
_reader->setReadCB([weak_self](const RtspMediaSource::RingDataType &pkt) {
auto strong_self = weak_self.lock();
if (!strong_self) {