clean some old members and naming conventions in the codec structs

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10084 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2008-10-20 17:48:42 +00:00
parent f1da124229
commit 30c318b995
39 changed files with 240 additions and 245 deletions

View File

@@ -285,7 +285,7 @@ static switch_status_t switch_amr_decode(switch_codec_t *codec,
}
Decoder_Interface_Decode(context->decoder_state, (unsigned char *) encoded_data, (int16_t *) decoded_data, 0);
*decoded_data_len = codec->implementation->bytes_per_frame;
*decoded_data_len = codec->implementation->decoded_bytes_per_packet;
return SWITCH_STATUS_SUCCESS;
#endif
@@ -320,8 +320,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_amr_load)
SWITCH_ADD_CODEC(codec_interface, "AMR");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 96, "AMR", "octet-align=0", 8000, 8000, 12200,
20000, 160, 320, 0, 1, 1, 1, switch_amr_init, switch_amr_encode, switch_amr_decode, switch_amr_destroy);
SWITCH_CODEC_TYPE_AUDIO, 96, "AMR", "octet-align=0", 8000, 8000, 12200, 20000, 160, 320, 0, 1, 1,
switch_amr_init, switch_amr_encode, switch_amr_decode, switch_amr_destroy);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}

View File

@@ -131,7 +131,7 @@ static switch_status_t switch_g723_encode(switch_codec_t *codec,
}
Coder(&context->encoder_object, (FLOAT *) context->cod_float_buf, ebuf);
*encoded_data_len = codec->implementation->encoded_bytes_per_frame;
*encoded_data_len = codec->implementation->encoded_bytes_per_packet;
return SWITCH_STATUS_SUCCESS;
#endif
@@ -161,7 +161,7 @@ static switch_status_t switch_g723_decode(switch_codec_t *codec,
for (x = 0; x < Frame; x++) {
to_slin_buf[x] = context->dec_float_buf[x];
}
*decoded_data_len = codec->implementation->bytes_per_frame;
*decoded_data_len = codec->implementation->decoded_bytes_per_packet;
return SWITCH_STATUS_SUCCESS;
#endif
@@ -177,7 +177,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_g723_1_load)
for (count = 1; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 4, "G723", NULL, 8000, 8000, 6300,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 4,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count,
switch_g723_init, switch_g723_encode, switch_g723_decode, switch_g723_destroy);
}
/* indicate that the module should continue to be loaded */

View File

@@ -218,7 +218,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 18, "G729", NULL, 8000, 8000, 8000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g729_init, switch_g729_encode, switch_g729_decode, switch_g729_destroy);
}
/* indicate that the module should continue to be loaded */

View File

@@ -85,23 +85,23 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_h26x_load)
SWITCH_ADD_CODEC(codec_interface, "H.264 Video (passthru)");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_VIDEO, 99, "H264", NULL, 90000, 90000, 0,
0, 0, 0, 0, 1, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
0, 0, 0, 0, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
SWITCH_ADD_CODEC(codec_interface, "H.263 Video (passthru)");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_VIDEO, 34, "H263", NULL, 90000, 90000, 0,
0, 0, 0, 0, 1, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
0, 0, 0, 0, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
SWITCH_ADD_CODEC(codec_interface, "H.263+ Video (passthru)");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_VIDEO, 115, "H263-1998", NULL, 90000, 90000, 0,
0, 0, 0, 0, 1, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
0, 0, 0, 0, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
SWITCH_ADD_CODEC(codec_interface, "H.263++ Video (passthru)");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_VIDEO, 121, "H263-2000", NULL, 90000, 90000, 0,
0, 0, 0, 0, 1, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
0, 0, 0, 0, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
SWITCH_ADD_CODEC(codec_interface, "H.261 Video (passthru)");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_VIDEO, 31, "H261", NULL, 90000, 90000, 0,
0, 0, 0, 0, 1, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
0, 0, 0, 0, 1, 1, switch_h26x_init, switch_h26x_encode, switch_h26x_decode, switch_h26x_destroy);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}

View File

