epoc32/include/mmf/common/mmfvideo.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 2002-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
// Mda\Common\MmfVideo.h
williamr@2
    15
// 
williamr@2
    16
//
williamr@2
    17
williamr@2
    18
#ifndef __MMF_COMMON_VIDEO_H__
williamr@2
    19
#define __MMF_COMMON_VIDEO_H__
williamr@2
    20
williamr@2
    21
#include <mmf/common/mmfutilities.h>
williamr@2
    22
williamr@4
    23
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS
williamr@4
    24
#include <mmf/common/mmfvideoenums.h>
williamr@4
    25
#endif
williamr@4
    26
williamr@2
    27
class CFbsBitmap;
williamr@2
    28
williamr@2
    29
/**
williamr@2
    30
@publishedAll
williamr@2
    31
@released
williamr@2
    32
williamr@2
    33
The use of this constant as either a parameter for
williamr@2
    34
CVideoRecorderUtility::SetVideoBitRateL or as a return value from
williamr@2
    35
CVideoRecorderUtility::VideoBitRateL signifies that a variable
williamr@2
    36
video bit rate is being used.
williamr@2
    37
*/
williamr@2
    38
const TInt KMMFVariableVideoBitRate = -1;
williamr@2
    39
williamr@2
    40
/**
williamr@2
    41
@publishedAll
williamr@2
    42
@released
williamr@2
    43
williamr@2
    44
CVideoRecorderUtility::SetMaxClipSizeL can take this constant
williamr@2
    45
instead of a byte value.  This signifies there should be no max
williamr@2
    46
clip size
williamr@2
    47
*/
williamr@2
    48
const TInt KMMFNoMaxClipSize = -1;
williamr@2
    49
williamr@2
    50
/**
williamr@2
    51
@publishedAll
williamr@2
    52
@released
williamr@2
    53
williamr@2
    54
CVideoPlayerUtility/CVideoRecorderUtility HandleEvent() code :
williamr@2
    55
the video source file has been successfully opened
williamr@2
    56
*/
williamr@2
    57
const TUid KMMFEventCategoryVideoOpenComplete = {0x101F7F85};
williamr@2
    58
williamr@2
    59
/**
williamr@2
    60
@publishedAll
williamr@2
    61
@released
williamr@2
    62
williamr@2
    63
The unique identifier for the event that indicates that the video has been prepared for recording.
williamr@2
    64
*/
williamr@2
    65
const TUid KMMFEventCategoryVideoPrepareComplete = {0x101F7F86};
williamr@2
    66
williamr@2
    67
/**
williamr@2
    68
@publishedAll
williamr@2
    69
@released
williamr@2
    70
*/
williamr@2
    71
const TUid KMMFEventCategoryVideoLoadingStarted = {0x101F7F87};
williamr@2
    72
williamr@2
    73
/**
williamr@2
    74
@publishedAll
williamr@2
    75
@released
williamr@2
    76
*/
williamr@2
    77
const TUid KMMFEventCategoryVideoLoadingComplete = {0x101F7F88};
williamr@2
    78
williamr@2
    79
/**
williamr@2
    80
@publishedAll
williamr@2
    81
@released
williamr@2
    82
*/
williamr@2
    83
const TUid KMMFEventCategoryVideoPlayerGeneralError = {0x101F8000};
williamr@2
    84
williamr@2
    85
/**
williamr@2
    86
@publishedAll
williamr@2
    87
@released
williamr@2
    88
*/
williamr@2
    89
const TUid KMMFEventCategoryVideoRecorderGeneralError = {0x101F8001};
williamr@2
    90
williamr@2
    91
williamr@2
    92
/**
williamr@2
    93
@publishedAll
williamr@2
    94
@released
williamr@2
    95
williamr@2
    96
Defines an absolute rotation in 90 degree increments
williamr@2
    97
williamr@2
    98
@since  7.0s
williamr@2
    99
*/
williamr@2
   100
enum TVideoRotation
williamr@2
   101
	{
williamr@2
   102
	EVideoRotationNone,
williamr@2
   103
	EVideoRotationClockwise90,
williamr@2
   104
	EVideoRotationClockwise180,
williamr@2
   105
	EVideoRotationClockwise270
williamr@2
   106
	};
williamr@2
   107
