|
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 MCEH263CODEC_H |
|
22 #define MCEH263CODEC_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <mcevideocodec.h> |
|
26 #include <mcedefs.h> |
|
27 |
|
28 // CONSTANTS |
|
29 |
|
30 const TUint KMceH263FrameHeight = 176; |
|
31 const TUint KMceH263FrameWidth = 144; |
|
32 const TUint KMceH263ClockRate = 90000; |
|
33 const TReal KMceH263FrameRate = 15; |
|
34 |
|
35 const TInt KMceH263Level10Bitrate = 64000; |
|
36 const TInt KMceH263Level45Bitrate = 128000; |
|
37 |
|
38 const TUint KMceAllowedH263Bitrate10 = 0x0001; |
|
39 const TUint KMceAllowedH263Bitrate45 = 0x0002; |
|
40 const TUint KMceAllowedH263BitrateAll = 0x00FF; |
|
41 |
|
42 |
|
43 // CLASS DECLARATION |
|
44 |
|
45 /** |
|
46 * Class for the H263 codec information. |
|
47 * |
|
48 * It checks the validity of inserted values for H263 |
|
49 * |
|
50 * @lib mceclient.lib |
|
51 */ |
|
52 class CMceH263Codec : public CMceVideoCodec |
|
53 { |
|
54 |
|
55 public: // Constructors and destructor |
|
56 |
|
57 /** |
|
58 * Destructor. |
|
59 */ |
|
60 IMPORT_C ~CMceH263Codec(); |
|
61 |
|
62 public: |
|
63 |
|
64 /** |
|
65 * Two-phased constructor. |
|
66 * @param aSdpName sdp name |
|
67 */ |
|
68 IMPORT_C static CMceH263Codec* NewL( TBuf8<KMceMaxSdpNameLength> aSdpName); |
|
69 |
|
70 /** |
|
71 * Two-phased constructor. |
|
72 * @param aSdpName sdp name |
|
73 */ |
|
74 IMPORT_C static CMceH263Codec* NewLC( TBuf8<KMceMaxSdpNameLength> aSdpName ); |
|
75 |
|
76 public: // From base classes |
|
77 |
|
78 /** |
|
79 * Sets bitrate used with codec for encoding. |
|
80 * @param aBitrate bitrate value for encoding |
|
81 * @return KErrNotSupported if codec doesn't support bitrate |
|
82 * value issued |
|
83 */ |
|
84 virtual TInt SetBitrate( TUint aBitrate ); |
|
85 |
|
86 /** |
|
87 * Sets bitrates allowed with codec. |
|
88 * @param aBitrates allowed bitrate values |
|
89 * @return KErrNotSupported if codec doesn't support bitrate |
|
90 * values issued |
|
91 */ |
|
92 virtual TInt SetAllowedBitrates( TUint aBitrates ); |
|
93 |
|
94 /** |
|
95 * Sets the codec specific mode. |
|
96 * @param aCodecMode mode of the codec |
|
97 * @return KErrNotSupported if codec doesnt' support codec mode |
|
98 * value issued |
|
99 */ |
|
100 virtual TInt SetCodecMode( TUint aCodecMode ); |
|
101 |
|
102 /** |
|
103 * Sets the payload type. |
|
104 * @param aPayloadType type identifier of the payload |
|
105 * @return KErrNotSupported if codec doesn't support payload type issued |
|
106 */ |
|
107 virtual TInt SetPayloadType( TUint8 aPayloadType ); |
|
108 |
|
109 /** |
|
110 * Clones the codec. |
|
111 * @return cloned codec; ownership is transferred |
|
112 */ |
|
113 virtual CMceVideoCodec* CloneL() const; |
|
114 |
|
115 /** |
|
116 * Sets maximum bitrate of the codec. |
|
117 * @param aMaxBitrate value of maximum bitrate used for encoding |
|
118 * @leave KErrNotSupported if codec doesn't support frame sizes issued |
|
119 */ |
|
120 virtual void SetMaxBitrateL( TUint aMaxBitrate ); |
|
121 |
|
122 /** |
|
123 * Sets resolutions allowed with the codec. |
|
124 * @param aResolutions bitfield of allowed resolutions |
|
125 * @leave KErrNotSupported if codec doesn't support resolutions issued |
|
126 */ |
|
127 virtual void SetAllowedResolutionsL( TUint aResolutions ); |
|
128 |
|
129 /** |
|
130 * Sets resolution of the video. |
|
131 * @param aResolution resolution of the video in pixels |
|
132 * @leave KErrNotSupported if codec doesn't support resolution issued |
|
133 */ |
|
134 virtual void SetResolutionL( TSize aResolution ); |
|
135 |
|
136 /** |
|
137 * Sets frame rates allowed with the codec. |
|
138 * @param aFrameRates allowed frame rate values as a bitfield |
|
139 * @leave KErrNotSupported if codec doesn't support frame rates issued |
|
140 */ |
|
141 virtual void SetAllowedFrameRatesL( TUint aFrameRates ); |
|
142 |
|
143 /** |
|
144 * Sets frame rate used with the codec for encoding. |
|
145 * @param aFrameRate frame rate for encoding |
|
146 * @leave KErrNotSupported if codec doesn't support frame rate value |
|
147 * issued |
|
148 */ |
|
149 virtual void SetFrameRateL( TReal aFrameRate ); |
|
150 |
|
151 /** |
|
152 * Sets preferred encoding device for uplink stream and preferred decoding |
|
153 * device for downlink stream. |
|
154 * @param aEncodingDecodingDevice |
|
155 * @leave KErrNotSupported if setting preferred device is not possible |
|
156 */ |
|
157 virtual void SetPreferredEncodingDecodingDeviceL( |
|
158 TUid aEncodingDecodingDevice ); |
|
159 |
|
160 /** |
|
161 * Set config key (sprop-parameter-sets) |
|
162 * @param aConfigKey, config key as Base64 encoded |
|
163 * @leave KErrNotSupported if setting config key is not possible |
|
164 */ |
|
165 virtual void SetConfigKeyL( const TDesC8& aConfigKey ); |
|
166 |
|
167 |
|
168 private: // Helper functions |
|
169 |
|
170 /** |
|
171 * Sets the sdp name. |
|
172 * @param aSdpName the sdp name |
|
173 */ |
|
174 void SetSdpNameL( const TDesC8& aSdpName ); |
|
175 |
|
176 private: // Constructors |
|
177 |
|
178 /** |
|
179 * C++ default constructor. |
|
180 */ |
|
181 CMceH263Codec(); |
|
182 |
|
183 /** |
|
184 * By default Symbian 2nd phase constructor is private. |
|
185 */ |
|
186 void ConstructL( TBuf8<KMceMaxSdpNameLength> aSdpName); |
|
187 |
|
188 //for testing |
|
189 |
|
190 MCE_UNIT_TEST_DEFS |
|
191 |
|
192 }; |
|
193 |
|
194 |
|
195 #endif |
|
196 |
|
197 // End of File |