@@ -50,7 +50,7 @@ static switch_status_t switch_ilbc_init(switch_codec_t *codec, switch_codec_flag
{
struct ilbc_context *context;
int encoding, decoding;
uint8_t ms = (uint8_t) (codec->implementation->microseconds_per_frame / 1000);
uint8_t ms = (uint8_t) (codec->implementation->microseconds_per_packet / 1000);
if (ms != 20 && ms != 30) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid speed! (I should never happen)\n");
@@ -189,28 +189,28 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_ilbc_load)
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 97, "iLBC", "mode=20", 8000, 8000, NO_OF_BYTES_20MS * 8 * 8000 / BLOCKL_20MS,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1, 1,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1,
switch_ilbc_init, switch_ilbc_encode, switch_ilbc_decode, switch_ilbc_destroy);
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 102, "iLBC", "mode=20", 8000, 8000, NO_OF_BYTES_20MS * 8 * 8000 / BLOCKL_20MS,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1, 1,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1,
switch_ilbc_init, switch_ilbc_encode, switch_ilbc_decode, switch_ilbc_destroy);
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 102, "iLBC102", "mode=20", 8000, 8000, NO_OF_BYTES_20MS * 8 * 8000 / BLOCKL_20MS,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1, 1,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1,
switch_ilbc_init, switch_ilbc_encode, switch_ilbc_decode, switch_ilbc_destroy);
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 102, "iLBC20ms", "mode=20", 8000, 8000, NO_OF_BYTES_20MS * 8 * 8000 / BLOCKL_20MS,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1, 1,
20000, 160, 320, NO_OF_BYTES_20MS, 1, 1,
switch_ilbc_init, switch_ilbc_encode, switch_ilbc_decode, switch_ilbc_destroy);
/* 30ms variants */
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 98, "iLBC", "mode=30", 8000, 8000, NO_OF_BYTES_30MS * 8 * 8000 / BLOCKL_30MS,
30000, 240, 480, NO_OF_BYTES_30MS, 1, 1, 1,
30000, 240, 480, NO_OF_BYTES_30MS, 1, 1,
switch_ilbc_init, switch_ilbc_encode, switch_ilbc_decode, switch_ilbc_destroy);
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 102, "iLBC", "mode=30", 8000, 8000, NO_OF_BYTES_30MS * 8 * 8000 / BLOCKL_30MS,
30000, 240, 480, NO_OF_BYTES_30MS, 1, 1, 1,
30000, 240, 480, NO_OF_BYTES_30MS, 1, 1,
switch_ilbc_init, switch_ilbc_encode, switch_ilbc_decode, switch_ilbc_destroy);
/* indicate that the module should continue to be loaded */

View File

@@ -229,7 +229,7 @@ static switch_status_t switch_speex_decode(switch_codec_t *codec,
speex_bits_read_from(&context->decoder_bits, (char *) encoded_data, (int) encoded_data_len);
speex_decode_int(context->decoder_state, &context->decoder_bits, buf);
}
*decoded_data_len = codec->implementation->bytes_per_frame;
*decoded_data_len = codec->implementation->decoded_bytes_per_packet;
return SWITCH_STATUS_SUCCESS;
}
@@ -274,7 +274,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_speex_load)
for (countb = 1; countb > 0; countb--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, ianacode[counta], "SPEEX", NULL, rate, rate, bps[counta],
mpf * countb, spf * countb, bpf * countb, ebpf * countb, 1, 1, 6,
mpf * countb, spf * countb, bpf * countb, ebpf * countb, 1, 1,
switch_speex_init, switch_speex_encode, switch_speex_decode, switch_speex_destroy);
}
rate = rate * 2;

View File

