mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
RTC: Refine error, show some bytes for RTCP
This commit is contained in:
parent
77403dd970
commit
d156bc2a1b
1 changed files with 9 additions and 12 deletions
|
@ -1915,14 +1915,10 @@ srs_error_t SrsRtcConnection::on_rtcp(char* data, int nb_data)
|
||||||
{
|
{
|
||||||
srs_error_t err = srs_success;
|
srs_error_t err = srs_success;
|
||||||
|
|
||||||
if (transport_ == NULL) {
|
|
||||||
return srs_error_new(ERROR_RTC_RTCP, "recv unexpect rtp packet before dtls done");
|
|
||||||
}
|
|
||||||
|
|
||||||
char unprotected_buf[kRtpPacketSize];
|
char unprotected_buf[kRtpPacketSize];
|
||||||
int nb_unprotected_buf = nb_data;
|
int nb_unprotected_buf = nb_data;
|
||||||
if ((err = transport_->unprotect_rtcp(data, unprotected_buf, nb_unprotected_buf)) != srs_success) {
|
if ((err = transport_->unprotect_rtcp(data, unprotected_buf, nb_unprotected_buf)) != srs_success) {
|
||||||
return srs_error_wrap(err, "rtcp unprotect failed");
|
return srs_error_wrap(err, "rtcp unprotect");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_srs_blackhole->blackhole) {
|
if (_srs_blackhole->blackhole) {
|
||||||
|
@ -1930,11 +1926,16 @@ srs_error_t SrsRtcConnection::on_rtcp(char* data, int nb_data)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player_) {
|
if (player_) {
|
||||||
return player_->on_rtcp(unprotected_buf, nb_unprotected_buf);
|
err = player_->on_rtcp(unprotected_buf, nb_unprotected_buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (publisher_) {
|
if (publisher_) {
|
||||||
return publisher_->on_rtcp(unprotected_buf, nb_unprotected_buf);
|
err = publisher_->on_rtcp(unprotected_buf, nb_unprotected_buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (err != srs_success) {
|
||||||
|
return srs_error_wrap(err, "cipher=%u, plaintext=%u, bytes=%s", nb_data, nb_unprotected_buf,
|
||||||
|
srs_string_dumps_hex(unprotected_buf, nb_unprotected_buf, 8).c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
|
@ -1948,11 +1949,7 @@ srs_error_t SrsRtcConnection::on_rtcp_feedback(char* data, int nb_data)
|
||||||
srs_error_t SrsRtcConnection::on_rtp(char* data, int nb_data)
|
srs_error_t SrsRtcConnection::on_rtp(char* data, int nb_data)
|
||||||
{
|
{
|
||||||
if (publisher_ == NULL) {
|
if (publisher_ == NULL) {
|
||||||
return srs_error_new(ERROR_RTC_RTCP, "rtc publisher null");
|
return srs_error_new(ERROR_RTC_RTCP, "no publisher");
|
||||||
}
|
|
||||||
|
|
||||||
if (transport_ == NULL) {
|
|
||||||
return srs_error_new(ERROR_RTC_RTCP, "recv unexpect rtp packet before dtls done");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: FIXME: add unprotect_rtcp.
|
//TODO: FIXME: add unprotect_rtcp.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue