Remove SEND_ONLY/RECV_ONLY options from media_stream

The media_stream object acts as uni-/bidirectional based on usage
so there is no need to explicitly define it as send/recv only
This commit is contained in:
Aaro Altonen 2020-10-08 04:02:21 +03:00
parent 1115c1d0a9
commit 3541212cc1
3 changed files with 5 additions and 31 deletions

View File

@ -14,12 +14,6 @@
namespace uvg_rtp {
enum mstream_type {
BIDIRECTIONAL,
UNIDIRECTIONAL_SENDER,
UNIDIRECTIONAL_RECEIVER
};
class media_stream {
public:
media_stream(std::string addr, int src_port, int dst_port, rtp_format_t fmt, int flags);
@ -196,9 +190,6 @@ namespace uvg_rtp {
/* Has the media stream been initialized */
bool initialized_;
/* media stream type */
enum mstream_type type_;
/* Primary handler keys for the RTP packet dispatcher */
uint32_t rtp_handler_key_;
uint32_t zrtp_handler_key_;

View File

@ -172,19 +172,8 @@ enum RTP_CTX_ENABLE_FLAGS {
/* Disable System Call Clustering (SCC), System Call Dispatching is still usable */
RCE_NO_SYSTEM_CALL_CLUSTERING = 1 << 8,
/* Make the media stream unidirectional, i.e. sender/receiver only */
RCE_UNIDIRECTIONAL = 1 << 9,
/* Media stream is only used for sending
* Mutually exclusive with RCE_UNIDIR_RECEIVER */
RCE_UNIDIR_SENDER = 1 << 10,
/* Media stream is only used for receiving
* Mutually exclusive with RCE_UNIDIR_SENDER */
RCE_UNIDIR_RECEIVER = 1 << 11,
/* Disable RTP payload encryption */
RCE_SRTP_NULL_CIPHER = 1 << 12,
RCE_SRTP_NULL_CIPHER = 1 << 9,
/* Enable RTP packet authentication
*
@ -192,16 +181,16 @@ enum RTP_CTX_ENABLE_FLAGS {
* to each outgoing RTP packet for all streams that have SRTP enabled.
*
* NOTE: this flag must be coupled with at least RCE_SRTP */
RCE_SRTP_AUTHENTICATE_RTP = 1 << 13,
RCE_SRTP_AUTHENTICATE_RTP = 1 << 10,
/* Enable packet replay protection */
RCE_SRTP_REPLAY_PROTECTION = 1 << 14,
RCE_SRTP_REPLAY_PROTECTION = 1 << 11,
/* Enable RTCP for the media stream.
* If SRTP is enabled, SRTCP is used instead */
RCE_RTCP = 1 << 15,
RCE_RTCP = 1 << 12,
RCE_LAST = 1 << 15,
RCE_LAST = 1 << 13,
};
/* These options are given to configuration() */

View File

@ -10,12 +10,6 @@
#define INVALID_TS UINT64_MAX
#define RECV_ONLY_FLAGS (RCE_UNIDIRECTIONAL | RCE_UNIDIR_RECEIVER)
#define SEND_ONLY_FLAGS (RCE_UNIDIRECTIONAL | RCE_UNIDIR_SENDER)
#define RECV_ONLY(flags) ((flags & RECV_ONLY_FLAGS) == RECV_ONLY_FLAGS)
#define SEND_ONLY(flags) ((flags & SEND_ONLY_FLAGS) == SEND_ONLY_FLAGS)
uvg_rtp::media_stream::media_stream(std::string addr, int src_port, int dst_port, rtp_format_t fmt, int flags):
srtp_(nullptr),
srtcp_(nullptr),