|
|
@ -1476,6 +1476,23 @@ static int replace_codec_list(struct sdp_chopper *chop, |
|
|
return 0; |
|
|
return 0; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static void insert_codec_parameters(struct sdp_chopper *chop, struct call_media *cm) { |
|
|
|
|
|
for (GList *l = cm->codecs_prefs_recv.head; l; l = l->next) { |
|
|
|
|
|
struct rtp_payload_type *pt = l->data; |
|
|
|
|
|
chopper_append_printf(chop, "a=rtpmap:%u " STR_FORMAT "\r\n", |
|
|
|
|
|
pt->payload_type, |
|
|
|
|
|
STR_FMT(&pt->encoding_with_params)); |
|
|
|
|
|
} |
|
|
|
|
|
for (GList *l = cm->codecs_prefs_recv.head; l; l = l->next) { |
|
|
|
|
|
struct rtp_payload_type *pt = l->data; |
|
|
|
|
|
if (!pt->format_parameters.len) |
|
|
|
|
|
continue; |
|
|
|
|
|
chopper_append_printf(chop, "a=fmtp:%u " STR_FORMAT "\r\n", |
|
|
|
|
|
pt->payload_type, |
|
|
|
|
|
STR_FMT(&pt->format_parameters)); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
static int replace_media_port(struct sdp_chopper *chop, struct sdp_media *media, struct packet_stream *ps) { |
|
|
static int replace_media_port(struct sdp_chopper *chop, struct sdp_media *media, struct packet_stream *ps) { |
|
|
str *port = &media->port; |
|
|
str *port = &media->port; |
|
|
unsigned int p; |
|
|
unsigned int p; |
|
|
@ -1692,6 +1709,8 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * |
|
|
case ATTR_SENDRECV: |
|
|
case ATTR_SENDRECV: |
|
|
case ATTR_IGNORE: |
|
|
case ATTR_IGNORE: |
|
|
case ATTR_END_OF_CANDIDATES: // we strip it here and re-insert it later |
|
|
case ATTR_END_OF_CANDIDATES: // we strip it here and re-insert it later |
|
|
|
|
|
case ATTR_RTPMAP: |
|
|
|
|
|
case ATTR_FMTP: |
|
|
goto strip; |
|
|
goto strip; |
|
|
|
|
|
|
|
|
case ATTR_EXTMAP: |
|
|
case ATTR_EXTMAP: |
|
|
@ -1711,22 +1730,6 @@ static int process_media_attributes(struct sdp_chopper *chop, struct sdp_media * |
|
|
goto strip; // hack/workaround: always remove a=mid |
|
|
goto strip; // hack/workaround: always remove a=mid |
|
|
break; |
|
|
break; |
|
|
|
|
|
|
|
|
case ATTR_RTPMAP: |
|
|
|
|
|
if (media->codecs_prefs_recv.length == 0) |
|
|
|
|
|
break; // legacy protocol or usage error |
|
|
|
|
|
if (!g_hash_table_lookup(media->codecs, |
|
|
|
|
|
&attr->u.rtpmap.rtp_pt.payload_type)) |
|
|
|
|
|
goto strip; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
case ATTR_FMTP: |
|
|
|
|
|
if (media->codecs_prefs_recv.length == 0) |
|
|
|
|
|
break; // legacy protocol or usage error |
|
|
|
|
|
if (!g_hash_table_lookup(media->codecs, |
|
|
|
|
|
&attr->u.fmtp.payload_type)) |
|
|
|
|
|
goto strip; |
|
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
default: |
|
|
break; |
|
|
break; |
|
|
} |
|
|
} |
|
|
@ -2058,6 +2061,8 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu |
|
|
|
|
|
|
|
|
copy_up_to_end_of(chop, &sdp_media->s); |
|
|
copy_up_to_end_of(chop, &sdp_media->s); |
|
|
|
|
|
|
|
|
|
|
|
insert_codec_parameters(chop, call_media); |
|
|
|
|
|
|
|
|
ps_rtcp = NULL; |
|
|
ps_rtcp = NULL; |
|
|
if (ps->rtcp_sibling) { |
|
|
if (ps->rtcp_sibling) { |
|
|
ps_rtcp = ps->rtcp_sibling; |
|
|
ps_rtcp = ps->rtcp_sibling; |
|
|
|