Remove old send interface
This interface was hardly used and it provided very little benefit over using the socket API directly.
This commit is contained in:
parent
8f0e746e59
commit
9e49ad4b09
|
@ -5,7 +5,6 @@
|
|||
|
||||
#include "receiver.hh"
|
||||
#include "rtcp.hh"
|
||||
#include "sender.hh"
|
||||
#include "socket.hh"
|
||||
#include "srtp.hh"
|
||||
#include "util.hh"
|
||||
|
@ -186,7 +185,6 @@ namespace uvg_rtp {
|
|||
|
||||
uvg_rtp::srtp *srtp_;
|
||||
uvg_rtp::socket socket_;
|
||||
uvg_rtp::sender *sender_;
|
||||
uvg_rtp::receiver *receiver_;
|
||||
uvg_rtp::rtp *rtp_;
|
||||
uvg_rtp::rtcp *rtcp_;
|
||||
|
|
|
@ -1,65 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "util.hh"
|
||||
|
||||
namespace uvg_rtp {
|
||||
class sender;
|
||||
|
||||
namespace send {
|
||||
/* Send RTP Frame to remote
|
||||
*
|
||||
* This functions assumes "frame_len" is smaller than MAX_PAYLOAD
|
||||
* No measures are taken (apart from print a warning) if it's larger
|
||||
* TODO: should it split the frame?
|
||||
*
|
||||
* send_frame() assumes that "frame" starts with a valid RTP header
|
||||
*
|
||||
* Return RTP_OK on success
|
||||
* Return RTP_INVALID_VALUE if one of the values are invalid
|
||||
* Return RTP_SEND_ERROR if sending the frame failed */
|
||||
rtp_error_t send_frame(
|
||||
uvg_rtp::sender *sender,
|
||||
uint8_t *frame, size_t frame_len
|
||||
);
|
||||
|
||||
/* Send RTP Frame to remote
|
||||
*
|
||||
* This functions assumes "frame_len" + "header_len" is smaller than MAX_PAYLOAD
|
||||
* No measures are taken (apart from print a warning) if it's larger
|
||||
* TODO: should it split the frame?
|
||||
*
|
||||
* send_frame() assumes that "header" points to a valid RTP header
|
||||
*
|
||||
* Return RTP_OK on success
|
||||
* Return RTP_INVALID_VALUE if one of the values are invalid
|
||||
* Return RTP_SEND_ERROR if sending the frame failed */
|
||||
rtp_error_t send_frame(
|
||||
uvg_rtp::sender *sender,
|
||||
uint8_t *header, size_t header_len,
|
||||
uint8_t *payload, size_t payload_len
|
||||
);
|
||||
|
||||
/* Send RTP Frame to remote
|
||||
*
|
||||
* This functions assumes "frame_len" is smaller than MAX_PAYLOAD
|
||||
* No measures are taken (apart from print a warning) if it's larger
|
||||
* TODO: should it split the frame?
|
||||
*
|
||||
* send_frame() assumes that "buffers" contains at least two buffers:
|
||||
* - RTP header
|
||||
* - RTP payload
|
||||
*
|
||||
* RTP header must be the first buffer of the "buffers" vector
|
||||
*
|
||||
* Return RTP_OK on success
|
||||
* Return RTP_INVALID_VALUE if one of the values are invalid
|
||||
* Return RTP_SEND_ERROR if sending the frame failed */
|
||||
rtp_error_t send_frame(
|
||||
uvg_rtp::sender *sender,
|
||||
std::vector<std::pair<size_t, uint8_t *>>& buffers
|
||||
);
|
||||
|
||||
};
|
||||
};
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#ifdef _WIN32
|
||||
// TODO
|
||||
#else
|
||||
|
@ -273,3 +274,4 @@ rtp_error_t uvg_rtp::generic::frame_receiver(uvg_rtp::receiver *receiver)
|
|||
return ret;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
#include "debug.hh"
|
||||
#include "queue.hh"
|
||||
#include "receiver.hh"
|
||||
#include "send.hh"
|
||||
|
||||
#define RTP_FRAME_MAX_DELAY 100
|
||||
#define INVALID_SEQ 0x13371338
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#include <cmath>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
|
@ -901,3 +902,4 @@ rtp_error_t __hevc_receiver_optimistic(uvg_rtp::receiver *receiver)
|
|||
|
||||
return RTP_OK;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#if 0
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
|
@ -47,3 +48,4 @@ rtp_error_t uvg_rtp::opus::push_frame(uvg_rtp::sender *sender, std::unique_ptr<u
|
|||
{
|
||||
return uvg_rtp::generic::push_frame(sender, std::move(data), data_len, flags);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
|
||||
#include "debug.hh"
|
||||
#include "frame.hh"
|
||||
#include "send.hh"
|
||||
#include "util.hh"
|
||||
|
||||
uvg_rtp::frame::rtp_frame *uvg_rtp::frame::alloc_rtp_frame()
|
||||
|
|
75
src/send.cc
75
src/send.cc
|
@ -1,75 +0,0 @@
|
|||
#ifdef _WIN32
|
||||
#include <winsock2.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
#include <arpa/inet.h>
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <iostream>
|
||||
|
||||
/* #include "debug.hh" */
|
||||
/* #include "formats/generic.hh" */
|
||||
#include "send.hh"
|
||||
/* #include "sender.hh" */
|
||||
/* #include "util.hh" */
|
||||
/* #include "sender.hh" */
|
||||
|
||||
#if 0
|
||||
rtp_error_t uvg_rtp::send::send_frame(
|
||||
uvg_rtp::sender *sender,
|
||||
uint8_t *frame, size_t frame_len
|
||||
)
|
||||
{
|
||||
if (!sender || !frame || frame_len == 0)
|
||||
return RTP_INVALID_VALUE;
|
||||
|
||||
sender->get_rtp_ctx()->inc_sent_pkts();
|
||||
sender->get_rtp_ctx()->inc_sequence();
|
||||
|
||||
return sender->get_socket().sendto(frame, frame_len, 0, NULL);
|
||||
}
|
||||
|
||||
rtp_error_t uvg_rtp::send::send_frame(
|
||||
uvg_rtp::sender *sender,
|
||||
uint8_t *header, size_t header_len,
|
||||
uint8_t *payload, size_t payload_len
|
||||
)
|
||||
{
|
||||
if (!sender || !header || header_len == 0 || !payload || payload_len == 0)
|
||||
return RTP_INVALID_VALUE;
|
||||
|
||||
std::vector<std::pair<size_t, uint8_t *>> buffers;
|
||||
|
||||
sender->get_rtp_ctx()->inc_sent_pkts();
|
||||
sender->get_rtp_ctx()->inc_sequence();
|
||||
|
||||
buffers.push_back(std::make_pair(header_len, header));
|
||||
buffers.push_back(std::make_pair(payload_len, payload));
|
||||
|
||||
return sender->get_socket().sendto(buffers, 0);
|
||||
}
|
||||
|
||||
rtp_error_t uvg_rtp::send::send_frame(
|
||||
uvg_rtp::sender *sender,
|
||||
std::vector<std::pair<size_t, uint8_t *>>& buffers
|
||||
)
|
||||
{
|
||||
if (!sender)
|
||||
return RTP_INVALID_VALUE;
|
||||
|
||||
size_t total_size = 0;
|
||||
|
||||
/* first buffer is supposed to be RTP header which is not included */
|
||||
for (size_t i = 1; i < buffers.size(); ++i) {
|
||||
total_size += buffers.at(i).first;
|
||||
}
|
||||
|
||||
sender->get_rtp_ctx()->inc_sent_pkts();
|
||||
sender->get_rtp_ctx()->inc_sequence();
|
||||
|
||||
return sender->get_socket().sendto(buffers, 0);
|
||||
}
|
||||
#endif
|
Loading…
Reference in New Issue