[asterisk-dev] [Code Review] Convert ast_rtp_codecs to using astobj2 internally for payloads

Kevin Fleming reviewboard at asterisk.org
Wed Jul 18 14:57:30 CDT 2012


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2052/#review6721
-----------------------------------------------------------


This looks pretty nice overall.


/trunk/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/2052/#comment12755>

    A bit ugly... since this function has no ability to 'fail', this has to be absorbed. This should only occur under extreme memory pressure conditions, though, so the resulting unusual behavior (missing one or more default format/payload items) will probably be lost in the noise. It would probably be worth adding a comment here to indicate why the memory allocation failure is not fatal, though.



/trunk/main/rtp_engine.c
<https://reviewboard.asterisk.org/r/2052/#comment12756>

    It is safe to have the same 'struct ast_rtp_payload_type' instance be linked into multiple containers? Semantically this seems risky, as changes in the object in the source container would affect the destination container too.


- Kevin


On July 18, 2012, 10:47 a.m., Joshua Colp wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2052/
> -----------------------------------------------------------
> 
> (Updated July 18, 2012, 10:47 a.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Summary
> -------
> 
> While doing the media attribute work I needed to increase the available space for attribute information but this has caused stack space usage to increase. While I have reduced it some there is still quite a bit of memory being consumed. To help with this I have converted ast_rtp_codecs to use astobj2 internally for storing payload information. The only memory used will be that of payloads present in the structure, and not a huge array containing every possible one. For all cases this should reduce memory consumption considerably and for most cases should reduce it to an amount lower than before attribute support was even added.
> 
> 
> Diffs
> -----
> 
>   /trunk/channels/chan_motif.c 370182 
>   /trunk/channels/chan_sip.c 370182 
>   /trunk/include/asterisk/rtp_engine.h 370182 
>   /trunk/main/rtp_engine.c 370182 
>   /trunk/res/res_rtp_asterisk.c 370182 
> 
> Diff: https://reviewboard.asterisk.org/r/2052/diff
> 
> 
> Testing
> -------
> 
> Done my own testing with calls to ensure they still work properly, and also ran the testsuite.
> 
> 
> Thanks,
> 
> Joshua
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20120718/6130308f/attachment.htm>


More information about the asterisk-dev mailing list