mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-17 15:27:49 +08:00
Merge remote-tracking branch 'open_src/master' into feature/python
This commit is contained in:
commit
d0a86924b7
@ -396,6 +396,12 @@ Track::Ptr getTrackBySdp(const SdpTrack::Ptr &track) {
|
|||||||
// If aac config information cannot be obtained from sdp, then it cannot be obtained from rtp either, so ignore this Track
|
// If aac config information cannot be obtained from sdp, then it cannot be obtained from rtp either, so ignore this Track
|
||||||
return nullptr;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
while (aac_cfg_str.size() < 4) {
|
||||||
|
aac_cfg_str = '0' + aac_cfg_str;
|
||||||
|
}
|
||||||
|
if (aac_cfg_str.size() > 4) {
|
||||||
|
aac_cfg_str = aac_cfg_str.substr(0, 4);
|
||||||
|
}
|
||||||
string aac_cfg;
|
string aac_cfg;
|
||||||
for (size_t i = 0; i < aac_cfg_str.size() / 2; ++i) {
|
for (size_t i = 0; i < aac_cfg_str.size() / 2; ++i) {
|
||||||
unsigned int cfg;
|
unsigned int cfg;
|
||||||
|
|||||||
@ -51,9 +51,9 @@ void RtpSender::startSend(const MediaSourceEvent &sender, const MediaSourceEvent
|
|||||||
// Do not recreate the object when reconnecting
|
// Do not recreate the object when reconnecting
|
||||||
auto lam = [this](std::shared_ptr<List<Buffer::Ptr>> list) { onFlushRtpList(std::move(list)); };
|
auto lam = [this](std::shared_ptr<List<Buffer::Ptr>> list) { onFlushRtpList(std::move(list)); };
|
||||||
switch (args.data_type) {
|
switch (args.data_type) {
|
||||||
case MediaSourceEvent::SendRtpArgs::kRtpPS: _interface = std::make_shared<RtpCachePS>(lam, atoi(args.ssrc.data()), args.pt, true); break;
|
case MediaSourceEvent::SendRtpArgs::kRtpPS: _interface = std::make_shared<RtpCachePS>(lam, stoll(args.ssrc), args.pt, true); break;
|
||||||
case MediaSourceEvent::SendRtpArgs::kRtpTS: _interface = std::make_shared<RtpCachePS>(lam, atoi(args.ssrc.data()), args.pt, false); break;
|
case MediaSourceEvent::SendRtpArgs::kRtpTS: _interface = std::make_shared<RtpCachePS>(lam, stoll(args.ssrc), args.pt, false); break;
|
||||||
case MediaSourceEvent::SendRtpArgs::kRtpES: _interface = std::make_shared<RtpCacheRaw>(lam, atoi(args.ssrc.data()), args.pt, args.only_audio); break;
|
case MediaSourceEvent::SendRtpArgs::kRtpES: _interface = std::make_shared<RtpCacheRaw>(lam, stoll(args.ssrc), args.pt, args.only_audio); break;
|
||||||
default: CHECK(0, "invalid rtp type: " + to_string(args.data_type)); break;
|
default: CHECK(0, "invalid rtp type: " + to_string(args.data_type)); break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -386,7 +386,7 @@ void RtpSender::onSendRtpUdp(const toolkit::Buffer::Ptr &buf, bool check) {
|
|||||||
_rtcp_send_ticker.resetTime();
|
_rtcp_send_ticker.resetTime();
|
||||||
// rtcp ssrc为rtp ssrc + 1 [AUTO-TRANSLATED:318fada3]
|
// rtcp ssrc为rtp ssrc + 1 [AUTO-TRANSLATED:318fada3]
|
||||||
// rtcp ssrc is rtp ssrc + 1
|
// rtcp ssrc is rtp ssrc + 1
|
||||||
auto sr = _rtcp_context->createRtcpSR(atoi(_args.ssrc.data()) + 1);
|
auto sr = _rtcp_context->createRtcpSR(stoll(_args.ssrc) + 1);
|
||||||
// send sender report rtcp
|
// send sender report rtcp
|
||||||
_socket_rtcp->send(sr);
|
_socket_rtcp->send(sr);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user