diff options
author | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-16 19:03:24 +0000 |
---|---|---|
committer | dvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b> | 2010-06-16 19:03:24 +0000 |
commit | 497bf0b92cad547930d1846fe2d23d3430a4316a (patch) | |
tree | eb89a0c0e7202e0334ef137f72ccc24c3f646432 /main/frame.c | |
parent | 5c51759e156fdd9bcf254f965c63c4969e393055 (diff) |
addition of G.719 pass-through support
(closes issue #16293)
Reported by: malcolmd
Patches:
g719.passthrough.patch.7 uploaded by malcolmd (license 924)
format_g719.c uploaded by malcolmd (license 924)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@270940 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/frame.c')
-rw-r--r-- | main/frame.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/main/frame.c b/main/frame.c index a4a7f2d32..1eb7d411b 100644 --- a/main/frame.c +++ b/main/frame.c @@ -120,6 +120,7 @@ static const struct ast_format_list AST_FORMAT_LIST[] = { { AST_FORMAT_SIREN7, "siren7", 16000, "ITU G.722.1 (Siren7, licensed from Polycom)", 80, 20, 80, 20, 20 }, /*!< Binary commercial distribution */ { AST_FORMAT_SIREN14, "siren14", 32000, "ITU G.722.1 Annex C, (Siren14, licensed from Polycom)", 120, 20, 80, 20, 20 }, /*!< Binary commercial distribution */ { AST_FORMAT_TESTLAW, "testlaw", 8000, "G.711 test-law", 80, 10, 150, 10, 20 }, /*!< codec_ulaw.c */ + { AST_FORMAT_G719, "g719", 48000, "ITU G.719", 160, 20, 80, 20, 20 }, }; struct ast_frame ast_null_frame = { AST_FRAME_NULL, }; @@ -1491,6 +1492,10 @@ int ast_codec_get_samples(struct ast_frame *f) /* 32,000 samples per second at 48kbps is 6,000 bytes per second */ samples = (int) f->datalen * ((float) 32000 / 6000); break; + case AST_FORMAT_G719: + /* 48,000 samples per second at 64kbps is 8,000 bytes per second */ + samples = (int) f->datalen * ((float) 48000 / 8000); + break; default: ast_log(LOG_WARNING, "Unable to calculate samples for format %s\n", ast_getformatname_multiple(tmp, sizeof(tmp), f->subclass.codec)); } @@ -1538,6 +1543,10 @@ int ast_codec_get_len(format_t format, int samples) /* 32,000 samples per second at 48kbps is 6,000 bytes per second */ len = (int) samples / ((float) 32000 / 6000); break; + case AST_FORMAT_G719: + /* 48,000 samples per second at 64kbps is 8,000 bytes per second */ + len = (int) samples / ((float) 48000 / 8000); + break; default: ast_log(LOG_WARNING, "Unable to calculate sample length for format %s\n", ast_getformatname(format)); } |