diff options
author | Liong Sauw Ming <ming@teluu.com> | 2011-10-24 09:28:13 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2011-10-24 09:28:13 +0000 |
commit | 2068f13bc42cf3a47374aa2765f82724a5782028 (patch) | |
tree | 29fbeaa152ab51e59b650c0d7cd83a38111e1ecc /pjmedia/src/test/mips_test.c | |
parent | 1c72a42676e7aa0c2ae0734549050f738f3bdf02 (diff) |
Re #1395: Backport of PJSIP 1.x branch into PJSIP 2.0 trunk
* Backport of r3557:r3832
TODO: ticket #1268 (Option for automatic/manual sending of RTCP SDES/BYE for the stream) for video stream.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@3841 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/src/test/mips_test.c')
-rw-r--r-- | pjmedia/src/test/mips_test.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/pjmedia/src/test/mips_test.c b/pjmedia/src/test/mips_test.c index 91551196..977fe9a0 100644 --- a/pjmedia/src/test/mips_test.c +++ b/pjmedia/src/test/mips_test.c @@ -916,6 +916,23 @@ static pjmedia_port* g7221c_encode_decode(pj_pool_t *pool, } #endif /* PJMEDIA_HAS_G7221_CODEC */ +#if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC +/* AMR-NB benchmark benchmark */ +static pjmedia_port* amr_encode_decode(pj_pool_t *pool, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned flags, + struct test_entry *te) +{ + return codec_encode_decode(pool, "AMR/8000", + &pjmedia_codec_opencore_amrnb_init, + &pjmedia_codec_opencore_amrnb_deinit, + clock_rate, channel_count, + samples_per_frame, flags, te); +} +#endif /* PJMEDIA_HAS_OPENCORE_AMRNB_CODEC */ + #if defined(PJMEDIA_HAS_L16_CODEC) && PJMEDIA_HAS_L16_CODEC!=0 static pj_status_t init_l16_default(pjmedia_endpt *endpt) { @@ -1976,6 +1993,23 @@ static pjmedia_port* create_stream_g7221c( pj_pool_t *pool, } #endif /* PJMEDIA_HAS_G7221_CODEC */ +/* AMR-NB stream */ +#if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC +static pjmedia_port* create_stream_amr( pj_pool_t *pool, + unsigned clock_rate, + unsigned channel_count, + unsigned samples_per_frame, + unsigned flags, + struct test_entry *te) +{ + return create_stream(pool, "AMR/8000", &pjmedia_codec_opencore_amrnb_init, + &pjmedia_codec_opencore_amrnb_deinit, + PJ_FALSE, PJ_FALSE, PJ_FALSE, + clock_rate, channel_count, + samples_per_frame, flags, te); +} +#endif /* PJMEDIA_HAS_OPENCORE_AMRNB_CODEC */ + /***************************************************************************/ /* Delay buffer */ enum {DELAY_BUF_MAX_DELAY = 80}; @@ -2366,6 +2400,9 @@ int mips_test(void) { "codec encode/decode - G.722.1", OP_PUT, K16, &g7221_encode_decode}, { "codec encode/decode - G.722.1c", OP_PUT, K32, &g7221c_encode_decode}, #endif +#if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC + { "codec encode/decode - AMR-NB", OP_PUT, K8, &amr_encode_decode}, +#endif #if PJMEDIA_HAS_L16_CODEC { "codec encode/decode - L16/8000/1", OP_PUT, K8, &l16_8_encode_decode}, { "codec encode/decode - L16/16000/1", OP_PUT, K16, &l16_16_encode_decode}, @@ -2391,6 +2428,9 @@ int mips_test(void) { "stream TX/RX - G.722.1", OP_PUT_GET, K16, &create_stream_g7221}, { "stream TX/RX - G.722.1c", OP_PUT_GET, K32, &create_stream_g7221c}, #endif +#if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC + { "stream TX/RX - AMR-NB", OP_PUT_GET, K8, &create_stream_amr}, +#endif }; unsigned i, c, k[3] = {K8, K16, K32}, clock_rates[3] = {8000, 16000, 32000}; |