use gsm0808_speech_codec

Change-Id: Ie72afae98f8efc04231af6f9e71daa9e84562bca
neels/codecs_fmtp
Neels Hofmeyr 2 months ago
parent cb39fcedda
commit 8d962f9a1d
  1. 17
      src/libmsc/codec_sdp_cc_t9n.c

@ -222,29 +222,30 @@ 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 *codec_mapping_by_gsm0808_speech_codec_type(enum gsm0808_speech_codec_type sct)
{
const struct codec_mapping *m;
foreach_codec_mapping(m) {
if (!m->has_gsm0808_speech_codec)
continue;
if (m->gsm0808_speech_codec.type == sc->type)
if (m->gsm0808_speech_codec.type == sct)
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 *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 == sct)
return m;
/* TODO: evaluate cfg bits? */
if (m->gsm0808_speech_codec.type != sc->type)
continue;
/* Return only those where sc->cfg is a subset of m->gsm0808_speech_codec.cfg. */
if ((m->gsm0808_speech_codec.cfg & sc->cfg) != sc->cfg)
continue;
return m;
}
return NULL;
}

Loading…
Cancel
Save