Add 'unidirectional' attribute

In order to kernelize unidirectional streams.
pull/227/head
Stefan Mititelu 10 years ago
parent 926d9d3963
commit a43996fe4a

@ -711,6 +711,10 @@ Optionally included keys are:
Corresponds to the *rtpproxy* `a` flag. Advertises an RTP endpoint which uses asymmetric
RTP, which disables learning of endpoint addresses (see below).
- `unidirectional`
When this flag is present, kernelize also one-way rtp media.
- `strict source`
Normally, *rtpengine* attempts to learn the correct endpoint address for every stream during

@ -1553,8 +1553,8 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
if (sp->rtp_endpoint.port) {
/* copy parameters advertised by the sender of this message */
bf_copy_same(&other_media->media_flags, &sp->sp_flags,
SHARED_FLAG_RTCP_MUX | SHARED_FLAG_ASYMMETRIC | SHARED_FLAG_ICE
| SHARED_FLAG_TRICKLE_ICE | SHARED_FLAG_ICE_LITE);
SHARED_FLAG_RTCP_MUX | SHARED_FLAG_ASYMMETRIC | SHARED_FLAG_UNIDIRECTIONAL |
SHARED_FLAG_ICE | SHARED_FLAG_TRICKLE_ICE | SHARED_FLAG_ICE_LITE);
crypto_params_copy(&other_media->sdes_in.params, &sp->crypto, 1);
other_media->sdes_in.tag = sp->sdes_tag;

@ -124,6 +124,7 @@ enum call_stream_state {
#define SHARED_FLAG_MEDIA_HANDOVER 0x00000200
#define SHARED_FLAG_TRICKLE_ICE 0x00000400
#define SHARED_FLAG_ICE_LITE 0x00000800
#define SHARED_FLAG_UNIDIRECTIONAL 0x00001000
/* struct stream_params */
#define SP_FLAG_NO_RTCP 0x00010000
@ -132,6 +133,7 @@ enum call_stream_state {
#define SP_FLAG_SEND SHARED_FLAG_SEND
#define SP_FLAG_RECV SHARED_FLAG_RECV
#define SP_FLAG_ASYMMETRIC SHARED_FLAG_ASYMMETRIC
#define SP_FLAG_UNIDIRECTIONAL SHARED_FLAG_UNIDIRECTIONAL
#define SP_FLAG_SETUP_ACTIVE SHARED_FLAG_SETUP_ACTIVE
#define SP_FLAG_SETUP_PASSIVE SHARED_FLAG_SETUP_PASSIVE
#define SP_FLAG_ICE SHARED_FLAG_ICE
@ -159,6 +161,7 @@ enum call_stream_state {
/* struct call_media */
#define MEDIA_FLAG_INITIALIZED 0x00010000
#define MEDIA_FLAG_ASYMMETRIC SHARED_FLAG_ASYMMETRIC
#define MEDIA_FLAG_UNIDIRECTIONAL SHARED_FLAG_UNIDIRECTIONAL
#define MEDIA_FLAG_SEND SHARED_FLAG_SEND
#define MEDIA_FLAG_RECV SHARED_FLAG_RECV
#define MEDIA_FLAG_RTCP_MUX SHARED_FLAG_RTCP_MUX

@ -541,6 +541,8 @@ static void call_ng_process_flags(struct sdp_ng_flags *out, bencode_item_t *inpu
out->trust_address = 0;
else if (!bencode_strcmp(it, "asymmetric"))
out->asymmetric = 1;
else if (!bencode_strcmp(it, "unidirectional"))
out->unidirectional = 1;
else if (!bencode_strcmp(it, "strict-source"))
out->strict_source = 1;
else if (!bencode_strcmp(it, "media-handover"))

@ -31,6 +31,7 @@ struct sdp_ng_flags {
sockfamily_t *address_family;
int tos;
int asymmetric:1,
unidirectional:1,
trust_address:1,
port_latching:1,
replace_origin:1,

@ -1204,6 +1204,11 @@ loop_ok:
if (MEDIA_ISSET(media, ASYMMETRIC))
PS_SET(stream, CONFIRMED);
/* confirm sink for unidirectional streams in order to kernelize */
if (MEDIA_ISSET(media, UNIDIRECTIONAL)) {
PS_SET(sink, CONFIRMED);
}
/* if we have already updated the endpoint in the past ... */
if (PS_ISSET(stream, CONFIRMED)) {
/* see if we need to compare the source address with the known endpoint */

@ -1188,6 +1188,7 @@ int sdp_streams(const GQueue *sessions, GQueue *streams, struct sdp_ng_flags *fl
memcpy(sp->direction, flags->direction, sizeof(sp->direction));
sp->desired_family = flags->address_family;
bf_set_clear(&sp->sp_flags, SP_FLAG_ASYMMETRIC, flags->asymmetric);
bf_set_clear(&sp->sp_flags, SP_FLAG_UNIDIRECTIONAL, flags->unidirectional);
bf_set_clear(&sp->sp_flags, SP_FLAG_STRICT_SOURCE, flags->strict_source);
bf_set_clear(&sp->sp_flags, SP_FLAG_MEDIA_HANDOVER, flags->media_handover);

Loading…
Cancel
Save