williamr@2
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
williamr@2
|
2 |
// All rights reserved.
|
williamr@2
|
3 |
// This component and the accompanying materials are made available
|
williamr@4
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
williamr@2
|
5 |
// which accompanies this distribution, and is available
|
williamr@4
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
williamr@2
|
7 |
//
|
williamr@2
|
8 |
// Initial Contributors:
|
williamr@2
|
9 |
// Nokia Corporation - initial contribution.
|
williamr@2
|
10 |
//
|
williamr@2
|
11 |
// Contributors:
|
williamr@2
|
12 |
//
|
williamr@2
|
13 |
// Description:
|
williamr@2
|
14 |
//
|
williamr@2
|
15 |
|
williamr@2
|
16 |
#ifndef __DEVVIDEOBASE_H__
|
williamr@2
|
17 |
#define __DEVVIDEOBASE_H__
|
williamr@2
|
18 |
|
williamr@2
|
19 |
#include <e32base.h>
|
williamr@2
|
20 |
#include <w32std.h>
|
williamr@2
|
21 |
#include <mmf/devvideo/devvideoconstants.h>
|
williamr@2
|
22 |
#include <ecom/ecom.h>
|
williamr@4
|
23 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
|
williamr@4
|
24 |
#include <mmf/devvideo/devvideohwdeviceadaptersetup.h>
|
williamr@4
|
25 |
#endif
|
williamr@2
|
26 |
|
williamr@2
|
27 |
|
williamr@2
|
28 |
/**
|
williamr@2
|
29 |
Panic utility function
|
williamr@4
|
30 |
@publishedAll
|
williamr@2
|
31 |
*/
|
williamr@2
|
32 |
LOCAL_C void DevVideoPanic(TInt aReason)
|
williamr@2
|
33 |
{
|
williamr@2
|
34 |
User::Panic(KDevVideoPanicCategory, aReason);
|
williamr@2
|
35 |
}
|
williamr@2
|
36 |
|
williamr@2
|
37 |
|
williamr@2
|
38 |
/**
|
williamr@2
|
39 |
A hardware device ID that identifies an instantiated video hardware device.
|
williamr@2
|
40 |
Used in the playback and recording APIs to identify the component being controlled.
|
williamr@2
|
41 |
@publishedAll
|
williamr@2
|
42 |
@released
|
williamr@2
|
43 |
*/
|
williamr@2
|
44 |
typedef TInt THwDeviceId;
|
williamr@2
|
45 |
|
williamr@2
|
46 |
|
williamr@2
|
47 |
/**
|
williamr@2
|
48 |
Defines a supported scale factor for a scaling pre-processor or post-processor.
|
williamr@2
|
49 |
|
williamr@2
|
50 |
The scale factor is defined as iScaleNum/iScaleDenom,
|
williamr@2
|
51 |
where the values are positive integers and relatively prime.
|
williamr@2
|
52 |
@publishedAll
|
williamr@2
|
53 |
@released
|
williamr@2
|
54 |
*/
|
williamr@2
|
55 |
class TScaleFactor
|
williamr@2
|
56 |
{
|
williamr@2
|
57 |
public:
|
williamr@2
|
58 |
/**Scale factor numerator. Non-zero.*/
|
williamr@2
|
59 |
TUint iScaleNum;
|
williamr@2
|
60 |
/**Scale factor denominator. Non-zero.*/
|
williamr@2
|
61 |
TUint iScaleDenom;
|
williamr@2
|
62 |
};
|
williamr@2
|
63 |
|
williamr@2
|
64 |
|
williamr@2
|
65 |
/**
|
williamr@2
|
66 |
A custom YUV/RGB conversion matrix. The same matrix structure is used for both conversion directions.
|
williamr@2
|
67 |
@publishedAll
|
williamr@2
|
68 |
@released
|
williamr@2
|
69 |
*/
|
williamr@2
|
70 |
class TYuvConversionMatrix
|
williamr@2
|
71 |
{
|
williamr@2
|
72 |
public:
|
williamr@2
|
73 |
/**
|
williamr@2
|
74 |
Post-multiplication offset, a three-item vector.
|
williamr@2
|
75 |
*/
|
williamr@2
|
76 |
TReal iPostOffset[3];
|
williamr@2
|
77 |
|
williamr@2
|
78 |
/**
|
williamr@2
|
79 |
Multiplication matrix, a 3x3 matrix. iMatrix[3*i+j] contains the j:th item on the i:th row of the matrix.
|
williamr@2
|
80 |
*/
|
williamr@2
|
81 |
TReal iMatrix[9];
|
williamr@2
|
82 |
|
williamr@2
|
83 |
/**
|
williamr@2
|
84 |
Pre-multiplication offset, a three-item vector.
|
williamr@2
|
85 |
*/
|
williamr@2
|
86 |
TReal iPreOffset[3];
|
williamr@2
|
87 |
};
|
williamr@2
|
88 |
|
williamr@2
|
89 |
|
williamr@2
|
90 |
/**
|
williamr@2
|
91 |
YUV (YCbCr) uncompressed image data format.
|
williamr@2
|
92 |
@publishedAll
|
williamr@2
|
93 |
@released
|
williamr@2
|
94 |
*/
|
williamr@2
|
95 |
class TYuvFormat
|
williamr@2
|
96 |
{
|
williamr@2
|
97 |
public:
|
williamr@2
|
98 |
/**
|
williamr@2
|
99 |
The YUV/RGB conversion coefficients to use
|
williamr@2
|
100 |
*/
|
williamr@2
|
101 |
TYuvCoefficients iCoefficients;
|
williamr@2
|
102 |
|
williamr@2
|
103 |
/**
|
williamr@2
|
104 |
Luminance/chrominance sampling pattern.
|
williamr@2
|
105 |
*/
|
williamr@2
|
106 |
TYuvSamplingPattern iPattern;
|
williamr@2
|
107 |
|
williamr@2
|
108 |
/**
|
williamr@2
|
109 |
Data layout, specifies whether the data is stored in a planar or interleaved mode.
|
williamr@2
|
110 |
*/
|
williamr@2
|
111 |
TYuvDataLayout iDataLayout;
|
williamr@2
|
112 |
|
williamr@2
|
113 |
/**
|
williamr@2
|
114 |
Custom YUV to RGB conversion matrix to use.
|
williamr@2
|
115 |
Valid only if custom conversion matrix is used (iCoefficients is ECustomYuvMatrix).
|
williamr@2
|
116 |
*/
|
williamr@2
|
117 |
TYuvConversionMatrix* iYuv2RgbMatrix;
|
williamr@2
|
118 |
|
williamr@2
|
119 |
/**
|
williamr@2
|
120 |
Custom RGB to YUV conversion matrix to use.
|
williamr@2
|
121 |
Valid only if custom conversion matrix is used (iCoefficients is ECustomYuvMatrix).
|
williamr@2
|
122 |
*/
|
williamr@2
|
123 |
TYuvConversionMatrix* iRgb2YuvMatrix;
|
williamr@2
|
124 |
|
williamr@2
|
125 |
/**
|
williamr@2
|
126 |
Pixel aspect ratio numerator.
|
williamr@2
|
127 |
*/
|
williamr@2
|
128 |
TUint iAspectRatioNum;
|
williamr@2
|
129 |
|
williamr@2
|
130 |
/**
|
williamr@2
|
131 |
Pixel aspect ratio denominator.
|
williamr@2
|
132 |
The aspect ratio is defined as iAspectRatioNum/iAspectRatioDenom,
|
williamr@2
|
133 |
where the values are positive integers and relatively prime.
|
williamr@2
|
134 |
*/
|
williamr@2
|
135 |
TUint iAspectRatioDenom;
|
williamr@2
|
136 |
|
williamr@2
|
137 |
/**
|
williamr@2
|
138 |
Tests whether this TYuvFormat object is the same as aOther.
|
williamr@2
|
139 |
@param "aOther" "The object to compare."
|
williamr@2
|
140 |
@return "ETrue if they are the same, EFalse if not."
|
williamr@2
|
141 |
*/
|
williamr@2
|
142 |
inline TBool operator==(const TYuvFormat& aOther) const;
|
williamr@2
|
143 |
};
|
williamr@2
|
144 |
|
williamr@2
|
145 |
/**
|
williamr@2
|
146 |
Defines an uncompressed video format.
|
williamr@2
|
147 |
This structure is mainly just a combination of YUV and RGB formats, defined to simplify the rest of the API.
|
williamr@2
|
148 |
@publishedAll
|
williamr@2
|
149 |
@released
|
williamr@2
|
150 |
*/
|
williamr@2
|
151 |
class TUncompressedVideoFormat
|
williamr@2
|
152 |
{
|
williamr@2
|
153 |
public:
|
williamr@2
|
154 |
/**
|
williamr@2
|
155 |
The image data format. The validity of the rest of the fields depends on the data format used.
|
williamr@2
|
156 |
*/
|
williamr@2
|
157 |
TImageDataFormat iDataFormat;
|
williamr@2
|
158 |
union
|
williamr@2
|
159 |
{
|
williamr@2
|
160 |
/**
|
williamr@2
|
161 |
YUV picture format details, valid if iDataFormat is EYuvRawData.
|
williamr@2
|
162 |
*/
|
williamr@2
|
163 |
TYuvFormat iYuvFormat;
|
williamr@2
|
164 |
|
williamr@2
|
165 |
/**
|
williamr@2
|
166 |
RGB picture format details, valid if iDataFormat is ERgbRawData or ERgbFbsBitmap.
|
williamr@2
|
167 |
*/
|
williamr@2
|
168 |
TRgbFormat iRgbFormat;
|
williamr@2
|
169 |
};
|
williamr@2
|
170 |
|
williamr@2
|
171 |
/**
|
williamr@2
|
172 |
Tests whether this TUncompressedVideoFormat object is the same as aOther.
|
williamr@2
|
173 |
@param "aOther" "The object to compare."
|
williamr@2
|
174 |
@return "ETrue if they are the same, EFalse if not."
|
williamr@2
|
175 |
*/
|
williamr@2
|
176 |
inline TBool operator==(const TUncompressedVideoFormat& aOther) const;
|
williamr@2
|
177 |
|
williamr@2
|
178 |
/**
|
williamr@2
|
179 |
Sets this object equal to aOther.
|
williamr@2
|
180 |
@param "aOther" "The object to clone."
|
williamr@2
|
181 |
*/
|
williamr@2
|
182 |
inline void operator=(const TUncompressedVideoFormat& aOther);
|
williamr@2
|
183 |
};
|
williamr@2
|
184 |
|
williamr@2
|
185 |
|
williamr@2
|
186 |
/**
|
williamr@2
|
187 |
Uncompressed picture data for one video picture.
|
williamr@2
|
188 |
@publishedAll
|
williamr@2
|
189 |
@released
|
williamr@2
|
190 |
*/
|
williamr@2
|
191 |
class TPictureData
|
williamr@2
|
192 |
{
|
williamr@2
|
193 |
public:
|
williamr@2
|
194 |
/**
|
williamr@2
|
195 |
The image data format. The validity of the rest of the fields depends on the data format used.
|
williamr@2
|
196 |
*/
|
williamr@2
|
197 |
TImageDataFormat iDataFormat;
|
williamr@2
|
198 |
|
williamr@2
|
199 |
/**
|
williamr@2
|
200 |
Image data size in pixels. In decoder output pictures the actual active picture area may be smaller,
|
williamr@2
|
201 |
this is indicated using TVideoPicture.iCropRect.
|
williamr@2
|
202 |
*/
|
williamr@2
|
203 |
TSize iDataSize;
|
williamr@2
|
204 |
|
williamr@2
|
205 |
union
|
williamr@2
|
206 |
{
|
williamr@2
|
207 |
/**
|
williamr@2
|
208 |
Pointer to raw image data. Valid if iDataFormat is ERgbRawData or iYuvRawData.
|
williamr@2
|
209 |
The data layout depends on the format used.
|
williamr@2
|
210 |
*/
|
williamr@2
|
211 |
TPtr8* iRawData;
|
williamr@2
|
212 |
|
williamr@2
|
213 |
/**
|
williamr@2
|
214 |
Pointer to an RGB bitmap. Valid if iDataFormat is ERgbFbsBitmap.
|
williamr@2
|
215 |
*/
|
williamr@2
|
216 |
CFbsBitmap* iRgbBitmap;
|
williamr@4
|
217 |
|
williamr@4
|
218 |
/**
|
williamr@4
|
219 |
Buffer number of current buffer for composition that is used when submitting a surface update. Valid if iDataFormat is set to ESurfaceBuffer
|
williamr@4
|
220 |
*/
|
williamr@4
|
221 |
TInt iSurfaceBufNum;
|
williamr@2
|
222 |
};
|
williamr@2
|
223 |
};
|
williamr@2
|
224 |
|
williamr@2
|
225 |
/**
|
williamr@2
|
226 |
Header information for one decoded picture.
|
williamr@2
|
227 |
The header information is returned alongside with decoded pictures,
|
williamr@2
|
228 |
or it can be read separately when DevVideoPlay is being initialized.
|
williamr@2
|
229 |
|
williamr@2
|
230 |
@publishedAll
|
williamr@2
|
231 |
@released
|
williamr@2
|
232 |
*/
|
williamr@2
|
233 |
class TVideoPictureHeader
|
williamr@2
|
234 |
{
|
williamr@2
|
235 |
public:
|
williamr@2
|
236 |
/**
|
williamr@2
|
237 |
*/
|
williamr@2
|
238 |
enum THeaderOptions
|
williamr@2
|
239 |
{
|
williamr@2
|
240 |
/** Decoding timestamp is valid
|
williamr@2
|
241 |
*/
|
williamr@2
|
242 |
EDecodingTimestamp = 0x00000001,
|
williamr@2
|
243 |
/** Presentation timestamp is valid
|
williamr@2
|
244 |
*/
|
williamr@2
|
245 |
EPresentationTimestamp = 0x00000002,
|
williamr@2
|
246 |
/** Pre-decoder buffersize is valid
|
williamr@2
|
247 |
*/
|
williamr@2
|
248 |
EPreDecoderBufferSize = 0x00000004,
|
williamr@2
|
249 |
/** Post-decoder buffersize is valid
|
williamr@2
|
250 |
*/
|
williamr@2
|
251 |
EPostDecoderBufferSize = 0x00000008,
|
williamr@2
|
252 |
/** Picture number field is valid
|
williamr@2
|
253 |
*/
|
williamr@2
|
254 |
EPictureNumber = 0x00000010,
|
williamr@2
|
255 |
/** Layered coding is used and the layer number field is valid
|
williamr@2
|
256 |
*/
|
williamr@2
|
257 |
ELayeredCoding = 0x00000020,
|
williamr@2
|
258 |
/** Supplemental data is available
|
williamr@2
|
259 |
*/
|
williamr@2
|
260 |
ESupplementalData = 0x00000040,
|
williamr@2
|
261 |
/** Random access buffering period is valid
|
williamr@2
|
262 |
*/
|
williamr@2
|
263 |
ERandomAccessBufferingPeriod = 0x00000080,
|
williamr@2
|
264 |
/** Random access buffer occupancy is valid
|
williamr@2
|
265 |
*/
|
williamr@2
|
266 |
ERandomAccessBufferOccupancy = 0x00000100
|
williamr@2
|
267 |
};
|
williamr@2
|
268 |
|
williamr@2
|
269 |
/**
|
williamr@2
|
270 |
Header options. The value is a bitfield combined from values from THeaderOptions.
|
williamr@2
|
271 |
*/
|
williamr@2
|
272 |
TUint32 iOptions;
|
williamr@2
|
273 |
|
williamr@2
|
274 |
/**
|
williamr@2
|
275 |
Video codec profile used. Use -1 if not applicable or not defined.
|
williamr@2
|
276 |
*/
|
williamr@2
|
277 |
TInt iProfile;
|
williamr@2
|
278 |
|
williamr@2
|
279 |
/**
|
williamr@2
|
280 |
Video codec level. Use -1 if not applicable or not defined.
|
williamr@2
|
281 |
*/
|
williamr@2
|
282 |
TInt iLevel;
|
williamr@2
|
283 |
|
williamr@2
|
284 |
/**
|
williamr@2
|
285 |
Video codec version. Use -1 if not applicable or not defined.
|
williamr@2
|
286 |
*/
|
williamr@2
|
287 |
TInt iVersion;
|
williamr@2
|
288 |
|
williamr@2
|
289 |
/**
|
williamr@2
|
290 |
Pointer to a descriptor that contains optional codec-specific features. Set to NULL if not used.
|
williamr@2
|
291 |
The format of the data is codec-specific. The pointer and descriptor data are valid as long as
|
williamr@2
|
292 |
the header information structure is valid.
|
williamr@2
|
293 |
*/
|
williamr@2
|
294 |
const TDesC8* iOptional;
|
williamr@2
|
295 |
|
williamr@2
|
296 |
/**
|
williamr@2
|
297 |
Image size in memory, in pixels. May be larger than the displayed picture.
|
williamr@2
|
298 |
*/
|
williamr@2
|
299 |
TSize iSizeInMemory;
|
williamr@2
|
300 |
|
williamr@2
|
301 |
/**
|
williamr@2
|
302 |
The portion of the full image to display.
|
williamr@2
|
303 |
*/
|
williamr@2
|
304 |
TRect iDisplayedRect;
|
williamr@2
|
305 |
|
williamr@2
|
306 |
/**
|
williamr@2
|
307 |
Picture presentation timestamp. Valid only if EPresentationTimestamp is set in the options.
|
williamr@2
|
308 |
The clock frequency is stored in the timestamp structure.
|
williamr@2
|
309 |
*/
|
williamr@2
|
310 |
TTimeIntervalMicroSeconds iPresentationTimestamp;
|
williamr@2
|
311 |
|
williamr@2
|
312 |
/**
|
williamr@2
|
313 |
Picture decoding timestamp. Valid only if EDecodingTimestamp is set in the options.
|
williamr@2
|
314 |
*/
|
williamr@2
|
315 |
TTimeIntervalMicroSeconds iDecodingTimestamp;
|
williamr@2
|
316 |
|
williamr@2
|
317 |
/**
|
williamr@2
|
318 |
Expected pre-decoder buffer size in bytes. Valid only if EPreDecoderBufferSize is set in the options.
|
williamr@2
|
319 |
*/
|
williamr@2
|
320 |
TUint iPreDecoderBufferSize;
|
williamr@2
|
321 |
|
williamr@2
|
322 |
/**
|
williamr@2
|
323 |
Expected post-decoder buffer size in bytes. Valid only if EPostDecoderBufferSize is set in the options.
|
williamr@2
|
324 |
It is assumed that a frame buffer to be displayed is returned before the decoding of the next frame
|
williamr@2
|
325 |
is started. If this is not the case, a larger post-decoder buffer may actually be needed.
|
williamr@2
|
326 |
*/
|
williamr@2
|
327 |
TUint iPostDecoderBufferSize;
|
williamr@2
|
328 |
|
williamr@2
|
329 |
/**
|
williamr@2
|
330 |
Picture number, valid only if EPictureNumber is set in the options.
|
williamr@2
|
331 |
This field is used to indicate one of the following: picture number or long-term picture index for H.263,
|
williamr@2
|
332 |
vop_id for MPEG-4 Visual, picture number or long-term picture number for AVC.
|
williamr@2
|
333 |
*/
|
williamr@2
|
334 |
TUint iPictureNumber;
|
williamr@2
|
335 |
|
williamr@2
|
336 |
/**
|
williamr@2
|
337 |
Picture layer number if layered coding is used, valid only if ELayeredCoding is set in the options.
|
williamr@2
|
338 |
Layers are numbered [0…n-1], where n is the number of layers available. The first layer (layer zero)
|
williamr@2
|
339 |
is the base layer, it can be decoded independently from the other layers, and it has the lowest total bitrate.
|
williamr@2
|
340 |
*/
|
williamr@2
|
341 |
TUint iPictureLayer;
|
williamr@2
|
342 |
|
williamr@2
|
343 |
/**
|
williamr@2
|
344 |
Picture supplemental data, valid only if ESupplementalData is set in the options.
|
williamr@2
|
345 |
The pointer and descriptor data are valid as long as the header information structure is valid.
|
williamr@2
|
346 |
*/
|
williamr@2
|
347 |
const TDesC8* iSupplementalData;
|
williamr@2
|
348 |
|
williamr@2
|
349 |
/**
|
williamr@2
|
350 |
True if the picture is a random-accessible picture.
|
williamr@2
|
351 |
*/
|
williamr@2
|
352 |
TBool iIsRandomAccessible;
|
williamr@2
|
353 |
|
williamr@2
|
354 |
/**
|
williamr@2
|
355 |
The expected initial pre-decoder buffering period before starting the playback from this picture.
|
williamr@2
|
356 |
Valid only if this picture is randomly accessible (iIsRandomAccessible is true) and
|
williamr@2
|
357 |
ERandomAccessBufferingPeriod is set in the options. MPEG-2 and H.264 | MPEG-4 AVC use this value.
|
williamr@2
|
358 |
*/
|
williamr@2
|
359 |
TTimeIntervalMicroSeconds32 iRandomAccessBufferingPeriod;
|
williamr@2
|
360 |
|
williamr@2
|
361 |
/**
|
williamr@2
|
362 |
The expected initial pre-decoder buffer occupancy in bytes before starting the playback
|
williamr@2
|
363 |
from this picture. Valid if this picture is randomly accessible (iIsRandomAccessible is true) and
|
williamr@2
|
364 |
ERandomAccessBufferOccupancy is set in the options. MPEG-4 Visual uses this value.
|
williamr@2
|
365 |
*/
|
williamr@2
|
366 |
TUint iRandomAccessBufferOccupancy;
|
williamr@2
|
367 |
};
|
williamr@2
|
368 |
|
williamr@2
|
369 |
|
williamr@2
|
370 |
|
williamr@2
|
371 |
/**
|
williamr@2
|
372 |
One uncompressed video picture. Used for both decoded picture output as well as uncompressed picture input.
|
williamr@2
|
373 |
|
williamr@2
|
374 |
@publishedAll
|
williamr@2
|
375 |
@released
|
williamr@2
|
376 |
*/
|
williamr@2
|
377 |
class TVideoPicture
|
williamr@2
|
378 |
{
|
williamr@2
|
379 |
public:
|
williamr@2
|
380 |
/**
|
williamr@2
|
381 |
*/
|
williamr@2
|
382 |
enum TVideoPictureOptions
|
williamr@2
|
383 |
{
|
williamr@2
|
384 |
/** The timestamp field is valid.
|
williamr@2
|
385 |
*/
|
williamr@2
|
386 |
ETimestamp = 0x00000001,
|
williamr@2
|
387 |
/** The crop rectangle field is valid.
|
williamr@2
|
388 |
*/
|
williamr@2
|
389 |
ECropRect = 0x00000002,
|
williamr@2
|
390 |
/** Picture header information is present.
|
williamr@2
|
391 |
*/
|
williamr@2
|
392 |
EHeader = 0x00000004,
|
williamr@2
|
393 |
/** The layer bit count targets field is valid.
|
williamr@2
|
394 |
*/
|
williamr@2
|
395 |
EBitTargets = 0x00000008,
|
williamr@2
|
396 |
/** Set in encoder input to request an instantaneous decoder refresh.
|
williamr@2
|
397 |
As a response, the encoder should code an intra frame and no consecutive
|
williamr@2
|
398 |
frame should refer to any frame before the encoded intra frame (in coding order).
|
williamr@2
|
399 |
*/
|
williamr@2
|
400 |
EReqInstantRefresh = 0x00000010,
|
williamr@2
|
401 |
/** Set in encoder input to indicate a scene cut in the picture stream.
|
williamr@2
|
402 |
*/
|
williamr@2
|
403 |
ESceneCut = 0x00000020,
|
williamr@2
|
404 |
/** Set if a picture effect is in use and the picture effect field is valid.
|
williamr@2
|
405 |
*/
|
williamr@2
|
406 |
EPictureEffect = 0x00000040,
|
williamr@2
|
407 |
/** Set if picture effect parameters are valid.
|
williamr@2
|
408 |
*/
|
williamr@4
|
409 |
EEffectParameters = 0x00000080,
|
williamr@4
|
410 |
/** Content protected pictures cannot be displayed on unprotected
|
williamr@4
|
411 |
external displays such as TV-out.
|
williamr@4
|
412 |
*/
|
williamr@4
|
413 |
EContentProtected = 0x00000100
|
williamr@2
|
414 |
};
|
williamr@2
|
415 |
|
williamr@2
|
416 |
/**
|
williamr@2
|
417 |
The picture data. The picture data, including all pointers, must remain valid until
|
williamr@2
|
418 |
the picture has been returned to its originator.
|
williamr@2
|
419 |
*/
|
williamr@2
|
420 |
TPictureData iData;
|
williamr@2
|
421 |
|
williamr@2
|
422 |
/**
|
williamr@2
|
423 |
Picture options. The value is a bitfield combined from values from TVideoPictureOptions.
|
williamr@2
|
424 |
*/
|
williamr@2
|
425 |
TUint32 iOptions;
|
williamr@2
|
426 |
|
williamr@2
|
427 |
/**
|
williamr@2
|
428 |
Picture timestamp. Valid if ETimestamp is set in the options.
|
williamr@2
|
429 |
Used for presentation timestamps in video playback and capture timestamps in uncompressed video
|
williamr@2
|
430 |
input for recording. If the timestamp is not specified for decoded video input for playback,
|
williamr@2
|
431 |
the picture is displayed immediately. For decoded video output in playback and uncompressed
|
williamr@2
|
432 |
video input for recording, the timestamp must always be set.
|
williamr@2
|
433 |
*/
|
williamr@2
|
434 |
TTimeIntervalMicroSeconds iTimestamp;
|
williamr@2
|
435 |
|
williamr@2
|
436 |
/**
|
williamr@2
|
437 |
Pan-scan cropping rectangle. Defines the area of the picture used for further processing.
|
williamr@2
|
438 |
Only used for decoded video output.
|
williamr@2
|
439 |
*/
|
williamr@2
|
440 |
TRect iCropRect;
|
williamr@2
|
441 |
|
williamr@2
|
442 |
/**
|
williamr@2
|
443 |
Picture header information. Valid if EHeader is set in the options.
|
williamr@2
|
444 |
Normally this field is only used in decoded pictures returned from the playback API.
|
williamr@2
|
445 |
In that case the header info pointer is valid until the picture is returned to the API.
|
williamr@2
|
446 |
*/
|
williamr@2
|
447 |
TVideoPictureHeader* iHeader;
|
williamr@2
|
448 |
|
williamr@2
|
449 |
/**
|
williamr@2
|
450 |
The target number of bits for each bit-rate scalability layer, valid when EBitTargets is set in the options.
|
williamr@2
|
451 |
Used in video encoding when the caller controls the bit-rate for each picture separately.
|
williamr@2
|
452 |
The field points to a table containing the target number of bits to use for each layer when
|
williamr@2
|
453 |
encoding this picture, starting from the lowest layer. The bit count for an enhancement layer
|
williamr@2
|
454 |
includes all lower layers. For example, if the client uses two layers, and reserves 1.5 kilobits
|
williamr@2
|
455 |
for the base layer and three kilobits for the whole picture, this field is set to {1500, 3000}.
|
williamr@2
|
456 |
*/
|
williamr@2
|
457 |
RArray<TUint>* iLayerBitRates;
|
williamr@2
|
458 |
|
williamr@2
|
459 |
/**
|
williamr@2
|
460 |
The picture effect in use when capturing this picture, valid when EPictureEffect is set in the options.
|
williamr@2
|
461 |
This information can be used when encoding the picture. Note that setting a picture effect does not
|
williamr@2
|
462 |
imply that the encoder should modify the picture data based on the effect. Instead, it can be used as
|
williamr@2
|
463 |
an encoding hint. For example, fade to black implies that the global picture brightness has been decreased,
|
williamr@2
|
464 |
and this knowledge can be used to aid motion prediction.
|
williamr@2
|
465 |
@see TPictureEffects
|
williamr@2
|
466 |
*/
|
williamr@2
|
467 |
TPictureEffect iEffect;
|
williamr@2
|
468 |
|
williamr@2
|
469 |
/**
|
williamr@2
|
470 |
Picture effect parameter for fade to/from black, valid when EEffectParameters is set in the options
|
williamr@2
|
471 |
and iEffect is EEffectFadeFromBlack or EEffectFadeToBlack. The value range is [0…65536], with zero
|
williamr@2
|
472 |
indicating the picture is black and 65536 indicating that the lightness of the picture is unchanged.
|
williamr@2
|
473 |
If the parameter is not given, the caller is unaware of the proper value or the value fluctuates spatially.
|
williamr@2
|
474 |
*/
|
williamr@2
|
475 |
TUint iFadeParam;
|
williamr@2
|
476 |
|
williamr@2
|
477 |
/**
|
williamr@2
|
478 |
A pointer for free-form user data. The pointer is set by the module that created the buffer, and is
|
williamr@2
|
479 |
usually used for memory management purposes.
|
williamr@2
|
480 |
*/
|
williamr@2
|
481 |
TAny* iUser;
|
williamr@2
|
482 |
|
williamr@2
|
483 |
/**
|
williamr@2
|
484 |
A queue link used internally by the MSL video components.
|
williamr@2
|
485 |
*/
|
williamr@2
|
486 |
TDblQueLink iLink;
|
williamr@2
|
487 |
};
|
williamr@2
|
488 |
|
williamr@2
|
489 |
/**
|
williamr@2
|
490 |
Identifies a video picture in feedback messages.
|
williamr@2
|
491 |
|
williamr@2
|
492 |
@publishedAll
|
williamr@2
|
493 |
@released
|
williamr@2
|
494 |
*/
|
williamr@2
|
495 |
class TPictureId
|
williamr@2
|
496 |
{
|
williamr@2
|
497 |
public:
|
williamr@2
|
498 |
enum TPictureIdType
|
williamr@2
|
499 |
{
|
williamr@2
|
500 |
/** Unidentified picture. */
|
williamr@2
|
501 |
ENone,
|
williamr@2
|
502 |
/** The picture is identified using its temporal reference. */
|
williamr@2
|
503 |
ETemporalReference,
|
williamr@2
|
504 |
/** The picture is identified using its picture number. Picture numbers are used in H.263 annex U and H.264 | MPEG-4 AVC, for example.. */
|
williamr@2
|
505 |
EPictureNumber
|
williamr@2
|
506 |
};
|
williamr@2
|
507 |
|
williamr@2
|
508 |
/** Picture identified type. */
|
williamr@2
|
509 |
TPictureIdType iIdType;
|
williamr@2
|
510 |
|
williamr@2
|
511 |
/** The picture identifier. The interpretation of this field depends on the value iIdType */
|
williamr@2
|
512 |
TUint32 iId;
|
williamr@2
|
513 |
};
|
williamr@2
|
514 |
|
williamr@2
|
515 |
|
williamr@2
|
516 |
/**
|
williamr@2
|
517 |
Defines a compressed video format. The format is identified by its MIME type, which may include
|
williamr@2
|
518 |
parameters that describe the used format profile and level. The MIME type used for H.263
|
williamr@2
|
519 |
is video/H263-2000, specified in TS 26.234, and the type for MPEG-4 is video/MP4V-ES, specified in RFC 3016.
|
williamr@2
|
520 |
|
williamr@2
|
521 |
@publishedAll
|
williamr@2
|
522 |
@released
|
williamr@2
|
523 |
*/
|
williamr@2
|
524 |
class CCompressedVideoFormat : public CBase
|
williamr@2
|
525 |
{
|
williamr@2
|
526 |
public:
|
williamr@2
|
527 |
/**
|
williamr@2
|
528 |
Static factory function for creating new CCompressedVideoFormat objects.
|
williamr@2
|
529 |
|
williamr@2
|
530 |
@param "aMimeType" "Video codec MIME type, including optional parameters for profile,
|
williamr@2
|
531 |
level and version information. The CCompressedVideoFormat object creates
|
williamr@2
|
532 |
and owns a copy of this buffer and takes care of deallocation."
|
williamr@2
|
533 |
|
williamr@2
|
534 |
@param "aOptionalData" "Reference to a descriptor that contains optional codec-specific data.
|
williamr@2
|
535 |
Set to KNullDesC8 if not used. [The format of the data is codec-specific, typically
|
williamr@2
|
536 |
a package buffer containing a data structure may be used. The pointer lifetime
|
williamr@2
|
537 |
and validity requirements are specified with each method that uses this structure."
|
williamr@2
|
538 |
|
williamr@2
|
539 |
@return "Pointer to a fully constructed CCompressedVideoFormat object."
|
williamr@2
|
540 |
@leave "This method may leave with one of the system-wide error codes."
|
williamr@2
|
541 |
*/
|
williamr@2
|
542 |
IMPORT_C static CCompressedVideoFormat* NewL(const TDesC8& aMimeType, const TDesC8& aOptionalData = KNullDesC8);
|
williamr@2
|
543 |
|
williamr@2
|
544 |
/**
|
williamr@2
|
545 |
Static factory function for creating a copy of an existing CCompressedVideoFormat object.
|
williamr@2
|
546 |
|
williamr@2
|
547 |
@param "aFormat" "The CCompressedVideoFormat object to copy."
|
williamr@2
|
548 |
|
williamr@2
|
549 |
@return Pointer to a fully constructed CCompressedVideoFormat object.
|
williamr@2
|
550 |
@leave This method may leave with one of the system-wide error codes.
|
williamr@2
|
551 |
*/
|
williamr@2
|
552 |
IMPORT_C static CCompressedVideoFormat* NewL(const CCompressedVideoFormat& aFormat);
|
williamr@2
|
553 |
|
williamr@2
|
554 |
/**
|
williamr@2
|
555 |
Virtual destructor. Destroys iMimeType.
|
williamr@2
|
556 |
*/
|
williamr@2
|
557 |
IMPORT_C virtual ~CCompressedVideoFormat();
|
williamr@2
|
558 |
|
williamr@2
|
559 |
/**
|
williamr@2
|
560 |
Returns the video codec MIME type.
|
williamr@2
|
561 |
|
williamr@2
|
562 |
@return "Reference to a descriptor that contains the video codec MIME type."
|
williamr@2
|
563 |
*/
|
williamr@2
|
564 |
IMPORT_C const TDesC8& MimeType() const;
|
williamr@2
|
565 |
|
williamr@2
|
566 |
/**
|
williamr@2
|
567 |
Returns the optional data.
|
williamr@2
|
568 |
|
williamr@2
|
569 |
@return "Reference to a descriptor that contains optional codec-specific data.
|
williamr@2
|
570 |
Zero length if not used. The format of the data is codec-specific, typically a package buffer
|
williamr@2
|
571 |
containing a data structure may be used."
|
williamr@2
|
572 |
*/
|
williamr@2
|
573 |
IMPORT_C const TDesC8& OptionalData() const;
|
williamr@2
|
574 |
|
williamr@2
|
575 |
/**
|
williamr@2
|
576 |
Tests whether this CCompressedVideoFormat is identical to aOther or not.
|
williamr@2
|
577 |
@return "ETrue if the two objects are identical, EFalse if not."
|
williamr@2
|
578 |
*/
|
williamr@2
|
579 |
IMPORT_C TBool operator==(const CCompressedVideoFormat& aOther) const;
|
williamr@2
|
580 |
protected:
|
williamr@4
|
581 |
/**
|
williamr@4
|
582 |
@internalTechnology
|
williamr@4
|
583 |
*/
|
williamr@2
|
584 |
CCompressedVideoFormat();
|
williamr@2
|
585 |
|
williamr@4
|
586 |
/**
|
williamr@4
|
587 |
@internalTechnology
|
williamr@4
|
588 |
*/
|
williamr@2
|
589 |
void ConstructL(const TDesC8& aMimeType, const TDesC8& aOptionalData);
|
williamr@2
|
590 |
private:
|
williamr@2
|
591 |
HBufC8* iMimeType;
|
williamr@2
|
592 |
HBufC8* iOptionalData;
|
williamr@2
|
593 |
};
|
williamr@2
|
594 |
|
williamr@2
|
595 |
|
williamr@2
|
596 |
/**
|
williamr@2
|
597 |
Specifies the HRD/VBV parameters used when 3GPP TS 26.234 annex G HRD/VBV settings are used (EHrdVbv3GPP).
|
williamr@2
|
598 |
See TS 26.234 Release 5 for details.
|
williamr@2
|
599 |
@publishedAll
|
williamr@2
|
600 |
@released
|
williamr@2
|
601 |
*/
|
williamr@2
|
602 |
class T3gppHrdVbvParams
|
williamr@2
|
603 |
{
|
williamr@2
|
604 |
public:
|
williamr@2
|
605 |
/** Initial pre-decoder buffering period. */
|
williamr@2
|
606 |
TTimeIntervalMicroSeconds iInitialPreDecoderBufferPeriod;
|
williamr@2
|
607 |
|
williamr@2
|
608 |
/** Initial post-decoder buffering period. */
|
williamr@2
|
609 |
TTimeIntervalMicroSeconds iInitialPostDecoderBufferPeriod;
|
williamr@2
|
610 |
|
williamr@2
|
611 |
/** Hypothetical pre-decoder buffer size, in bytes. */
|
williamr@2
|
612 |
TUint iPreDecoderBufferSize;
|
williamr@2
|
613 |
|
williamr@2
|
614 |
/** Peak decoding byte rate. By default, the peak decoding byte rate is
|
williamr@2
|
615 |
defined according to the video coding profile and level in use. */
|
williamr@2
|
616 |
TUint iPeakDecodingByteRate;
|
williamr@2
|
617 |
|
williamr@2
|
618 |
/** Decoding macroblock rate. The default decoding macroblock rate is defined
|
williamr@2
|
619 |
according to the video coding profile and level in use. */
|
williamr@2
|
620 |
TUint iDecodingMacroblockRate;
|
williamr@2
|
621 |
};
|
williamr@2
|
622 |
|
williamr@2
|
623 |
|
williamr@2
|
624 |
/**
|
williamr@2
|
625 |
YUV to RGB post-processing options.
|
williamr@2
|
626 |
@publishedAll
|
williamr@2
|
627 |
@released
|
williamr@2
|
628 |
*/
|
williamr@2
|
629 |
class TYuvToRgbOptions
|
williamr@2
|
630 |
{
|
williamr@2
|
631 |
public:
|
williamr@2
|
632 |
/**
|
williamr@2
|
633 |
Lightness setting. The value range is [-100 … 100], with -100 corresponding to minimum setting,
|
williamr@2
|
634 |
100 to maximum setting, and 0 to no change in lightness. The actual lightness change formula
|
williamr@2
|
635 |
used is hardware device specific.
|
williamr@2
|
636 |
*/
|
williamr@2
|
637 |
TInt iLightness;
|
williamr@2
|
638 |
|
williamr@2
|
639 |
/**
|
williamr@2
|
640 |
Saturation setting. The value range is [-100 … 100], with -100 corresponding to minimum setting,
|
williamr@2
|
641 |
100 to maximum setting, and 0 to no change in saturation. The actual saturation formula used
|
williamr@2
|
642 |
is hardware device specific.
|
williamr@2
|
643 |
*/
|
williamr@2
|
644 |
TInt iSaturation;
|
williamr@2
|
645 |
|
williamr@2
|
646 |
/**
|
williamr@2
|
647 |
Contrast setting. The value range is [-100 … 100], with -100 corresponding to minimum setting,
|
williamr@2
|
648 |
100 to maximum setting, and 0 to no change in contrast. The actual contrast change formula
|
williamr@2
|
649 |
used is hardware device specific.
|
williamr@2
|
650 |
*/
|
williamr@2
|
651 |
TInt iContrast;
|
williamr@2
|
652 |
|
williamr@2
|
653 |
/**
|
williamr@2
|
654 |
Gamma setting for conversion. Ignored if the converter does not support gamma correction.
|
williamr@2
|
655 |
The gamma correction is defined as x' = x^(1/g), where x' refers to the corrected value,
|
williamr@2
|
656 |
x to the original input value and g to this field. Gamma correction is performed on the RGB values.
|
williamr@2
|
657 |
Set gamma to 1.0 to disable gamma correction.
|
williamr@2
|
658 |
*/
|
williamr@2
|
659 |
TReal iGamma;
|
williamr@2
|
660 |
|
williamr@2
|
661 |
/**
|
williamr@2
|
662 |
The dithering type to use.
|
williamr@2
|
663 |
*/
|
williamr@2
|
664 |
TDitherType iDitherType;
|
williamr@2
|
665 |
};
|
williamr@2
|
666 |
|
williamr@2
|
667 |
/**
|
williamr@2
|
668 |
Pre-processing options for color enhancement.
|
williamr@2
|
669 |
The value ranges have been chosen to match those in the Onboard Camera API.
|
williamr@2
|
670 |
@publishedAll
|
williamr@2
|
671 |
@released
|
williamr@2
|
672 |
*/
|
williamr@2
|
673 |
class TColorEnhancementOptions
|
williamr@2
|
674 |
{
|
williamr@2
|
675 |
public:
|
williamr@2
|
676 |
/**
|
williamr@2
|
677 |
Lightness setting. The value range is [-100 … 100], with -100 corresponding to minimum setting,
|
williamr@2
|
678 |
100 to maximum setting, and 0 to no change in lightness.
|
williamr@2
|
679 |
*/
|
williamr@2
|
680 |
TInt iLightness;
|
williamr@2
|
681 |
|
williamr@2
|
682 |
/**
|
williamr@2
|
683 |
Saturation setting. The value range is [-100 … 100], with -100 corresponding to minimum setting,
|
williamr@2
|
684 |
100 to maximum setting, and 0 to no change in saturation.
|
williamr@2
|
685 |
*/
|
williamr@2
|
686 |
TInt iSaturation;
|
williamr@2
|
687 |
|
williamr@2
|
688 |
/**
|
williamr@2
|
689 |
Contrast setting. The value range is [-100 … 100], with -100 corresponding to minimum setting,
|
williamr@2
|
690 |
100 to maximum setting, and 0 to no change in contrast.
|
williamr@2
|
691 |
*/
|
williamr@2
|
692 |
TInt iContrast;
|
williamr@2
|
693 |
};
|
williamr@2
|
694 |
|
williamr@2
|
695 |
/**
|
williamr@2
|
696 |
Describes the YUV to RGB color conversion capabilities of a post-processor.
|
williamr@2
|
697 |
@publishedAll
|
williamr@2
|
698 |
@released
|
williamr@2
|
699 |
*/
|
williamr@2
|
700 |
class TYuvToRgbCapabilities
|
williamr@2
|
701 |
{
|
williamr@2
|
702 |
public:
|
williamr@2
|
703 |
/**
|
williamr@2
|
704 |
Input YUV sampling patterns supported, a bitfield combination (bitwise OR) of TYuvSamplingPattern.
|
williamr@2
|
705 |
*/
|
williamr@2
|
706 |
TUint32 iSamplingPatterns;
|
williamr@2
|
707 |
|
williamr@2
|
708 |
/**
|
williamr@2
|
709 |
YUV to RGB conversion coefficients supported, a bitfield combination of TYuvCoefficients.
|
williamr@2
|
710 |
*/
|
williamr@2
|
711 |
TUint32 iCoefficients;
|
williamr@2
|
712 |
|
williamr@2
|
713 |
/**
|
williamr@2
|
714 |
Output RGB formats supported, a bitfield combination of TRgbFormat.
|
williamr@2
|
715 |
*/
|
williamr@2
|
716 |
TUint32 iRgbFormats;
|
williamr@2
|
717 |
|
williamr@2
|
718 |
/**
|
williamr@2
|
719 |
True if lightness control is supported.
|
williamr@2
|
720 |
*/
|
williamr@2
|
721 |
TBool iLightnessControl;
|
williamr@2
|
722 |
|
williamr@2
|
723 |
/**
|
williamr@2
|
724 |
True if saturation control is supported.
|
williamr@2
|
725 |
*/
|
williamr@2
|
726 |
TBool iSaturationControl;
|
williamr@2
|
727 |
|
williamr@2
|
728 |
/**
|
williamr@2
|
729 |
True if contrast control is supported.
|
williamr@2
|
730 |
*/
|
williamr@2
|
731 |
TBool iContrastControl;
|
williamr@2
|
732 |
|
williamr@2
|
733 |
/**
|
williamr@2
|
734 |
True if gamma correction is supported.
|
williamr@2
|
735 |
*/
|
williamr@2
|
736 |
TBool iGammaCorrection;
|
williamr@2
|
737 |
|
williamr@2
|
738 |
/**
|
williamr@2
|
739 |
Dithering types supported, a bitfield combination of TDitherType.
|
williamr@2
|
740 |
*/
|
williamr@2
|
741 |
TUint32 iDitherTypes;
|
williamr@2
|
742 |
};
|
williamr@2
|
743 |
|
williamr@2
|
744 |
/**
|
williamr@2
|
745 |
Specifies the YUV-to-YUV conversion capabilities for a plug-in.
|
williamr@2
|
746 |
@publishedAll
|
williamr@2
|
747 |
@released
|
williamr@2
|
748 |
*/
|
williamr@2
|
749 |
class TYuvToYuvCapabilities
|
williamr@2
|
750 |
{
|
williamr@2
|
751 |
public:
|
williamr@2
|
752 |
/**
|
williamr@2
|
753 |
The YUV sampling patterns supported for input data, a combination (binary OR) of values from TYuvSamplingPatterns.
|
williamr@2
|
754 |
*/
|
williamr@2
|
755 |
TUint32 iInputSamplingPatterns;
|
williamr@2
|
756 |
|
williamr@2
|
757 |
/**
|
williamr@2
|
758 |
The YUV data layouts supported for input data, a combination (binary OR) of values from TYuvDataLayout.
|
williamr@2
|
759 |
*/
|
williamr@2
|
760 |
TUint32 iInputDataLayouts;
|
williamr@2
|
761 |
|
williamr@2
|
762 |
/**
|
williamr@2
|
763 |
The YUV sampling patterns supported for output data, a combination (binary OR) of values from TYuvSamplingPatterns.
|
williamr@2
|
764 |
*/
|
williamr@2
|
765 |
TUint32 iOutputSamplingPatterns;
|
williamr@2
|
766 |
|
williamr@2
|
767 |
/**
|
williamr@2
|
768 |
The YUV data layouts supported for output data, a combination (binary OR) of values from TYuvDataLayout.
|
williamr@2
|
769 |
*/
|
williamr@2
|
770 |
TUint32 iOutputDataLayouts;
|
williamr@2
|
771 |
};
|
williamr@2
|
772 |
|
williamr@2
|
773 |
/**
|
williamr@2
|
774 |
Structure to combine a picture rate and size. Used when defining the maximum rate/size combinations
|
williamr@2
|
775 |
available.
|
williamr@2
|
776 |
@publishedAll
|
williamr@2
|
777 |
@released
|
williamr@2
|
778 |
*/
|
williamr@2
|
779 |
class TPictureRateAndSize
|
williamr@2
|
780 |
{
|
williamr@2
|
781 |
public:
|
williamr@2
|
782 |
/** The picture rate. */
|
williamr@2
|
783 |
TReal iPictureRate;
|
williamr@2
|
784 |
|
williamr@2
|
785 |
/** The picture size. */
|
williamr@2
|
786 |
TSize iPictureSize;
|
williamr@2
|
787 |
};
|
williamr@2
|
788 |
|
williamr@2
|
789 |
/**
|
williamr@2
|
790 |
CMMFVideoHwDevice is a base class for all video hardware devices.
|
williamr@2
|
791 |
@publishedAll
|
williamr@2
|
792 |
@released
|
williamr@2
|
793 |
*/
|
williamr@2
|
794 |
class CMMFVideoHwDevice : public CBase
|
williamr@2
|
795 |
{
|
williamr@2
|
796 |
public:
|
williamr@2
|
797 |
/**
|
williamr@2
|
798 |
Retrieves a custom interface to the device.
|
williamr@2
|
799 |
@param "aInterface" "Interface UID, defined with the custom interface."
|
williamr@2
|
800 |
@return "Pointer to the interface implementation, or NULL if the device does not
|
williamr@2
|
801 |
implement the interface requested. The return value must be cast to the
|
williamr@2
|
802 |
correct type by the user."
|
williamr@2
|
803 |
*/
|
williamr@2
|
804 |
virtual TAny* CustomInterface(TUid aInterface) = 0;
|
williamr@2
|
805 |
};
|
williamr@2
|
806 |
|
williamr@2
|
807 |
|
williamr@2
|
808 |
|
williamr@2
|
809 |
/**
|
williamr@2
|
810 |
Defines the interface that video clock sources must to implement.
|
williamr@2
|
811 |
|
williamr@2
|
812 |
A clock source can be used to synchronize video processing to some other processing entity,
|
williamr@2
|
813 |
for example an audio stream. The clock source is created and controlled by the DevVideo client,
|
williamr@2
|
814 |
and passed to the video hwdevices via the DevVideo interface. This allows the hwdevice to query
|
williamr@2
|
815 |
the current stream time, so it can ascertain which frame should be processed at any given moment.
|
williamr@2
|
816 |
|
williamr@2
|
817 |
"Stream time" is defined as the current position in the media stream. For example, when playing
|
williamr@2
|
818 |
a video clip, the stream time will always equal the current position in the clip. So, when the
|
williamr@2
|
819 |
clip is repositioned, the stream time will be equal to the new clip position. When the clip is
|
williamr@2
|
820 |
paused, the stream time will pause too.
|
williamr@2
|
821 |
|
williamr@2
|
822 |
Many hwdevice implementations will use extra threads to perform the video processing, so it is
|
williamr@2
|
823 |
essential that all implementations of the MMMFClockSource interface can be used from multiple
|
williamr@2
|
824 |
threads. A hwdevice that receives a clock source from the DevVideo client must be able to
|
williamr@2
|
825 |
assume that it can pass a pointer to the clock source object into another thread and use the
|
williamr@2
|
826 |
object directly from there.
|
williamr@2
|
827 |
|
williamr@2
|
828 |
All clock source implementations must protect the methods defined in the MMMFClockSource interface
|
williamr@2
|
829 |
so they can be called from any thread within the current process. Practically speaking, this means
|
williamr@2
|
830 |
using mutexes and critical sections to protect member data from being accessed from multiple threads
|
williamr@2
|
831 |
simultaneously. Also, any use of thread-specific handles (e.g. a CMMFDevSound object) must be
|
williamr@2
|
832 |
avoided from within these methods.
|
williamr@2
|
833 |
|
williamr@2
|
834 |
It can be assumed that any methods defined outside the MMMFClockSource interface (for example
|
williamr@2
|
835 |
methods used to control the clock source) will only be executed within the DevVideo client's thread,
|
williamr@2
|
836 |
so do not require protection.
|
williamr@2
|
837 |
|
williamr@2
|
838 |
@publishedAll
|
williamr@2
|
839 |
@released
|
williamr@2
|
840 |
*/
|
williamr@2
|
841 |
class MMMFClockSource
|
williamr@2
|
842 |
{
|
williamr@2
|
843 |
public:
|
williamr@2
|
844 |
/**
|
williamr@2
|
845 |
Retrieves a custom interface for the clock source.
|
williamr@2
|
846 |
|
williamr@2
|
847 |
This method can be called from any thread running inside the process in which the concrete
|
williamr@2
|
848 |
clock source was created. Note that this does not mean that all methods in the custom
|
williamr@2
|
849 |
interface can be called from any thread - that will be specified by the custom interface itself.
|
williamr@2
|
850 |
|
williamr@2
|
851 |
@param "aInterface" "Interface UID, defined by the entity specifying the interface."
|
williamr@2
|
852 |
@return "Pointer to the interface implementation, or NULL if the interface is not available.
|
williamr@2
|
853 |
The pointer must be cast to the appropriate interface class."
|
williamr@2
|
854 |
*/
|
williamr@2
|
855 |
virtual TAny* CustomInterface(TUid aInterface) = 0;
|
williamr@2
|
856 |
|
williamr@2
|
857 |
/**
|
williamr@2
|
858 |
Retrieves the current stream time. For example, if a clip is being played, the stream time will
|
williamr@2
|
859 |
be equal to the current position in the clip.
|
williamr@2
|
860 |
|
williamr@2
|
861 |
This method can be called from any thread running inside the process in which the concrete clock
|
williamr@2
|
862 |
source was created.
|
williamr@2
|
863 |
|
williamr@2
|
864 |
@return "The number of microseconds passed in the clock compared to the reference time."
|
williamr@2
|
865 |
*/
|
williamr@2
|
866 |
virtual TTimeIntervalMicroSeconds Time() = 0;
|
williamr@2
|
867 |
};
|
williamr@2
|
868 |
|
williamr@2
|
869 |
/**
|
williamr@2
|
870 |
The CSystemClockSource provides a basic clock source implementation based on the system clock.
|
williamr@2
|
871 |
It will count microseconds since the object was created or Reset() was last called, and return
|
williamr@2
|
872 |
that count from Time(). It does not implement any custom interfaces.
|
williamr@2
|
873 |
@publishedAll
|
williamr@2
|
874 |
@released
|
williamr@2
|
875 |
*/
|
williamr@2
|
876 |
class CSystemClockSource : public CBase, public MMMFClockSource
|
williamr@2
|
877 |
{
|
williamr@2
|
878 |
public:
|
williamr@2
|
879 |
/**
|
williamr@2
|
880 |
Creates a new CSystemClockSource object.
|
williamr@2
|
881 |
@return "A new clock source object."
|
williamr@2
|
882 |
@leave "This method may leave with one of the system-wide error codes."
|
williamr@2
|
883 |
*/
|
williamr@2
|
884 |
IMPORT_C static CSystemClockSource* NewL();
|
williamr@2
|
885 |
|
williamr@2
|
886 |
/**
|
williamr@2
|
887 |
Destructor.
|
williamr@2
|
888 |
*/
|
williamr@2
|
889 |
IMPORT_C ~CSystemClockSource();
|
williamr@2
|
890 |
|
williamr@2
|
891 |
// Control methods
|
williamr@2
|
892 |
/**
|
williamr@2
|
893 |
Resets the clock source to zero. Typically called by the DevVideo client at stream start.
|
williamr@2
|
894 |
*/
|
williamr@2
|
895 |
IMPORT_C void Reset();
|
williamr@2
|
896 |
|
williamr@2
|
897 |
/**
|
williamr@2
|
898 |
Resets the clock source to a user-defined offset. Typically called by the DevVideo client
|
williamr@2
|
899 |
when seeking in a file.
|
williamr@2
|
900 |
|
williamr@2
|
901 |
@param "aOffset" "The clock offset."
|
williamr@2
|
902 |
*/
|
williamr@2
|
903 |
IMPORT_C void Reset(const TTimeIntervalMicroSeconds& aOffset);
|
williamr@2
|
904 |
|
williamr@2
|
905 |
/**
|
williamr@2
|
906 |
Suspends the clock source. The clock time will not increment until the clock has been resumed.
|
williamr@2
|
907 |
This method is used when pausing playback.
|
williamr@2
|
908 |
*/
|
williamr@2
|
909 |
IMPORT_C void Suspend();
|
williamr@2
|
910 |
|
williamr@2
|
911 |
/**
|
williamr@2
|
912 |
Resumes the clock source after a Suspend() method call. This method is used when resuming playback.
|
williamr@2
|
913 |
*/
|
williamr@2
|
914 |
IMPORT_C void Resume();
|
williamr@2
|
915 |
|
williamr@2
|
916 |
// Implementation of MMMFClockSource
|
williamr@2
|
917 |
/**
|
williamr@2
|
918 |
No custom interfaces are implemented by this clock source, so this method will always return NULL.
|
williamr@2
|
919 |
@param "aInterface" "The interface"
|
williamr@2
|
920 |
@return "NULL"
|
williamr@2
|
921 |
*/
|
williamr@2
|
922 |
virtual TAny* CustomInterface(TUid aInterface);
|
williamr@2
|
923 |
/**
|
williamr@2
|
924 |
Retrieves the time that has elapsed since Reset() was last called, subtracting any time
|
williamr@2
|
925 |
during which the clock was suspended.
|
williamr@2
|
926 |
|
williamr@2
|
927 |
@return "The number of microseconds that have elapsed in the stream."
|
williamr@2
|
928 |
*/
|
williamr@2
|
929 |
virtual TTimeIntervalMicroSeconds Time();
|
williamr@2
|
930 |
|
williamr@2
|
931 |
private:
|
williamr@2
|
932 |
CSystemClockSource();
|
williamr@2
|
933 |
void ConstructL();
|
williamr@2
|
934 |
private:
|
williamr@2
|
935 |
TTime iStartTime;
|
williamr@2
|
936 |
TTime iCurrentTime;
|
williamr@2
|
937 |
|
williamr@2
|
938 |
TTimeIntervalMicroSeconds iOffset;
|
williamr@2
|
939 |
|
williamr@2
|
940 |
TTime iTimeWhenSuspended;
|
williamr@2
|
941 |
TTimeIntervalMicroSeconds iTimeSuspended;
|
williamr@2
|
942 |
TBool iSuspended;
|
williamr@2
|
943 |
|
williamr@2
|
944 |
RCriticalSection iCriticalSection;
|
williamr@2
|
945 |
};
|
williamr@2
|
946 |
|
williamr@2
|
947 |
|
williamr@2
|
948 |
/**
|
williamr@2
|
949 |
Observer class to be used with class CMMFClockSourcePeriodicUtility.
|
williamr@2
|
950 |
@publishedAll
|
williamr@2
|
951 |
@released
|
williamr@2
|
952 |
*/
|
williamr@2
|
953 |
class MMMFClockSourcePeriodicUtilityObserver
|
williamr@2
|
954 |
{
|
williamr@2
|
955 |
public:
|
williamr@2
|
956 |
/**
|
williamr@2
|
957 |
Notifies the observer that the specified period has elapsed.
|
williamr@2
|
958 |
@param "aTime" "The current time, queried from the clock source."
|
williamr@2
|
959 |
*/
|
williamr@2
|
960 |
virtual void MmcspuoTick(const TTimeIntervalMicroSeconds& aTime) = 0;
|
williamr@2
|
961 |
};
|
williamr@2
|
962 |
|
williamr@2
|
963 |
/**
|
williamr@2
|
964 |
Utility class that can be used by video HW devices to receive periodic callbacks with the current time.
|
williamr@2
|
965 |
Note that the exact timing of the callbacks cannot be guaranteed due to other things pre-empting
|
williamr@2
|
966 |
the execution of the active object or thread.
|
williamr@2
|
967 |
@publishedAll
|
williamr@2
|
968 |
@released
|
williamr@2
|
969 |
*/
|
williamr@2
|
970 |
class CMMFClockSourcePeriodicUtility : public CBase
|
williamr@2
|
971 |
{
|
williamr@2
|
972 |
public:
|
williamr@2
|
973 |
/**
|
williamr@2
|
974 |
Creates a new clock source periodic utility object.
|
williamr@2
|
975 |
|
williamr@2
|
976 |
@param "aClockSource" "A reference to the clock source to be used to query the current time."
|
williamr@2
|
977 |
@param "aObserver" "A reference to the observer of the utility that will receive callbacks
|
williamr@2
|
978 |
each time the specified period elapses."
|
williamr@2
|
979 |
@return "A new clock source periodic utility object."
|
williamr@2
|
980 |
@leave "The method will leave if an error occurs."
|
williamr@2
|
981 |
*/
|
williamr@2
|
982 |
IMPORT_C static CMMFClockSourcePeriodicUtility* NewL(MMMFClockSource& aClockSource, MMMFClockSourcePeriodicUtilityObserver& aObserver);
|
williamr@2
|
983 |
|
williamr@2
|
984 |
/**
|
williamr@2
|
985 |
Starts the clock source periodic utility. The utility will call MmcspuoTick on its observer
|
williamr@2
|
986 |
every aPeriod microseconds until Stop() is called. Note that the utility will not stop
|
williamr@2
|
987 |
automatically when the clock source is stopped.
|
williamr@2
|
988 |
|
williamr@2
|
989 |
@param "aPeriod" "Defines the period with which the observer will receive callbacks."
|
williamr@2
|
990 |
*/
|
williamr@2
|
991 |
IMPORT_C void Start(TTimeIntervalMicroSeconds32 aPeriod);
|
williamr@2
|
992 |
|
williamr@2
|
993 |
/**
|
williamr@2
|
994 |
Stops the clock source periodic utility. No more callbacks will be made after this method has
|
williamr@2
|
995 |
been called.
|
williamr@2
|
996 |
*/
|
williamr@2
|
997 |
IMPORT_C void Stop();
|
williamr@2
|
998 |
|
williamr@2
|
999 |
/**
|
williamr@2
|
1000 |
Destructor.
|
williamr@2
|
1001 |
*/
|
williamr@2
|
1002 |
IMPORT_C ~CMMFClockSourcePeriodicUtility();
|
williamr@2
|
1003 |
private:
|
williamr@2
|
1004 |
CMMFClockSourcePeriodicUtility(MMMFClockSource& aClockSource, MMMFClockSourcePeriodicUtilityObserver& aObserver);
|
williamr@2
|
1005 |
void ConstructL();
|
williamr@2
|
1006 |
static TInt Callback(TAny* aAny);
|
williamr@2
|
1007 |
void DoCallback();
|
williamr@2
|
1008 |
private:
|
williamr@2
|
1009 |
CPeriodic* iTimer;
|
williamr@2
|
1010 |
MMMFClockSource& iClockSource;
|
williamr@2
|
1011 |
MMMFClockSourcePeriodicUtilityObserver& iObserver;
|
williamr@2
|
1012 |
};
|
williamr@2
|
1013 |
|
williamr@2
|
1014 |
|
williamr@2
|
1015 |
/**
|
williamr@2
|
1016 |
Specifies the encoder buffering options.
|
williamr@2
|
1017 |
@publishedAll
|
williamr@2
|
1018 |
@released
|
williamr@2
|
1019 |
*/
|
williamr@2
|
1020 |
class TEncoderBufferOptions
|
williamr@2
|
1021 |
{
|
williamr@2
|
1022 |
public:
|
williamr@2
|
1023 |
/**
|
williamr@2
|
1024 |
The maximum number of pictures in the pre-encoder buffer.
|
williamr@2
|
1025 |
*/
|
williamr@2
|
1026 |
TUint iMaxPreEncoderBufferPictures;
|
williamr@2
|
1027 |
|
williamr@2
|
1028 |
/**
|
williamr@2
|
1029 |
The HRD/VBV specification that shall be fullfilled.
|
williamr@2
|
1030 |
*/
|
williamr@2
|
1031 |
THrdVbvSpecification iHrdVbvSpec;
|
williamr@2
|
1032 |
|
williamr@2
|
1033 |
/**
|
williamr@2
|
1034 |
The HRD/VBV buffering parameters. The data format depends on the parameters chosen. For
|
williamr@2
|
1035 |
3GPP TS 26.234 parameters (iHrdVbvSpec=EHrdVbv3GPP), the data in the descriptor is a package of type
|
williamr@2
|
1036 |
TPckC<T3gppHrdVbvParams> (see T3gppHrdVbvParams). If no HRD/VBV parameters are used, the
|
williamr@2
|
1037 |
descriptor is empty.
|
williamr@2
|
1038 |
*/
|
williamr@2
|
1039 |
TPtrC8 iHrdVbvParams;
|
williamr@2
|
1040 |
|
williamr@2
|
1041 |
/**
|
williamr@2
|
1042 |
The maximum size of an output buffer, in bytes. Use KMaxTUint for an unlimited size.
|
williamr@2
|
1043 |
*/
|
williamr@2
|
1044 |
TUint iMaxOutputBufferSize;
|
williamr@2
|
1045 |
|
williamr@2
|
1046 |
/**
|
williamr@2
|
1047 |
The maximum size of a coded picture, in bytes. Use KMaxTUint for an unlimited size.
|
williamr@2
|
1048 |
*/
|
williamr@2
|
1049 |
TUint iMaxCodedPictureSize;
|
williamr@2
|
1050 |
|
williamr@2
|
1051 |
/**
|
williamr@2
|
1052 |
The maximum size of a coded video segment, in bytes. Use KMaxTUint for an unlimited size.
|
williamr@2
|
1053 |
*/
|
williamr@2
|
1054 |
TUint iMaxCodedSegmentSize;
|
williamr@2
|
1055 |
|
williamr@2
|
1056 |
/**
|
williamr@2
|
1057 |
The mimimum number of output buffers.
|
williamr@2
|
1058 |
*/
|
williamr@2
|
1059 |
TUint iMinNumOutputBuffers;
|
williamr@2
|
1060 |
};
|
williamr@2
|
1061 |
|
williamr@2
|
1062 |
/**
|
williamr@2
|
1063 |
Specifies the video encoder bit-rate control options.
|
williamr@2
|
1064 |
@publishedAll
|
williamr@2
|
1065 |
@released
|
williamr@2
|
1066 |
*/
|
williamr@2
|
1067 |
class TRateControlOptions
|
williamr@2
|
1068 |
{
|
williamr@2
|
1069 |
public:
|
williamr@2
|
1070 |
/**
|
williamr@2
|
1071 |
Defines the bit-rate control type.
|
williamr@2
|
1072 |
*/
|
williamr@2
|
1073 |
TBitrateControlType iControl;
|
williamr@2
|
1074 |
|
williamr@2
|
1075 |
/**
|
williamr@2
|
1076 |
The target bit-rate, in bits per second. Used if bit-rate control type is EBrControlStream.
|
williamr@2
|
1077 |
If specified for an enhancement layer, the target bit-rate includes all lower layers. For example,
|
williamr@2
|
1078 |
if the client uses two layers, with the base layer using 64000 bps and the whole stream 192000 bps,
|
williamr@2
|
1079 |
this field is set to 64000 for layer zero and 192000 for layer one.
|
williamr@2
|
1080 |
*/
|
williamr@2
|
1081 |
TUint iBitrate;
|
williamr@2
|
1082 |
|
williamr@2
|
1083 |
/**
|
williamr@2
|
1084 |
The target picture quality. The value range is [0…100], with 0 corresponding to minimum quality
|
williamr@2
|
1085 |
and 100 to lossless coding (or the closest equivalent supported).
|
williamr@2
|
1086 |
*/
|
williamr@2
|
1087 |
TUint iPictureQuality;
|
williamr@2
|
1088 |
|
williamr@2
|
1089 |
/**
|
williamr@2
|
1090 |
The target picture rate, in pictures per second. If specified for an enhancement layer, the target
|
williamr@2
|
1091 |
frame rate includes all lower layers.
|
williamr@2
|
1092 |
*/
|
williamr@2
|
1093 |
TReal iPictureRate;
|
williamr@2
|
1094 |
|
williamr@2
|
1095 |
/**
|
williamr@2
|
1096 |
The quality/temporal tradeoff for bit-rate control. The value range is [0.0…1.0]. Value 0.0
|
williamr@2
|
1097 |
specifies that picture quality should be maintained as well as possible, sacrificing picture rate.
|
williamr@2
|
1098 |
Value 1.0 specifies that picture rate should be maintained as well as possible, sacrificing
|
williamr@2
|
1099 |
picture quality.
|
williamr@2
|
1100 |
*/
|
williamr@4
|
1101 |
TReal iQualityTemporalTradeoff;
|
williamr@4
|
1102 |
|
williamr@2
|
1103 |
/**
|
williamr@4
|
1104 |
The latency/quality tradeoff for bit-rate control. The value range is [0.0…1.0]. Value 0.0
|
williamr@4
|
1105 |
specifies that the transmission delay and the decoder input buffer occupancy level caused by
|
williamr@4
|
1106 |
the bit-rate control is minimized, i.e. the actual coded bit-rate follows the target bit-rate
|
williamr@4
|
1107 |
as closely as possible. 1.0 specifies that the transmission delay caused by the bit-rate control
|
williamr@4
|
1108 |
should be as high as needed to guarantee a constant picture quality and frame rate as long as
|
williamr@4
|
1109 |
the coded data conforms to the given HRD/VBV parameters (if any).
|
williamr@4
|
1110 |
*/
|
williamr@4
|
1111 |
|
williamr@2
|
1112 |
TReal iLatencyQualityTradeoff;
|
williamr@2
|
1113 |
};
|
williamr@2
|
1114 |
|
williamr@2
|
1115 |
/**
|
williamr@2
|
1116 |
Custom interface Uid for setting up the DevVideo hw device adapter
|
williamr@2
|
1117 |
*/
|
williamr@2
|
1118 |
const TInt KUidDevVideoHwDeviceAdapterSetup = 0x102737EF;
|
williamr@2
|
1119 |
|
williamr@2
|
1120 |
#include <mmf/devvideo/devvideobase.inl>
|
williamr@2
|
1121 |
|
williamr@2
|
1122 |
#endif
|
williamr@4
|
1123 |
|