mirror of
https://github.com/ZLMediaKit/ZLMediaKit.git
synced 2026-04-03 04:00:53 +08:00
统一部分变量名和代码样式风格
This commit is contained in:
@@ -42,22 +42,22 @@ void WebRtcPlayer::onStartWebRTC() {
|
||||
weak_ptr<Session> weak_session = getSession();
|
||||
_reader->setGetInfoCB([weak_session]() { return weak_session.lock(); });
|
||||
_reader->setReadCB([weak_self](const RtspMediaSource::RingDataType &pkt) {
|
||||
auto strongSelf = weak_self.lock();
|
||||
if (!strongSelf) {
|
||||
auto strong_self = weak_self.lock();
|
||||
if (!strong_self) {
|
||||
return;
|
||||
}
|
||||
size_t i = 0;
|
||||
pkt->for_each([&](const RtpPacket::Ptr &rtp) {
|
||||
//TraceL<<"send track type:"<<rtp->type<<" ts:"<<rtp->getStamp()<<" ntp:"<<rtp->ntp_stamp<<" size:"<<rtp->getPayloadSize()<<" i:"<<i;
|
||||
strongSelf->onSendRtp(rtp, ++i == pkt->size());
|
||||
strong_self->onSendRtp(rtp, ++i == pkt->size());
|
||||
});
|
||||
});
|
||||
_reader->setDetachCB([weak_self]() {
|
||||
auto strongSelf = weak_self.lock();
|
||||
if (!strongSelf) {
|
||||
auto strong_self = weak_self.lock();
|
||||
if (!strong_self) {
|
||||
return;
|
||||
}
|
||||
strongSelf->onShutdown(SockException(Err_shutdown, "rtsp ring buffer detached"));
|
||||
strong_self->onShutdown(SockException(Err_shutdown, "rtsp ring buffer detached"));
|
||||
});
|
||||
}
|
||||
//使用完毕后,释放强引用,这样确保推流器断开后能及时注销媒体
|
||||
|
||||
Reference in New Issue
Block a user