mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-14 01:49:05 +00:00
restructure codec code
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1818 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
@@ -190,6 +190,7 @@ static switch_status_t switch_g711a_destroy(switch_codec_t *codec)
|
||||
#if 0
|
||||
|
||||
static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 0,
|
||||
/*.iananame */ "PCMU",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -206,9 +207,10 @@ static const switch_codec_implementation_t g711u_8k_60ms_implementation = {
|
||||
/*.decode */ switch_g711u_decode,
|
||||
/*.destroy */ switch_g711u_destroy
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 0,
|
||||
/*.iananame */ "PCMU",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -224,11 +226,11 @@ static const switch_codec_implementation_t g711u_8k_30ms_implementation = {
|
||||
/*.encode */ switch_g711u_encode,
|
||||
/*.decode */ switch_g711u_decode,
|
||||
/*.destroy */ switch_g711u_destroy,
|
||||
/*.next */ &g711u_8k_60ms_implementation
|
||||
/*.next */ NULL
|
||||
};
|
||||
#endif
|
||||
|
||||
static const switch_codec_implementation_t g711u_16k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 0,
|
||||
/*.iananame */ "PCMU",
|
||||
/*.samples_per_second */ 16000,
|
||||
@@ -244,9 +246,11 @@ static const switch_codec_implementation_t g711u_16k_implementation = {
|
||||
/*.encode */ switch_g711u_encode,
|
||||
/*.decode */ switch_g711u_decode,
|
||||
/*.destroy */ switch_g711u_destroy,
|
||||
/*.next */ &g711u_8k_30ms_implementation
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t g711u_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 0,
|
||||
/*.iananame */ "PCMU",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -267,6 +271,7 @@ static const switch_codec_implementation_t g711u_8k_implementation = {
|
||||
|
||||
|
||||
static const switch_codec_implementation_t g711a_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 8,
|
||||
/*.iananame */ "PCMA",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -287,13 +292,11 @@ static const switch_codec_implementation_t g711a_8k_implementation = {
|
||||
|
||||
static const switch_codec_interface_t g711a_codec_interface = {
|
||||
/*.interface_name */ "g711 alaw",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &g711a_8k_implementation
|
||||
};
|
||||
|
||||
static const switch_codec_interface_t g711u_codec_interface = {
|
||||
/*.interface_name */ "g711 ulaw",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &g711u_8k_implementation,
|
||||
/*.next */ &g711a_codec_interface
|
||||
};
|
||||
|
@@ -219,6 +219,7 @@ static switch_status_t switch_g729_decode(switch_codec_t *codec,
|
||||
/* Registration */
|
||||
|
||||
static const switch_codec_implementation_t g729_10ms_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 18,
|
||||
/*.iananame */ "G729",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -237,6 +238,7 @@ static const switch_codec_implementation_t g729_10ms_8k_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t g729_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 18,
|
||||
/*.iananame */ "G729",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -258,7 +260,6 @@ static const switch_codec_implementation_t g729_8k_implementation = {
|
||||
|
||||
static const switch_codec_interface_t g729_codec_interface = {
|
||||
/*.interface_name */ "g729",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &g729_8k_implementation,
|
||||
};
|
||||
|
||||
|
@@ -133,6 +133,7 @@ static switch_status_t switch_gsm_decode(switch_codec_t *codec, switch_codec_t *
|
||||
|
||||
/* Registration */
|
||||
static const switch_codec_implementation_t gsm_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 3,
|
||||
/*.iananame */ "gsm",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -151,7 +152,6 @@ static const switch_codec_implementation_t gsm_8k_implementation = {
|
||||
};
|
||||
static const switch_codec_interface_t gsm_codec_interface = {
|
||||
/*.interface_name */ "gsm",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &gsm_8k_implementation,
|
||||
};
|
||||
static switch_loadable_module_interface_t gsm_module_interface = {
|
||||
|
@@ -186,6 +186,7 @@ static switch_status_t switch_ilbc_decode(switch_codec_t *codec,
|
||||
/* Registration */
|
||||
|
||||
static const switch_codec_implementation_t ilbc_8k_30ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 97,
|
||||
/*.iananame */ "iLBC",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -204,6 +205,7 @@ static const switch_codec_implementation_t ilbc_8k_30ms_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t ilbc_8k_20ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 97,
|
||||
/*.iananame */ "iLBC",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -225,6 +227,7 @@ static const switch_codec_implementation_t ilbc_8k_20ms_implementation = {
|
||||
|
||||
|
||||
static const switch_codec_implementation_t ilbc_102_8k_30ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 102,
|
||||
/*.iananame */ "iLBC",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -243,6 +246,7 @@ static const switch_codec_implementation_t ilbc_102_8k_30ms_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t ilbc_102_8k_20ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 102,
|
||||
/*.iananame */ "iLBC102",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -263,6 +267,7 @@ static const switch_codec_implementation_t ilbc_102_8k_20ms_implementation = {
|
||||
|
||||
|
||||
static const switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 97,
|
||||
/*.iananame */ "iLBC20ms",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -283,20 +288,17 @@ static const switch_codec_implementation_t ilbc_8k_20ms_nonext_implementation =
|
||||
|
||||
static const switch_codec_interface_t ilbc_20ms_codec_interface = {
|
||||
/*.interface_name */ "ilbc",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &ilbc_8k_20ms_nonext_implementation
|
||||
};
|
||||
|
||||
static const switch_codec_interface_t ilbc_102_codec_interface = {
|
||||
/*.interface_name */ "ilbc",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &ilbc_102_8k_20ms_implementation,
|
||||
/*.next*/ &ilbc_20ms_codec_interface
|
||||
};
|
||||
|
||||
static const switch_codec_interface_t ilbc_codec_interface = {
|
||||
/*.interface_name */ "ilbc",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &ilbc_8k_20ms_implementation,
|
||||
/*.next*/ &ilbc_102_codec_interface
|
||||
};
|
||||
|
@@ -90,6 +90,7 @@ static switch_status_t switch_raw_destroy(switch_codec_t *codec)
|
||||
}
|
||||
|
||||
static const switch_codec_implementation_t raw_32k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second = */ 32000,
|
||||
@@ -108,6 +109,7 @@ static const switch_codec_implementation_t raw_32k_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t raw_22k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second = */ 22050,
|
||||
@@ -127,6 +129,7 @@ static const switch_codec_implementation_t raw_22k_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t raw_16k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second = */ 16000,
|
||||
@@ -146,6 +149,7 @@ static const switch_codec_implementation_t raw_16k_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t raw_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second = */ 8000,
|
||||
@@ -166,6 +170,7 @@ static const switch_codec_implementation_t raw_8k_implementation = {
|
||||
|
||||
|
||||
static const switch_codec_implementation_t raw_8k_30ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -186,6 +191,7 @@ static const switch_codec_implementation_t raw_8k_30ms_implementation = {
|
||||
|
||||
|
||||
static const switch_codec_implementation_t raw_8k_60ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -205,6 +211,7 @@ static const switch_codec_implementation_t raw_8k_60ms_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t raw_8k_120ms_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 10,
|
||||
/*.iananame */ "L16",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -226,7 +233,6 @@ static const switch_codec_implementation_t raw_8k_120ms_implementation = {
|
||||
|
||||
static const switch_codec_interface_t raw_codec_interface = {
|
||||
/*.interface_name */ "raw signed linear (16 bit)",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &raw_8k_120ms_implementation
|
||||
};
|
||||
|
||||
|
@@ -268,6 +268,7 @@ static switch_status_t switch_speex_destroy(switch_codec_t *codec)
|
||||
|
||||
/* Registration */
|
||||
static const switch_codec_implementation_t speex_32k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 98,
|
||||
/*.iananame */ "speex",
|
||||
/*.samples_per_second */ 32000,
|
||||
@@ -286,6 +287,7 @@ static const switch_codec_implementation_t speex_32k_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t speex_16k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 98,
|
||||
/*.iananame */ "speex",
|
||||
/*.samples_per_second */ 16000,
|
||||
@@ -305,6 +307,7 @@ static const switch_codec_implementation_t speex_16k_implementation = {
|
||||
};
|
||||
|
||||
static const switch_codec_implementation_t speex_8k_implementation = {
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.ianacode */ 98,
|
||||
/*.iananame */ "speex",
|
||||
/*.samples_per_second */ 8000,
|
||||
@@ -325,7 +328,6 @@ static const switch_codec_implementation_t speex_8k_implementation = {
|
||||
|
||||
static const switch_codec_interface_t speex_codec_interface = {
|
||||
/*.interface_name */ "speex",
|
||||
/*.codec_type */ SWITCH_CODEC_TYPE_AUDIO,
|
||||
/*.implementations */ &speex_8k_implementation
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user