williamr@2
   108
/**
williamr@2
   109
@publishedAll
williamr@2
   110
@released
williamr@2
   111
williamr@2
   112
Class used when sending custom commands from the client API
williamr@2
   113
to the video controller to get or set the video configuration.
williamr@2
   114
*/
williamr@2
   115
class TMMFVideoConfig
williamr@2
   116
	{
williamr@2
   117
public:
williamr@2
   118
	inline TMMFVideoConfig();
williamr@2
   119
williamr@2
   120
public:
williamr@2
   121
	/**
williamr@2
   122
	A flag indicating whether audio output is enabled. ETrue if teh audio is to be enabled, false if
williamr@2
   123
	not.
williamr@2
   124
	*/
williamr@2
   125
	TBool						iAudioEnabled;
williamr@2
   126
	/**
williamr@2
   127
	The location of the top left corner of the video window.
williamr@2
   128
	*/
williamr@2
   129
	TPoint						iTopLeftPt;
williamr@2
   130
	/**
williamr@2
   131
	Defines the rectangle in which the video clip will be played.
williamr@2
   132
	*/
williamr@2
   133
	TRect						iClipRect;
williamr@2
   134
	/**
williamr@2
   135
	A handle to the bitmap into which the decoded frame(s) are put.
williamr@2
   136
	*/
williamr@2
   137
	TInt						iBitmapHandle;
williamr@2
   138
	/**
williamr@2
   139
	The current frame number in the video clip.
williamr@2
   140
	 */
williamr@2
   141
	TInt						iFrameNumber;
williamr@2
   142
	/**
williamr@2
   143
	The number of frames per second; may not be an integer.
williamr@2
   144
	*/
williamr@2
   145
	TReal32						iFramesPerSecond;
williamr@2
   146
	/**
williamr@2
   147
	The width & height of the video frame.
williamr@2
   148
	*/
williamr@2
   149
	TSize						iVideoFrameSize;
williamr@2
   150
	/**
williamr@2
   151
	The volume setting of the video device.
williamr@2
   152
williamr@2
   153
	Should be between 0 and iMaxVolume.
williamr@2
   154
	*/
williamr@2
   155
	TInt						iVolume;
williamr@2
   156
	/**
williamr@2
   157
	The maximum volume setting of the video device.
williamr@2
   158
williamr@2
   159
	This value is platform dependent but is always greater than or equal to one. This is the maximum
williamr@2
   160
	value that should be passed to iVolume.
williamr@2
   161
	*/
williamr@2
   162
	TInt						iMaxVolume;
williamr@2
   163
	/**
williamr@2
   164
	The balance of the audio channels for the video device. Zero for normal balance.
williamr@2
   165
	*/
williamr@2
   166
	TInt						iBalance;
williamr@2
   167
	/**
williamr@2
   168
	The gain of the audio channels for the video device. This can be any value from zero to
williamr@2
   169
	iMaxGain.
williamr@2
   170
	*/
williamr@2
   171
	TInt						iGain;
williamr@2
   172
	/**
williamr@2
   173
	The maximum gain of the audio channels for the video device.
williamr@2
   174
	*/
williamr@2
   175
	TInt						iMaxGain;
williamr@2
   176
	/**
williamr@2
   177
	Unused.
williamr@2
   178
williamr@2
   179
	Meta data is often contained in the header of multimedia clips and is used to define attributes
williamr@2
   180
	such as the author and copyright details.
williamr@2
   181
	*/
williamr@2
   182
	TInt						iMetaData;
williamr@2
   183
	/**
williamr@2
   184
	Set the maximum size of the recording, in bytes.
williamr@2
   185
	*/
williamr@2
   186
	TInt						iMaxFileSize;
williamr@2
   187
	/**
williamr@2
   188
	The number of channels (mono/stereo) that can be read by the video device.
williamr@2
   189
	*/
williamr@2
   190
	TUint						iChannels;
williamr@2
   191
	/**
williamr@2
   192
	The video bit rate of the video device.
williamr@2
   193
	*/
williamr@2
   194
	TInt						iVideoBitRate;
williamr@2
   195
	/**
williamr@2
   196
	The audio bit rate of the video device.
williamr@2
   197
	*/
williamr@2
   198
	TInt						iAudioBitRate;
williamr@2
   199
	/**
williamr@2
   200
	The unique identifier of the video format handled by the video device.
williamr@2
   201
	*/
williamr@2
   202
	TUid						iFormatUid;
williamr@2
   203
	/**
williamr@2
   204
	The video data type represented as a fourCC code.
williamr@2
   205
	*/
williamr@2
   206
	TFourCC						iVideoCodec;
williamr@2
   207
	/**
williamr@2
   208
	The audio data type represented as a fourCC code.
williamr@2
   209
	*/
williamr@2
   210
	TFourCC						iAudioCodec;
williamr@2
   211
	/**
williamr@2
   212
	The period over which the volume is to rise.
williamr@2
   213
	*/
williamr@2
   214
	TTimeIntervalMicroSeconds	iRampDuration;
williamr@2
   215
	/**
williamr@2
   216
	The start position for playback in micro seconds.
williamr@2
   217
	 */
williamr@2
   218
	TTimeIntervalMicroSeconds	iStartPosition;
williamr@2
   219
	/**
williamr@2
   220
	The end position for playback in micro seconds.
williamr@2
   221
	 */
williamr@2
   222
	TTimeIntervalMicroSeconds	iEndPosition;
williamr@2
   223
	/**
williamr@2
   224
	The (possibly estimated) record time left in the clip.
williamr@2
   225
	*/
williamr@2
   226
	TTimeIntervalMicroSeconds	iRecordTimeAvailable;
williamr@2
   227
	/**
williamr@2
   228
	Handle to the bitmap of the current video frame.
williamr@2
   229
williamr@2
   230
	Used by RMMFVideoPlayControllerCustomCommands::GetFrame()
williamr@2
   231
	to pass a bitmap handle to the video controller.
williamr@2
   232
	*/
williamr@2
   233
	TInt						iFrameBitmapServerHandle;
williamr@2
   234
	/**
williamr@2
   235
	Defines the window in which the video clip will be played.
williamr@2
   236
	 */
williamr@2
   237
	TRect						iWindowRect;
williamr@2
   238
	/**
williamr@2
   239
	A handle to the video camera being used.
williamr@2
   240
	*/
williamr@2
   241
	TInt						iCameraHandle;
williamr@2
   242
	/**
williamr@2
   243
	Whether the video display is active
williamr@2
   244
	*/
williamr@2
   245
	TInt						iDSAEvent;
williamr@2
   246
	/**
williamr@2
   247
	The percentage of loading/rebuffering completed.
williamr@2
   248
	*/
williamr@2
   249
	TInt						iLoadingCompletePercentage;
williamr@2
   250
	/**
williamr@2
   251
	The video rotation.
williamr@2
   252
	*/
williamr@2
   253
	TVideoRotation				iVideoRotation;
williamr@2
   254
	/**
williamr@2
   255
	The percentage (100 = original size) by which the width of the video image is scaled.
williamr@2
   256
	*/
williamr@2
   257
	TReal32						iWidthScalePercentage;
williamr@2
   258
	/**
williamr@2
   259
	The percentage (100 = original size) by which the height of the video image is scaled.
williamr@2
   260
	*/
williamr@2
   261
	TReal32						iHeightScalePercentage;
williamr@2
   262
	/**
williamr@2
   263
	A boolean indicating if anti-aliasing filtering should be used.
williamr@2
   264
	*/
williamr@2
   265
	TBool						iAntiAliasFiltering;
williamr@2
   266
	/**
williamr@2
   267
	The crop region currently applied to the image.
williamr@2
   268
	*/
williamr@2
   269
	TRect						iCropRectangle;
williamr@2
   270
private:
williamr@2
   271
	/**
williamr@2
   272
	This member is internal and not intended for use.
williamr@2
   273
	*/
williamr@2
   274
	TInt iReserved1;
williamr@2
   275
	TInt iReserved2;
williamr@2
   276
	TInt iReserved3;
williamr@2
   277
	};
