mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
RTC: Refine log
This commit is contained in:
parent
7459f287e0
commit
5b3f278243
4 changed files with 20 additions and 3 deletions
|
@ -32,6 +32,11 @@
|
||||||
#include <srs_app_reload.hpp>
|
#include <srs_app_reload.hpp>
|
||||||
#include <srs_service_log.hpp>
|
#include <srs_service_log.hpp>
|
||||||
|
|
||||||
|
// For log TAGs.
|
||||||
|
#define TAG_MAIN "MAIN"
|
||||||
|
#define TAG_MAYBE "MAYBE"
|
||||||
|
#define TAG_DTLS_ALERT "DTLSALERT"
|
||||||
|
|
||||||
// Use memory/disk cache and donot flush when write log.
|
// Use memory/disk cache and donot flush when write log.
|
||||||
// it's ok to use it without config, which will log to console, and default trace level.
|
// it's ok to use it without config, which will log to console, and default trace level.
|
||||||
// when you want to use different level, override this classs, set the protected _level.
|
// when you want to use different level, override this classs, set the protected _level.
|
||||||
|
|
|
@ -598,7 +598,7 @@ void SrsDtlsImpl::callback_by_ssl(std::string type, std::string desc)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
if ((err = callback_->on_dtls_alert(type, desc)) != srs_success) {
|
if ((err = callback_->on_dtls_alert(type, desc)) != srs_success) {
|
||||||
srs_warn2("DTLSAlert", "DTLS: handler alert err %s", srs_error_desc(err).c_str());
|
srs_warn2(TAG_DTLS_ALERT, "DTLS: handler alert err %s", srs_error_desc(err).c_str());
|
||||||
srs_freep(err);
|
srs_freep(err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -882,6 +882,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_stap_a(SrsRtcStream* source, SrsShare
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(kVideoPayloadType);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
|
pkt->nalu_type = (SrsAvcNaluType)kStapA;
|
||||||
pkt->header.set_marker(false);
|
pkt->header.set_marker(false);
|
||||||
pkt->header.set_sequence(video_sequence++);
|
pkt->header.set_sequence(video_sequence++);
|
||||||
pkt->header.set_timestamp(msg->timestamp * 90);
|
pkt->header.set_timestamp(msg->timestamp * 90);
|
||||||
|
@ -929,6 +930,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_nalus(SrsSharedPtrMessage* msg, const
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
SrsRtpRawNALUs* raw = new SrsRtpRawNALUs();
|
SrsRtpRawNALUs* raw = new SrsRtpRawNALUs();
|
||||||
|
SrsAvcNaluType first_nalu_type = SrsAvcNaluTypeReserved;
|
||||||
|
|
||||||
for (int i = 0; i < (int)samples.size(); i++) {
|
for (int i = 0; i < (int)samples.size(); i++) {
|
||||||
SrsSample* sample = samples[i];
|
SrsSample* sample = samples[i];
|
||||||
|
@ -939,6 +941,14 @@ srs_error_t SrsRtcFromRtmpBridger::package_nalus(SrsSharedPtrMessage* msg, const
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!sample->size) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (first_nalu_type == SrsAvcNaluTypeReserved) {
|
||||||
|
first_nalu_type = SrsAvcNaluType((uint8_t)(sample->bytes[0] & kNalTypeMask));
|
||||||
|
}
|
||||||
|
|
||||||
raw->push_back(sample->copy());
|
raw->push_back(sample->copy());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -955,6 +965,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_nalus(SrsSharedPtrMessage* msg, const
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(kVideoPayloadType);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
|
pkt->nalu_type = (SrsAvcNaluType)first_nalu_type;
|
||||||
pkt->header.set_sequence(video_sequence++);
|
pkt->header.set_sequence(video_sequence++);
|
||||||
pkt->header.set_timestamp(msg->timestamp * 90);
|
pkt->header.set_timestamp(msg->timestamp * 90);
|
||||||
pkt->payload = raw;
|
pkt->payload = raw;
|
||||||
|
@ -987,6 +998,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_nalus(SrsSharedPtrMessage* msg, const
|
||||||
pkt->header.set_payload_type(kVideoPayloadType);
|
pkt->header.set_payload_type(kVideoPayloadType);
|
||||||
pkt->header.set_ssrc(video_ssrc);
|
pkt->header.set_ssrc(video_ssrc);
|
||||||
pkt->frame_type = SrsFrameTypeVideo;
|
pkt->frame_type = SrsFrameTypeVideo;
|
||||||
|
pkt->nalu_type = (SrsAvcNaluType)kFuA;
|
||||||
pkt->header.set_sequence(video_sequence++);
|
pkt->header.set_sequence(video_sequence++);
|
||||||
pkt->header.set_timestamp(msg->timestamp * 90);
|
pkt->header.set_timestamp(msg->timestamp * 90);
|
||||||
|
|
||||||
|
@ -1813,7 +1825,7 @@ srs_error_t SrsRtcVideoRecvTrack::check_send_nacks()
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
srs_trace2("MAYBE", "RTC: NACK timeout=%u, request PLI, track=%s, ssrc=%u", timeout_nacks,
|
srs_trace2(TAG_MAYBE, "RTC: NACK timeout=%u, request PLI, track=%s, ssrc=%u", timeout_nacks,
|
||||||
track_desc_->id_.c_str(), track_desc_->ssrc_);
|
track_desc_->id_.c_str(), track_desc_->ssrc_);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
|
|
@ -134,7 +134,7 @@ srs_error_t do_main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
// config already applied to log.
|
// config already applied to log.
|
||||||
srs_trace2("MAIN", "%s, %s", RTMP_SIG_SRS_SERVER, RTMP_SIG_SRS_LICENSE);
|
srs_trace2(TAG_MAIN, "%s, %s", RTMP_SIG_SRS_SERVER, RTMP_SIG_SRS_LICENSE);
|
||||||
srs_trace("authors: %s", RTMP_SIG_SRS_AUTHORS);
|
srs_trace("authors: %s", RTMP_SIG_SRS_AUTHORS);
|
||||||
srs_trace("contributors: %s", SRS_CONSTRIBUTORS);
|
srs_trace("contributors: %s", SRS_CONSTRIBUTORS);
|
||||||
srs_trace("cwd=%s, work_dir=%s, build: %s, configure: %s, uname: %s, osx: %d",
|
srs_trace("cwd=%s, work_dir=%s, build: %s, configure: %s, uname: %s, osx: %d",
|
||||||
|
|
Loading…
Reference in a new issue