<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/3234/">https://reviewboard.asterisk.org/r/3234/</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/3234/diff/1/?file=54011#file54011line262" style="color: black; font-weight: bold; text-decoration: underline;">/team/file/include/asterisk/format.h</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<tbody>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">248</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">/*!</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">112</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">/*! \brief Definition of a media format */</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">249</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * \brief This function is used to have a media format aware module parse and interpret</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">113</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="k">struct</span> <span class="n">ast_format</span> <span class="p">{</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">250</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * SDP attribute information. Once interpreted this information is stored on the format</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">114</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="cm">/*! \brief Pointer to the codec in use for this format */</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">251</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * itself using Asterisk format attributes.</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">115</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="k">struct</span> <span class="n">ast_codec</span> <span class="o">*</span><span class="n">codec</span><span class="p">;</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">252</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> *</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">116</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="cm">/*! \brief Attribute specific data, implementation specific */</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">253</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * \param format to set</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">117</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="kt">void</span> <span class="o">*</span><span class="n">attribute_data</span><span class="p">;</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">254</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * \param attributes string containing the fmtp line from the SDP</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">118</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="cm">/*! \brief Pointer to the optional format interface */</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">255</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> *</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">119</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="k">struct</span> <span class="n">ast_format_interface</span> <span class="o">*</span><span class="n">interface</span><span class="p">;</span></pre></td>
</tr>
<tr>
<th bgcolor="#e9eaa8" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2">256</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm"> * \retval 0 success, attribute values were valid</span></pre></td>
<th bgcolor="#e9eaa8" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">120</font></th>
<td bgcolor="#fdfebc" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><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;">I think it's worth documenting here the contract users of an ast_format structure must abide by.
(1) The codec is reference counted and should be treated as immutable. Once it is set on a format, it must not be changed or altered.
(2) Same thing with the interface.
(3) And, really, same thing with the attribute_data.
Right now, in fact, ast_format could be made an opaque data structure, since only format.c really bothers with the attribute_data or interface pointers. It could have an accessor for the codec object.
The benefit of making this opaque would be that we could add things to the format struct and not break the ABI.</pre>
</div>
<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/3234/diff/1/?file=54026#file54026line730" style="color: black; font-weight: bold; text-decoration: underline;">/team/file/main/format_cap.c</a>
<span style="font-weight: normal;">
(Diff revision 1)
</span>
</th>
</tr>
</thead>
<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">497</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="n">framems</span> <span class="o">=</span> <span class="n">atoi</span><span class="p">(</span><span class="n">psize</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">498</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="k">if</span> <span class="p">(</span><span class="n">framems</span> <span class="o"><</span> <span class="mi">0</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">499</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="n">framems</span> <span class="o">=</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">500</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="n">errors</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">501</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="tb"> </span><span class="n">ast_log</span><span class="p">(</span><span class="n">LOG_WARNING</span><span class="p">,</span> <span class="s">"Bad packetization value for codec %s</span><span class="se">\n</span><span class="s">"</span><span class="p">,</span> <span class="n">this</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">647</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </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">502</font></th>
<td bgcolor="#ffffff" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="tb"> </span><span class="tb"> </span><span class="tb"> </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;">You may as well sscanf this.</pre>
</div>
<br />
<p>- Matt Jordan</p>
<br />
<p>On February 16th, 2014, 9:56 a.m. CST, Joshua Colp wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/static/rb/images/review_request_box_top_bg.ab6f3b1072c9.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers.</div>
<div>By Joshua Colp.</div>
<p style="color: grey;"><i>Updated Feb. 16, 2014, 9:56 a.m.</i></p>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt;">Repository: </b>
Asterisk
</div>
<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;">This movies basic channel drivers and applications over to the new media formats API.</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>/team/file/media_formats-impl/pbx/pbx_spool.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/frame.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/format_ng.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/format_cap_ng.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/format_cap.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/format_cache.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/format.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/codec.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/channel_internal_api.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/main/channel.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/translate.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/slin.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/rtp_engine.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/mod_format.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/frame.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/format_ng.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/format_cap_ng.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/format_cap.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/format_cache.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/format.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/data.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/codec.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/include/asterisk/channel.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/codecs/ex_alaw.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/codecs/ex_adpcm.h <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/codecs/codec_adpcm.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/channels/chan_oss.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/channels/chan_bridge_media.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/channels/chan_alsa.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/confbridge/conf_chan_record.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_waitforsilence.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_voicemail.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_test.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_talkdetect.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_speech_utils.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_sms.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_record.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_originate.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_nbscat.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_mp3.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_mixmonitor.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_milliwatt.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_meetme.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_ices.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_festival.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_dumpchan.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_dictate.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_dahdibarge.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_confbridge.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_chanspy.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_amd.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_alarmreceiver.c <span style="color: grey">(408257)</span></li>
<li>/team/file/media_formats-impl/apps/app_agent_pool.c <span style="color: grey">(408257)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/3234/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>