1 /* |
|
2 * Copyright (c) 2006-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: Fake implementation for the unittest_cxequalitypresetssymbian |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef IMAGINGCONFIGMANAGER_H |
|
20 #define IMAGINGCONFIGMANAGER_H |
|
21 |
|
22 #include <mmf\common\mmfutilities.h> |
|
23 |
|
24 const TUint KMaxStringLength = 256; |
|
25 |
|
26 /* |
|
27 * Video quality set structure |
|
28 */ |
|
29 class TVideoQualitySet |
|
30 { |
|
31 public: |
|
32 // Enum level for the Quality set, used as ID |
|
33 TUint iVideoQualitySetLevel; |
|
34 // Video file format mime type, e.g. "video/3gpp" |
|
35 TText8 iVideoFileMimeType[ KMaxStringLength ]; |
|
36 // Video codec mime type, e.g. "video/mp4v-es" |
|
37 TText8 iVideoCodecMimeType[ KMaxStringLength ]; |
|
38 // Video picture width in pixels (luminance), resolution width |
|
39 TInt iVideoWidth; |
|
40 // Video picture height in pixels (luminance), resolution height |
|
41 TInt iVideoHeight; |
|
42 // Video framerate in fps |
|
43 TReal iVideoFrameRate; |
|
44 // Video bitrate in bps |
|
45 TInt iVideoBitRate; |
|
46 // Video encoder UID |
|
47 TUid iVideoEncoderUID; |
|
48 // Random access point rate, in pictures per second. For example, to |
|
49 // request a random access point every ten seconds, set the value to |
|
50 // 0.1. Random access means in video case usually that an INTRA frame |
|
51 // is forced by the encoder to make the video accessible at that time |
|
52 // without depending on the previous frames |
|
53 TReal iRandomAccessRate; |
|
54 // Video's pixel aspect ratio numerator, e.g. in PAL 16:11 pixel |
|
55 // aspect ratio means that this value is set to 16 |
|
56 TUint iVideoPixelAspectRatioNum; |
|
57 // Video's pixel aspect ratio denominator, e.g. in PAL 16:11 pixel |
|
58 // aspect ratio means that this value is set to 11 |
|
59 TUint iVideoPixelAspectRatioDenom; |
|
60 // Preferred supplier for the MMF camcorder plug-in (e.g. "Nokia") |
|
61 TText8 iPreferredSupplier[ KMaxStringLength ]; |
|
62 |
|
63 // Audio codec FourCC, e.g. " AMR" |
|
64 TFourCC iAudioFourCCType; |
|
65 // Audio bitrate in bps |
|
66 TInt iAudioBitRate; |
|
67 // Audio sampling rate in Hz |
|
68 TInt iAudioSamplingRate; |
|
69 // Number of audio channels; in practice mono(1) vs stereo(2) |
|
70 TInt iAudioChannels; |
|
71 // Audio encoder UID |
|
72 TUid iAudioEncoderUID; |
|
73 // Video recording A/V sync start delay (ms), only used by |
|
74 // CamcorderMMFPlugIn, but depends on the qualityset |
|
75 TInt iAVSyncStartDelay; |
|
76 // Video recording A/V sync resume delay (ms), only used by |
|
77 // CamcorderMMFPlugIn, but depends on the qualityset |
|
78 TInt iAVSyncResumeDelay; |
|
79 // A non-zero ID telling unique combination of camera (primary/ |
|
80 // secondary) and/or display (cover UI/main display) and/or rotation |
|
81 // setting combined into a number for separating each setting set |
|
82 // type from others |
|
83 TUint iCameraDisplayId; |
|
84 // Camcorder specific field that can be either 1(true) or 0(false) |
|
85 // meaning if the current quality settings set should be shown on |
|
86 // Camcorder UI or not |
|
87 TUint iCamcorderVisible; |
|
88 }; |
|
89 |
|
90 |
|
91 /* |
|
92 * Image quality set structure |
|
93 */ |
|
94 class TImageQualitySet |
|
95 { |
|
96 public: |
|
97 // Enum level for the Quality set, used as ID |
|
98 TUint iImageQualitySetLevel; |
|
99 // Image file format mime type, e.g. "image/jpeg" |
|
100 TText8 iImageFileMimeType[ KMaxStringLength ]; |
|
101 // Image picture width in pixels, resolution width |
|
102 TInt iImageWidth; |
|
103 // Image picture height in pixels, resolution height |
|
104 TInt iImageHeight; |
|
105 // Image extension, e.g. ".jpg" |
|
106 TText8 iImageFileExtension[ KMaxStringLength ]; |
|
107 // Image encoder UID |
|
108 TUid iImageEncoderUID; |
|
109 // Compression quality, determines wether file size or image quality |
|
110 // is preferred over the other |
|
111 TInt iCompressionQuality; |
|
112 // Estimated image size, in bytes |
|
113 TInt iEstimatedSize; |
|
114 // A non-Zero ID telling unique combination of camera (primary/ |
|
115 // secondary) and/or display (cover UI/main display) and/or rotation |
|
116 // setting combined into a number for separating each setting set type |
|
117 // from others |
|
118 TUint iCameraDisplayId; |
|
119 // Camcorder specific field that can be either 1(true) or 0(false) |
|
120 // meaning if the current quality settings set should be shown on |
|
121 // Camcorder UI or not |
|
122 TUint iCamcorderVisible; |
|
123 }; |
|
124 |
|
125 /* |
|
126 * Camcorder MMF Plug-in Specific settings structure |
|
127 * |
|
128 */ |
|
129 class TCamcorderMMFPluginSettings |
|
130 { |
|
131 public: |
|
132 // Video framerate in nightmode (fps) |
|
133 TReal iVideoNightFrameRate; |
|
134 // Video bitrate scaler for remaining time calculation during |
|
135 // first 3seconds. |
|
136 TReal iCMRAvgVideoBitRateScaler; |
|
137 // Video Complexity Setting |
|
138 TInt iVideoComplexitySetting; |
|
139 // Quality is more important in camcorder than delay |
|
140 TReal iCMRLatencyQualityTradeoff; |
|
141 // range is [0...100] |
|
142 TUint iCMRPictureQuality; |
|
143 // Try to maintain the frame-rate, |
|
144 // 1.0 means the picture quality is sacrificed |
|
145 // "all the way" to match the target fps |
|
146 TReal iCMRQualityTemporalTradeoff; |
|
147 // number of camera buffers to use when using HW accelerated encoder |
|
148 TUint iCMRNumCameraBuffers; |
|
149 // number of camera buffers to use when using SW encoder |
|
150 TUint iCMRNumCameraBuffersARM; |
|
151 // min number of output (bitstream) buffers |
|
152 TUint iCMRMinNumOutputBuffers; |
|
153 }; |
|
154 |
|
155 /** |
|
156 * Fake API class for emulate imaging configurations and settings |
|
157 */ |
|
158 class CImagingConfigManager : public CBase |
|
159 { |
|
160 public: |
|
161 |
|
162 // two phase constructor |
|
163 static CImagingConfigManager* NewL(); |
|
164 |
|
165 |
|
166 // Destructor |
|
167 ~CImagingConfigManager(); |
|
168 |
|
169 // Returns number of video quality levels |
|
170 TInt NumberOfVideoQualityLevels() const; |
|
171 |
|
172 // Get video quality levels |
|
173 TInt GetVideoQualityLevelsL( CArrayFixFlat<TUint>& aLevels, |
|
174 TUint aCameraDisplayID = 0 ); |
|
175 |
|
176 /// returns video quality set and symbian error code if any. |
|
177 TInt GetVideoQualitySet( TVideoQualitySet& aSet, |
|
178 TInt aLevel, |
|
179 TUint aCameraDisplayID = 0 ); |
|
180 |
|
181 // Get all settings for Camcorder |
|
182 TInt GetCamcorderMMFPluginSettings(TCamcorderMMFPluginSettings& aSet) const; |
|
183 |
|
184 // returns number of image quality levels |
|
185 TInt NumberOfImageQualityLevels() const; |
|
186 |
|
187 // Get image quality levels |
|
188 TInt GetImageQualityLevelsL( CArrayFixFlat<TUint>& aLevels, |
|
189 TUint aCameraDisplayID = 0 ); |
|
190 |
|
191 // Get image quality set |
|
192 TInt GetImageQualitySet( TImageQualitySet& aSet, |
|
193 TInt aLevel, |
|
194 TUint aCameraDisplayID = 0 ); |
|
195 |
|
196 private: |
|
197 CImagingConfigManager(); |
|
198 // helper method to init image quality set |
|
199 void initImageQualitySet(TImageQualitySet& aSet); |
|
200 void initVideoQualitySet(TVideoQualitySet& aSet); |
|
201 private: |
|
202 CArrayFixFlat< TVideoQualitySet >* iVideoQualitySets; |
|
203 CArrayFixFlat< TImageQualitySet >* iImageQualitySets; |
|
204 |
|
205 }; |
|
206 |
|
207 #endif //IMAGINGCONFIGMANAGER_H |
|