diff options
author | Liong Sauw Ming <ming@teluu.com> | 2013-01-23 06:18:18 +0000 |
---|---|---|
committer | Liong Sauw Ming <ming@teluu.com> | 2013-01-23 06:18:18 +0000 |
commit | f7506f68b514a31348fe71f29f1fea571711bc33 (patch) | |
tree | 93fceee898f55de78f4176b4d366036581005ad8 /pjmedia/include | |
parent | 1b4137b1713944a4fcb42f52facce72f39d24578 (diff) |
Re #1608: Add support for OpenCORE AMR-WB
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4331 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjmedia/include')
-rw-r--r-- | pjmedia/include/pjmedia-codec.h | 2 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/config.h | 14 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/config_auto.h.in | 5 | ||||
-rw-r--r-- | pjmedia/include/pjmedia-codec/opencore_amr.h (renamed from pjmedia/include/pjmedia-codec/opencore_amrnb.h) | 46 |
4 files changed, 56 insertions, 11 deletions
diff --git a/pjmedia/include/pjmedia-codec.h b/pjmedia/include/pjmedia-codec.h index 26389f8b..01e3e842 100644 --- a/pjmedia/include/pjmedia-codec.h +++ b/pjmedia/include/pjmedia-codec.h @@ -34,7 +34,7 @@ #include <pjmedia-codec/g722.h> #include <pjmedia-codec/g7221.h> #include <pjmedia-codec/ipp_codecs.h> -#include <pjmedia-codec/opencore_amrnb.h> +#include <pjmedia-codec/opencore_amr.h> #include <pjmedia-codec/passthrough.h> #include <pjmedia-codec/silk.h> diff --git a/pjmedia/include/pjmedia-codec/config.h b/pjmedia/include/pjmedia-codec/config.h index a6aa2d66..875c821a 100644 --- a/pjmedia/include/pjmedia-codec/config.h +++ b/pjmedia/include/pjmedia-codec/config.h @@ -323,8 +323,18 @@ #endif /** + * Enable OpenCORE AMR-WB codec. + * See https://trac.pjsip.org/repos/ticket/1608 for some info. + * + * Default: 0 + */ +#ifndef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC +# define PJMEDIA_HAS_OPENCORE_AMRWB_CODEC 0 +#endif + +/** * Link with libopencore-amrXX via pragma comment on Visual Studio. - * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC + * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB/WB_CODEC * is enabled. * * Default: 1 @@ -335,7 +345,7 @@ /** * Link with libopencore-amrXX.a that has been produced with gcc. - * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB_CODEC + * This option only makes sense if PJMEDIA_HAS_OPENCORE_AMRNB/WB_CODEC * and PJMEDIA_AUTO_LINK_OPENCORE_AMR_LIBS are enabled. * * Default: 1 diff --git a/pjmedia/include/pjmedia-codec/config_auto.h.in b/pjmedia/include/pjmedia-codec/config_auto.h.in index c8ab8534..746c1fc7 100644 --- a/pjmedia/include/pjmedia-codec/config_auto.h.in +++ b/pjmedia/include/pjmedia-codec/config_auto.h.in @@ -74,6 +74,11 @@ #undef PJMEDIA_HAS_OPENCORE_AMRNB_CODEC #endif +/* OpenCORE AMR-WB codec */ +#ifndef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC +#undef PJMEDIA_HAS_OPENCORE_AMRWB_CODEC +#endif + /* SILK codec */ #ifndef PJMEDIA_HAS_SILK_CODEC #undef PJMEDIA_HAS_SILK_CODEC diff --git a/pjmedia/include/pjmedia-codec/opencore_amrnb.h b/pjmedia/include/pjmedia-codec/opencore_amr.h index 3e618e46..56816415 100644 --- a/pjmedia/include/pjmedia-codec/opencore_amrnb.h +++ b/pjmedia/include/pjmedia-codec/opencore_amr.h @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (C) 2011 Teluu Inc. (http://www.teluu.com) + * Copyright (C) 2011-2013 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2011 Dan Arrhenius <dan@keystream.se> * * This program is free software; you can redistribute it and/or modify @@ -17,25 +17,25 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ -#define __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ +#ifndef __PJMEDIA_CODEC_OPENCORE_AMR_H__ +#define __PJMEDIA_CODEC_OPENCORE_AMR_H__ #include <pjmedia-codec/types.h> /** - * @defgroup PJMED_OC_AMRNB OpenCORE AMR-NB Codec + * @defgroup PJMED_OC_AMR OpenCORE AMR Codec * @ingroup PJMEDIA_CODEC_CODECS - * @brief AMRCodec wrapper for OpenCORE AMR-NB codec + * @brief AMRCodec wrapper for OpenCORE AMR codec * @{ */ PJ_BEGIN_DECL /** - * Settings. Use #pjmedia_codec_opencore_amrnb_set_config() to + * Settings. Use #pjmedia_codec_opencore_amrnb/wb_set_config() to * activate. */ -typedef struct pjmedia_codec_amrnb_config +typedef struct pjmedia_codec_amr_config { /** * Control whether to use octent align. @@ -47,8 +47,10 @@ typedef struct pjmedia_codec_amrnb_config */ unsigned bitrate; -} pjmedia_codec_amrnb_config; +} pjmedia_codec_amr_config; +typedef pjmedia_codec_amr_config pjmedia_codec_amrnb_config; +typedef pjmedia_codec_amr_config pjmedia_codec_amrwb_config; /** * Initialize and register AMR-NB codec factory to pjmedia endpoint. @@ -78,6 +80,34 @@ PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_deinit(void); PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_set_config( const pjmedia_codec_amrnb_config* cfg); +/** + * Initialize and register AMR-WB codec factory to pjmedia endpoint. + * + * @param endpt The pjmedia endpoint. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_init(pjmedia_endpt* endpt); + +/** + * Unregister AMR-WB codec factory from pjmedia endpoint and deinitialize + * the OpenCORE codec library. + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_deinit(void); + + +/** + * Set AMR-WB parameters. + * + * @param cfg The settings; + * + * @return PJ_SUCCESS on success. + */ +PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_set_config( + const pjmedia_codec_amrwb_config* cfg); + PJ_END_DECL |