multiplex: Fix bug with rtcp reader socket
This commit is contained in:
parent
92441ea626
commit
bb450f7be4
|
|
@ -473,20 +473,26 @@ rtp_error_t uvgrtp::media_stream::start_components()
|
||||||
std::shared_ptr<uvgrtp::rtcp_reader> rtcp_reader;
|
std::shared_ptr<uvgrtp::rtcp_reader> rtcp_reader;
|
||||||
|
|
||||||
if (!(rce_flags_ & RCE_RTCP_MUX)) {
|
if (!(rce_flags_ & RCE_RTCP_MUX)) {
|
||||||
|
// TODO solve this mess
|
||||||
|
//
|
||||||
|
//
|
||||||
// If RTCP is not multiplexed with RTP, configure the socket for RTCP:
|
// If RTCP is not multiplexed with RTP, configure the socket for RTCP:
|
||||||
// 1. If RTCP port is not in use -> create new socket
|
// 1. If RTCP port is not in use -> create new socket
|
||||||
// 2. Install an RTCP reader into socketfactory
|
// 2. Install an RTCP reader into socketfactory
|
||||||
// 3. In RTCP reader, map our RTCP object to the REMOTE ssrc of this stream. If we are not doing
|
// 3. In RTCP reader, map our RTCP object to the REMOTE ssrc of this stream. If we are not doing
|
||||||
// any socket multiplexing, it will be 0 by default
|
// any socket multiplexing, it will be 0 by default
|
||||||
rtcp_socket = sfp_->get_socket_ptr(1, rtcp_port);
|
rtcp_socket = sfp_->get_socket_ptr(1, rtcp_port);
|
||||||
if (!rtcp_socket) {
|
rtcp_->set_socket(rtcp_socket);
|
||||||
rtcp_socket = sfp_->create_new_socket(1, rtcp_port);
|
rtcp_reader = sfp_->get_rtcp_reader(rtcp_port);
|
||||||
rtcp_reader = sfp_->install_rtcp_reader(rtcp_port);
|
rtcp_reader->map_ssrc_to_rtcp(remote_ssrc_, rtcp_);
|
||||||
rtcp_reader->set_socket(rtcp_socket);
|
rtcp_reader->set_socket(rtcp_socket);
|
||||||
rtcp_->set_socket(rtcp_socket);
|
|
||||||
rtcp_reader->map_ssrc_to_rtcp(remote_ssrc_, rtcp_);
|
|
||||||
}
|
//if (!rtcp_socket) {
|
||||||
|
//rtcp_socket = sfp_->create_new_socket(1, rtcp_port);
|
||||||
|
//rtcp_reader = sfp_->install_rtcp_reader(rtcp_port);
|
||||||
|
//rtcp_reader->set_socket(rtcp_socket);
|
||||||
|
//}
|
||||||
/*if (!sfp_->is_port_in_use(rtcp_port)) {
|
/*if (!sfp_->is_port_in_use(rtcp_port)) {
|
||||||
rtcp_socket = sfp_->create_new_socket(1);
|
rtcp_socket = sfp_->create_new_socket(1);
|
||||||
rtcp_reader = sfp_->install_rtcp_reader(rtcp_port);
|
rtcp_reader = sfp_->install_rtcp_reader(rtcp_port);
|
||||||
|
|
@ -499,7 +505,7 @@ rtp_error_t uvgrtp::media_stream::start_components()
|
||||||
// 2. Fetch the existing RTCP reader from socketfactory
|
// 2. Fetch the existing RTCP reader from socketfactory
|
||||||
// 3. In RTCP reader, map our RTCP object to the REMOTE ssrc of this stream. In this case, the remote
|
// 3. In RTCP reader, map our RTCP object to the REMOTE ssrc of this stream. In this case, the remote
|
||||||
// ssrc should be manually set to allow multiplexing
|
// ssrc should be manually set to allow multiplexing
|
||||||
else {
|
/*else {
|
||||||
//rtcp_socket = sfp_->get_socket_ptr(rtcp_port);
|
//rtcp_socket = sfp_->get_socket_ptr(rtcp_port);
|
||||||
if (!rtcp_socket) {
|
if (!rtcp_socket) {
|
||||||
// This should not ever happen. However if it does, you could just create a new socket like above
|
// This should not ever happen. However if it does, you could just create a new socket like above
|
||||||
|
|
@ -508,8 +514,8 @@ rtp_error_t uvgrtp::media_stream::start_components()
|
||||||
}
|
}
|
||||||
rtcp_->set_socket(rtcp_socket);
|
rtcp_->set_socket(rtcp_socket);
|
||||||
rtcp_reader = sfp_->get_rtcp_reader(rtcp_port);
|
rtcp_reader = sfp_->get_rtcp_reader(rtcp_port);
|
||||||
rtcp_reader->map_ssrc_to_rtcp(remote_ssrc_, rtcp_);
|
rtcp_reader->map_ssrc_to_rtcp(remote_ssrc_, rtcp_);*/
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
rtcp_->start();
|
rtcp_->start();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,11 @@ std::shared_ptr<uvgrtp::socket> uvgrtp::socketfactory::create_new_socket(int typ
|
||||||
std::pair pair = std::make_pair(flow, socket);
|
std::pair pair = std::make_pair(flow, socket);
|
||||||
reception_flows_.insert(pair);
|
reception_flows_.insert(pair);
|
||||||
}
|
}
|
||||||
|
else if (type == 1) {
|
||||||
|
// RTCP socket
|
||||||
|
std::shared_ptr<uvgrtp::rtcp_reader> reader = std::shared_ptr<uvgrtp::rtcp_reader>(new uvgrtp::rtcp_reader());
|
||||||
|
rtcp_readers_to_ports_[reader] = port;
|
||||||
|
}
|
||||||
return socket;
|
return socket;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue