diff --git a/include/uvgrtp/media_stream.hh b/include/uvgrtp/media_stream.hh index 927f79f..d7f1218 100644 --- a/include/uvgrtp/media_stream.hh +++ b/include/uvgrtp/media_stream.hh @@ -273,9 +273,11 @@ namespace uvgrtp { */ rtp_error_t push_frame(std::unique_ptr data, size_t data_len, uint32_t ts, uint64_t ntp_ts, int rtp_flags); + /* ----------- User packets not yet supported ----------- rtp_error_t send_user_packet(uint8_t* data, uint32_t payload_size, std::string remote_address, uint16_t port); rtp_error_t install_user_hook(void* arg, void (*hook)(void*, uint8_t* payload)); + */ /** * \brief Poll a frame indefinitely from the media stream object diff --git a/src/media_stream.cc b/src/media_stream.cc index 01f2066..74bbc07 100644 --- a/src/media_stream.cc +++ b/src/media_stream.cc @@ -630,7 +630,7 @@ rtp_error_t uvgrtp::media_stream::push_frame(std::unique_ptr data, si return ret; } - +/* ----------- User packets not yet supported ----------- rtp_error_t uvgrtp::media_stream::send_user_packet(uint8_t* data, uint32_t payload_size, std::string remote_address, uint16_t port) { @@ -658,7 +658,7 @@ rtp_error_t uvgrtp::media_stream::install_user_hook(void* arg, void (*hook)(void return reception_flow_->install_user_hook(arg, hook);; -} +}*/ uvgrtp::frame::rtp_frame *uvgrtp::media_stream::pull_frame() { diff --git a/src/reception_flow.cc b/src/reception_flow.cc index 26a34d9..cdc0732 100644 --- a/src/reception_flow.cc +++ b/src/reception_flow.cc @@ -34,8 +34,8 @@ uvgrtp::reception_flow::reception_flow(bool ipv6) : handler_mapping_({}), should_stop_(true), receiver_(nullptr), - user_hook_arg_(nullptr), - user_hook_(nullptr), + //user_hook_arg_(nullptr), + //user_hook_(nullptr), ring_buffer_(), ring_read_index_(-1), // invalid first index that will increase to a valid one last_ring_write_index_(-1), @@ -366,7 +366,7 @@ void uvgrtp::reception_flow::return_frame(uvgrtp::frame::rtp_frame *frame) frames_mtx_.unlock(); } } - +/* ----------- User packets not yet supported ----------- rtp_error_t uvgrtp::reception_flow::install_user_hook(void* arg, void (*hook)(void*, uint8_t* payload)) { if (!hook) @@ -391,9 +391,9 @@ void uvgrtp::reception_flow::return_user_pkt(uint8_t* pkt) else { UVG_LOG_DEBUG("No user hook installed"); } -} +}*/ -void uvgrtp::reception_flow::call_aux_handlers(uint32_t key, int rce_flags, uvgrtp::frame::rtp_frame **frame, uint8_t* ptr) +void uvgrtp::reception_flow::call_aux_handlers(uint32_t key, int rce_flags, uvgrtp::frame::rtp_frame **frame) { rtp_error_t ret; @@ -632,9 +632,6 @@ void uvgrtp::reception_flow::process_packet(int rce_flags) else if (current_ssrc == 0) { found = true; } - //else { - // return_user_pkt(ptr); - //} if (!found) { // No SSRC match found, skip this handler continue; @@ -653,7 +650,7 @@ void uvgrtp::reception_flow::process_packet(int rce_flags) } case RTP_PKT_NOT_HANDLED: { - // packet was not handled by this primary handlers, proceed to the next one + /* ----------- User packets not yet supported ----------- std::string from_str; if (ipv6_) { from_str = uvgrtp::socket::sockaddr_ip6_to_string(from6); @@ -663,13 +660,16 @@ void uvgrtp::reception_flow::process_packet(int rce_flags) } UVG_LOG_DEBUG("User packet from ip: %s", from_str.c_str()); return_user_pkt(ptr); + */ + + // packet was not handled by this primary handlers, proceed to the next one continue; /* packet was handled by the primary handler * and should be dispatched to the auxiliary handler(s) */ } case RTP_PKT_MODIFIED: { - call_aux_handlers(handler.first, rce_flags, &frame, ptr); + call_aux_handlers(handler.first, rce_flags, &frame); break; } case RTP_GENERIC_ERROR: diff --git a/src/reception_flow.hh b/src/reception_flow.hh index eda34d4..fe21efd 100644 --- a/src/reception_flow.hh +++ b/src/reception_flow.hh @@ -29,7 +29,9 @@ namespace uvgrtp { class socket; typedef void (*recv_hook)(void* arg, uvgrtp::frame::rtp_frame* frame); - typedef void (*user_hook)(void* arg, uint8_t* payload, uint32_t payload_size); + + // Not yet supported + //typedef void (*user_hook)(void* arg, uint8_t* payload, uint32_t payload_size); struct receive_pkt_hook { void* arg = nullptr; @@ -183,7 +185,9 @@ namespace uvgrtp { void set_buffer_size(const ssize_t& value); ssize_t get_buffer_size() const; void set_payload_size(const size_t& value); - rtp_error_t install_user_hook(void* arg, void (*hook)(void*, uint8_t* payload)); + + // Not yet supported + //rtp_error_t install_user_hook(void* arg, void (*hook)(void*, uint8_t* payload)); /// \endcond private: @@ -196,10 +200,11 @@ namespace uvgrtp { /* Return a processed RTP frame to user either through frame queue or receive hook */ void return_frame(uvgrtp::frame::rtp_frame *frame); - void return_user_pkt(uint8_t* pkt); + // Not yet supported + //void return_user_pkt(uint8_t* pkt); /* Call auxiliary handlers of a primary handler */ - void call_aux_handlers(uint32_t key, int rce_flags, uvgrtp::frame::rtp_frame **frame, uint8_t* ptr); + void call_aux_handlers(uint32_t key, int rce_flags, uvgrtp::frame::rtp_frame **frame); inline void increase_buffer_size(ssize_t next_write_index); @@ -240,8 +245,9 @@ namespace uvgrtp { sockaddr_in from; }; - void* user_hook_arg_; - void (*user_hook_)(void* arg, uint8_t* payload); + // Not yet supported + //void* user_hook_arg_; + //void (*user_hook_)(void* arg, uint8_t* payload); std::vector ring_buffer_; std::mutex ring_mutex_;