1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // Mda\Common\MmfVideo.h
18 #ifndef __MMF_COMMON_VIDEO_H__
19 #define __MMF_COMMON_VIDEO_H__
21 #include <mmf/common/mmfutilities.h>
23 #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
24 #include <mmf/common/mmfvideoenums.h>
33 The use of this constant as either a parameter for
34 CVideoRecorderUtility::SetVideoBitRateL or as a return value from
35 CVideoRecorderUtility::VideoBitRateL signifies that a variable
36 video bit rate is being used.
38 const TInt KMMFVariableVideoBitRate = -1;
44 CVideoRecorderUtility::SetMaxClipSizeL can take this constant
45 instead of a byte value. This signifies there should be no max
48 const TInt KMMFNoMaxClipSize = -1;
54 CVideoPlayerUtility/CVideoRecorderUtility HandleEvent() code :
55 the video source file has been successfully opened
57 const TUid KMMFEventCategoryVideoOpenComplete = {0x101F7F85};
63 The unique identifier for the event that indicates that the video has been prepared for recording.
65 const TUid KMMFEventCategoryVideoPrepareComplete = {0x101F7F86};
71 const TUid KMMFEventCategoryVideoLoadingStarted = {0x101F7F87};
77 const TUid KMMFEventCategoryVideoLoadingComplete = {0x101F7F88};
83 const TUid KMMFEventCategoryVideoPlayerGeneralError = {0x101F8000};
89 const TUid KMMFEventCategoryVideoRecorderGeneralError = {0x101F8001};
96 Defines an absolute rotation in 90 degree increments
103 EVideoRotationClockwise90,
104 EVideoRotationClockwise180,
105 EVideoRotationClockwise270
112 Class used when sending custom commands from the client API
113 to the video controller to get or set the video configuration.
115 class TMMFVideoConfig
118 inline TMMFVideoConfig();
122 A flag indicating whether audio output is enabled. ETrue if teh audio is to be enabled, false if
127 The location of the top left corner of the video window.
131 Defines the rectangle in which the video clip will be played.
135 A handle to the bitmap into which the decoded frame(s) are put.
139 The current frame number in the video clip.
143 The number of frames per second; may not be an integer.
145 TReal32 iFramesPerSecond;
147 The width & height of the video frame.
149 TSize iVideoFrameSize;
151 The volume setting of the video device.
153 Should be between 0 and iMaxVolume.
157 The maximum volume setting of the video device.
159 This value is platform dependent but is always greater than or equal to one. This is the maximum
160 value that should be passed to iVolume.
164 The balance of the audio channels for the video device. Zero for normal balance.
168 The gain of the audio channels for the video device. This can be any value from zero to
173 The maximum gain of the audio channels for the video device.
179 Meta data is often contained in the header of multimedia clips and is used to define attributes
180 such as the author and copyright details.
184 Set the maximum size of the recording, in bytes.
188 The number of channels (mono/stereo) that can be read by the video device.
192 The video bit rate of the video device.
196 The audio bit rate of the video device.
200 The unique identifier of the video format handled by the video device.
204 The video data type represented as a fourCC code.
208 The audio data type represented as a fourCC code.
212 The period over which the volume is to rise.
214 TTimeIntervalMicroSeconds iRampDuration;
216 The start position for playback in micro seconds.
218 TTimeIntervalMicroSeconds iStartPosition;
220 The end position for playback in micro seconds.
222 TTimeIntervalMicroSeconds iEndPosition;
224 The (possibly estimated) record time left in the clip.
226 TTimeIntervalMicroSeconds iRecordTimeAvailable;
228 Handle to the bitmap of the current video frame.
230 Used by RMMFVideoPlayControllerCustomCommands::GetFrame()
231 to pass a bitmap handle to the video controller.
233 TInt iFrameBitmapServerHandle;
235 Defines the window in which the video clip will be played.
239 A handle to the video camera being used.
243 Whether the video display is active
247 The percentage of loading/rebuffering completed.
249 TInt iLoadingCompletePercentage;
253 TVideoRotation iVideoRotation;
255 The percentage (100 = original size) by which the width of the video image is scaled.
257 TReal32 iWidthScalePercentage;
259 The percentage (100 = original size) by which the height of the video image is scaled.
261 TReal32 iHeightScalePercentage;
263 A boolean indicating if anti-aliasing filtering should be used.
265 TBool iAntiAliasFiltering;
267 The crop region currently applied to the image.
269 TRect iCropRectangle;
272 This member is internal and not intended for use.
280 Initialises the object with arbitrary values.
282 inline TMMFVideoConfig::TMMFVideoConfig() {};
288 Interface class to provide a callback to the video controller
289 custom command interface from the controller plug-in
290 (the object that implements the video record controller interface
291 MMMFVideoPlayControllerCustomCommandImplementor) when a GetFrame()
292 request has been issued.
294 @see RMMFVideoPlayControllerCustomCommands::GetFrame()
296 class MMMFVideoFrameMessage
300 Called when a frame has been successfully decoded.
303 The result code to be given to the client.
305 virtual void FrameReady(TInt aError) = 0;
307 Returns the decoded frame as a bitmap.
309 @return A reference to the video frame.
311 virtual CFbsBitmap& GetBitmap() = 0;
318 Represents the video aspect ratio as a fraction: iNumerator/iDenominator.
320 class TVideoAspectRatio
324 Aspect ratio numerator.
329 Aspect ratio denominator.
334 Constructs a default aspect ratio object. The default aspect ratio is
337 inline TVideoAspectRatio();
340 Constructs an aspect ratio object from a numerator and a denominator.
343 Aspect ratio numerator.
345 Aspect ratio denominator.
347 inline TVideoAspectRatio(TInt aNumerator, TInt aDenominator);
350 Compares two aspect ratio object for equality. The objects are
351 considered equal if the numerator and denominator match.
352 Note that the implementation will not attempt to reduce the fractions
355 inline TBool operator==(const TVideoAspectRatio& aAspectRatio) const;
358 Compares two aspect ratio object for equality. The objects are
359 considered inequal if either the numerators or the denominators differ.
360 Note that the implementation will not attempt to reduce the fractions
363 inline TBool operator!=(const TVideoAspectRatio& aAspectRatio) const;
366 inline TVideoAspectRatio::TVideoAspectRatio()
367 : iNumerator(1),iDenominator(1)
371 inline TVideoAspectRatio::TVideoAspectRatio(TInt aNumerator, TInt aDenominator)
372 : iNumerator(aNumerator),iDenominator(aDenominator)
376 inline TBool TVideoAspectRatio::operator==(const TVideoAspectRatio& aAspectRatio) const
378 return ((iNumerator == aAspectRatio.iNumerator) && (iDenominator == aAspectRatio.iDenominator));
381 inline TBool TVideoAspectRatio::operator!=(const TVideoAspectRatio& aAspectRatio) const
383 return ((iNumerator != aAspectRatio.iNumerator) || (iDenominator != aAspectRatio.iDenominator));
387 Automatic scaling type.
392 @see CVideoPlayerUtility::SetAutoScaleL
396 /** No automatic scaling */
400 Best fit: The picture is scaled to fit the window without
401 clipping while maintaining aspect ratio. If window and
402 picture aspect ratios do not match, window background color
403 is used to fill the borders.
408 Clip: The picture is scaled to fit in the window, scaled in both
409 directions while maintaining aspect ratio. If window and
410 picture aspect ratios do not match, some of the video
411 picture will be clipped.
416 Stretch: The picture is scaled to fit in the window without
417 maintaining aspect ratio. If window and picture aspect
418 ratios do not match, the picture will be distorted.
424 Horizontal alignment for automatic scaling.
431 enum THorizontalAlign
433 /** The picture is horizontally centered */
434 EHorizontalAlignCenter = 0x70000000,
435 /** The picture is left-aligned */
436 EHorizontalAlignLeft,
437 /** The picture is right-aligned */
438 EHorizontalAlignRight
442 Vertical alignment for automatic scaling.
451 /** The picture is vertically centered */
452 EVerticalAlignCenter = 0x70000000,
453 /** The picture is top-aligned */
455 /** The picture is bottom-aligned */