Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Freeswitch-users] codecs initialization flags in endpoint modules


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users
View previous topic :: View next topic  
Author Message
lele at windmill.it
Guest





PostPosted: Fri Apr 03, 2009 8:31 am    Post subject: [Freeswitch-users] codecs initialization flags in endpoint m Reply with quote

Hello,
I've been experimenting with the use of mod_dahdi_codec and other ways
to perform external transcoding for codecs, and came up with noticing
that transcoding resources seemed to be used up twice what I expected.
That is and 2x the number of call legs, ending up to two encoder and two
decoder instances per leg.


So, I looked at the code and noticed almost every endpoint module does
something like this (excerpt from mod_sofia, sofia_glue.c:~1800):

if (switch_core_codec_init(&tech_pvt->read_codec,
tech_pvt->iananame,
tech_pvt->rm_fmtp,
tech_pvt->rm_rate,
tech_pvt->codec_ms,
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_goto_status(SWITCH_STATUS_FALSE, end);
}

if (switch_core_codec_init(&tech_pvt->write_codec,
tech_pvt->iananame,
tech_pvt->rm_fmtp,
tech_pvt->rm_rate,
tech_pvt->codec_ms,
1,
SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
switch_goto_status(SWITCH_STATUS_FALSE, end);
}


The flags being SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE
seems to be causing the apparent 'double' allocation of transcoding
resources, and I fail to understand the need for both, in both cases.

Could someone please spend a minute to explain?


thanks
lele





_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
msc at freeswitch.org
Guest





PostPosted: Fri Apr 03, 2009 11:56 am    Post subject: [Freeswitch-users] codecs initialization flags in endpoint m Reply with quote

FYI, these are good questions but they probably belong on the dev list since they are so technical in nature. Smile
-MC

On Fri, Apr 3, 2009 at 6:20 AM, Lele Forzani <lele@windmill.it (lele@windmill.it)> wrote:
Quote:

Hello,
I've been experimenting with the use of mod_dahdi_codec and other ways
to perform external transcoding for codecs, and came up with noticing
that transcoding resources seemed to be used up twice what I expected.
That is and 2x the number of call legs, ending up to two encoder and two
decoder instances per leg.


So, I looked at the code and noticed almost every endpoint module does
something like this (excerpt from mod_sofia, sofia_glue.c:~1800):

if (switch_core_codec_init(&tech_pvt->read_codec,
                  tech_pvt->iananame,
                  tech_pvt->rm_fmtp,
                  tech_pvt->rm_rate,
                  tech_pvt->codec_ms,
                  1,
                  SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
                  NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
       switch_goto_status(SWITCH_STATUS_FALSE, end);
}

if (switch_core_codec_init(&tech_pvt->write_codec,
                  tech_pvt->iananame,
                  tech_pvt->rm_fmtp,
                  tech_pvt->rm_rate,
                  tech_pvt->codec_ms,
                  1,
                  SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE | tech_pvt->profile->codec_flags,
                  NULL, switch_core_session_get_pool(tech_pvt->session)) != SWITCH_STATUS_SUCCESS) {
       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't load codec?\n");
       switch_goto_status(SWITCH_STATUS_FALSE, end);
}


The flags being SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE
seems to be causing the apparent 'double' allocation of transcoding
resources, and I fail to understand the need for both, in both cases.

Could someone please spend a minute to explain?


thanks
lele





_______________________________________________
Freeswitch-users mailing list
Freeswitch-users@lists.freeswitch.org (Freeswitch-users@lists.freeswitch.org)
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> freeSWITCH Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services