1
/* $Id: opencore_amr.h 4335 2013-01-29 08:09:15Z ming $ */
3
* Copyright (C) 2011-2013 Teluu Inc. (http://www.teluu.com)
4
* Copyright (C) 2011 Dan Arrhenius <dan@keystream.se>
6
* This program is free software; you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License as published by
8
* the Free Software Foundation; either version 2 of the License, or
9
* (at your option) any later version.
11
* This program is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
* GNU General Public License for more details.
16
* You should have received a copy of the GNU General Public License
17
* along with this program; if not, write to the Free Software
18
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20
#ifndef __PJMEDIA_CODEC_OPENCORE_AMR_H__
21
#define __PJMEDIA_CODEC_OPENCORE_AMR_H__
23
#include <pjmedia-codec/types.h>
26
* @defgroup PJMED_OC_AMR OpenCORE AMR Codec
27
* @ingroup PJMEDIA_CODEC_CODECS
28
* @brief AMRCodec wrapper for OpenCORE AMR codec
35
* Bitmask options to be passed during AMR codec factory initialization.
37
enum pjmedia_amr_options
39
PJMEDIA_AMR_NO_NB = 1, /**< Disable narrowband mode. */
40
PJMEDIA_AMR_NO_WB = 2, /**< Disable wideband mode. */
44
* Settings. Use #pjmedia_codec_opencore_amrnb/wb_set_config() to
47
typedef struct pjmedia_codec_amr_config
50
* Control whether to use octent align.
52
pj_bool_t octet_align;
59
} pjmedia_codec_amr_config;
61
typedef pjmedia_codec_amr_config pjmedia_codec_amrnb_config;
62
typedef pjmedia_codec_amr_config pjmedia_codec_amrwb_config;
65
* Initialize and register AMR codec factory to pjmedia endpoint.
67
* @param endpt The pjmedia endpoint.
68
* @param options Bitmask of pjmedia_amr_options (default=0).
70
* @return PJ_SUCCESS on success.
72
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_init(pjmedia_endpt* endpt,
76
* Initialize and register AMR codec factory using default settings to
79
* @param endpt The pjmedia endpoint.
81
* @return PJ_SUCCESS on success.
84
pjmedia_codec_opencore_amr_init_default(pjmedia_endpt* endpt);
87
* Unregister AMR codec factory from pjmedia endpoint and deinitialize
88
* the OpenCORE codec library.
90
* @return PJ_SUCCESS on success.
92
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_deinit(void);
95
* Initialize and register AMR-NB codec factory to pjmedia endpoint. Calling
96
* this function will automatically initialize AMR codec factory without
97
* the wideband mode (i.e. it is equivalent to calling
98
* #pjmedia_codec_opencore_amr_init() with PJMEDIA_AMR_NO_WB). Application
99
* should call #pjmedia_codec_opencore_amr_init() instead if wishing to use
102
* @param endpt The pjmedia endpoint.
104
* @return PJ_SUCCESS on success.
106
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_init(pjmedia_endpt* endpt);
109
* Unregister AMR-NB codec factory from pjmedia endpoint and deinitialize
110
* the OpenCORE codec library.
112
* @return PJ_SUCCESS on success.
114
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_deinit(void);
118
* Set AMR-NB parameters.
120
* @param cfg The settings;
122
* @return PJ_SUCCESS on success.
124
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_set_config(
125
const pjmedia_codec_amrnb_config* cfg);
129
* Set AMR-WB parameters.
131
* @param cfg The settings;
133
* @return PJ_SUCCESS on success.
135
PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_set_config(
136
const pjmedia_codec_amrwb_config* cfg);
145
#endif /* __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ */