]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
48k 30ms and 40ms codecs
authorBrian West <brian@freeswitch.org>
Sat, 10 Oct 2009 02:10:43 +0000 (02:10 +0000)
committerBrian West <brian@freeswitch.org>
Sat, 10 Oct 2009 02:10:43 +0000 (02:10 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@15135 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/include/switch_loadable_module.h
src/switch_pcm.c

index f868830efc591ca8d71fe65651912f504ee4c56a..f43fdb54d6be43fb7aedbe3192ed3d93ef49a83f 100644 (file)
@@ -335,7 +335,7 @@ static inline int switch_check_interval(uint32_t rate, uint32_t ptime)
                if (ptime < 120) return 1;
                break;
        case 48000:
-               max_ms = 20;
+               max_ms = 40;
                ptime_div = 2;
                break;
        case 32000:
index f4a70a94950c4ed7303d34b920a2e0ee75e83671..b8cc8ea4350fffee34992f0c0663ffdb9692e9a0 100644 (file)
@@ -515,24 +515,33 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
                
        }
 
-       switch_core_codec_add_implementation(pool, codec_interface,
-                                                                                SWITCH_CODEC_TYPE_AUDIO,       /* enumeration defining the type of the codec */
-                                                                                118,                                           /* the IANA code number */
-                                                                                "L16",                                         /* the IANA code name */
-                                                                                NULL,                                          /* default fmtp to send (can be overridden by the init function) */
-                                                                                48000,                                         /* samples transferred per second */
-                                                                                48000,                                         /* actual samples transferred per second */
-                                                                                768000,                                        /* bits transferred per second */
-                                                                                20000,                                         /* number of microseconds per frame */
-                                                                                960,                                           /* number of samples per frame */
-                                                                                1920,                                          /* number of bytes per frame decompressed */
-                                                                                1920,                                          /* number of bytes per frame compressed */
-                                                                                1,                                                     /* number of channels represented */
-                                                                                1,                                                     /* number of frames per network packet */
-                                                                                switch_raw_init,                       /* function to initialize a codec handle using this implementation */
-                                                                                switch_raw_encode,                     /* function to encode raw data into encoded data */
-                                                                                switch_raw_decode,                     /* function to decode encoded data into raw data */
-                                                                                switch_raw_destroy);           /* deinitalize a codec handle using this implementation */
+       samples_per_frame = 960;
+       bytes_per_frame = 1920;
+       ms_per_frame = 20000;
+       /* 10ms is already registered */
+       for (x = 0; x < 3; x++) {
+               switch_core_codec_add_implementation(pool, codec_interface,
+                                                                                        SWITCH_CODEC_TYPE_AUDIO,       /* enumeration defining the type of the codec */
+                                                                                        118,                                           /* the IANA code number */
+                                                                                        "L16",                                         /* the IANA code name */
+                                                                                        NULL,                                          /* default fmtp to send (can be overridden by the init function) */
+                                                                                        48000,                                         /* samples transferred per second */
+                                                                                        48000,                                         /* actual samples transferred per second */
+                                                                                        768000,                                        /* bits transferred per second */
+                                                                                        ms_per_frame,                          /* number of microseconds per frame */
+                                                                                        samples_per_frame,                     /* number of samples per frame */
+                                                                                        bytes_per_frame,                       /* number of bytes per frame decompressed */
+                                                                                        bytes_per_frame,                       /* number of bytes per frame compressed */
+                                                                                        1,                                                     /* number of channels represented */
+                                                                                        1,                                                     /* number of frames per network packet */
+                                                                                        switch_raw_init,                       /* function to initialize a codec handle using this implementation */
+                                                                                        switch_raw_encode,                     /* function to encode raw data into encoded data */
+                                                                                        switch_raw_decode,                     /* function to decode encoded data into raw data */
+                                                                                        switch_raw_destroy);           /* deinitalize a codec handle using this implementation */
+               samples_per_frame += 480;
+               bytes_per_frame += 960;
+               ms_per_frame += 10000;
+       }
 
        switch_core_codec_add_implementation(pool, codec_interface,
                                                                                 SWITCH_CODEC_TYPE_AUDIO,       /* enumeration defining the type of the codec */