1 /* |
|
2 * Copyright (c) 2002 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: Camera Application Engine video quality level and container |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CAEVIDEOQUALITYLEVELS_H |
|
21 #define CAEVIDEOQUALITYLEVELS_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <ecam.h> |
|
25 #include <e32base.h> |
|
26 #include <e32std.h> |
|
27 #include "CaeSdKeys.h" |
|
28 #include "CaeQualityLevels.h" |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 const TInt KCaeMaxVideoStringParLength = 32; |
|
33 const TInt KCaeMaxAudioTypeStringParLength = 4; |
|
34 |
|
35 const TInt KCaeMaxVideoQltyLevelCount = 6; |
|
36 |
|
37 const TInt KImgWidthSubQCIF = 128; |
|
38 const TInt KImgHeightSubQCIF = 96; |
|
39 |
|
40 const TInt KImgWidthQCIF = 176; |
|
41 const TInt KImgHeightQCIF = 144; |
|
42 |
|
43 const TInt KImgWidthCIF = 352; |
|
44 const TInt KImgHeightCIF = 288; |
|
45 |
|
46 _LIT8(KVideoMimeType, "video/3gpp"); |
|
47 |
|
48 _LIT(KPreferredSupplier, "Nokia"); |
|
49 |
|
50 _LIT8(KVideoType, "video/H263-2000"); |
|
51 |
|
52 _LIT8(KAudioType, " AMR"); |
|
53 |
|
54 |
|
55 // FORWARD DECLARATIONS |
|
56 class CVideoQualityLevel; |
|
57 |
|
58 |
|
59 // CLASS DECLARATION |
|
60 |
|
61 /** |
|
62 * Camera Application Engine video recording quality levels container. |
|
63 * |
|
64 */ |
|
65 NONSHARABLE_CLASS( CCaeVideoQualityLevelsCont ) : public CCaeQualityLevelsCont |
|
66 { |
|
67 |
|
68 public: // Constructors and destructor |
|
69 |
|
70 /** |
|
71 * Destructor. |
|
72 */ |
|
73 virtual ~CCaeVideoQualityLevelsCont(); |
|
74 |
|
75 /** |
|
76 * Two-phased constructor. |
|
77 */ |
|
78 static CCaeVideoQualityLevelsCont* NewL(); |
|
79 |
|
80 /** |
|
81 * Initializes quality levels to hardcoded default values. |
|
82 * @since 2.1 |
|
83 * @return The count of quality levels initialized |
|
84 */ |
|
85 TInt InitDefaultsL(); |
|
86 |
|
87 /** |
|
88 * Gets the quality level count. |
|
89 * @since 2.1 |
|
90 * @return Quality level count |
|
91 */ |
|
92 TInt Count() const; |
|
93 |
|
94 /** |
|
95 * Gets the specified quality level. |
|
96 * @since 2.1 |
|
97 * @param aIndex Quality level index |
|
98 * @return Video quality level |
|
99 */ |
|
100 CVideoQualityLevel& At( |
|
101 TInt aIndex ) const; |
|
102 |
|
103 /** |
|
104 * Gets the Shared Data key of specified quality level. |
|
105 * @since 2.1 |
|
106 * @param aIndex Quality level index |
|
107 * @return Shared Data key |
|
108 */ |
|
109 const TDes& Key( |
|
110 TInt aIndex ) const; |
|
111 |
|
112 private: |
|
113 |
|
114 /** |
|
115 * C++ constructor. |
|
116 */ |
|
117 CCaeVideoQualityLevelsCont(); |
|
118 |
|
119 /** |
|
120 * Symbian OS 2nd phase constructor that can leave. |
|
121 */ |
|
122 void ConstructL(); |
|
123 |
|
124 private: |
|
125 |
|
126 /** |
|
127 * Resizes quality level array. |
|
128 * @since 2.1 |
|
129 * @param aQualityLevelCount Quality level count for the new array |
|
130 * @return void |
|
131 */ |
|
132 void ResizeL( |
|
133 TInt aQualityLevelCount ); |
|
134 |
|
135 /** |
|
136 * Gets the quality level count Shared Data key. |
|
137 * @since 2.1 |
|
138 * @return Quality level count Shared Data key |
|
139 */ |
|
140 const TDesC& QltyLevelCountSdKey() const; |
|
141 |
|
142 private: // For Shared Data support. |
|
143 |
|
144 /** |
|
145 * Creates quality level string for SharedData Camera ini file. |
|
146 * @since 2.1 |
|
147 * @param aIndex Quality level index |
|
148 * @param aDefaultQualityLevel Output quality level string |
|
149 * @return void |
|
150 */ |
|
151 void CreateQualityLevelString( |
|
152 TInt aIndex, |
|
153 TDes& aDefaultQualityLevel ); |
|
154 |
|
155 /** |
|
156 * Parses quality level string to quality level object data. |
|
157 * @since 2.1 |
|
158 * @param aQualityLevelString Quality level string to parse |
|
159 * @param aIndex Quality level index |
|
160 * @return void |
|
161 */ |
|
162 void ParseQualityLevelFromStringL( |
|
163 const TDesC& aQualityLevelString, |
|
164 TInt aIndex ); |
|
165 |
|
166 private: |
|
167 |
|
168 // Supported video recording quality levels. |
|
169 CArrayFixFlat<CVideoQualityLevel>* iQualityLevels; |
|
170 |
|
171 // Quality level count Shared Data key. |
|
172 const TDesC& iQltyLevelCountSdKey; |
|
173 }; |
|
174 |
|
175 |
|
176 |
|
177 // CLASS DECLARATION |
|
178 |
|
179 /** |
|
180 * Camera Application Engine video recording quality level. |
|
181 * |
|
182 */ |
|
183 NONSHARABLE_CLASS( CVideoQualityLevel ) : public CQualityLevel |
|
184 { |
|
185 public: |
|
186 |
|
187 /** |
|
188 * Constructor. |
|
189 */ |
|
190 CVideoQualityLevel(); |
|
191 |
|
192 /** |
|
193 * Destructor. |
|
194 */ |
|
195 virtual ~CVideoQualityLevel(); |
|
196 |
|
197 public: |
|
198 |
|
199 // The video recording frame size. |
|
200 TSize iFrameSize; |
|
201 |
|
202 // The video recording frame rate. |
|
203 TReal32 iFrameRate; |
|
204 |
|
205 // The video recording bit rate. |
|
206 TInt iBitRate; |
|
207 |
|
208 // A Boolean indicating if video recording audio is enabled or not. |
|
209 TBool iAudioEnabled; |
|
210 |
|
211 // The video recording audio bit rate. |
|
212 TInt iAudioBitRate; |
|
213 |
|
214 // The video MIME type (e.g. "video/3gpp"). |
|
215 TBuf8<KCaeMaxVideoStringParLength> iMimeType; |
|
216 |
|
217 // The preferred supplier of video controller (e.g. "Company X"). |
|
218 TBuf<KCaeMaxVideoStringParLength> iPreferredSupplier; |
|
219 |
|
220 // The video type (e.g. "video/H263-2000"). |
|
221 TBuf8<KCaeMaxVideoStringParLength> iVideoType; |
|
222 |
|
223 // The audio type expressed with four characters (e.g. " AMR"). |
|
224 TBuf8<KCaeMaxAudioTypeStringParLength> iAudioType; |
|
225 |
|
226 // The estimated video recording bit rate to storage (bits per second). |
|
227 TInt iStorageRate; |
|
228 }; |
|
229 |
|
230 |
|
231 #endif // CAEVIDEOQUALITYLEVELS_H |
|