codec t9n: use full speech_codec instead of enum mgcp_codec

Change-Id: Ibfa6f94b394c7aed5f2c5196ea3a7e8fd41b9e67
neels/codecs_fmtp
Neels Hofmeyr 3 months ago
parent 221e26a770
commit cb39fcedda
  1. 4
      include/osmocom/msc/codec_sdp_cc_t9n.h
  2. 15
      src/libmsc/codec_sdp_cc_t9n.c

@ -44,8 +44,8 @@ extern const struct codec_mapping codec_map[];
for ((CODEC_MAPPING) = codec_map; (CODEC_MAPPING) < codec_map + ARRAY_SIZE(codec_map); (CODEC_MAPPING)++)
const struct codec_mapping *codec_mapping_by_speech_ver(enum gsm48_bcap_speech_ver speech_ver);
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec_type(enum gsm0808_speech_codec_type sct,
uint16_t cfg);
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec_type(enum gsm0808_speech_codec_type sct);
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec(const struct gsm0808_speech_codec *sc);
const struct codec_mapping *codec_mapping_by_perm_speech(enum gsm0808_permitted_speech perm_speech);
const struct codec_mapping *codec_mapping_by_subtype_name(const char *subtype_name);
const struct codec_mapping *codec_mapping_by_mgcp_codec(enum mgcp_codecs mgcp);

@ -222,7 +222,20 @@ const struct codec_mapping *codec_mapping_by_speech_ver(enum gsm48_bcap_speech_v
return NULL;
}
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec(const struct gsm0808_speech_codec *sc)
{
const struct codec_mapping *m;
foreach_codec_mapping(m) {
if (!m->has_gsm0808_speech_codec)
continue;
if (m->gsm0808_speech_codec.type == sc->type)
return m;
/* FIXME: evaluate cfg bits? */
}
return NULL;
}
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec_type(enum gsm0808_speech_codec_type sct);
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec_type(enum gsm0808_speech_codec_type sct, uint16_t cfg)
{
const struct codec_mapping *m;
@ -405,7 +418,7 @@ void sdp_audio_codecs_from_speech_codec_list(struct sdp_audio_codecs *ac, const
int i;
for (i = 0; i < cl->len; i++) {
const struct gsm0808_speech_codec *sc = &cl->codec[i];
const struct codec_mapping *m = codec_mapping_by_gsm0808_speech_codec_type(sc->type, sc->cfg);
const struct codec_mapping *m = codec_mapping_by_gsm0808_speech_codec(sc);
if (!m)
continue;
sdp_audio_codecs_add_copy(ac, &m->sdp);

Loading…
Cancel
Save