Browse Source

TT#91151 move `num_ports` into stream_params

Change-Id: I8f20f07f092204a70917c3d180adc13fb7b44da1
pull/1295/head
Richard Fuchs 5 years ago
parent
commit
3b3979586f
3 changed files with 10 additions and 15 deletions
  1. +8
    -15
      daemon/call.c
  2. +1
    -0
      daemon/sdp.c
  3. +1
    -0
      include/call.h

+ 8
- 15
daemon/call.c View File

@ -2216,7 +2216,6 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
struct stream_params *sp;
GList *media_iter, *ml_media, *other_ml_media;
struct call_media *media, *other_media;
unsigned int num_ports;
struct call_monologue *monologue;
struct endpoint_map *em;
struct call *call;
@ -2421,15 +2420,9 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
}
}
/* determine number of consecutive ports needed locally.
* XXX only do *=2 for RTP streams? */
num_ports = sp->consecutive_ports;
num_ports *= 2;
/* local interface selection */
__init_interface(media, &sp->direction[1], num_ports);
__init_interface(other_media, &sp->direction[0], num_ports);
__init_interface(media, &sp->direction[1], sp->num_ports);
__init_interface(other_media, &sp->direction[0], sp->num_ports);
if (media->logical_intf == NULL || other_media->logical_intf == NULL) {
goto error_intf;
@ -2451,8 +2444,8 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
* RFC 3264, chapter 6:
* If a stream is rejected, the offerer and answerer MUST NOT
* generate media (or RTCP packets) for that stream. */
__disable_streams(media, num_ports);
__disable_streams(other_media, num_ports);
__disable_streams(media, sp->num_ports);
__disable_streams(other_media, sp->num_ports);
goto init;
}
if (is_addr_unspecified(&sp->rtp_endpoint.address) && !MEDIA_ISSET(other_media, TRICKLE_ICE)) {
@ -2465,7 +2458,7 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
/* get that many ports for each side, and one packet stream for each port, then
* assign the ports to the streams */
em = __get_endpoint_map(media, num_ports, &sp->rtp_endpoint, flags);
em = __get_endpoint_map(media, sp->num_ports, &sp->rtp_endpoint, flags);
if (!em) {
goto error_ports;
}
@ -2473,14 +2466,14 @@ int monologue_offer_answer(struct call_monologue *other_ml, GQueue *streams,
if(flags->disable_jb && media->call)
media->call->disable_jb=1;
__num_media_streams(media, num_ports);
__num_media_streams(media, sp->num_ports);
__assign_stream_fds(media, &em->intf_sfds);
if (__num_media_streams(other_media, num_ports)) {
if (__num_media_streams(other_media, sp->num_ports)) {
/* new streams created on OTHER side. normally only happens in
* initial offer. create a wildcard endpoint_map to be filled in
* when the answer comes. */
if (__wildcard_endpoint_map(other_media, num_ports))
if (__wildcard_endpoint_map(other_media, sp->num_ports))
goto error_ports;
}


+ 1
- 0
daemon/sdp.c View File

@ -1529,6 +1529,7 @@ int sdp_streams(const GQueue *sessions, GQueue *streams, struct sdp_ng_flags *fl
goto error;
sp->consecutive_ports = media->port_count;
sp->num_ports = sp->consecutive_ports * 2; // only do *=2 for RTP streams?
sp->protocol = transport_protocol(&media->transport);
sp->type = media->media_type_str;
sp->type_id = media->media_type_id;


+ 1
- 0
include/call.h View File

@ -243,6 +243,7 @@ struct stream_params {
struct endpoint rtp_endpoint;
struct endpoint rtcp_endpoint;
unsigned int consecutive_ports;
unsigned int num_ports;
const struct transport_protocol *protocol;
str format_str;
GQueue sdes_params; // slice-alloc'd


Loading…
Cancel
Save