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