FYI, these are good questions but they probably belong on the dev list since they are so technical in nature. :)<br>-MC<br><br><div class="gmail_quote">On Fri, Apr 3, 2009 at 6:20 AM, Lele Forzani <span dir="ltr">&lt;<a href="mailto:lele@windmill.it">lele@windmill.it</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
Hello,<br>
I&#39;ve been experimenting with the use of mod_dahdi_codec and other ways<br>
to perform external transcoding for codecs, and came up with noticing<br>
that transcoding resources seemed to be used up twice what I expected.<br>
That is and 2x the number of call legs, ending up to two encoder and two<br>
decoder instances per leg.<br>
<br>
<br>
So, I looked at the code and noticed almost every endpoint module does<br>
something like this (excerpt from mod_sofia, sofia_glue.c:~1800):<br>
<br>
if (switch_core_codec_init(&amp;tech_pvt-&gt;read_codec,<br>
                   tech_pvt-&gt;iananame,<br>
                   tech_pvt-&gt;rm_fmtp,<br>
                   tech_pvt-&gt;rm_rate,<br>
                   tech_pvt-&gt;codec_ms,<br>
                   1,<br>
                   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt-&gt;profile-&gt;codec_flags,<br>
                   NULL, switch_core_session_get_pool(tech_pvt-&gt;session)) != SWITCH_STATUS_SUCCESS) {<br>
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Can&#39;t load codec?\n&quot;);<br>
        switch_goto_status(SWITCH_STATUS_FALSE, end);<br>
}<br>
<br>
if (switch_core_codec_init(&amp;tech_pvt-&gt;write_codec,<br>
                   tech_pvt-&gt;iananame,<br>
                   tech_pvt-&gt;rm_fmtp,<br>
                   tech_pvt-&gt;rm_rate,<br>
                   tech_pvt-&gt;codec_ms,<br>
                   1,<br>
                   SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt-&gt;profile-&gt;codec_flags,<br>
                   NULL, switch_core_session_get_pool(tech_pvt-&gt;session)) != SWITCH_STATUS_SUCCESS) {<br>
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, &quot;Can&#39;t load codec?\n&quot;);<br>
        switch_goto_status(SWITCH_STATUS_FALSE, end);<br>
}<br>
<br>
<br>
The flags being SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE<br>
seems to be causing the apparent &#39;double&#39; allocation of transcoding<br>
resources, and I fail to understand the need for both, in both cases.<br>
<br>
Could someone please spend a minute to explain?<br>
<br>
<br>
thanks<br>
lele<br>
<br>
<br>
<br>
<br>
<br>
_______________________________________________<br>
Freeswitch-users mailing list<br>
<a href="mailto:Freeswitch-users@lists.freeswitch.org">Freeswitch-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
</blockquote></div><br>