williamr@2
   278
williamr@2
   279
/**
williamr@2
   280
Initialises the object with arbitrary values.
williamr@2
   281
*/
williamr@2
   282
inline TMMFVideoConfig::TMMFVideoConfig() {};
williamr@2
   283
williamr@2
   284
/**
williamr@2
   285
@publishedAll
williamr@2
   286
@released
williamr@2
   287
williamr@2
   288
Interface class to provide a callback to the video controller
williamr@2
   289
custom command interface from the controller plug-in
williamr@2
   290
(the object that implements the video record controller interface
williamr@2
   291
MMMFVideoPlayControllerCustomCommandImplementor) when a GetFrame()
williamr@2
   292
request has been issued.
williamr@2
   293
williamr@2
   294
@see RMMFVideoPlayControllerCustomCommands::GetFrame()
williamr@2
   295
*/
williamr@2
   296
class MMMFVideoFrameMessage 
williamr@2
   297
	{
williamr@2
   298
public:
williamr@2
   299
	/**
williamr@2
   300
	Called when a frame has been successfully decoded.
williamr@2
   301
williamr@2
   302
	@param  aError
williamr@2
   303
	        The result code to be given to the client.
williamr@2
   304
	*/
williamr@2
   305
	virtual void FrameReady(TInt aError) = 0;
williamr@2
   306
	/**
williamr@2
   307
	Returns the decoded frame as a bitmap.
williamr@2
   308
williamr@2
   309
	@return A reference to the video frame.
williamr@2
   310
	*/
williamr@2
   311
	virtual CFbsBitmap& GetBitmap() = 0;
williamr@2
   312
	};
