File difference report generated by CSDiff by ComponentSoftware on 26/01/2010 10:06 Base file: V:\roip\roipserver\Asterisk\codecs\1.6.2\codec_g726.c Compared file: V:\roip\roipserver\Asterisk\codecs\codec_g726.c 771a773,816 > /*! \brief convert G726-32 RFC3551 packed data into AAL2 packed data (or vice-versa) */ > static int g726tog726aal2_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) > { > unsigned char *src = f->data.ptr; > unsigned char *dst = pvt->outbuf.uc + pvt->samples; > unsigned int i; > > for (i = 0; i < f->datalen; i++) > *dst++ = ((src[i] & 0xf) << 4) | (src[i] >> 4); > > pvt->samples += f->samples; > pvt->datalen += f->samples; /* 1 byte/sample */ > > return 0; > } > > static struct ast_frame *g726tolin_sample(void) > { > static struct ast_frame f = { > .frametype = AST_FRAME_VOICE, > .subclass = AST_FORMAT_G726, > .datalen = sizeof(g726_slin_ex), > .samples = sizeof(g726_slin_ex) * 2, /* 2 samples per byte */ > .src = __PRETTY_FUNCTION__, > .data.ptr = g726_slin_ex, > }; > > return &f; > } > > static struct ast_frame *lintog726_sample (void) > { > static struct ast_frame f = { > .frametype = AST_FRAME_VOICE, > .subclass = AST_FORMAT_SLINEAR, > .datalen = sizeof(slin_g726_ex), > .samples = sizeof(slin_g726_ex) / 2, /* 1 sample per 2 bytes */ > .src = __PRETTY_FUNCTION__, > .data.ptr = slin_g726_ex, > }; > > return &f; > } > 778c823 < .sample = g726_sample, --- > .sample = g726tolin_sample, 791c836 < .sample = slin8_sample, --- > .sample = lintog726_sample, 803c848 < .sample = g726_sample, --- > .sample = g726tolin_sample, 816c861 < .sample = slin8_sample, --- > .sample = lintog726_sample, 821a867,886 > static struct ast_translator g726tog726aal2 = { > .name = "g726tog726aal2", > .srcfmt = AST_FORMAT_G726, > .dstfmt = AST_FORMAT_G726_AAL2, > .framein = g726tog726aal2_framein, /* same for both directions */ > .sample = lintog726_sample, > .buffer_samples = BUFFER_SAMPLES, > .buf_size = BUFFER_SAMPLES, > }; > > static struct ast_translator g726aal2tog726 = { > .name = "g726aal2tog726", > .srcfmt = AST_FORMAT_G726_AAL2, > .dstfmt = AST_FORMAT_G726, > .framein = g726tog726aal2_framein, /* same for both directions */ > .sample = lintog726_sample, > .buffer_samples = BUFFER_SAMPLES, > .buf_size = BUFFER_SAMPLES, > }; > 857a923,925 > res |= ast_unregister_translator(&g726aal2tog726); > res |= ast_unregister_translator(&g726tog726aal2); > 873a942,944 > > res |= ast_register_translator(&g726aal2tog726); > res |= ast_register_translator(&g726tog726aal2); <--------------------- End of report --------------------->