codec_mapping_matches_speech_ver

Change-Id: Iccd1f137674ef23dfa37a7e21086e046514ce39b
This commit is contained in:
Neels Hofmeyr 2024-01-19 05:52:16 +01:00
parent 21f1bfb4a8
commit d1039bb8a5
2 changed files with 11 additions and 0 deletions

View File

@ -58,6 +58,8 @@ const struct codec_mapping *codec_mapping_next(const struct codec_mapping *c);
#define codec_mapping_foreach(CODEC_MAPPING) \
for ((CODEC_MAPPING) = codec_mapping_next(NULL); (CODEC_MAPPING); (CODEC_MAPPING) = codec_mapping_next(CODEC_MAPPING))
bool codec_mapping_matches_speech_ver(const struct codec_mapping *m, enum gsm48_bcap_speech_ver speech_ver);
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);
const struct codec_mapping *codec_mapping_by_gsm0808_speech_codec(const struct gsm0808_speech_codec *sc);

View File

@ -224,6 +224,15 @@ const struct gsm_mncc_bearer_cap bearer_cap_empty = {
.speech_ver = { -1 },
};
bool codec_mapping_matches_speech_ver(const struct codec_mapping *m, enum gsm48_bcap_speech_ver speech_ver)
{
int i;
for (i = 0; i < m->speech_ver_count; i++)
if (m->speech_ver[i] == speech_ver)
return true;
return false;
}
const struct codec_mapping *codec_mapping_by_speech_ver(enum gsm48_bcap_speech_ver speech_ver)
{
const struct codec_mapping *m;