From eda7c35f2bf5799d7c201868a851d70851e1202a Mon Sep 17 00:00:00 2001 From: Heikki Tampio Date: Wed, 10 May 2023 15:53:28 +0300 Subject: [PATCH] rtcp: Remove unnecessary function set_rtcp_interval() --- include/uvgrtp/rtcp.hh | 12 +++--------- src/rtcp.cc | 14 -------------- 2 files changed, 3 insertions(+), 23 deletions(-) diff --git a/include/uvgrtp/rtcp.hh b/include/uvgrtp/rtcp.hh index 8b14723..d2d485c 100644 --- a/include/uvgrtp/rtcp.hh +++ b/include/uvgrtp/rtcp.hh @@ -231,18 +231,12 @@ namespace uvgrtp { /* Update various session statistics */ void update_session_statistics(const uvgrtp::frame::rtp_frame *frame); - /* Getter for interval_ms_, which is calculated by set_session_bandwidth */ + /* Getter for interval_ms_, which is calculated by set_session_bandwidth + * Be aware that this interval is frequently re-calculated in rtcp_runner() */ uint32_t get_rtcp_interval_ms() const; - /* Set RTCP packet transmission interval in milliseconds - * - * Return RTP_OK if interval was set successfully - * Return RTP_INVALID_VALUE if new interval is invalid */ - rtp_error_t set_rtcp_interval_ms(int32_t new_interval); - /* Set total bandwidth for this session, called at the start - * If you want to set the interval manually later, use - * set_rtcp_interval_ms() function */ + * This affects the RTCP packet transmission interval */ void set_session_bandwidth(uint32_t kbps); std::shared_ptr get_socket() const; diff --git a/src/rtcp.cc b/src/rtcp.cc index c429fc8..973efc9 100644 --- a/src/rtcp.cc +++ b/src/rtcp.cc @@ -333,8 +333,6 @@ void uvgrtp::rtcp::rtcp_runner(rtcp* rtcp) true, (double)rtcp->avg_rtcp_size_, true, true); current_interval_ms = (uint32_t)round(1000 * interval_s); - rtcp->set_rtcp_interval_ms(current_interval_ms); - std::this_thread::sleep_for(std::chrono::milliseconds(current_interval_ms)); } UVG_LOG_DEBUG("Exited RTCP loop"); @@ -1980,18 +1978,6 @@ rtp_error_t uvgrtp::rtcp::set_network_addresses(std::string local_addr, std::str return RTP_OK; } -rtp_error_t uvgrtp::rtcp::set_rtcp_interval_ms(int32_t new_interval) { - if (new_interval < 0) { - UVG_LOG_WARN("Interval cannot be negative"); - return RTP_INVALID_VALUE; - } - interval_ms_ = new_interval; - - - return RTP_OK; - -} - std::shared_ptr uvgrtp::rtcp::get_socket() const{ return rtcp_socket_; }