@@ -242,8 +242,8 @@ static switch_status_t switch_g711u_decode(switch_codec_t *codec,
ebuf = encoded_data;
if (*flag & SWITCH_CODEC_FLAG_SILENCE) {
memset(dbuf, 0, codec->implementation->bytes_per_frame);
*decoded_data_len = codec->implementation->bytes_per_frame;
memset(dbuf, 0, codec->implementation->decoded_bytes_per_packet);
*decoded_data_len = codec->implementation->decoded_bytes_per_packet;
} else {
for (i = 0; i < encoded_data_len; i++) {
dbuf[i] = ulaw_to_linear(ebuf[i]);
@@ -313,8 +313,8 @@ static switch_status_t switch_g711a_decode(switch_codec_t *codec,
ebuf = encoded_data;
if (*flag & SWITCH_CODEC_FLAG_SILENCE) {
memset(dbuf, 0, codec->implementation->bytes_per_frame);
*decoded_data_len = codec->implementation->bytes_per_frame;
memset(dbuf, 0, codec->implementation->decoded_bytes_per_packet);
*decoded_data_len = codec->implementation->decoded_bytes_per_packet;
} else {
for (i = 0; i < encoded_data_len; i++) {
dbuf[i] = alaw_to_linear(ebuf[i]);
@@ -569,14 +569,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 5, "DVI4", NULL, 8000, 8000, 32000,
mpf * count, spf * count, bpf * count, (ebpf * count) + 4, 1, 1, 12,
mpf * count, spf * count, bpf * count, (ebpf * count) + 4, 1, spf * count,
switch_adpcm_init, switch_adpcm_encode, switch_adpcm_decode, switch_adpcm_destroy);
}
mpf = 10000, spf = 160, bpf = 320, ebpf = 160;
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 6, "DVI4", NULL, 16000, 16000, 64000,
mpf * count, spf * count, bpf * count, (ebpf * count) + 4, 1, 1, 12,
mpf * count, spf * count, bpf * count, (ebpf * count) + 4, 1, spf * count,
switch_adpcm_init, switch_adpcm_encode, switch_adpcm_decode, switch_adpcm_destroy);
}
@@ -586,14 +586,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 124, "AAL2-G726-16", NULL, 8000, 8000, 16000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
SWITCH_ADD_CODEC(codec_interface, "G.726 16k");
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 127, "G726-16", NULL, 8000, 8000, 16000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
/* Increase encoded bytes per frame by 10 */
@@ -603,14 +603,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 123, "AAL2-G726-24", NULL, 8000, 8000, 24000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
SWITCH_ADD_CODEC(codec_interface, "G.726 24k");
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 126, "G726-24", NULL, 8000, 8000, 24000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
/* Increase encoded bytes per frame by 10 */
@@ -620,14 +620,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 2, "AAL2-G726-32", NULL, 8000, 8000, 32000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
SWITCH_ADD_CODEC(codec_interface, "G.726 32k");
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 2, "G726-32", NULL, 8000, 8000, 32000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
/* Increase encoded bytes per frame by 10 */
@@ -637,14 +637,14 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 122, "AAL2-G726-40", NULL, 8000, 8000, 40000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
SWITCH_ADD_CODEC(codec_interface, "G.726 40k");
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 125, "G726-40", NULL, 8000, 8000, 40000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count * 10,
switch_g726_init, switch_g726_encode, switch_g726_decode, switch_g726_destroy);
}
@@ -654,7 +654,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 9, "G722", NULL, 8000, 16000, 64000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, spf * count,
switch_g722_init, switch_g722_encode, switch_g722_decode, switch_g722_destroy);
}
@@ -665,7 +665,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 0, "PCMU", NULL, 8000, 8000, 64000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, spf * count,
switch_g711u_init, switch_g711u_encode, switch_g711u_decode, switch_g711u_destroy);
}
@@ -673,7 +673,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 12; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 8, "PCMA", NULL, 8000, 8000, 64000,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 12,
mpf * count, spf * count, bpf * count, ebpf * count, 1, spf * count,
switch_g711a_init, switch_g711a_encode, switch_g711a_decode, switch_g711a_destroy);
}
#endif
@@ -684,7 +684,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
for (count = 6; count > 0; count--) {
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 3, "GSM", NULL, 8000, 8000, 13200,
mpf * count, spf * count, bpf * count, ebpf * count, 1, 1, 6,
mpf * count, spf * count, bpf * count, ebpf * count, 1, count,
switch_gsm_init, switch_gsm_encode, switch_gsm_decode, switch_gsm_destroy);
}
/* LPC10 */
@@ -692,7 +692,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_voipcodecs_load)
SWITCH_ADD_CODEC(codec_interface, "LPC-10");
switch_core_codec_add_implementation(pool, codec_interface,
SWITCH_CODEC_TYPE_AUDIO, 7, "LPC", NULL, 8000, 8000, 2400,
90000, 720, 1440, 28, 1, 1, 1, switch_lpc10_init, switch_lpc10_encode, switch_lpc10_decode, switch_lpc10_destroy);
90000, 720, 1440, 28, 1, 4, switch_lpc10_init, switch_lpc10_encode, switch_lpc10_decode, switch_lpc10_destroy);
#endif
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;