mirror of
https://gitee.com/xia-chu/ZLMediaKit.git
synced 2026-05-06 10:57:50 +08:00
rtp推流时打印ssrc
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
Some checks failed
Android / build (push) Has been cancelled
CodeQL / Analyze (cpp) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
Docker / build (push) Has been cancelled
Linux / build (push) Has been cancelled
macOS / build (push) Has been cancelled
Windows / build (push) Has been cancelled
This commit is contained in:
parent
dd1e8ef430
commit
444aeceacc
@ -107,6 +107,7 @@ bool RtpProcess::inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data
|
||||
if (!_auth_err.empty()) {
|
||||
throw toolkit::SockException(toolkit::Err_other, _auth_err);
|
||||
}
|
||||
auto header = (RtpHeader *) data;
|
||||
if (_sock != sock) {
|
||||
// 第一次运行本函数 [AUTO-TRANSLATED:a1d7ac17]
|
||||
// First time running this function
|
||||
@ -114,7 +115,7 @@ bool RtpProcess::inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data
|
||||
_sock = sock;
|
||||
_addr.reset(new sockaddr_storage(*((sockaddr_storage *)addr)));
|
||||
if (first) {
|
||||
emitOnPublish();
|
||||
emitOnPublish(ntohl(header->ssrc));
|
||||
_cache_ticker.resetTime();
|
||||
}
|
||||
}
|
||||
@ -131,7 +132,6 @@ bool RtpProcess::inputRtp(bool is_udp, const Socket::Ptr &sock, const char *data
|
||||
_process = std::make_shared<GB28181Process>(_media_info, this);
|
||||
}
|
||||
|
||||
auto header = (RtpHeader *) data;
|
||||
onRtp(ntohs(header->seq), ntohl(header->stamp), 0/*不发送sr,所以可以设置为0*/ , 90000/*ps/ts流时间戳按照90K采样率*/, len);
|
||||
|
||||
GET_CONFIG(string, dump_dir, RtpProxy::kDumpDir);
|
||||
@ -271,15 +271,15 @@ string RtpProcess::getIdentifier() const {
|
||||
return _media_info.stream;
|
||||
}
|
||||
|
||||
void RtpProcess::emitOnPublish() {
|
||||
void RtpProcess::emitOnPublish(uint32_t ssrc) {
|
||||
weak_ptr<RtpProcess> weak_self = shared_from_this();
|
||||
Broadcast::PublishAuthInvoker invoker = [weak_self](const string &err, const ProtocolOption &option) {
|
||||
Broadcast::PublishAuthInvoker invoker = [weak_self, ssrc](const string &err, const ProtocolOption &option) {
|
||||
auto strong_self = weak_self.lock();
|
||||
if (!strong_self) {
|
||||
return;
|
||||
}
|
||||
auto poller = strong_self->getOwnerPoller(MediaSource::NullMediaSource());
|
||||
poller->async([weak_self, err, option]() {
|
||||
poller->async([weak_self, err, option, ssrc]() {
|
||||
auto strong_self = weak_self.lock();
|
||||
if (!strong_self) {
|
||||
return;
|
||||
@ -293,7 +293,7 @@ void RtpProcess::emitOnPublish() {
|
||||
}
|
||||
strong_self->_muxer->setMediaListener(strong_self);
|
||||
strong_self->doCachedFunc();
|
||||
InfoP(strong_self) << "允许RTP推流";
|
||||
InfoP(strong_self) << "允许RTP推流,ssrc: " << printSSRC(ssrc);
|
||||
} else {
|
||||
strong_self->_auth_err = err;
|
||||
WarnP(strong_self) << "禁止RTP推流:" << err;
|
||||
|
||||
@ -122,7 +122,7 @@ protected:
|
||||
private:
|
||||
RtpProcess(const MediaTuple &tuple);
|
||||
|
||||
void emitOnPublish();
|
||||
void emitOnPublish(uint32_t ssrc);
|
||||
void doCachedFunc();
|
||||
bool alive();
|
||||
void onManager();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user