[Freeswitch-svn] [commit] r4348 - in freeswitch/trunk/src: . mod/codecs/mod_ilbc

Freeswitch SVN anthm at freeswitch.org
Thu Feb 22 15:56:24 EST 2007


Author: anthm
Date: Thu Feb 22 15:56:23 2007
New Revision: 4348

Modified:
   freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c
   freeswitch/trunk/src/switch_core.c

Log:
add mode goodies to ilbc

Modified: freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c
==============================================================================
--- freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c	(original)
+++ freeswitch/trunk/src/mod/codecs/mod_ilbc/mod_ilbc.c	Thu Feb 22 15:56:23 2007
@@ -190,7 +190,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 97, 
 		/*.iananame */ "iLBC", 
-		/*.fmtp */ NULL,
+		/*.fmtp */ "mode=30",
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_30MS*8*8000/BLOCKL_30MS,
 		/*.microseconds_per_frame */ 30000,
@@ -210,7 +210,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 97, 
 		/*.iananame */ "iLBC", 
-		/*.fmtp */ NULL,
+		/*.fmtp */ "mode=20",
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS, 
 		/*.microseconds_per_frame */ 20000,
@@ -233,7 +233,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 102, 
 		/*.iananame */ "iLBC", 
-		/*.fmtp */ NULL,
+		/*.fmtp */ "mode=30",
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_30MS*8*8000/BLOCKL_30MS,
 		/*.microseconds_per_frame */ 30000,
@@ -253,7 +253,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 102, 
 		/*.iananame */ "iLBC102", 
-		/*.fmtp */ NULL,
+		/*.fmtp */ "mode=20",
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS, 
 		/*.microseconds_per_frame */ 20000,
@@ -275,7 +275,7 @@
 		/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO, 
 		/*.ianacode */ 97, 
 		/*.iananame */ "iLBC20ms",
-		/*.fmtp */ NULL,
+		/*.fmtp */ "mode=20",
 		/*.samples_per_second */ 8000, 
 		/*.bits_per_second */ NO_OF_BYTES_20MS*8*8000/BLOCKL_20MS, 
 		/*.microseconds_per_frame */ 20000,

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Thu Feb 22 15:56:23 2007
@@ -809,6 +809,7 @@
 {
 	const switch_codec_interface_t *codec_interface;
 	const switch_codec_implementation_t *iptr, *implementation = NULL;
+	char *mode = fmtp; 
 
 	assert(codec != NULL);
 	assert(codec_name != NULL);
@@ -820,6 +821,17 @@
 		return SWITCH_STATUS_GENERR;
 	}
 
+	if (mode && strncasecmp(mode, "mode=", 5)) {
+		int mms;
+		mode += 5;
+		if (mode) {
+			mms = atoi(mode);
+			if (mms > 0 && mms < 120) {
+				ms = mms;
+			}
+		}
+	}
+	
     /* If no specific codec interval is requested opt for 20ms above all else because lots of stuff assumes it */
     if (!ms) {
         for (iptr = codec_interface->implementations; iptr; iptr = iptr->next) {



More information about the Freeswitch-svn mailing list