<html>
 <body>
  <div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
   <table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
    <tr>
     <td>
      This is an automatically generated e-mail. To reply, visit:
      <a href="https://reviewboard.asterisk.org/r/1104/">https://reviewboard.asterisk.org/r/1104/</a>
     </td>
    </tr>
   </table>
   <br />









<div>




<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
 <thead>
  <tr>
   <th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
    <a href="https://reviewboard.asterisk.org/r/1104/diff/2/?file=15548#file15548line942" style="color: black; font-weight: bold; text-decoration: underline;">/main/format.c</a>
    <span style="font-weight: normal;">

     (Diff revision 2)

    </span>
   </th>
  </tr>
 </thead>

 <tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
  <tr>

   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
   <td colspan="2"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static int build_format_list_array(void)</pre></td>

  </tr>
 </tbody>




 
 



 <tbody>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">941</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">it</span> <span class="o">=</span> <span class="n">ao2_iterator_init</span><span class="p">(</span><span class="n">format_list</span><span class="p">,</span> <span class="mi">0</span><span class="p">);</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">942</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">while</span> <span class="p">((</span><span class="n">tmp</span> <span class="o">=</span> <span class="n">ao2_iterator_next</span><span class="p">(</span><span class="o">&amp;</span><span class="n">it</span><span class="p">))</span> <span class="o">&amp;&amp;</span> <span class="p">(</span><span class="n">i</span> <span class="o">&lt;</span> <span class="n">format_list_array_len</span><span class="p">))</span> <span class="p">{</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">943</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">memcpy</span><span class="p">(</span><span class="o">&amp;</span><span class="n">format_list_array</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">tmp</span><span class="p">,</span> <span class="k">sizeof</span><span class="p">(</span><span class="k">struct</span> <span class="n">ast_format_list</span><span class="p">));</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">944</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">i</span><span class="o">++</span><span class="p">;</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">945</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="p">}</span></pre></td>
  </tr>

  <tr>
    <th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
    <th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">946</font></th>
    <td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="n">ao2_iterator_destroy</span><span class="p">(</span><span class="o">&amp;</span><span class="n">it</span><span class="p">);</span></pre></td>
  </tr>

 </tbody>

</table>

<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">It seems like I should know how to use ao2 iterators by now.  This ref leak is fixed.</pre>
</div>
<br />



<p>- David</p>


<br />
<p>On February 16th, 2011, 5:41 p.m., David Vossel wrote:</p>






<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.orgrb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
 <tr>
  <td>

<div>Review request for Asterisk Developers.</div>
<div>By David Vossel.</div>


<p style="color: grey;"><i>Updated 2011-02-16 17:41:27</i></p>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">-Functional Changes
Dynamic global format list build by codecs defined in codecs.conf
SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
Negotiation of SILK attributes in chan_sip.
SPEEX 32khz with translation
SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation using codec_resample.c
Various changes to RTP code required to properly handle the dynamic format list and formats with attributes.

-Organizational changes
Global format list is moved from frame.c to format.c
Various format specific functions moved from frame.c to format.c

-MIS
There were several changes that I opted not to do during phase 1 that involved the proper use of formats with attributes.  I felt that the phase 1 patch was too complex to attempt these changes so I have included them here.  The primary change I held off doing the first time around was in the rtp_engine.c Payload and MIME type lists.  These lists were statically defined which made it impossible to set formats with attributes in them.  I have gone back and revised these lists to allow the flexibility required for the new architecture.
</pre>
  </td>
 </tr>
</table>


<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
 <tr>
  <td>
   <pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">I used the same testing I did for phase1 with phase2.  This includes load testing with various codec negotiation scenarios.  Speex 32 and its translators were verified using Asterisk back to back.  I verified SILK using a codec translator module I&#39;m working with.  The new slinear resample code was exercised with both Speex32 and SILK 12khz/24khz translation.</pre>
  </td>
 </tr>
</table>




<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">

 <li>/trunk/CHANGES <span style="color: grey">(308199)</span></li>

 <li>/trunk/apps/app_chanspy.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/apps/app_jack.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/apps/app_mixmonitor.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/bridges/bridge_multiplexed.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/bridges/bridge_softmix.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/channels/chan_gtalk.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/channels/chan_iax2.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/channels/chan_jingle.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/channels/chan_sip.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/channels/chan_skinny.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/channels/iax2.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/codecs/Makefile <span style="color: grey">(308199)</span></li>

 <li>/trunk/codecs/codec_resample.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/codecs/codec_speex.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/codecs/speex/arch.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/codecs/speex/fixed_generic.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/codecs/speex/resample.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/codecs/speex/resample_sse.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/codecs/speex/speex_resampler.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/codecs/speex/stack_alloc.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/configs/codecs.conf.sample <span style="color: grey">(308199)</span></li>

 <li>/trunk/formats/format_attr_silk.c <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/funcs/func_pitchshift.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/funcs/func_speex.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/funcs/func_volume.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/audiohook.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/format.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/format_cap.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/frame.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/rtp_engine.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/silk.h <span style="color: grey">(PRE-CREATION)</span></li>

 <li>/trunk/include/asterisk/slinfactory.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/time.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/include/asterisk/translate.h <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/asterisk.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/audiohook.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/channel.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/data.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/format.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/format_cap.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/format_pref.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/frame.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/rtp_engine.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/slinfactory.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/main/translate.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/res/res_mutestream.c <span style="color: grey">(308199)</span></li>

 <li>/trunk/res/res_rtp_asterisk.c <span style="color: grey">(308199)</span></li>

</ul>

<p><a href="https://reviewboard.asterisk.org/r/1104/diff/" style="margin-left: 3em;">View Diff</a></p>




  </td>
 </tr>
</table>








  </div>
 </body>
</html>