multiplex: Rename functions
This commit is contained in:
parent
455cc03ab7
commit
8fe4167123
|
@ -193,12 +193,12 @@ rtp_error_t uvgrtp::media_stream::create_media(rtp_format_t fmt)
|
|||
case RTP_FORMAT_H264:
|
||||
{
|
||||
uvgrtp::formats::h264* format_264 = new uvgrtp::formats::h264(socket_, rtp_, rce_flags_);
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
5, remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::h264::new_packet_handler, format_264, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), nullptr
|
||||
);
|
||||
reception_flow_->new_install_getter(remote_ssrc_,
|
||||
reception_flow_->install_getter(remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::h264::frame_getter, format_264, std::placeholders::_1));
|
||||
|
||||
media_.reset(format_264);
|
||||
|
@ -207,12 +207,12 @@ rtp_error_t uvgrtp::media_stream::create_media(rtp_format_t fmt)
|
|||
case RTP_FORMAT_H265:
|
||||
{
|
||||
uvgrtp::formats::h265* format_265 = new uvgrtp::formats::h265(socket_, rtp_, rce_flags_);
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
5, remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::h265::new_packet_handler, format_265, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), nullptr
|
||||
);
|
||||
reception_flow_->new_install_getter(remote_ssrc_,
|
||||
reception_flow_->install_getter(remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::h265::frame_getter, format_265, std::placeholders::_1));
|
||||
|
||||
media_.reset(format_265);
|
||||
|
@ -221,12 +221,12 @@ rtp_error_t uvgrtp::media_stream::create_media(rtp_format_t fmt)
|
|||
case RTP_FORMAT_H266:
|
||||
{
|
||||
uvgrtp::formats::h266* format_266 = new uvgrtp::formats::h266(socket_, rtp_, rce_flags_);
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
5, remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::h266::new_packet_handler, format_266, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), nullptr
|
||||
);
|
||||
reception_flow_->new_install_getter(remote_ssrc_,
|
||||
reception_flow_->install_getter(remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::h266::frame_getter, format_266, std::placeholders::_1));
|
||||
|
||||
media_.reset(format_266);
|
||||
|
@ -258,7 +258,7 @@ rtp_error_t uvgrtp::media_stream::create_media(rtp_format_t fmt)
|
|||
case RTP_FORMAT_VDVI:
|
||||
{
|
||||
media_ = std::unique_ptr<uvgrtp::formats::media>(new uvgrtp::formats::media(socket_, rtp_, rce_flags_));
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
5, remote_ssrc_,
|
||||
std::bind(&uvgrtp::formats::media::new_packet_handler, media_.get(), std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), media_->get_media_frame_info());
|
||||
|
@ -298,26 +298,26 @@ rtp_error_t uvgrtp::media_stream::free_resources(rtp_error_t ret)
|
|||
|
||||
rtp_error_t uvgrtp::media_stream::install_packet_handlers()
|
||||
{
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
1, remote_ssrc_,
|
||||
std::bind(&uvgrtp::rtp::new_packet_handler, rtp_, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5),
|
||||
nullptr);
|
||||
if (rce_flags_ & RCE_RTCP) {
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
6, remote_ssrc_,
|
||||
std::bind(&uvgrtp::rtcp::new_recv_packet_handler_common, rtcp_, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), rtcp_.get());
|
||||
}
|
||||
if (rce_flags_ & RCE_RTCP_MUX) {
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
2, remote_ssrc_,
|
||||
std::bind(&uvgrtp::rtcp::new_recv_packet_handler, rtcp_, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), nullptr);
|
||||
}
|
||||
if (rce_flags_ & RCE_SRTP) {
|
||||
socket_->install_handler(ssrc_, srtp_.get(), srtp_->send_packet_handler);
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
4, remote_ssrc_,
|
||||
std::bind(&uvgrtp::srtp::recv_packet_handler, srtp_, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5), srtp_.get());
|
||||
|
@ -348,7 +348,7 @@ rtp_error_t uvgrtp::media_stream::init()
|
|||
/* If we are using ZRTP, we only install the ZRTP handler first. Rest of the handlers are installed after ZRTP is
|
||||
finished. If ZRTP is not enabled, we can install all the required handlers now */
|
||||
if ((rce_flags_ & RCE_SRTP_KMNGMNT_ZRTP) && zrtp_) {
|
||||
reception_flow_->new_install_handler(
|
||||
reception_flow_->install_handler(
|
||||
3, remote_ssrc_,
|
||||
std::bind(&uvgrtp::zrtp::packet_handler, zrtp_, std::placeholders::_1, std::placeholders::_2, std::placeholders::_3,
|
||||
std::placeholders::_4, std::placeholders::_5),
|
||||
|
|
|
@ -289,7 +289,7 @@ uvgrtp::frame::rtp_frame* uvgrtp::reception_flow::pull_frame(ssize_t timeout_ms,
|
|||
return frame;
|
||||
}
|
||||
|
||||
rtp_error_t uvgrtp::reception_flow::new_install_handler(int type, std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
rtp_error_t uvgrtp::reception_flow::install_handler(int type, std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
std::function<rtp_error_t(void*, int, uint8_t*, size_t, frame::rtp_frame** out)> handler, void* args)
|
||||
{
|
||||
uint32_t ssrc = remote_ssrc.get()->load();
|
||||
|
@ -334,7 +334,7 @@ rtp_error_t uvgrtp::reception_flow::new_install_handler(int type, std::shared_pt
|
|||
return RTP_OK;
|
||||
}
|
||||
|
||||
rtp_error_t uvgrtp::reception_flow::new_install_getter(std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
rtp_error_t uvgrtp::reception_flow::install_getter(std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
std::function<rtp_error_t(uvgrtp::frame::rtp_frame**)> getter)
|
||||
{
|
||||
handlers_mutex_.lock();
|
||||
|
|
|
@ -94,12 +94,12 @@ namespace uvgrtp {
|
|||
4 SRTP
|
||||
5 Media
|
||||
6 RTCP common: Updates RTCP stats from RTP packets */
|
||||
rtp_error_t new_install_handler(int type, std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
rtp_error_t install_handler(int type, std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
std::function<rtp_error_t(void*, int, uint8_t*, size_t, frame::rtp_frame** out)> handler,
|
||||
void* args);
|
||||
|
||||
/* Install a media getter. If multiple packets are ready, this is called. */
|
||||
rtp_error_t new_install_getter(std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
rtp_error_t install_getter(std::shared_ptr<std::atomic<std::uint32_t>> remote_ssrc,
|
||||
std::function<rtp_error_t(uvgrtp::frame::rtp_frame**)> getter);
|
||||
|
||||
/* Remove all handlers associated with this SSRC */
|
||||
|
|
Loading…
Reference in New Issue