|
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 CMCECOMDTMFCODEC_H |
|
22 #define CMCECOMDTMFCODEC_H |
|
23 |
|
24 // INCLUDES |
|
25 #include "mcecomaudiocodec.h" |
|
26 #include "mcedefs.h" |
|
27 |
|
28 |
|
29 |
|
30 // CLASS DECLARATION |
|
31 /** |
|
32 * Container class for the codec information. |
|
33 * |
|
34 * @lib |
|
35 */ |
|
36 class CMceComDtmfCodec : public CMceComAudioCodec |
|
37 { |
|
38 public: // Constructors and destructor |
|
39 |
|
40 /** |
|
41 * Two-phased constructor. |
|
42 * @param aSdpName sdp name |
|
43 */ |
|
44 static CMceComDtmfCodec* NewL( TBuf8<KMceMaxSdpNameLength> aSdpName ); |
|
45 |
|
46 /** |
|
47 * Two-phased constructor. |
|
48 * @param aSdpName sdp name |
|
49 */ |
|
50 static CMceComDtmfCodec* NewLC( TBuf8<KMceMaxSdpNameLength> aSdpName ); |
|
51 |
|
52 /** |
|
53 * Destructor. |
|
54 */ |
|
55 ~CMceComDtmfCodec(); |
|
56 |
|
57 public: // from CMceComCodec |
|
58 |
|
59 /** |
|
60 * Sets bitrate used with codec for encoding. |
|
61 * @param aBitrate bitrate value for encoding |
|
62 * @return KErrNotSupported if codec doesn't support bitrate |
|
63 * value issued |
|
64 */ |
|
65 TInt SetBitrate( TUint aBitrate ); |
|
66 |
|
67 /** |
|
68 * Set Allowed Bitrate |
|
69 * @return |
|
70 */ |
|
71 TInt SetAllowedBitrates( TUint aBitrates ); |
|
72 |
|
73 /** |
|
74 * Sets the codec specific mode. |
|
75 * @param aCodecMode mode of the codec |
|
76 * @return KErrNotSupported if codec doesnt' support codec mode |
|
77 * value issued |
|
78 */ |
|
79 TInt SetCodecMode( TUint aCodecMode ); |
|
80 |
|
81 /** |
|
82 * Sets the payload type. |
|
83 * @param aPayloadType type identifier of the payload |
|
84 * @return KErrNotSupported if codec doesn't support payload type issued |
|
85 */ |
|
86 TInt SetPayloadType( TUint8 aPayloadType ); |
|
87 |
|
88 /** |
|
89 * Returns max bit rate |
|
90 * @return max bit rate |
|
91 */ |
|
92 TUint GetMaxBitRate(); |
|
93 |
|
94 /** |
|
95 * Sets codec enabled/disabled. |
|
96 * @param aIsEnabled |
|
97 */ |
|
98 void SetEnabled( TBool aIsEnabled ); |
|
99 |
|
100 /** |
|
101 * Check if codec can send. |
|
102 * @return ETrue if can send |
|
103 */ |
|
104 TBool SendSupported(); |
|
105 |
|
106 #ifdef MCE_COMMON_SERVER_SIDE |
|
107 |
|
108 |
|
109 /** |
|
110 * Creates server stream(s) for this codec |
|
111 * @param aCodecIndex |
|
112 * @param aStreams stream is added to the array |
|
113 * @param aAudio |
|
114 * @param aManager |
|
115 */ |
|
116 void DoDecodeAudioL( TInt aCodecIndex, |
|
117 RPointerArray<CMceSrvStream>& aStreams, |
|
118 CMceComAudioStream& aAudio, |
|
119 CMceMediaManager& aManager ); |
|
120 |
|
121 protected: // from CMceComCodec |
|
122 |
|
123 /** |
|
124 * Validates codec values based on mcc codec |
|
125 * @param aMccCodec mcc codec |
|
126 * @param aStream stream |
|
127 * @param aRole role |
|
128 */ |
|
129 CMceComCodec* DoMccValidateL( CMccCodecInformation& aMccCodec, |
|
130 CMceSrvStream& aStream, |
|
131 TMceNegotiationRole aRole ); |
|
132 |
|
133 #endif |
|
134 |
|
135 public: // serialization etc |
|
136 |
|
137 /** |
|
138 * Clones |
|
139 */ |
|
140 CMceComAudioCodec* CloneL(); |
|
141 |
|
142 |
|
143 private: |
|
144 |
|
145 /** |
|
146 * C++ default constructor. |
|
147 */ |
|
148 CMceComDtmfCodec(); |
|
149 |
|
150 /** |
|
151 * By default Symbian 2nd phase constructor is private. |
|
152 */ |
|
153 void ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName); |
|
154 |
|
155 /** |
|
156 * second-phase copy constructor |
|
157 */ |
|
158 void ConstructL( CMceComDtmfCodec& aCodec ); |
|
159 |
|
160 |
|
161 }; |
|
162 |
|
163 |
|
164 #endif // CMCECOMDTMFCODEC_H |
|
165 |
|
166 // End of File |