|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Telephony Multimedia Service |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef TMS_G711_FORMAT_H |
|
19 #define TMS_G711_FORMAT_H |
|
20 |
|
21 #include <tms.h> |
|
22 #include <tmsformat.h> |
|
23 |
|
24 namespace TMS { |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 class TMSG711FormatBody; |
|
28 |
|
29 /** |
|
30 * TMSG711Format class |
|
31 * |
|
32 * This class provides access methods to configure and query G.711 codec |
|
33 * format settings. |
|
34 * |
|
35 * This format class can be used for both the encoder and decoder. |
|
36 * |
|
37 * @lib tmsapi.lib |
|
38 * |
|
39 */ |
|
40 class TMSG711Format : public TMSFormat |
|
41 { |
|
42 public: |
|
43 /** |
|
44 * Destructor |
|
45 */ |
|
46 IMPORT_C virtual ~TMSG711Format(); |
|
47 |
|
48 /** |
|
49 * Set G.711 codec mode. |
|
50 * |
|
51 * This method is allowable when encoding is not active; i.e. anytime |
|
52 * before encoding is started or after it is stopped. |
|
53 * |
|
54 * Supported G.711 codec modes are: |
|
55 * TMS_G711_CODEC_MODE_ALAW |
|
56 * TMS_G711_CODEC_MODE_MULAW |
|
57 * |
|
58 * @param mode |
|
59 * Sets selected G.711 encoding or decoding mode. |
|
60 |
|
61 * @return |
|
62 * TMS_RESULT_SUCCESS if the operation was successful. |
|
63 * TMS_RESULT_INVALID_STATE if this method is used during active |
|
64 * encoding or decoding operation. |
|
65 * TMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
66 * by the adaptation. |
|
67 * |
|
68 */ |
|
69 IMPORT_C gint SetMode(const TMSG711CodecMode mode); |
|
70 |
|
71 /** |
|
72 * Return current G.711 codec mode. |
|
73 * |
|
74 * This method is allowable at all times, while actively encoding/decoding |
|
75 * or not. |
|
76 * |
|
77 * Supported G.711 codec modes are: |
|
78 * TMS_G711_CODEC_MODE_ALAW |
|
79 * TMS_G711_CODEC_MODE_MULAW |
|
80 * |
|
81 * @param mode |
|
82 * Returns current G.711 encoding or decoding mode. |
|
83 |
|
84 * @return |
|
85 * TMS_RESULT_SUCCESS if the operation was successful. |
|
86 * |
|
87 */ |
|
88 IMPORT_C gint GetMode(TMSG711CodecMode& mode); |
|
89 |
|
90 /** |
|
91 * Toggles on and off Comfort Noise Generator (CNG) for G.711 decoder. |
|
92 * Not supported by the encoder. |
|
93 * |
|
94 * This method is allowable when decoding is not active; i.e. anytime |
|
95 * before decoding is started or after it is stopped. |
|
96 * |
|
97 * @param cng |
|
98 * Sets CNG feature on or off. |
|
99 * |
|
100 * @return |
|
101 * TMS_RESULT_SUCCESS if the operation was successful. |
|
102 * TMS_RESULT_INVALID_STATE if this method is used during active |
|
103 * decoding operation. |
|
104 * TMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
105 * by the adaptation. |
|
106 * |
|
107 */ |
|
108 IMPORT_C gint SetCNG(const gboolean cng); |
|
109 |
|
110 /** |
|
111 * Returns current CNG setting of the G.711 decoder. |
|
112 * |
|
113 * This method is allowable when decoding is not active; i.e. anytime |
|
114 * before decoding is started or after it is stopped. |
|
115 * |
|
116 * @param cng |
|
117 * Current CNG setting of the decoder. |
|
118 * |
|
119 * @return gint |
|
120 * TMS_RESULT_SUCCESS if the operation was successful. |
|
121 * |
|
122 */ |
|
123 IMPORT_C gint GetCNG(gboolean& cng); |
|
124 |
|
125 /** |
|
126 * Toggles on and off Packet Loss Concealment (PLC) for G.711 decoder. |
|
127 * Not supported by the encoder. |
|
128 * |
|
129 * This method is allowable when decoding is not active; i.e. anytime |
|
130 * before decoding is started or after it is stopped. |
|
131 * |
|
132 * @param plc |
|
133 * Sets PLC feature on or off. |
|
134 * |
|
135 * @return |
|
136 * TMS_RESULT_SUCCESS if the operation was successful. |
|
137 * TMS_RESULT_INVALID_STATE if this method is used during active |
|
138 * decoding operation. |
|
139 * TMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
140 * by the adaptation. |
|
141 * |
|
142 */ |
|
143 IMPORT_C gint SetPlc(const gboolean plc); |
|
144 |
|
145 /** |
|
146 * Returns current PLC setting of the G.711 decoder. |
|
147 * |
|
148 * This method is allowable at all times, while actively decoding or not. |
|
149 * |
|
150 * @param plc |
|
151 * Current CNG setting of the decoder. |
|
152 * |
|
153 * @return |
|
154 * TMS_RESULT_SUCCESS if the operation was successful. |
|
155 * |
|
156 */ |
|
157 IMPORT_C gint GetPlc(gboolean& plc); |
|
158 |
|
159 /** |
|
160 * Toggles on and off Voice Activation Detection (VAD) for G.711 encoder. |
|
161 * Not supported by the decoder. |
|
162 * |
|
163 * This method is allowable at all times, while actively encoding or not. |
|
164 * |
|
165 * @param vad |
|
166 * Sets VAD feature on or off. |
|
167 * |
|
168 * @return |
|
169 * TMS_RESULT_SUCCESS if the operation was successful. |
|
170 * TMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
171 * by the adaptation. |
|
172 * |
|
173 */ |
|
174 IMPORT_C gint SetVADMode(const gboolean vad); |
|
175 |
|
176 /** |
|
177 * Returns current VAD setting of the G.711 encoder. |
|
178 * |
|
179 * This method is allowable at all times, while actively encoding or not. |
|
180 * |
|
181 * @param vad |
|
182 * Current VAD setting of the encoder. |
|
183 * |
|
184 * @return |
|
185 * TMS_RESULT_SUCCESS if the operation was successful. |
|
186 * |
|
187 */ |
|
188 IMPORT_C gint GetVADMode(gboolean& vad); |
|
189 |
|
190 protected: |
|
191 /** |
|
192 * Constructor |
|
193 */ |
|
194 IMPORT_C TMSG711Format(); |
|
195 |
|
196 protected: |
|
197 TMSG711FormatBody *iBody; |
|
198 }; |
|
199 |
|
200 } //namespace TMS |
|
201 |
|
202 #endif //TMS_G711_FORMAT_H |