[asterisk-dev] A thread for format work

Joshua Colp jcolp at digium.com
Tue Apr 29 07:13:59 CDT 2014

Matthew Jordan wrote:


> So something like:
>      read_ptime0 = ast_format_cap_get_framing(cap0,
> ast_channel_rawreadformat(c0->chan));
>      read_ptime1 = ast_format_cap_get_framing(cap1,
> ast_channel_rawreadformat(c1->chan));
>      write_ptime0 = ast_format_cap_get_framing(cap0,
> ast_channel_rawwriteformat(c0->chan));
>      write_ptime1 = ast_format_cap_get_framing(cap1,
> ast_channel_rawwriteformat(c1->chan));
> My concern here is that the capabilities are obtained from the channel
> driver via the get_codec callbacks. I'm not sure that's correct, since
> the previous approach got the codecs from the rtp instance via
> ast_rtp_instance_get_codecs. However, as that is an AST_VECTOR of
> ast_formats, there's not a clean way to turn that into an ast_format_cap.
> Do we need a call that turns the vector of formats into a capabilities
> structure? Or is what comes back from the get_codecs callback sufficient?

For the purposes of the above call the framing on the channels 
themselves will match what is being used - so doing everything using the 
nativeformats capabilities of the channel will be equivalent to the old 
code. The only difference is everything is stored on the channel and 
being accessed there.

The question becomes... how do we notify the RTP side of stuff for 
*setting up* the smoother. Since format capabilities are reference 
counted we could pass in the same structure as the channel 
nativeformats, and have it access that.

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