Remove RTCP forwards from media_stream

RTCP state should be modified only through the RTCP object allocated
for each media_stream
This commit is contained in:
Aaro Altonen 2020-06-17 07:55:02 +03:00
parent a522c81324
commit b243d7d47e
2 changed files with 9 additions and 40 deletions

View File

@ -161,17 +161,6 @@ namespace uvg_rtp {
* Return RTP_INITIALIZED if RTCP has already been initialized */
rtp_error_t create_rtcp(uint16_t src_port, uint16_t dst_port);
/* Install various RTCP-related hooks, one for each report type
* These are optional and one can always poll the RTCP objects for new frames
*
* Return RTP_OK on success
* Return RTP_INVALID_VALUE if "hook" is nullptr
* Return RTP_NOT_INITIALIZED if RTCP has not been initialized */
rtp_error_t install_rtcp_sender_hook(void (*hook)(uvg_rtp::frame::rtcp_sender_frame *));
rtp_error_t install_rtcp_receiver_hook(void (*hook)(uvg_rtp::frame::rtcp_receiver_frame *));
rtp_error_t install_rtcp_sdes_hook(void (*hook)(uvg_rtp::frame::rtcp_sdes_frame *));
rtp_error_t install_rtcp_app_hook(void (*hook)(uvg_rtp::frame::rtcp_app_frame *));
private:
/* Initialize the connection by initializing the socket
* and binding ourselves to specified interface and creating

View File

@ -381,36 +381,16 @@ rtp_error_t uvg_rtp::media_stream::set_dynamic_payload(uint8_t payload)
rtp_error_t uvg_rtp::media_stream::create_rtcp(uint16_t src_port, uint16_t dst_port)
{
if (!(rtcp_ = new uvg_rtp::rtcp(rtp_->get_ssrc(), false)))
rtp_error_t ret;
if (!(rtcp_ = new uvg_rtp::rtcp(rtp_->get_ssrc(), true)))
return RTP_MEMORY_ERROR;
return rtcp_->add_participant(addr_, dst_port, src_port, rtp_->get_clock_rate());
}
if ((ret = rtcp_->add_participant(addr_, dst_port, src_port, rtp_->get_clock_rate())) != RTP_OK) {
delete rtcp_;
rtcp_ = nullptr;
return ret;
}
rtp_error_t uvg_rtp::media_stream::install_rtcp_sender_hook(void (*hook)(uvg_rtp::frame::rtcp_sender_frame *))
{
if (!rtcp_)
return RTP_NOT_INITIALIZED;
return rtcp_->install_sender_hook(hook);
}
rtp_error_t uvg_rtp::media_stream::install_rtcp_receiver_hook(void (*hook)(uvg_rtp::frame::rtcp_receiver_frame *))
{
if (!rtcp_)
return RTP_NOT_INITIALIZED;
return rtcp_->install_receiver_hook(hook);
}
rtp_error_t uvg_rtp::media_stream::install_rtcp_sdes_hook(void (*hook)(uvg_rtp::frame::rtcp_sdes_frame *))
{
if (!rtcp_)
return RTP_NOT_INITIALIZED;
return rtcp_->install_sdes_hook(hook);
}
rtp_error_t uvg_rtp::media_stream::install_rtcp_app_hook(void (*hook)(uvg_rtp::frame::rtcp_app_frame *))
{
if (!rtcp_)
return RTP_NOT_INITIALIZED;
return rtcp_->install_app_hook(hook);
return rtcp_->start();
}