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