williamr@2
   313
williamr@2
   314
/**
williamr@2
   315
@publishedAll
williamr@4
   316
@released
williamr@2
   317
williamr@2
   318
Represents the video aspect ratio as a fraction: iNumerator/iDenominator.
williamr@2
   319
*/
williamr@2
   320
class TVideoAspectRatio
williamr@2
   321
    {
williamr@2
   322
public:
williamr@2
   323
    /**
williamr@2
   324
    Aspect ratio numerator.
williamr@2
   325
    */
williamr@2
   326
    TInt iNumerator;
williamr@2
   327
    
williamr@2
   328
    /**
williamr@2
   329
    Aspect ratio denominator.
williamr@2
   330
    */
williamr@2
   331
    TInt iDenominator;
williamr@2
   332
williamr@2
   333
    /** 
williamr@2
   334
    Constructs a default aspect ratio object. The default aspect ratio is
williamr@2
   335
    1:1 (square).
williamr@2
   336
    */
williamr@2
   337
    inline TVideoAspectRatio();
williamr@2
   338
williamr@2
   339
    /** 
williamr@2
   340
    Constructs an aspect ratio object from a numerator and a denominator.
williamr@2
   341
    
williamr@2
   342
    @param 	aNumerator 
williamr@2
   343
    		Aspect ratio numerator.
williamr@2
   344
    @param 	aDenominator 
williamr@2
   345
    		Aspect ratio denominator.
williamr@2
   346
    */
williamr@2
   347
    inline TVideoAspectRatio(TInt aNumerator, TInt aDenominator);
williamr@2
   348
williamr@2
   349
    /** 
williamr@2
   350
    Compares two aspect ratio object for equality. The objects are
williamr@2
   351
    considered equal if the numerator and denominator match. 
williamr@2
   352
    Note that the implementation will not attempt to reduce the fractions 
williamr@2
   353
    before comparison.
williamr@2
   354
    */
williamr@2
   355
    inline TBool operator==(const TVideoAspectRatio& aAspectRatio) const;
williamr@2
   356
williamr@2
   357
    /** 
williamr@2
   358
    Compares two aspect ratio object for equality. The objects are
williamr@2
   359
    considered inequal if either the numerators or the denominators differ.
williamr@2
   360
    Note that the implementation will not attempt to reduce the fractions
williamr@2
   361
    before comparison.
williamr@2
   362
    */
williamr@2
   363
    inline TBool operator!=(const TVideoAspectRatio& aAspectRatio) const;
williamr@2
   364
    };
williamr@2
   365
williamr@2
   366
inline TVideoAspectRatio::TVideoAspectRatio()
williamr@2
   367
	: iNumerator(1),iDenominator(1)
williamr@2
   368
	{
williamr@2
   369
	}
williamr@2
   370
williamr@2
   371
inline TVideoAspectRatio::TVideoAspectRatio(TInt aNumerator, TInt aDenominator)
williamr@2
   372
	: iNumerator(aNumerator),iDenominator(aDenominator)
