Debian Codegraph @

Xpjproject/pjmedia/include/pjmedia-codec/opencore_amr.h

raw symbols SCIP
1 /*
2 * Copyright (C) 2011-2013 Teluu Inc. (http://www.teluu.com)
3 * Copyright (C) 2011 Dan Arrhenius <[email protected]>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __PJMEDIA_CODEC_OPENCORE_AMR_H__
20 #define __PJMEDIA_CODEC_OPENCORE_AMR_H__
21
22 #include <pjmedia-codec/types.h>
23
24 /**
25 * @defgroup PJMED_OC_AMR OpenCORE AMR Codec
26 * @ingroup PJMEDIA_CODEC_CODECS
27 * @brief AMRCodec wrapper for OpenCORE AMR codec
28 * @{
29 */
30
31 PJ_BEGIN_DECL
32
33 /**
34 * Bitmask options to be passed during AMR codec factory initialization.
35 */
36 enum pjmedia_amr_options
37 {
38 PJMEDIA_AMR_NO_NB = 1, /**< Disable narrowband mode. */
39 PJMEDIA_AMR_NO_WB = 2, /**< Disable wideband mode. */
40 };
41
42 /**
43 * Settings. Use pjmedia_codec_opencore_amrnb_set_config() and
44 * pjmedia_codec_opencore_amrwb_set_config() to activate.
45 */
46 typedef struct pjmedia_codec_amr_config
47 {
48 /**
49 * Control whether to use octent align.
50 */
51 pj_bool_t octet_align;
52
53 /**
54 * Set the bitrate.
55 */
56 unsigned bitrate;
57
58 } pjmedia_codec_amr_config;
59
60 typedef pjmedia_codec_amr_config pjmedia_codec_amrnb_config;
61 typedef pjmedia_codec_amr_config pjmedia_codec_amrwb_config;
62
63 /**
64 * Initialize and register AMR codec factory to pjmedia endpoint.
65 *
66 * @param endpt The pjmedia endpoint.
67 * @param options Bitmask of pjmedia_amr_options (default=0).
68 *
69 * @return PJ_SUCCESS on success.
70 */
71 PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_init(pjmedia_endpt* endpt,
72 unsigned options);
73
74 /**
75 * Initialize and register AMR codec factory using default settings to
76 * pjmedia endpoint.
77 *
78 * @param endpt The pjmedia endpoint.
79 *
80 * @return PJ_SUCCESS on success.
81 */
82 PJ_DECL(pj_status_t)
83 pjmedia_codec_opencore_amr_init_default(pjmedia_endpt* endpt);
84
85 /**
86 * Unregister AMR codec factory from pjmedia endpoint and deinitialize
87 * the OpenCORE codec library.
88 *
89 * @return PJ_SUCCESS on success.
90 */
91 PJ_DECL(pj_status_t) pjmedia_codec_opencore_amr_deinit(void);
92
93 /**
94 * Initialize and register AMR-NB codec factory to pjmedia endpoint. Calling
95 * this function will automatically initialize AMR codec factory without
96 * the wideband mode (i.e. it is equivalent to calling
97 * #pjmedia_codec_opencore_amr_init() with PJMEDIA_AMR_NO_WB). Application
98 * should call #pjmedia_codec_opencore_amr_init() instead if wishing to use
99 * both modes.
100 *
101 * @param endpt The pjmedia endpoint.
102 *
103 * @return PJ_SUCCESS on success.
104 */
105 PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_init(pjmedia_endpt* endpt);
106
107 /**
108 * Unregister AMR-NB codec factory from pjmedia endpoint and deinitialize
109 * the OpenCORE codec library.
110 *
111 * @return PJ_SUCCESS on success.
112 */
113 PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_deinit(void);
114
115
116 /**
117 * Set AMR-NB parameters.
118 *
119 * @param cfg The settings;
120 *
121 * @return PJ_SUCCESS on success.
122 */
123 PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrnb_set_config(
124 const pjmedia_codec_amrnb_config* cfg);
125
126
127 /**
128 * Set AMR-WB parameters.
129 *
130 * @param cfg The settings;
131 *
132 * @return PJ_SUCCESS on success.
133 */
134 PJ_DECL(pj_status_t) pjmedia_codec_opencore_amrwb_set_config(
135 const pjmedia_codec_amrwb_config* cfg);
136
137 PJ_END_DECL
138
139
140 /**
141 * @}
142 */
143
144 #endif /* __PJMEDIA_CODEC_OPENCORE_AMRNB_H__ */
145