common: Small fixes to function names, etc

This commit is contained in:
Heikki Tampio 2023-08-02 13:30:21 +03:00
parent 6aaf23e06d
commit 6ec8880760
6 changed files with 17 additions and 15 deletions

View File

@ -85,7 +85,7 @@ namespace uvgrtp {
* 1. Use flags RCE_SRTP + RCE_SRTP_KMNGMNT_ZRTP + (RCE_ZRTP_DIFFIE_HELLMAN_MODE/RCE_ZRTP_MULTISTREAM_MODE)
* to automatically start ZRTP negotiation when creating a media stream.
* 2. Use flags RCE_SRTP + (RCE_ZRTP_DIFFIE_HELLMAN_MODE/RCE_ZRTP_MULTISTREAM_MODE) and after creating
* the media stream, call add_zrtp_ctx() to manually start the ZRTP negotiation
* the media stream, call start_zrtp() to manually start the ZRTP negotiation
*
* \return RTP error code
*
@ -306,8 +306,7 @@ namespace uvgrtp {
* \retval RTP_SEND_ERROR If uvgRTP failed to send the data to remote
* \retval RTP_GENERIC_ERROR If an unspecified error occurred
*/
rtp_error_t push_user_frame(uint8_t* data, uint32_t len,
std::string remote_address, uint16_t port);
rtp_error_t push_user_packet(uint8_t* data, uint32_t len);
/**
* \brief Asynchronous way of getting user frames
@ -326,7 +325,7 @@ namespace uvgrtp {
*
* \retval RTP_OK On success
* \retval RTP_INVALID_VALUE If hook is nullptr */
rtp_error_t install_user_hook(void* arg, void (*hook)(void*, uint8_t* data, uint32_t len));
rtp_error_t install_user_receive_hook(void* arg, void (*hook)(void*, uint8_t* data, uint32_t len));
/**

View File

@ -278,7 +278,7 @@ enum RTP_CTX_ENABLE_FLAGS {
RCE_RTCP_MUX = 1 << 21,
/// \cond DO_NOT_DOCUMENT
RCE_LAST = 1 << 21
RCE_LAST = 1 << 22
/// \endcond
}; // maximum is 1 << 30 for int
@ -394,7 +394,7 @@ enum RTP_CTX_CONFIGURATION_FLAGS {
/** Set the timeout value for socket polling
*
* Default value is 100 ms. If you are experiencing packet loss when receiving, you can try
* lowering this value down to 0. This will, however cause a busy loop in the receiver, so
* lowering this value down to 0. This will, however cause increased CPU usage in the receiver, so
* use with caution.
*/
RCC_POLL_TIMEOUT = 13,

View File

@ -645,22 +645,25 @@ rtp_error_t uvgrtp::media_stream::push_frame(std::unique_ptr<uint8_t[]> data, si
return ret;
}
rtp_error_t uvgrtp::media_stream::push_user_frame(uint8_t* data, uint32_t len,
std::string remote_address, uint16_t port)
rtp_error_t uvgrtp::media_stream::push_user_packet(uint8_t* data, uint32_t len)
{
if (rce_flags_ && RCE_RECEIVE_ONLY) {
UVG_LOG_WARN("Cannot send user packets from a RECEIVE_ONLY stream");
return RTP_SEND_ERROR;
}
sockaddr_in6 addr6;
sockaddr_in addr;
if (ipv6_) {
addr6 = uvgrtp::socket::create_ip6_sockaddr(remote_address, port);
addr6 = uvgrtp::socket::create_ip6_sockaddr(remote_address_, dst_port_);
}
else {
addr = uvgrtp::socket::create_sockaddr(AF_INET, remote_address, port);
addr = uvgrtp::socket::create_sockaddr(AF_INET, remote_address_, dst_port_);
}
UVG_LOG_DEBUG("Sending user packet");
return socket_->sendto(addr, addr6, data, len, 0);
}
rtp_error_t uvgrtp::media_stream::install_user_hook(void* arg, void (*hook)(void*, uint8_t* payload, uint32_t len))
rtp_error_t uvgrtp::media_stream::install_user_receive_hook(void* arg, void (*hook)(void*, uint8_t* payload, uint32_t len))
{
if (!initialized_) {
UVG_LOG_ERROR("RTP context has not been initialized fully, cannot continue!");

View File

@ -135,7 +135,7 @@ uvgrtp::media_stream* uvgrtp::session::create_stream(uint16_t src_port, uint16_t
* 1. Use flags RCE_SRTP + RCE_SRTP_KMNGMNT_ZRTP + negotiation mode flag
* -> This way ZRTP negotiation is started automatically
* 2. Use flags RCE_SRTP + negotiation mode flag
* -> Use add_zrtp_ctx() function to start ZRTP negotiation manually
* -> Use start_zrtp() function to start ZRTP negotiation manually
*/
if (rce_flags & RCE_SRTP_KMNGMNT_ZRTP) {

View File

@ -417,7 +417,7 @@ void zrtp_sender_func(uvgrtp::session* sender_session, int sender_port, int rece
send->configure_ctx(RCC_REMOTE_SSRC, 33);
send->configure_ctx(RCC_SSRC, 44);
}
send->add_zrtp_ctx();
send->start_zrtp();
//send = sender_session->create_stream(sender_port, receiver_port, RTP_FORMAT_GENERIC, flags);
}
//Sleep for a bit so that the receiver is ready to receives
@ -456,7 +456,7 @@ void zrtp_receive_func(uvgrtp::session* receiver_session, int sender_port, int r
recv->configure_ctx(RCC_REMOTE_SSRC, 44);
recv->configure_ctx(RCC_SSRC, 33);
}
recv->add_zrtp_ctx();
recv->start_zrtp();
//recv = receiver_session->create_stream(receiver_port, sender_port, RTP_FORMAT_GENERIC, flags);
}

View File

@ -115,7 +115,7 @@ inline void send_packets(std::unique_ptr<uint8_t[]> test_packet, size_t size,
if (i % 4 == 0 && user) {
uint8_t data[5] = {20, 25, 30, 35, 40};
uint8_t* ptr = &data[0];
sender->push_user_frame(ptr, 5, "127.0.0.1", 9300);
sender->push_user_packet(ptr, 5);
}
rtp_error_t ret = RTP_OK;