|
1 /* |
|
2 * Copyright (c) 2003 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 #ifndef __VEDCOMMON_H__ |
|
20 #define __VEDCOMMON_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 |
|
24 |
|
25 /** |
|
26 * Constants for video clip speed settings. The speed is given by % x10, i.e. 1000 means 100 %. |
|
27 */ |
|
28 const TInt KVedNormalSpeed(1000); |
|
29 const TInt KVedMaxSpeed(1000); |
|
30 const TInt KVedMinSpeed(1); |
|
31 |
|
32 |
|
33 /** |
|
34 * Enumeration for video clip classes. |
|
35 */ |
|
36 enum TVedVideoClipClass |
|
37 { |
|
38 EVedVideoClipClassFile = 15001, |
|
39 EVedVideoClipClassGenerated |
|
40 }; |
|
41 |
|
42 |
|
43 /** |
|
44 * Enumeration for bitrate modes. |
|
45 */ |
|
46 enum TVedBitrateMode |
|
47 { |
|
48 EVedBitrateModeUnrecognized = 18001, |
|
49 EVedBitrateModeConstant, |
|
50 EVedBitrateModeVariable, |
|
51 EVedBitrateModeLast // should always be the last one |
|
52 }; |
|
53 |
|
54 /** |
|
55 * Enumeration for video bitstream modes. |
|
56 */ |
|
57 enum TVedVideoBitstreamMode |
|
58 { |
|
59 EVedVideoBitstreamModeUnknown = 0, /* unrecognized mode; outside of H.263 Profile 0 Level 10, or MPEG-4 Visual Simple Profile */ |
|
60 EVedVideoBitstreamModeH263, /* H.263 Simple Profile (Profile 0, Level 10) */ |
|
61 EVedVideoBitstreamModeMPEG4ShortHeader, /* MPEG-4 Visual Simple Profile - Short Header */ |
|
62 EVedVideoBitstreamModeMPEG4Regular, /* MPEG-4 Visual Simple Profile - Regular */ |
|
63 EVedVideoBitstreamModeMPEG4Resyn, /* MPEG-4 Visual Simple Profile - Regular with Resynchronization Markers */ |
|
64 EVedVideoBitstreamModeMPEG4DP, /* MPEG-4 Visual Simple Profile - Data Partitioned */ |
|
65 EVedVideoBitstreamModeMPEG4DP_RVLC, /* MPEG-4 Visual Simple Profile - Data Partitioned with Reversible VLCs */ |
|
66 EVedVideoBitstreamModeMPEG4Resyn_DP, /* MPEG-4 Visual Simple Profile - Data Partitioned with Resynchronization Markers */ |
|
67 EVedVideoBitstreamModeMPEG4Resyn_DP_RVLC, /* MPEG-4 Visual Simple Profile - Data Partitioned with Reversible VLCs & Resynchronization Markers */ |
|
68 EVedVideoBitstreamModeAVC |
|
69 }; |
|
70 |
|
71 |
|
72 |
|
73 /* Video format of bitstream - used everywhere */ |
|
74 enum TVedVideoType |
|
75 { |
|
76 EVedVideoTypeUnrecognized = 13001, /* should always be the first one */ |
|
77 EVedVideoTypeNoVideo, /* video is not present */ |
|
78 EVedVideoTypeH263Profile0Level10, /* H.263 Simple Profile (Profile 0, Level 10) */ |
|
79 EVedVideoTypeH263Profile0Level45, /* H.263 Simple Profile (Profile 0, Level 45) */ |
|
80 EVedVideoTypeMPEG4SimpleProfile, /* MPEG-4 Visual Simple Profile (any mode) */ |
|
81 EVedVideoTypeAVCBaselineProfile, /* AVC Baseline Profile */ |
|
82 EVedVideoTypeLast /* should always be the last one */ |
|
83 }; |
|
84 |
|
85 /** |
|
86 * Enumeration for video formats. |
|
87 */ |
|
88 enum TVedVideoFormat |
|
89 { |
|
90 EVedVideoFormatUnrecognized = 11001, // should always be the first one |
|
91 EVedVideoFormat3GPP, |
|
92 EVedVideoFormatMP4, |
|
93 EVedVideoFormatLast // should always be the last one |
|
94 }; |
|
95 |
|
96 /** |
|
97 * Enumeration for audio formats. |
|
98 */ |
|
99 enum TVedAudioFormat |
|
100 { |
|
101 EVedAudioFormatUnrecognized = 16001, // should always be the first one |
|
102 EVedAudioFormat3GPP, |
|
103 EVedAudioFormatMP4, |
|
104 EVedAudioFormatAMR, |
|
105 EVedAudioFormatAMRWB, |
|
106 EVedAudioFormatMP3, |
|
107 EVedAudioFormatAAC_ADIF, |
|
108 EVedAudioFormatAAC_ADTS, |
|
109 EVedAudioFormatWAV, |
|
110 EVedAudioFormatLast // should always be the last one |
|
111 }; |
|
112 |
|
113 |
|
114 /** |
|
115 * Enumeration for audio types (that is, codecs). |
|
116 */ |
|
117 enum TVedAudioType |
|
118 { |
|
119 EVedAudioTypeUnrecognized = 14001, // should always be the first one |
|
120 EVedAudioTypeNoAudio, |
|
121 EVedAudioTypeAMR, |
|
122 EVedAudioTypeAMRWB, |
|
123 EVedAudioTypeMP3, |
|
124 EVedAudioTypeAAC_LC, |
|
125 EVedAudioTypeAAC_LTP, |
|
126 EVedAudioTypeWAV, |
|
127 EVedAudioTypeLast // should always be the last one |
|
128 }; |
|
129 |
|
130 /** |
|
131 * Enumeration for audio channel modes. |
|
132 */ |
|
133 enum TVedAudioChannelMode |
|
134 { |
|
135 EVedAudioChannelModeUnrecognized = 17001, |
|
136 EVedAudioChannelModeStereo, |
|
137 EVedAudioChannelModeDualChannel, |
|
138 EVedAudioChannelModeSingleChannel |
|
139 }; |
|
140 |
|
141 /** |
|
142 * Output parameter class |
|
143 */ |
|
144 |
|
145 class TVedOutputParameters |
|
146 { |
|
147 public: |
|
148 // default constructor; initializes optional parameters to values which mean that editor can decide the value |
|
149 inline TVedOutputParameters() |
|
150 : iVideoType(EVedVideoTypeH263Profile0Level10), iVideoResolution(TSize(0,0)), iVideoBitrate(0), iVideoFrameRate(0), |
|
151 iAudioType(EVedAudioTypeAMR), iAudioBitrate(0), iAudioChannelMode(EVedAudioChannelModeSingleChannel), iAudioSamplingRate(0), |
|
152 iSyncIntervalInPicture(0), iSegmentSizeInBytes(0) |
|
153 {} |
|
154 |
|
155 public: |
|
156 |
|
157 // video codec |
|
158 TVedVideoType iVideoType; |
|
159 // target resolution, 0 = no preference (use from input) |
|
160 TSize iVideoResolution; |
|
161 // target video bitrate, 0 = no preference |
|
162 TInt iVideoBitrate; |
|
163 // target video framerate, 0 = no preference |
|
164 TReal iVideoFrameRate; |
|
165 |
|
166 // audio codec |
|
167 TVedAudioType iAudioType; |
|
168 // target audio bitrate, 0 = no preference |
|
169 TInt iAudioBitrate; |
|
170 // audio channel mode |
|
171 TVedAudioChannelMode iAudioChannelMode; |
|
172 // audio sampling rate, 0 = no preference |
|
173 TInt iAudioSamplingRate; |
|
174 |
|
175 // Segment interval in picture. In H.263 baseline this means number of non-empty GOB headers (1=every GOB has a header), |
|
176 // Default is 0 == no segments inside picture |
|
177 // Coding standard & used profile etc. limit the value. |
|
178 TInt iSyncIntervalInPicture; |
|
179 |
|
180 // Target size of each coded video segment. Valid for H.264 and MPEG-4 |
|
181 // Default is 0 == no segments inside picture |
|
182 TInt iSegmentSizeInBytes; |
|
183 |
|
184 }; |
|
185 |
|
186 |
|
187 /** |
|
188 * Enumeration for start transition effects. |
|
189 */ |
|
190 enum TVedStartTransitionEffect |
|
191 { |
|
192 EVedStartTransitionEffectNone = 21001, // should always be the first one |
|
193 EVedStartTransitionEffectFadeFromBlack, |
|
194 EVedStartTransitionEffectFadeFromWhite, |
|
195 EVedStartTransitionEffectLast // should always be the last one |
|
196 }; |
|
197 |
|
198 |
|
199 /** |
|
200 * Enumeration for middle transition effects. |
|
201 */ |
|
202 enum TVedMiddleTransitionEffect |
|
203 { |
|
204 EVedMiddleTransitionEffectNone = 22001, // should always be the first one |
|
205 EVedMiddleTransitionEffectDipToBlack, |
|
206 EVedMiddleTransitionEffectDipToWhite, |
|
207 EVedMiddleTransitionEffectCrossfade, |
|
208 EVedMiddleTransitionEffectWipeLeftToRight, |
|
209 EVedMiddleTransitionEffectWipeRightToLeft, |
|
210 EVedMiddleTransitionEffectWipeTopToBottom, |
|
211 EVedMiddleTransitionEffectWipeBottomToTop, |
|
212 EVedMiddleTransitionEffectLast // should always be the last one |
|
213 }; |
|
214 |
|
215 |
|
216 /** |
|
217 * Enumeration for end transition effects. |
|
218 */ |
|
219 enum TVedEndTransitionEffect |
|
220 { |
|
221 EVedEndTransitionEffectNone = 23001, // should always be the first one |
|
222 EVedEndTransitionEffectFadeToBlack, |
|
223 EVedEndTransitionEffectFadeToWhite, |
|
224 EVedEndTransitionEffectLast // should always be the last one |
|
225 }; |
|
226 |
|
227 |
|
228 /** |
|
229 * Enumeration for color effects. |
|
230 */ |
|
231 enum TVedColorEffect |
|
232 { |
|
233 EVedColorEffectNone = 31001, // should always be the first one |
|
234 EVedColorEffectBlackAndWhite, |
|
235 EVedColorEffectToning, |
|
236 EVedColorEffectLast // should always be the last one |
|
237 }; |
|
238 |
|
239 |
|
240 /** |
|
241 * Class for storing dynamic level marks. |
|
242 */ |
|
243 class TVedDynamicLevelMark |
|
244 { |
|
245 public: |
|
246 /** Mark time. */ |
|
247 TTimeIntervalMicroSeconds iTime; |
|
248 |
|
249 /** |
|
250 * Dynamic level (-63.5 - +12.7) in dB:s; one step represents +0.1 or -0.5 dB => values are -127...+127 |
|
251 */ |
|
252 TInt8 iLevel; |
|
253 |
|
254 /** |
|
255 * Constructs a new dynamic level mark. |
|
256 * |
|
257 * @param aTime time for the mark |
|
258 * @param aLevel dynamic level (-63.5 ... +12.7) in dB:s one step = +0.1 or -0.5 dB => values can be -127...+127 |
|
259 */ |
|
260 inline TVedDynamicLevelMark(TTimeIntervalMicroSeconds aTime, TInt aLevel); |
|
261 |
|
262 /** |
|
263 * Constructs a new dynamic level mark from existing instance. |
|
264 * |
|
265 * @param aMark dynamic level mark to copy |
|
266 */ |
|
267 inline TVedDynamicLevelMark(const TVedDynamicLevelMark& aMark); |
|
268 }; |
|
269 |
|
270 |
|
271 /** |
|
272 * Transcode factor. |
|
273 */ |
|
274 struct TVedTranscodeFactor |
|
275 { |
|
276 TInt iTRes; |
|
277 TVedVideoBitstreamMode iStreamType; |
|
278 }; |
|
279 |
|
280 |
|
281 /** |
|
282 * Enumerates video editor engine panic codes and |
|
283 * provides a static Panic() function. |
|
284 * |
|
285 */ |
|
286 class TVedPanic |
|
287 { |
|
288 public: |
|
289 enum TVedPanicCodes |
|
290 { |
|
291 EInternal = 1, // internal error (that is, a bug in the video editor engine) |
|
292 EDeprecated, // deprecated class or method |
|
293 EVideoClipInfoNotReady, |
|
294 EVideoClipInfoIllegalVideoFrameIndex, |
|
295 EVideoClipInfoIllegalVideoFrameTime, |
|
296 EVideoClipInfoFrameOperationAlreadyRunning, |
|
297 EVideoClipInfoIllegalFrameResolution, |
|
298 EVideoClipInfoNoFileAssociated, |
|
299 EVideoClipInfoNoGeneratorAssociated, |
|
300 EAudioClipInfoNotReady, //10 |
|
301 EMovieEmpty, |
|
302 EMovieAddOperationAlreadyRunning, |
|
303 EMovieIllegalStartTransitionEffect, |
|
304 EMovieIllegalMiddleTransitionEffect, |
|
305 EMovieIllegalEndTransitionEffect, |
|
306 EMovieProcessingOperationAlreadyRunning, |
|
307 EMovieObserverAlreadyRegistered, |
|
308 EMovieObserverNotRegistered, |
|
309 EMovieIllegalQuality, |
|
310 EVideoClipIllegalIndex, //20 |
|
311 EVideoClipIllegalSpeed, |
|
312 EVideoClipIllegalColorEffect, |
|
313 EVideoClipIllegalCutInTime, |
|
314 EVideoClipIllegalCutOutTime, |
|
315 EVideoClipNoFileAssociated, |
|
316 EAudioClipIllegalStartTime, |
|
317 EAudioClipIllegalCutInTime, |
|
318 EAudioClipIllegalCutOutTime, |
|
319 EVideoClipGeneratorNotInserted, |
|
320 EVideoClipGeneratorNotReady,//30 |
|
321 EVideoClipGeneratorAlreadyInserted, |
|
322 EVideoClipGeneratorIllegalVideoFrameIndex, |
|
323 EVideoClipGeneratorIllegalDuration, |
|
324 EVideoClipGeneratorIllegalFrameResolution, |
|
325 EVideoClipGeneratorIllegalVideoFrameTime, |
|
326 EImageClipGeneratorIllegalMaxResolution, |
|
327 EImageClipGeneratorNotReady, |
|
328 EImageClipGeneratorFrameOperationAlreadyRunning, |
|
329 ETitleClipGeneratorIllegalMaxResolution, |
|
330 ETitleClipGeneratorIllegalMaxFramerate,//40 |
|
331 ETitleClipGeneratorFrameOperationAlreadyRunning, |
|
332 EIllegalDynamicLevelMark, |
|
333 EIllegalDynamicLevelMarkIndex, |
|
334 EVideoClipGeneratorNotOveray, |
|
335 EAnimationClipGeneratorNotReady |
|
336 }; |
|
337 |
|
338 public: |
|
339 inline static void Panic(TInt aPanic); |
|
340 }; |
|
341 |
|
342 |
|
343 #include "VedCommon.inl" |
|
344 |
|
345 #endif // __VEDCOMMON_H__ |
|
346 |