From c26c190711a1bbe3b5fff1a93facae333757c56e Mon Sep 17 00:00:00 2001 From: David Vossel Date: Thu, 3 Feb 2011 16:22:10 +0000 Subject: Asterisk media architecture conversion - no more format bitfields This patch is the foundation of an entire new way of looking at media in Asterisk. The code present in this patch is everything required to complete phase1 of my Media Architecture proposal. For more information about this project visit the link below. https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal The primary function of this patch is to convert all the usages of format bitfields in Asterisk to use the new format and format_cap APIs. Functionally no change in behavior should be present in this patch. Thanks to twilson and russell for all the time they spent reviewing these changes. Review: https://reviewboard.asterisk.org/r/1083/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- codecs/codec_a_mu.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'codecs/codec_a_mu.c') diff --git a/codecs/codec_a_mu.c b/codecs/codec_a_mu.c index 9b2e40850..a7d86e2c4 100644 --- a/codecs/codec_a_mu.c +++ b/codecs/codec_a_mu.c @@ -76,8 +76,6 @@ static int ulawtoalaw_framein(struct ast_trans_pvt *pvt, struct ast_frame *f) static struct ast_translator alawtoulaw = { .name = "alawtoulaw", - .srcfmt = AST_FORMAT_ALAW, - .dstfmt = AST_FORMAT_ULAW, .framein = alawtoulaw_framein, .sample = alaw_sample, .buffer_samples = BUFFER_SAMPLES, @@ -86,8 +84,6 @@ static struct ast_translator alawtoulaw = { static struct ast_translator ulawtoalaw = { .name = "ulawtoalaw", - .srcfmt = AST_FORMAT_ULAW, - .dstfmt = AST_FORMAT_ALAW, .framein = ulawtoalaw_framein, .sample = ulaw_sample, .buffer_samples = BUFFER_SAMPLES, @@ -111,6 +107,12 @@ static int load_module(void) int res; int x; + ast_format_set(&alawtoulaw.src_format, AST_FORMAT_ALAW, 0); + ast_format_set(&alawtoulaw.dst_format, AST_FORMAT_ULAW, 0); + + ast_format_set(&ulawtoalaw.src_format, AST_FORMAT_ULAW, 0); + ast_format_set(&ulawtoalaw.dst_format, AST_FORMAT_ALAW, 0); + for (x=0;x<256;x++) { mu2a[x] = AST_LIN2A(AST_MULAW(x)); a2mu[x] = AST_LIN2MU(AST_ALAW(x)); -- cgit v1.2.3