sl@0: // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // Mda\Common\MmfVideo.h sl@0: // sl@0: // sl@0: sl@0: #ifndef __MMF_COMMON_VIDEO_H__ sl@0: #define __MMF_COMMON_VIDEO_H__ sl@0: sl@0: #include sl@0: sl@0: #ifndef SYMBIAN_ENABLE_SPLIT_HEADERS sl@0: #include sl@0: #endif sl@0: sl@0: class CFbsBitmap; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: The use of this constant as either a parameter for sl@0: CVideoRecorderUtility::SetVideoBitRateL or as a return value from sl@0: CVideoRecorderUtility::VideoBitRateL signifies that a variable sl@0: video bit rate is being used. sl@0: */ sl@0: const TInt KMMFVariableVideoBitRate = -1; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: CVideoRecorderUtility::SetMaxClipSizeL can take this constant sl@0: instead of a byte value. This signifies there should be no max sl@0: clip size sl@0: */ sl@0: const TInt KMMFNoMaxClipSize = -1; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: CVideoPlayerUtility/CVideoRecorderUtility HandleEvent() code : sl@0: the video source file has been successfully opened sl@0: */ sl@0: const TUid KMMFEventCategoryVideoOpenComplete = {0x101F7F85}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: The unique identifier for the event that indicates that the video has been prepared for recording. sl@0: */ sl@0: const TUid KMMFEventCategoryVideoPrepareComplete = {0x101F7F86}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: const TUid KMMFEventCategoryVideoLoadingStarted = {0x101F7F87}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: const TUid KMMFEventCategoryVideoLoadingComplete = {0x101F7F88}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: const TUid KMMFEventCategoryVideoPlayerGeneralError = {0x101F8000}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: */ sl@0: const TUid KMMFEventCategoryVideoRecorderGeneralError = {0x101F8001}; sl@0: sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Defines an absolute rotation in 90 degree increments sl@0: sl@0: @since 7.0s sl@0: */ sl@0: enum TVideoRotation sl@0: { sl@0: EVideoRotationNone, sl@0: EVideoRotationClockwise90, sl@0: EVideoRotationClockwise180, sl@0: EVideoRotationClockwise270 sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Class used when sending custom commands from the client API sl@0: to the video controller to get or set the video configuration. sl@0: */ sl@0: class TMMFVideoConfig sl@0: { sl@0: public: sl@0: inline TMMFVideoConfig(); sl@0: sl@0: public: sl@0: /** sl@0: A flag indicating whether audio output is enabled. ETrue if teh audio is to be enabled, false if sl@0: not. sl@0: */ sl@0: TBool iAudioEnabled; sl@0: /** sl@0: The location of the top left corner of the video window. sl@0: */ sl@0: TPoint iTopLeftPt; sl@0: /** sl@0: Defines the rectangle in which the video clip will be played. sl@0: */ sl@0: TRect iClipRect; sl@0: /** sl@0: A handle to the bitmap into which the decoded frame(s) are put. sl@0: */ sl@0: TInt iBitmapHandle; sl@0: /** sl@0: The current frame number in the video clip. sl@0: */ sl@0: TInt iFrameNumber; sl@0: /** sl@0: The number of frames per second; may not be an integer. sl@0: */ sl@0: TReal32 iFramesPerSecond; sl@0: /** sl@0: The width & height of the video frame. sl@0: */ sl@0: TSize iVideoFrameSize; sl@0: /** sl@0: The volume setting of the video device. sl@0: sl@0: Should be between 0 and iMaxVolume. sl@0: */ sl@0: TInt iVolume; sl@0: /** sl@0: The maximum volume setting of the video device. sl@0: sl@0: This value is platform dependent but is always greater than or equal to one. This is the maximum sl@0: value that should be passed to iVolume. sl@0: */ sl@0: TInt iMaxVolume; sl@0: /** sl@0: The balance of the audio channels for the video device. Zero for normal balance. sl@0: */ sl@0: TInt iBalance; sl@0: /** sl@0: The gain of the audio channels for the video device. This can be any value from zero to sl@0: iMaxGain. sl@0: */ sl@0: TInt iGain; sl@0: /** sl@0: The maximum gain of the audio channels for the video device. sl@0: */ sl@0: TInt iMaxGain; sl@0: /** sl@0: Unused. sl@0: sl@0: Meta data is often contained in the header of multimedia clips and is used to define attributes sl@0: such as the author and copyright details. sl@0: */ sl@0: TInt iMetaData; sl@0: /** sl@0: Set the maximum size of the recording, in bytes. sl@0: */ sl@0: TInt iMaxFileSize; sl@0: /** sl@0: The number of channels (mono/stereo) that can be read by the video device. sl@0: */ sl@0: TUint iChannels; sl@0: /** sl@0: The video bit rate of the video device. sl@0: */ sl@0: TInt iVideoBitRate; sl@0: /** sl@0: The audio bit rate of the video device. sl@0: */ sl@0: TInt iAudioBitRate; sl@0: /** sl@0: The unique identifier of the video format handled by the video device. sl@0: */ sl@0: TUid iFormatUid; sl@0: /** sl@0: The video data type represented as a fourCC code. sl@0: */ sl@0: TFourCC iVideoCodec; sl@0: /** sl@0: The audio data type represented as a fourCC code. sl@0: */ sl@0: TFourCC iAudioCodec; sl@0: /** sl@0: The period over which the volume is to rise. sl@0: */ sl@0: TTimeIntervalMicroSeconds iRampDuration; sl@0: /** sl@0: The start position for playback in micro seconds. sl@0: */ sl@0: TTimeIntervalMicroSeconds iStartPosition; sl@0: /** sl@0: The end position for playback in micro seconds. sl@0: */ sl@0: TTimeIntervalMicroSeconds iEndPosition; sl@0: /** sl@0: The (possibly estimated) record time left in the clip. sl@0: */ sl@0: TTimeIntervalMicroSeconds iRecordTimeAvailable; sl@0: /** sl@0: Handle to the bitmap of the current video frame. sl@0: sl@0: Used by RMMFVideoPlayControllerCustomCommands::GetFrame() sl@0: to pass a bitmap handle to the video controller. sl@0: */ sl@0: TInt iFrameBitmapServerHandle; sl@0: /** sl@0: Defines the window in which the video clip will be played. sl@0: */ sl@0: TRect iWindowRect; sl@0: /** sl@0: A handle to the video camera being used. sl@0: */ sl@0: TInt iCameraHandle; sl@0: /** sl@0: Whether the video display is active sl@0: */ sl@0: TInt iDSAEvent; sl@0: /** sl@0: The percentage of loading/rebuffering completed. sl@0: */ sl@0: TInt iLoadingCompletePercentage; sl@0: /** sl@0: The video rotation. sl@0: */ sl@0: TVideoRotation iVideoRotation; sl@0: /** sl@0: The percentage (100 = original size) by which the width of the video image is scaled. sl@0: */ sl@0: TReal32 iWidthScalePercentage; sl@0: /** sl@0: The percentage (100 = original size) by which the height of the video image is scaled. sl@0: */ sl@0: TReal32 iHeightScalePercentage; sl@0: /** sl@0: A boolean indicating if anti-aliasing filtering should be used. sl@0: */ sl@0: TBool iAntiAliasFiltering; sl@0: /** sl@0: The crop region currently applied to the image. sl@0: */ sl@0: TRect iCropRectangle; sl@0: private: sl@0: /** sl@0: This member is internal and not intended for use. sl@0: */ sl@0: TInt iReserved1; sl@0: TInt iReserved2; sl@0: TInt iReserved3; sl@0: }; sl@0: sl@0: /** sl@0: Initialises the object with arbitrary values. sl@0: */ sl@0: inline TMMFVideoConfig::TMMFVideoConfig() {}; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Interface class to provide a callback to the video controller sl@0: custom command interface from the controller plug-in sl@0: (the object that implements the video record controller interface sl@0: MMMFVideoPlayControllerCustomCommandImplementor) when a GetFrame() sl@0: request has been issued. sl@0: sl@0: @see RMMFVideoPlayControllerCustomCommands::GetFrame() sl@0: */ sl@0: class MMMFVideoFrameMessage sl@0: { sl@0: public: sl@0: /** sl@0: Called when a frame has been successfully decoded. sl@0: sl@0: @param aError sl@0: The result code to be given to the client. sl@0: */ sl@0: virtual void FrameReady(TInt aError) = 0; sl@0: /** sl@0: Returns the decoded frame as a bitmap. sl@0: sl@0: @return A reference to the video frame. sl@0: */ sl@0: virtual CFbsBitmap& GetBitmap() = 0; sl@0: }; sl@0: sl@0: /** sl@0: @publishedAll sl@0: @released sl@0: sl@0: Represents the video aspect ratio as a fraction: iNumerator/iDenominator. sl@0: */ sl@0: class TVideoAspectRatio sl@0: { sl@0: public: sl@0: /** sl@0: Aspect ratio numerator. sl@0: */ sl@0: TInt iNumerator; sl@0: sl@0: /** sl@0: Aspect ratio denominator. sl@0: */ sl@0: TInt iDenominator; sl@0: sl@0: /** sl@0: Constructs a default aspect ratio object. The default aspect ratio is sl@0: 1:1 (square). sl@0: */ sl@0: inline TVideoAspectRatio(); sl@0: sl@0: /** sl@0: Constructs an aspect ratio object from a numerator and a denominator. sl@0: sl@0: @param aNumerator sl@0: Aspect ratio numerator. sl@0: @param aDenominator sl@0: Aspect ratio denominator. sl@0: */ sl@0: inline TVideoAspectRatio(TInt aNumerator, TInt aDenominator); sl@0: sl@0: /** sl@0: Compares two aspect ratio object for equality. The objects are sl@0: considered equal if the numerator and denominator match. sl@0: Note that the implementation will not attempt to reduce the fractions sl@0: before comparison. sl@0: */ sl@0: inline TBool operator==(const TVideoAspectRatio& aAspectRatio) const; sl@0: sl@0: /** sl@0: Compares two aspect ratio object for equality. The objects are sl@0: considered inequal if either the numerators or the denominators differ. sl@0: Note that the implementation will not attempt to reduce the fractions sl@0: before comparison. sl@0: */ sl@0: inline TBool operator!=(const TVideoAspectRatio& aAspectRatio) const; sl@0: }; sl@0: sl@0: inline TVideoAspectRatio::TVideoAspectRatio() sl@0: : iNumerator(1),iDenominator(1) sl@0: { sl@0: } sl@0: sl@0: inline TVideoAspectRatio::TVideoAspectRatio(TInt aNumerator, TInt aDenominator) sl@0: : iNumerator(aNumerator),iDenominator(aDenominator) sl@0: { sl@0: } sl@0: sl@0: inline TBool TVideoAspectRatio::operator==(const TVideoAspectRatio& aAspectRatio) const sl@0: { sl@0: return ((iNumerator == aAspectRatio.iNumerator) && (iDenominator == aAspectRatio.iDenominator)); sl@0: } sl@0: sl@0: inline TBool TVideoAspectRatio::operator!=(const TVideoAspectRatio& aAspectRatio) const sl@0: { sl@0: return ((iNumerator != aAspectRatio.iNumerator) || (iDenominator != aAspectRatio.iDenominator)); sl@0: } sl@0: sl@0: /** sl@0: Automatic scaling type. sl@0: sl@0: @publishedAll sl@0: @released sl@0: sl@0: @see CVideoPlayerUtility::SetAutoScaleL sl@0: */ sl@0: enum TAutoScaleType sl@0: { sl@0: /** No automatic scaling */ sl@0: EAutoScaleNone = 0, sl@0: sl@0: /** sl@0: Best fit: The picture is scaled to fit the window without sl@0: clipping while maintaining aspect ratio. If window and sl@0: picture aspect ratios do not match, window background color sl@0: is used to fill the borders. sl@0: */ sl@0: EAutoScaleBestFit, sl@0: sl@0: /** sl@0: Clip: The picture is scaled to fit in the window, scaled in both sl@0: directions while maintaining aspect ratio. If window and sl@0: picture aspect ratios do not match, some of the video sl@0: picture will be clipped. sl@0: */ sl@0: EAutoScaleClip, sl@0: sl@0: /** sl@0: Stretch: The picture is scaled to fit in the window without sl@0: maintaining aspect ratio. If window and picture aspect sl@0: ratios do not match, the picture will be distorted. sl@0: */ sl@0: EAutoScaleStretch sl@0: }; sl@0: sl@0: /** sl@0: Horizontal alignment for automatic scaling. sl@0: sl@0: @publishedAll sl@0: @released sl@0: sl@0: @see SetAutoScaleL sl@0: */ sl@0: enum THorizontalAlign sl@0: { sl@0: /** The picture is horizontally centered */ sl@0: EHorizontalAlignCenter = 0x70000000, sl@0: /** The picture is left-aligned */ sl@0: EHorizontalAlignLeft, sl@0: /** The picture is right-aligned */ sl@0: EHorizontalAlignRight sl@0: }; sl@0: sl@0: /** sl@0: Vertical alignment for automatic scaling. sl@0: sl@0: @publishedAll sl@0: @released sl@0: sl@0: @see SetAutoScaleL sl@0: */ sl@0: enum TVerticalAlign sl@0: { sl@0: /** The picture is vertically centered */ sl@0: EVerticalAlignCenter = 0x70000000, sl@0: /** The picture is top-aligned */ sl@0: EVerticalAlignTop, sl@0: /** The picture is bottom-aligned */ sl@0: EVerticalAlignBottom sl@0: }; sl@0: sl@0: #endif