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 | |
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')
-rw-r--r-- | main/channel.c | 1 | ||||
-rw-r--r-- | main/frame.c | 9 | ||||
-rw-r--r-- | main/rtp_engine.c | 2 |
3 files changed, 12 insertions, 0 deletions
diff --git a/main/channel.c b/main/channel.c index 39130c35a..90ac32de0 100644 --- a/main/channel.c +++ b/main/channel.c @@ -792,6 +792,7 @@ format_t ast_best_codec(format_t fmts) AST_FORMAT_ULAW, /*! Unless of course, you're a silly European, so then prefer ALAW */ AST_FORMAT_ALAW, + AST_FORMAT_G719, AST_FORMAT_SIREN14, AST_FORMAT_SIREN7, AST_FORMAT_TESTLAW, 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)); } diff --git a/main/rtp_engine.c b/main/rtp_engine.c index 2d23958ae..c42d3f6fb 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -122,6 +122,7 @@ static const struct ast_rtp_mime_type { {{1, AST_FORMAT_T140}, "text", "T140", 1000}, {{1, AST_FORMAT_SIREN7}, "audio", "G7221", 16000}, {{1, AST_FORMAT_SIREN14}, "audio", "G7221", 32000}, + {{1, AST_FORMAT_G719}, "audio", "G719", 48000}, }; /*! @@ -169,6 +170,7 @@ static const struct ast_rtp_payload_type static_RTP_PT[AST_RTP_MAX_PT] = { [111] = {1, AST_FORMAT_G726}, [112] = {1, AST_FORMAT_G726_AAL2}, [115] = {1, AST_FORMAT_SIREN14}, + [116] = {1, AST_FORMAT_G719}, [121] = {0, AST_RTP_CISCO_DTMF}, /* Must be type 121 */ }; |