|
1 /* |
|
2 * Copyright (c) 2010 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: QT Bindings for TMS |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef QTMS_G711_FORMAT_H |
|
19 #define QTMS_G711_FORMAT_H |
|
20 |
|
21 #include <qtms.h> |
|
22 #include <qtmsformat.h> |
|
23 #include <QObject> |
|
24 #include "qtmswrapperexport.h" |
|
25 |
|
26 // FORWARD DECLARATIONS |
|
27 namespace TMS |
|
28 { |
|
29 class TMSFormat; |
|
30 } |
|
31 |
|
32 namespace QTMS |
|
33 { |
|
34 |
|
35 /** |
|
36 * QTMSG711Format class |
|
37 * |
|
38 * This class provides access methods to configure and query G.711 codec |
|
39 * format settings. |
|
40 * |
|
41 * This format class can be used for both the encoder and decoder. |
|
42 * |
|
43 * @lib QTMSapi.lib |
|
44 * |
|
45 */ |
|
46 class QTMS_WRAPPER_DLL_EXPORT QTMSG711Format: public QObject, public QTMSFormat |
|
47 { |
|
48 Q_OBJECT |
|
49 public: |
|
50 /** |
|
51 * Destructor |
|
52 */ |
|
53 virtual ~QTMSG711Format(); |
|
54 |
|
55 /** |
|
56 * Set G.711 codec mode. |
|
57 * |
|
58 * This method is allowable when encoding is not active; i.e. anytime |
|
59 * before encoding is started or after it is stopped. |
|
60 * |
|
61 * Supported G.711 codec modes are: |
|
62 * QTMS_G711_CODEC_MODE_ALAW |
|
63 * QTMS_G711_CODEC_MODE_MULAW |
|
64 * |
|
65 * @param mode |
|
66 * Sets selected G.711 encoding or decoding mode. |
|
67 |
|
68 * @return |
|
69 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
70 * QTMS_RESULT_INVALID_STATE if this method is used during active |
|
71 * encoding or decoding operation. |
|
72 * QTMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
73 * by the adaptation. |
|
74 * |
|
75 */ |
|
76 gint SetMode(const QTMSG711CodecMode mode); |
|
77 |
|
78 /** |
|
79 * Return current G.711 codec mode. |
|
80 * |
|
81 * This method is allowable at all times, while actively encoding/decoding |
|
82 * or not. |
|
83 * |
|
84 * Supported G.711 codec modes are: |
|
85 * QTMS_G711_CODEC_MODE_ALAW |
|
86 * QTMS_G711_CODEC_MODE_MULAW |
|
87 * |
|
88 * @param mode |
|
89 * Returns current G.711 encoding or decoding mode. |
|
90 |
|
91 * @return |
|
92 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
93 * |
|
94 */ |
|
95 gint GetMode(QTMSG711CodecMode& mode); |
|
96 |
|
97 /** |
|
98 * Toggles on and off Comfort Noise Generator (CNG) for G.711 decoder. |
|
99 * Not supported by the encoder. |
|
100 * |
|
101 * This method is allowable when decoding is not active; i.e. anytime |
|
102 * before decoding is started or after it is stopped. |
|
103 * |
|
104 * @param cng |
|
105 * Sets CNG feature on or off. |
|
106 * |
|
107 * @return |
|
108 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
109 * QTMS_RESULT_INVALID_STATE if this method is used during active |
|
110 * decoding operation. |
|
111 * QTMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
112 * by the adaptation. |
|
113 * |
|
114 */ |
|
115 gint SetCNG(const gboolean cng); |
|
116 |
|
117 /** |
|
118 * Returns current CNG setting of the G.711 decoder. |
|
119 * |
|
120 * This method is allowable when decoding is not active; i.e. anytime |
|
121 * before decoding is started or after it is stopped. |
|
122 * |
|
123 * @param cng |
|
124 * Current CNG setting of the decoder. |
|
125 * |
|
126 * @return gint |
|
127 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
128 * |
|
129 */ |
|
130 gint GetCNG(gboolean& cng); |
|
131 |
|
132 /** |
|
133 * Toggles on and off Packet Loss Concealment (PLC) for G.711 decoder. |
|
134 * Not supported by the encoder. |
|
135 * |
|
136 * This method is allowable when decoding is not active; i.e. anytime |
|
137 * before decoding is started or after it is stopped. |
|
138 * |
|
139 * @param plc |
|
140 * Sets PLC feature on or off. |
|
141 * |
|
142 * @return |
|
143 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
144 * QTMS_RESULT_INVALID_STATE if this method is used during active |
|
145 * decoding operation. |
|
146 * QTMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
147 * by the adaptation. |
|
148 * |
|
149 */ |
|
150 gint SetPlc(const gboolean plc); |
|
151 |
|
152 /** |
|
153 * Returns current PLC setting of the G.711 decoder. |
|
154 * |
|
155 * This method is allowable at all times, while actively decoding or not. |
|
156 * |
|
157 * @param plc |
|
158 * Current CNG setting of the decoder. |
|
159 * |
|
160 * @return |
|
161 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
162 * |
|
163 */ |
|
164 gint GetPlc(gboolean& plc); |
|
165 |
|
166 /** |
|
167 * Toggles on and off Voice Activation Detection (VAD) for G.711 encoder. |
|
168 * Not supported by the decoder. |
|
169 * |
|
170 * This method is allowable at all times, while actively encoding or not. |
|
171 * |
|
172 * @param vad |
|
173 * Sets VAD feature on or off. |
|
174 * |
|
175 * @return |
|
176 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
177 * QTMS_RESULT_FEATURE_NOT_SUPPORTED if this method is not implemented |
|
178 * by the adaptation. |
|
179 * |
|
180 */ |
|
181 gint SetVADMode(const gboolean vad); |
|
182 |
|
183 /** |
|
184 * Returns current VAD setting of the G.711 encoder. |
|
185 * |
|
186 * This method is allowable at all times, while actively encoding or not. |
|
187 * |
|
188 * @param vad |
|
189 * Current VAD setting of the encoder. |
|
190 * |
|
191 * @return |
|
192 * QTMS_RESULT_SUCCESS if the operation was successful. |
|
193 * |
|
194 */ |
|
195 gint GetVADMode(gboolean& vad); |
|
196 |
|
197 protected: |
|
198 /** |
|
199 * Constructor |
|
200 */ |
|
201 QTMSG711Format(); |
|
202 }; |
|
203 |
|
204 } //namespace QTMS |
|
205 |
|
206 #endif //QTMS_G711_FORMAT_H |