[asterisk-dev] Asterisk goes Spatial Conferencing: the STEAK project

Joshua Colp jcolp at digium.com
Tue Oct 25 05:33:19 CDT 2016


Dennis Guse wrote:
> Hey,
>
> last week we started reworking the major patch [1] and could not solve
> one issue.
> At the moment, the softmix_bridge determines if interleaved stereo can
> be written by querying ast_format's attribute data if OPUS is used ([2]):
>
> ```
> struct opus_attr *attr = ast_format_get_attribute_data(format);
> if (attr != NULL) {
>    if (attr->stereo == 1) {
>       *sample_rate = attr->maxplayrate;
>       return 1;
>    }
> }
> ```
>
> In fact, this approach is conceptually flawed as it introduces a direct
> dependency between softmix_bridge and opus.
> To remove this dependency, we tried to attach this information to
> ast_codec (channel_count uint; default 1), but did not find a useful and
> working method to write the newly introduced field.
> We tried to set it in the res/res_format_attr_opus, ie, while parsing
> the fmtp for OPUS.
> Here, the ast_codec is const and we thus cannot be change.
>
> Any suggestions?
> Are we approaching the issue from a "correct" perspective?

The structure that is actually editable is the format (despite it being 
const in the format attribute module - this was done because it was 
never envisioned that a format attribute module would set anything 
directly on the format), this data would need to be there. The codec 
structure is an immutable structure which is shared by EVERY instance of 
a format that uses the codec. That is why you can't edit it.

-- 
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org




More information about the asterisk-dev mailing list