<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/1/?file=15502#file15502line870" style="color: black; font-weight: bold; text-decoration: underline;">/main/translate.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static void handle_cli_recalc(struct ast_cli_args *a)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">855</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">865</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">856</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">for</span> <span class="p">(</span><span class="n"><span class="hl">x</span></span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="n"><span class="hl">x</span></span> <span class="o"><</span> <span class="n"><span class="hl">cur_max_index</span></span><span class="p"><span class="hl">;</span></span><span class="hl"> </span><span class="n"><span class="hl">x</span></span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">866</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">        <span class="k">for</span> <span class="p">(</span><span class="n"><span class="hl">i</span></span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</span><span class="p">;</span> <span class="n"><span class="hl">i</span></span> <span class="o"><</span> <span class="n"><span class="hl">f_len</span></span><span class="p"><span class="hl">;</span></span><span class="hl"> </span><span class="n"><span class="hl">i</span></span><span class="o">++</span><span class="p">)</span> <span class="p">{</span></pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#f0f0f0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">857</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="k">struct</span> <span class="n">ast_str</span> <span class="o">*</span><span class="n">out</span> <span class="o">=</span> <span class="n">ast_str_alloca</span><span class="p">(</span><span class="mi">256</span><span class="p">);</span></pre></td>
<th bgcolor="#f0f0f0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">867</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="k">struct</span> <span class="n">ast_str</span> <span class="o">*</span><span class="n">out</span> <span class="o">=</span> <span class="n">ast_str_alloca</span><span class="p">(</span><span class="mi">256</span><span class="p">);</span></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">868</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="n">x</span> <span class="o">=</span> <span class="o">-</span><span class="mi">1</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">869</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">                <span class="k">if</span> <span class="p">((</span><span class="n">i</span> <span class="o">>=</span> <span class="mi">0</span><span class="p">)</span> <span class="o">&&</span> <span class="p">((</span><span class="n">x</span> <span class="o">=</span> <span class="n">format2index</span><span class="p">(</span><span class="n">f_list</span><span class="p">[</span><span class="n">i</span><span class="p">].</span><span class="n">format</span><span class="p">.</span><span class="n">id</span><span class="p">))</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">))</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;">This needs to be a dynamically allocated string rather than a statically defined string.
All uses of ast_str_append to this new dynamically allocated string must use the argument '0' for the maximum length they can grow. This will allow the string to grow as needed according to the ast_str API.</pre>
</div>
<br />
<p>- David</p>
<br />
<p>On February 11th, 2011, 12:09 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-11 12:09:35</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'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">(307672)</span></li>
<li>/trunk/channels/chan_gtalk.c <span style="color: grey">(307672)</span></li>
<li>/trunk/channels/chan_iax2.c <span style="color: grey">(307672)</span></li>
<li>/trunk/channels/chan_jingle.c <span style="color: grey">(307672)</span></li>
<li>/trunk/channels/chan_sip.c <span style="color: grey">(307672)</span></li>
<li>/trunk/channels/chan_skinny.c <span style="color: grey">(307672)</span></li>
<li>/trunk/channels/iax2.h <span style="color: grey">(307672)</span></li>
<li>/trunk/codecs/codec_resample.c <span style="color: grey">(307672)</span></li>
<li>/trunk/codecs/codec_speex.c <span style="color: grey">(307672)</span></li>
<li>/trunk/configs/codecs.conf.sample <span style="color: grey">(307672)</span></li>
<li>/trunk/formats/format_attr_silk.c <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/include/asterisk/format.h <span style="color: grey">(307672)</span></li>
<li>/trunk/include/asterisk/format_cap.h <span style="color: grey">(307672)</span></li>
<li>/trunk/include/asterisk/frame.h <span style="color: grey">(307672)</span></li>
<li>/trunk/include/asterisk/rtp_engine.h <span style="color: grey">(307672)</span></li>
<li>/trunk/include/asterisk/silk.h <span style="color: grey">(PRE-CREATION)</span></li>
<li>/trunk/include/asterisk/time.h <span style="color: grey">(307672)</span></li>
<li>/trunk/include/asterisk/translate.h <span style="color: grey">(307672)</span></li>
<li>/trunk/main/asterisk.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/channel.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/data.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/format.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/format_cap.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/format_pref.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/frame.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/rtp_engine.c <span style="color: grey">(307672)</span></li>
<li>/trunk/main/translate.c <span style="color: grey">(307672)</span></li>
<li>/trunk/res/res_rtp_asterisk.c <span style="color: grey">(307672)</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>