williamr@2
   373
	{
williamr@2
   374
	}
williamr@2
   375
williamr@2
   376
inline TBool TVideoAspectRatio::operator==(const TVideoAspectRatio& aAspectRatio) const
williamr@2
   377
	{
williamr@2
   378
	return ((iNumerator == aAspectRatio.iNumerator) && (iDenominator == aAspectRatio.iDenominator));
williamr@2
   379
	}
williamr@2
   380
	
williamr@2
   381
inline TBool TVideoAspectRatio::operator!=(const TVideoAspectRatio& aAspectRatio) const
williamr@2
   382
	{
williamr@2
   383
	return ((iNumerator != aAspectRatio.iNumerator) || (iDenominator != aAspectRatio.iDenominator));
williamr@2
   384
	}
williamr@2
   385
williamr@2
   386
/**
williamr@2
   387
Automatic scaling type.
williamr@2
   388
williamr@4
   389
@publishedAll
williamr@4
   390
@released
williamr@2
   391
williamr@2
   392
@see CVideoPlayerUtility::SetAutoScaleL
williamr@2
   393
*/
williamr@2
   394
enum TAutoScaleType
williamr@2
   395
    {
williamr@2
   396
    /** No automatic scaling */
williamr@2
   397
    EAutoScaleNone = 0,
williamr@2
   398
    
williamr@2
   399
    /**
williamr@2
   400
    Best fit: The picture is scaled to fit the window without
williamr@2
   401
    clipping while maintaining aspect ratio. If window and
williamr@2
   402
    picture aspect ratios do not match, window background color
williamr@2
   403
    is used to fill the borders.
williamr@2
   404
    */
williamr@2
   405
    EAutoScaleBestFit,
williamr@2
   406
williamr@2
   407
    /**
williamr@2
   408
    Clip: The picture is scaled to fit in the window, scaled in both
williamr@2
   409
    directions while maintaining aspect ratio. If window and
williamr@2
   410
    picture aspect ratios do not match, some of the video
williamr@2
   411
    picture will be clipped.
williamr@2
   412
    */
williamr@2
   413
    EAutoScaleClip,
williamr@2
   414
williamr@2
   415
    /**
williamr@2
   416
    Stretch: The picture is scaled to fit in the window without
williamr@2
   417
    maintaining aspect ratio. If window and picture aspect
williamr@2
   418
    ratios do not match, the picture will be distorted.
williamr@2
   419
    */
williamr@2
   420
    EAutoScaleStretch
williamr@2
   421
    };
williamr@2
   422
williamr@2
   423
/**
williamr@2
   424
Horizontal alignment for automatic scaling.
williamr@2
   425
williamr@4
   426
@publishedAll
williamr@4
   427
@released
williamr@2
   428
williamr@2
   429
@see SetAutoScaleL
williamr@2
   430
*/
williamr@2
   431
enum THorizontalAlign
williamr@2
   432
	{
williamr@2
   433
	/** The picture is horizontally centered */
williamr@2
   434
	EHorizontalAlignCenter = 0x70000000, 
williamr@2
   435
	/** The picture is left-aligned */
williamr@2
   436
	EHorizontalAlignLeft,
williamr@2
   437
	/** The picture is right-aligned */
williamr@2
   438
	EHorizontalAlignRight
williamr@2
   439
	};
williamr@2
   440
		
williamr@2
   441
/**
williamr@2
   442
Vertical alignment for automatic scaling.
williamr@2
   443
williamr@4
   444
@publishedAll
williamr@4
   445
@released
williamr@2
   446
williamr@2
   447
@see SetAutoScaleL
williamr@2
   448
*/
williamr@2
   449
enum TVerticalAlign
williamr@2
   450
	{
williamr@2
   451
	/** The picture is vertically centered */
williamr@2
   452
	EVerticalAlignCenter = 0x70000000,
williamr@2
   453
	/** The picture is top-aligned */
williamr@2
   454
	EVerticalAlignTop, 
williamr@2
   455
	/** The picture is bottom-aligned */
williamr@2
   456
	EVerticalAlignBottom 
williamr@2
   457
	};
williamr@2
   458
	
williamr@2
   459
#endif