[core, mod_opus] bring more fmtp params to core (offer/answer).
This commit is contained in:
parent
f90aeade4f
commit
5e914efc8c
|
@ -676,8 +676,14 @@ struct switch_codec_fmtp {
|
||||||
int bits_per_second;
|
int bits_per_second;
|
||||||
/*! number of microseconds of media in one packet (ptime * 1000) */
|
/*! number of microseconds of media in one packet (ptime * 1000) */
|
||||||
int microseconds_per_packet;
|
int microseconds_per_packet;
|
||||||
/*! stereo */
|
/*! maximum ptime in ms */
|
||||||
|
int max_ptime;
|
||||||
|
/*! minimum ptime in ms */
|
||||||
|
int min_ptime;
|
||||||
|
/*! stereo, typically bidirectional */
|
||||||
int stereo;
|
int stereo;
|
||||||
|
/* sender properties (stereo) */
|
||||||
|
int sprop_stereo;
|
||||||
/*! private data for the codec module to store handle specific info */
|
/*! private data for the codec module to store handle specific info */
|
||||||
void *private_info;
|
void *private_info;
|
||||||
|
|
||||||
|
|
|
@ -273,10 +273,12 @@ static switch_status_t switch_opus_fmtp_parse(const char *fmtp, switch_codec_fmt
|
||||||
|
|
||||||
if (!strcasecmp(data, "maxptime")) {
|
if (!strcasecmp(data, "maxptime")) {
|
||||||
codec_settings->maxptime = atoi(arg);
|
codec_settings->maxptime = atoi(arg);
|
||||||
|
codec_fmtp->max_ptime = codec_settings->maxptime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(data, "minptime")) {
|
if (!strcasecmp(data, "minptime")) {
|
||||||
codec_settings->minptime = atoi(arg);
|
codec_settings->minptime = atoi(arg);
|
||||||
|
codec_fmtp->min_ptime = codec_settings->minptime;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(data, "ptime")) {
|
if (!strcasecmp(data, "ptime")) {
|
||||||
|
@ -291,6 +293,7 @@ static switch_status_t switch_opus_fmtp_parse(const char *fmtp, switch_codec_fmt
|
||||||
|
|
||||||
if (!strcasecmp(data, "sprop-stereo")) {
|
if (!strcasecmp(data, "sprop-stereo")) {
|
||||||
codec_settings->sprop_stereo = atoi(arg);
|
codec_settings->sprop_stereo = atoi(arg);
|
||||||
|
codec_fmtp->sprop_stereo = codec_settings->sprop_stereo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcasecmp(data, "maxaveragebitrate")) {
|
if (!strcasecmp(data, "maxaveragebitrate")) {
|
||||||
|
|
|
@ -5497,6 +5497,10 @@ SWITCH_DECLARE(uint8_t) switch_core_media_negotiate_sdp(switch_core_session_t *s
|
||||||
} else if (!strcasecmp(map->rm_encoding, "opus")) {
|
} else if (!strcasecmp(map->rm_encoding, "opus")) {
|
||||||
map_channels = 1;
|
map_channels = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (codec_fmtp.max_ptime) {
|
||||||
|
maxptime = codec_fmtp.max_ptime;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue