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