ipv6: remove clutter from media_stream api

This commit is contained in:
Heikki Tampio 2023-03-20 15:07:09 +02:00
parent a533b82e4c
commit 0d9e3beed6
4 changed files with 5 additions and 21 deletions

View File

@ -352,8 +352,6 @@ namespace uvgrtp {
*/ */
uint32_t get_ssrc() const; uint32_t get_ssrc() const;
bool get_ipv6() const;
private: private:
/* Initialize the connection by initializing the socket /* Initialize the connection by initializing the socket
* and binding ourselves to specified interface and creating * and binding ourselves to specified interface and creating

View File

@ -230,8 +230,6 @@ namespace uvgrtp {
/* Getter for interval_ms_, which is calculated by set_session_bandwidth */ /* Getter for interval_ms_, which is calculated by set_session_bandwidth */
uint32_t get_rtcp_interval_ms() const; uint32_t get_rtcp_interval_ms() const;
void set_ipv6(bool set);
/* Set RTCP packet transmission interval in milliseconds /* Set RTCP packet transmission interval in milliseconds
* *
* Return RTP_OK if interval was set successfully * Return RTP_OK if interval was set successfully
@ -253,7 +251,7 @@ namespace uvgrtp {
* These are used when adding new participants and creating sockets for them */ * These are used when adding new participants and creating sockets for them */
rtp_error_t set_network_addresses(std::string local_addr, std::string remote_addr, rtp_error_t set_network_addresses(std::string local_addr, std::string remote_addr,
uint16_t local_port, uint16_t dst_port); uint16_t local_port, uint16_t dst_port, bool ipv6);
/* Return SSRCs of all participants */ /* Return SSRCs of all participants */
std::vector<uint32_t> get_participants() const; std::vector<uint32_t> get_participants() const;

View File

@ -306,9 +306,6 @@ rtp_error_t uvgrtp::media_stream::init()
rtp_ = std::shared_ptr<uvgrtp::rtp> (new uvgrtp::rtp(fmt_, ssrc_)); rtp_ = std::shared_ptr<uvgrtp::rtp> (new uvgrtp::rtp(fmt_, ssrc_));
rtcp_ = std::shared_ptr<uvgrtp::rtcp> (new uvgrtp::rtcp(rtp_, ssrc_, cname_, rce_flags_)); rtcp_ = std::shared_ptr<uvgrtp::rtcp> (new uvgrtp::rtcp(rtp_, ssrc_, cname_, rce_flags_));
if (ipv6_) {
rtcp_->set_ipv6(true);
}
socket_->install_handler(rtcp_.get(), rtcp_->send_packet_handler_vec); socket_->install_handler(rtcp_.get(), rtcp_->send_packet_handler_vec);
@ -364,9 +361,7 @@ rtp_error_t uvgrtp::media_stream::init(std::shared_ptr<uvgrtp::zrtp> zrtp)
zrtp->dh_has_finished(); // only after the DH stream has gotten its keys, do we let non-DH stream perform ZRTP zrtp->dh_has_finished(); // only after the DH stream has gotten its keys, do we let non-DH stream perform ZRTP
rtcp_ = std::shared_ptr<uvgrtp::rtcp> (new uvgrtp::rtcp(rtp_, ssrc_, cname_, srtcp_, rce_flags_)); rtcp_ = std::shared_ptr<uvgrtp::rtcp> (new uvgrtp::rtcp(rtp_, ssrc_, cname_, srtcp_, rce_flags_));
if (ipv6_) {
rtcp_->set_ipv6(true);
}
socket_->install_handler(rtcp_.get(), rtcp_->send_packet_handler_vec); socket_->install_handler(rtcp_.get(), rtcp_->send_packet_handler_vec);
socket_->install_handler(srtp_.get(), srtp_->send_packet_handler); socket_->install_handler(srtp_.get(), srtp_->send_packet_handler);
@ -446,7 +441,7 @@ rtp_error_t uvgrtp::media_stream::start_components()
} }
else else
{ {
rtcp_->set_network_addresses(local_address_, remote_address_, src_port_ + 1, dst_port_ + 1); rtcp_->set_network_addresses(local_address_, remote_address_, src_port_ + 1, dst_port_ + 1, ipv6_);
rtcp_->add_initial_participant(rtp_->get_clock_rate()); rtcp_->add_initial_participant(rtp_->get_clock_rate());
bandwidth_ = get_default_bandwidth_kbps(fmt_); bandwidth_ = get_default_bandwidth_kbps(fmt_);
rtcp_->set_session_bandwidth(bandwidth_); rtcp_->set_session_bandwidth(bandwidth_);
@ -804,10 +799,6 @@ uint32_t uvgrtp::media_stream::get_ssrc() const
return *ssrc_.get(); return *ssrc_.get();
} }
bool uvgrtp::media_stream::get_ipv6() const {
return ipv6_;
}
rtp_error_t uvgrtp::media_stream::init_srtp_with_zrtp(int rce_flags, int type, std::shared_ptr<uvgrtp::base_srtp> srtp, rtp_error_t uvgrtp::media_stream::init_srtp_with_zrtp(int rce_flags, int type, std::shared_ptr<uvgrtp::base_srtp> srtp,
std::shared_ptr<uvgrtp::zrtp> zrtp) std::shared_ptr<uvgrtp::zrtp> zrtp)
{ {

View File

@ -2036,17 +2036,14 @@ uint32_t uvgrtp::rtcp::get_rtcp_interval_ms() const
return interval_ms_.load(); return interval_ms_.load();
} }
void uvgrtp::rtcp::set_ipv6(bool set) {
ipv6_ = set;
}
rtp_error_t uvgrtp::rtcp::set_network_addresses(std::string local_addr, std::string remote_addr, rtp_error_t uvgrtp::rtcp::set_network_addresses(std::string local_addr, std::string remote_addr,
uint16_t local_port, uint16_t dst_port) uint16_t local_port, uint16_t dst_port, bool ipv6)
{ {
local_addr_ = local_addr; local_addr_ = local_addr;
remote_addr_ = remote_addr; remote_addr_ = remote_addr;
local_port_ = local_port; local_port_ = local_port;
dst_port_ = dst_port; dst_port_ = dst_port;
ipv6_ = ipv6;
return RTP_OK; return RTP_OK;
} }