multiplex: Add new handler types to reception_flow
This commit is contained in:
parent
dafad6cfd8
commit
00823467b3
|
@ -697,14 +697,13 @@ void uvgrtp::reception_flow::process_packet(int rce_flags)
|
||||||
UVG_LOG_INFO("Holepuncher packet");
|
UVG_LOG_INFO("Holepuncher packet");
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
|
/* THIS IS WRONG, BECAUSE USER PACKETS DONT HAVE SSRC!! fix
|
||||||
/* -------------------- User packet -------------------------------- */
|
|
||||||
else {
|
else {
|
||||||
// TODO: Add functionality
|
// TODO: Add functionality
|
||||||
UVG_LOG_INFO("User packet");
|
UVG_LOG_INFO("User packet");
|
||||||
//break;
|
//break;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
// Here we don't lock ring mutex because the chaging is only done above.
|
// Here we don't lock ring mutex because the chaging is only done above.
|
||||||
// NOTE: If there is a need for multiple processing threads, the read should be guarded
|
// NOTE: If there is a need for multiple processing threads, the read should be guarded
|
||||||
switch ((ret = (*handler.second.primary)(ring_buffer_[ring_read_index_].read,
|
switch ((ret = (*handler.second.primary)(ring_buffer_[ring_read_index_].read,
|
||||||
|
|
|
@ -60,6 +60,14 @@ namespace uvgrtp {
|
||||||
std::vector<auxiliary_handler_cpp> auxiliary_cpp;
|
std::vector<auxiliary_handler_cpp> auxiliary_cpp;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// -----------new packet handlers
|
||||||
|
typedef rtp_error_t(*packet_handler_new)(void*, int, uint8_t*, size_t);
|
||||||
|
|
||||||
|
struct handler_new {
|
||||||
|
packet_handler_new handler = nullptr;
|
||||||
|
std::function<rtp_error_t(uvgrtp::frame::rtp_frame ** out)> getter;
|
||||||
|
};
|
||||||
|
|
||||||
/* This class handles the reception processing of received RTP packets. It
|
/* This class handles the reception processing of received RTP packets. It
|
||||||
* utilizes function dispatching to other classes to achieve this.
|
* utilizes function dispatching to other classes to achieve this.
|
||||||
|
|
||||||
|
@ -262,6 +270,14 @@ namespace uvgrtp {
|
||||||
//void* user_hook_arg_;
|
//void* user_hook_arg_;
|
||||||
//void (*user_hook_)(void* arg, uint8_t* payload);
|
//void (*user_hook_)(void* arg, uint8_t* payload);
|
||||||
|
|
||||||
|
// Map different types of handlers by remote SSRCs
|
||||||
|
std::map<std::shared_ptr<std::atomic<std::uint32_t>>, handler_new> rtcp_handlers_;
|
||||||
|
std::map<std::shared_ptr<std::atomic<std::uint32_t>>, handler_new> zrtp_handlers_;
|
||||||
|
std::map<std::shared_ptr<std::atomic<std::uint32_t>>, handler_new> rtp_handlers_;
|
||||||
|
|
||||||
|
std::map<std::shared_ptr<std::atomic<std::uint32_t>>, handler_new> srtp_handlers_;
|
||||||
|
std::map<std::shared_ptr<std::atomic<std::uint32_t>>, handler_new> srtcp_handlers_;
|
||||||
|
|
||||||
std::vector<Buffer> ring_buffer_;
|
std::vector<Buffer> ring_buffer_;
|
||||||
std::mutex ring_mutex_;
|
std::mutex ring_mutex_;
|
||||||
// these uphold the ring buffer details
|
// these uphold the ring buffer details
|
||||||
|
|
Loading…
Reference in New Issue