|
1 /* |
|
2 * Copyright (c) 2005 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: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CMCEG729CODEC_H |
|
22 #define CMCEG729CODEC_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <mceaudiocodec.h> |
|
26 #include <mcedefs.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 // G.729 Codec bitrate |
|
31 const TUint KMceG729Bitrate = 8000; |
|
32 |
|
33 const TUint KMceAllowedG729Bitrate8K = 0x0001; |
|
34 const TUint KMceAllowedG729BitrateAllowAll = 0x00FF; |
|
35 |
|
36 |
|
37 // G.729 Codec modes |
|
38 const TUint KG729CodecMode = 1; |
|
39 |
|
40 const TUint KMceG729SamplingFreq = 8000; |
|
41 |
|
42 // PTime and MaxPTime |
|
43 const TUint KMceG729DefaultPtime = 20; |
|
44 const TUint KMceG729DefaultMaxPtime = 200; |
|
45 |
|
46 // G.729 Payload Type |
|
47 const TUint8 KMceDefaultG729PayloadType = 18; |
|
48 |
|
49 |
|
50 // CLASS DECLARATION |
|
51 |
|
52 /** |
|
53 * Class for the G729 codec information. |
|
54 * |
|
55 * It checks the validity of inserted values for G729. |
|
56 * |
|
57 * @lib mceclient.lib |
|
58 */ |
|
59 class CMceG729Codec : public CMceAudioCodec |
|
60 { |
|
61 public: // Constructors and destructor |
|
62 |
|
63 /** |
|
64 * Destructor. |
|
65 */ |
|
66 IMPORT_C ~CMceG729Codec(); |
|
67 |
|
68 public: // From base class |
|
69 |
|
70 /** |
|
71 * Enable / Disable Voice Activity Detection. |
|
72 * @param aEnableVAD, Boolean indicating whether to enable Voice Activity Detection |
|
73 * @return KErrNotSupported if codec doesn't support VAD; otherwise KErrNone. |
|
74 */ |
|
75 IMPORT_C TInt EnableVAD(TBool aEnableVAD); |
|
76 |
|
77 /** |
|
78 * Sets bitrate used with codec for encoding. |
|
79 * @param aBitrate, bitrate value for encoding |
|
80 * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone. |
|
81 */ |
|
82 IMPORT_C TInt SetBitrate(TUint aBitrate); |
|
83 |
|
84 /** |
|
85 * Sets bitrates allowed with codec. |
|
86 * @param aBitrates, allowed bitrate values |
|
87 * @return KErrNotSupported if codec doesn't support bitrate value issued; otherwise KErrNone. |
|
88 */ |
|
89 IMPORT_C TInt SetAllowedBitrates(TUint aBitrates); |
|
90 |
|
91 /** |
|
92 * Sets the sampling frequency. |
|
93 * @param aSamplingFreq, Sampling frequency to be used |
|
94 * @return KErrNotSupported if codec doesn't support sampling frequency issued; otherwise KErrNone. |
|
95 */ |
|
96 IMPORT_C TInt SetSamplingFreq(TUint aSamplingFreq); |
|
97 |
|
98 /** |
|
99 * Sets the packetization rate. |
|
100 * @param aPTime, Packetization rate, must be multiple of audio frame size. |
|
101 * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. |
|
102 */ |
|
103 IMPORT_C TInt SetPTime(TUint aPTime); |
|
104 |
|
105 /** |
|
106 * Sets the maximum packetization rate. |
|
107 * @param aMaxPTime, maximum allowed packetization rate, must be multiple of audio frame size. |
|
108 * @return KErrNotSupported if codec doesn't support packetrate value issued; otherwise KErrNone. |
|
109 */ |
|
110 IMPORT_C TInt SetMaxPTime(TUint aMaxPTime); |
|
111 |
|
112 /** |
|
113 * Sets the payload type identifier. |
|
114 * @param aPayloadType payload type identifier. |
|
115 * @return One of the standard system-wide error codes. |
|
116 */ |
|
117 IMPORT_C TInt SetPayloadType(TUint8 aPayloadType); |
|
118 |
|
119 /** |
|
120 * Sets the codec mode. |
|
121 * @param aCodecMode Codec mode (PCMU / PCMA ) |
|
122 * @return KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone. |
|
123 */ |
|
124 IMPORT_C TInt SetCodecMode(TUint aCodecMode); |
|
125 |
|
126 /** |
|
127 * Enable / Disable Comfort noise codec existence. |
|
128 * @param aComfortNoise Boolean indicating whether to enable CN codec existence |
|
129 * @return KErrNotSupported if codec doesnt' support codec mode value issued; otherwise KErrNone. |
|
130 */ |
|
131 //IMPORT_C TInt EnableCN(const TBool aComfortNoise); |
|
132 |
|
133 /** |
|
134 * Clones codec, ownership is transferred. |
|
135 * @return cloned codec |
|
136 */ |
|
137 IMPORT_C CMceAudioCodec* CloneL() const; |
|
138 |
|
139 public: |
|
140 |
|
141 /** |
|
142 * Two-phased constructor. |
|
143 * @param aSdpName sdp name |
|
144 */ |
|
145 static CMceG729Codec* NewL( TBuf8<KMceMaxSdpNameLength> aSdpName); |
|
146 |
|
147 /** |
|
148 * Two-phased constructor. |
|
149 * @param aSdpName sdp name |
|
150 */ |
|
151 static CMceG729Codec* NewLC(TBuf8<KMceMaxSdpNameLength> aSdpName); |
|
152 |
|
153 |
|
154 private: |
|
155 |
|
156 /** |
|
157 * C++ default constructor. |
|
158 */ |
|
159 CMceG729Codec(); |
|
160 |
|
161 /** |
|
162 * By default Symbian 2nd phase constructor is private. |
|
163 */ |
|
164 void ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName); |
|
165 |
|
166 /** |
|
167 * Sets the sdp name. |
|
168 * @param aSdpName the sdp name |
|
169 */ |
|
170 void SetSdpNameL( const TDesC8& aSdpName ); |
|
171 |
|
172 //for testing |
|
173 |
|
174 MCE_UNIT_TEST_DEFS |
|
175 }; |
|
176 |
|
177 |
|
178 #endif |
|
179 |
|
180 // End of File |