]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add 44.1khz codec defs
authorAnthony Minessale <anthm@freeswitch.org>
Sun, 29 Jun 2014 20:22:16 +0000 (01:22 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Sun, 29 Jun 2014 20:23:07 +0000 (01:23 +0500)
src/include/switch_loadable_module.h
src/switch_pcm.c

index 644887a931910869d50b71256f8882664e8da01e..53b8b5db2c0b32de2f39628a6bec347dfc535086 100644 (file)
@@ -434,6 +434,10 @@ SWITCH_DECLARE(uint32_t) switch_core_codec_next_id(void);
                max_ms = 40;
                ptime_div = 2;
                break;
+       case 44100:
+               max_ms = 40;
+               ptime_div = 2;
+               break;
        case 32000:
        case 24000:
        case 16000:
index d62e5f7337737c07ef001aadd9a56a7da034b938..eaa099e32cf3db067dcce49b5b28e2f583d53444 100644 (file)
@@ -741,6 +741,55 @@ SWITCH_MODULE_LOAD_FUNCTION(core_pcm_load)
                ms_per_frame += 10000;
        }
 
+       samples_per_frame = 441;
+       bytes_per_frame = 882;
+       ms_per_frame = 10000;
+
+       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 */
+                                                                                        70,    /* the IANA code number */
+                                                                                        "L16", /* the IANA code name */
+                                                                                        NULL,  /* default fmtp to send (can be overridden by the init function) */
+                                                                                        44100, /* samples transferred per second */
+                                                                                        44100, /* actual samples transferred per second */
+                                                                                        705600,        /* 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 */
+
+               switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,    /* enumeration defining the type of the codec */
+                                                                                        70,    /* the IANA code number */
+                                                                                        "L16", /* the IANA code name */
+                                                                                        NULL,  /* default fmtp to send (can be overridden by the init function) */
+                                                                                        44100, /* samples transferred per second */
+                                                                                        44100, /* actual samples transferred per second */
+                                                                                        705600,        /* bits transferred per second */
+                                                                                        ms_per_frame,  /* number of microseconds per frame */
+                                                                                        samples_per_frame,     /* number of samples per frame */
+                                                                                        bytes_per_frame * 2,   /* number of bytes per frame decompressed */
+                                                                                        bytes_per_frame * 2,   /* number of bytes per frame compressed */
+                                                                                        2,     /* 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 += 441;
+               bytes_per_frame += 882;
+               ms_per_frame += 10000;
+               
+       }       
+
+
+
        switch_core_codec_add_implementation(pool, codec_interface, SWITCH_CODEC_TYPE_AUDIO,    /* enumeration defining the type of the codec */
                                                                                 70,    /* the IANA code number */
                                                                                 "L16", /* the IANA code name */