[asterisk-dev] Media Formats: ast_best_codec and cached formats questions

Joshua Colp jcolp at digium.com
Sun Jun 22 10:12:03 CDT 2014


Matthew Jordan wrote:
> On Sun, Jun 22, 2014 at 9:46 AM, Joshua Colp<jcolp at digium.com>  wrote:
>> Matthew Jordan wrote:
>>> A few questions for those working on the media format improvements:
>>>
>
> <snip>
>
>>> 2) Cached formats: who is supposed to define these things? Thanks to
>>> Corey's patches compilation succeeds, but linking fails big time. I'm
>>> not sure where/who the creator of these structures is supposed to be.
>>
>> I don't think anything, yet. Something in the core should though.
>>
>
> There's something of a chicken&  egg problem here.
>
> We can't generate a format properly until we have the codec. Those
> codecs are loadable modules: they may be present, they may not ever be
> present. And they may load late in the startup sequence.

Not completely. Built-in codecs are initialized in the core at a 
specific point, it is guaranteed for them to exist after that. If you 
create formats using them and cache them after that then all is well. 
What you can't do is exactly what you said - create a cached format for 
a codec that isn't loaded. Heck, it may not never be loaded if you allow 
that. For that case I would expect that a single module would register 
the codec and also create the cached format.

-- 
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