It's a minor technicality, but it seems the newly added API to
iterate the codec_mapping can slightly improve this implementation:
For some reason, the Bearer Capabilities should reflect whether any HR
codec is possible with its listed Speech Versions. So far we looked only
whether the first match for a given Speech Version in the global const
codec_mapping is a HR codec. Instead, look through *all* entries for a
Speech Version, and see if any one of them indicates HR.
For example, an AMR-FR codec with a well adjusted mode-set can work with
a half rate channel.
Change-Id: Ic964af4bec21598836748279f3fee480e470738c
So far the API is pivoting on the payload type numbers as the "primary
key" for codec lists. However, working with variants of codecs, the
payload type numbers are just incidental, and the API isn't helpful.
- change the behavior to regard the subtype name and fmtp as the
defining identity of a codec: use sdp_audio_codec_cmp() to match.
- add argument 'once': flag to make sure a given subtype+fmtp exists
only once, regardless of payload type nr.
- add argument 'pick_unused_pt_nr': flag to make sure a new entry
doesn't duplicate payload type numbers.
This is preparation to properly match AMR variants, in order to fix the
expected error currently visible in msc_vlr_test_call.c:875.
Change-Id: I87db779dbab39dfdef2724488ccdb6959e6731ed
In msc_a_up_call_assignment_complete(), iterate all the new AMR modes
and rates recently added to codec_mapping, and enlist all possible
matches.
Change-Id: I6163a51765efff998e05c9ee4e82a0a3759f2043
These flags are redundant, the aim is to speed up comparisons of AMR
fmtp when traversing a long list of codec variants. It can skip a lot of
repetitive strcmp and fmtp string parsing when used by a loop.
Change-Id: Ic2c9b4983b5374621e02389900e3622faa29cad9
So far, querying the codec mapping returns one match.
For example:
const struct codec_mapping *m;
m = codec_mapping_by_speech_ver(GSM48_BCAP_SV_FR);
if (!m)
return -ENOENT;
But when supporting various AMR rates, we need to find multiple matches
in some code paths.
Also to support AMR OA vs BE modes, we need to combine multiple criteria
in some places.
With this patch, and as soon as an upcoming patch implements
codec_mapping_matches_speech_ver(), above code example becomes:
const struct codec_mapping *m;
codec_mapping_foreach (m) {
if (codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_FR))
break;
}
if (!m)
return -ENOENT;
This pattern supports collecting multiple matches in a list:
const struct codec_mapping *m;
codec_mapping_foreach (m) {
if (codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_FR))
sdp_audio_codecs_add_copy(my_list, m);
}
And this pattern also supports combining criteria:
const struct codec_mapping *m;
codec_mapping_foreach (m) {
// only allow AMR in OA mode
if (!osmo_sdp_fmtp_amr_is_octet_aligned(m->sdp.fmtp))
continue;
if (codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_AMR_F)
|| codec_mapping_matches_speech_ver(m, GSM48_BCAP_SV_AMR_H))
sdp_audio_codecs_add_copy(my_list, m);
}
Change-Id: Iaaa59d4bf5a6126a1bfe4ae282b82f6cb3ec6f99
Instead of returning multiple occurences of AMR as duplicated
gsm0808_speech_codec_type entries, combine their cfg bits to form a
single entry listing all AMR rate combinations that are allowed.
Prepare for AMR mode-set negotiation: soon we'll have multiple AMR
variants in codec_mapping.c, and then these must produce correct
gsm0808_speech_codec_list.
Change-Id: Ibeffb6c1325abebb904a14f00e6a0818870b119e
Looking at 3GPP TS 26.103 table 4.1, none of the AMR-Oxx variants are
supported by GERAN-GMSK nor UTRAN, so it makes no sense to include
these. There are no users of this.
Change-Id: I0cbc770fff55209676d9b6aae50011d6d5f897e2
Better match the pattern of sdp_audio_codecs_* instead of having
foreach_ in the front. Prepare for prepending osmo_ some day, because I
plan to move the SDP API to a separate library.
Change-Id: Ia96190e0bdb513886663be1c8c12be3b403b71c9
Used by I8760feaa8598047369ef8c3ab2673013bac8ac8a to add just a single
codec to a speech codec list, instead of a list.
Change-Id: I6ac23c54bc26939e048ff2df06eb987421cfb1c5
The cfg bits are for AMR-HR, not GSM-HR. The function
gsm0808_enc_speech_codec_list2() will return -EINVAL when it encounters
GSM-HR with non-zero cfg bits.
It appears this mapping was never used before, and my testing of call
re-assignment to match MT's codecs (it allows more than just the
assigned codec, because it can re-assign) has uncovered this bug
via MSC_Tests.TC_ho_inter_msc_out. I don't fully understand all the
details why we didn't see this before; anyway, the fix is obvious.
Change-Id: I19cff847a0f618ad000d12c1df54c55ef2f79699
Without the gsm0808_speech_codec functions:
* codec_mapping_by_gsm0808_speech_codec_type(), and
* codec_mapping_by_gsm0808_speech_codec()
fail to find the codec mapping for CLEARMODE.
Change-Id: I87b3aedaf7ff7bbbcb381e94158566dc765e3ae6
Related: OS#6110, OS#4394
Converting between different codec representations is confusing. This
codec mapping provides a consolidated overview of all our codec
representations, and how they match up.
In particular, it adds the SDP codec representation repertoire,
preparing the use of full SDP on the MNCC interface.
Related: SYS#5066
Change-Id: Iaa307be6a8487aa8d4ba7cd59d5c5ef04818a744