Skip to content

Commit 2ddbeda

Browse files
committed
MT#60693 sdp_create: print attributes in a func
Move printing of attributes to a separate func, in order to be able to re-use this print during the same media section iteration (e.g. with OSRTP). Later on this func is to be merged with the `print_sdp_media_section()` function, after the sdp_replace is fully deprecated. Change-Id: I15825ed6eecb450b742b31677961fd8ddbf950fb
1 parent 6751ff7 commit 2ddbeda

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

daemon/sdp.c

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3651,6 +3651,26 @@ static void sdp_out_add_media_connection(GString *out, struct call_media *media,
36513651
media_conn_address);
36523652
}
36533653

3654+
/**
3655+
* TODO: after sdp_replace() is deprecated, move the content of this func
3656+
* to `print_sdp_media_section()`.
3657+
*/
3658+
void handle_sdp_media_attributes(GString *s, struct call_media *media,
3659+
struct packet_stream *rtp_ps, packet_stream_list *rtp_ps_link,
3660+
sdp_ng_flags *flags)
3661+
{
3662+
struct call_monologue *monologue = media->monologue;
3663+
3664+
/* add actual media connection */
3665+
sdp_out_add_media_connection(s, media, rtp_ps, flags);
3666+
3667+
/* add per media bandwidth */
3668+
sdp_out_add_bandwidth(s, monologue, media);
3669+
3670+
/* print media level attributes */
3671+
print_sdp_media_section(s, media, NULL, flags, rtp_ps_link, true, false);
3672+
}
3673+
36543674
/**
36553675
* For the offer/answer model, SDP create will be triggered for the B monologue,
36563676
* which likely has empty paramaters (such as sdp origin, session name etc.), hence
@@ -3740,14 +3760,7 @@ int sdp_create(str *out, struct call_monologue *monologue, sdp_ng_flags *flags)
37403760
print_codec_list(s, media);
37413761
g_string_append_printf(s, "\r\n");
37423762

3743-
/* add actual media connection */
3744-
sdp_out_add_media_connection(s, media, rtp_ps, flags);
3745-
3746-
/* add per media bandwidth */
3747-
sdp_out_add_bandwidth(s, monologue, media);
3748-
3749-
/* print media level attributes */
3750-
print_sdp_media_section(s, media, NULL, flags, rtp_ps_link, true, false);
3763+
handle_sdp_media_attributes(s, media, rtp_ps, rtp_ps_link, flags);
37513764
}
37523765

37533766
/* The SDP version gets increased in case:

0 commit comments

Comments
 (0)