MT#60476 Move `sdp_manipulations_add()` to Gstring

Move the `sdp_manipulations_add()` func to work with
Gstring directly, instead of using the chopper object.

This will be needed later, when working with it
from behalf of sdp_create.

Change-Id: I2843aa0c97cb968adb450ca985efa6d7d9b2275e
mr13.0
Donat Zenichev 8 months ago
parent c9b583dc9a
commit 3d97bd89f7

@ -359,8 +359,7 @@ static bool sdp_manipulate_remove_attr(struct sdp_manipulations *sdp_manipulatio
/** /**
* Adds values into a requested session level (global, audio, video) * Adds values into a requested session level (global, audio, video)
*/ */
static void sdp_manipulations_add(struct sdp_chopper *chop, static void sdp_manipulations_add(GString *s, struct sdp_manipulations * sdp_manipulations) {
struct sdp_manipulations * sdp_manipulations) {
if (!sdp_manipulations) if (!sdp_manipulations)
return; return;
@ -370,10 +369,9 @@ static void sdp_manipulations_add(struct sdp_chopper *chop,
for (__auto_type l = q_ptr->head; l; l = l->next) for (__auto_type l = q_ptr->head; l; l = l->next)
{ {
str * attr_value = l->data; str * attr_value = l->data;
g_string_append_len(s, "a=", 2);
chopper_append_c(chop, "a="); g_string_append_len(s, attr_value->s, strlen(attr_value->s));
chopper_append_c(chop, attr_value->s); g_string_append_len(s, "\r\n", 2);
chopper_append_c(chop, "\r\n");
} }
} }
@ -3431,7 +3429,7 @@ int sdp_replace(struct sdp_chopper *chop, sdp_sessions_q *sessions,
/* ADD arbitrary SDP manipulations for a session sessions */ /* ADD arbitrary SDP manipulations for a session sessions */
struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, MT_UNKNOWN); struct sdp_manipulations *sdp_manipulations = sdp_manipulations_get_by_id(flags, MT_UNKNOWN);
sdp_manipulations_add(chop, sdp_manipulations); sdp_manipulations_add(chop->output, sdp_manipulations);
for (__auto_type k = session->media_streams.head; k; k = k->next) { for (__auto_type k = session->media_streams.head; k; k = k->next) {
sdp_media = k->data; sdp_media = k->data;
@ -3507,7 +3505,7 @@ int sdp_replace(struct sdp_chopper *chop, sdp_sessions_q *sessions,
/* ADD arbitrary SDP manipulations for audio/video media sessions */ /* ADD arbitrary SDP manipulations for audio/video media sessions */
sdp_manipulations = sdp_manipulations_get_by_id(flags, sdp_media->media_type_id); sdp_manipulations = sdp_manipulations_get_by_id(flags, sdp_media->media_type_id);
sdp_manipulations_add(chop, sdp_manipulations); sdp_manipulations_add(chop->output, sdp_manipulations);
media_index++; media_index++;
} }

Loading…
Cancel
Save