Refactor the logs.

pull/1754/head
winlin 5 years ago
parent 1b08fb6b6e
commit 6fbd41cff4

@ -1563,6 +1563,8 @@ SrsRtcPublisher::SrsRtcPublisher(SrsRtcSession* session)
source = NULL;
nn_simulate_nack_drop = 0;
nack_enabled_ = false;
nn_audio_frames = 0;
}
SrsRtcPublisher::~SrsRtcPublisher()
@ -2094,6 +2096,11 @@ srs_error_t SrsRtcPublisher::on_audio_frame(SrsRtpPacket2* frame)
// TODO: FIXME: Check error.
source->on_rtc_audio(&msg);
if (nn_audio_frames++ == 0) {
SrsRtpHeader* h = &frame->rtp_header;
srs_trace("RTC got Opus seq=%u, ssrc=%u, ts=%u, %d bytes", h->get_sequence(), h->get_ssrc(), h->get_timestamp(), payload->nn_payload);
}
return err;
}
@ -2217,7 +2224,9 @@ srs_error_t SrsRtcPublisher::on_video_frame(SrsRtpPacket2* frame)
if (frame->nalu_type == SrsAvcNaluTypeIDR) {
buf.write_1bytes(0x17); // Keyframe.
srs_trace("RTC got IDR %d bytes", nn_payload);
SrsRtpHeader* h = &frame->rtp_header;
srs_trace("RTC got IDR seq=%u, ssrc=%u, ts=%u, %d bytes", h->get_sequence(), h->get_ssrc(), h->get_timestamp(), nn_payload);
} else {
buf.write_1bytes(0x27); // Not-Keyframe.
}

@ -273,6 +273,7 @@ class SrsRtcPublisher : virtual public ISrsHourGlass, virtual public ISrsRtpPack
{
private:
SrsHourGlass* report_timer;
uint64_t nn_audio_frames;
private:
SrsRtcSession* session_;
uint32_t video_ssrc;

Loading…
Cancel
Save