epoc32/include/mmf/devvideo/devvideoplay.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) 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 __DEVVIDEOPLAY_H__
williamr@2
    17
#define __DEVVIDEOPLAY_H__
williamr@2
    18
williamr@2
    19
#include <e32std.h>
williamr@2
    20
#include <mmf/devvideo/devvideobase.h>
williamr@2
    21
williamr@2
    22
class MMMFDevVideoPlayObserver;
williamr@2
    23
class CMMFVideoPlayHwDevice;
williamr@2
    24
class CMMFVideoDecodeHwDevice;
williamr@2
    25
class CMMFVideoPostProcHwDevice;
williamr@2
    26
williamr@2
    27
williamr@2
    28
/**
williamr@2
    29
MMMFDevVideoPlayProxy is the interface to the CMMFDevVideoPlay API implementation that the hardware devices 
williamr@2
    30
use to deliver data back to the client and report their progress to the API implementation.
williamr@2
    31
@publishedAll
williamr@2
    32
@released
williamr@2
    33
*/
williamr@2
    34
class MMMFDevVideoPlayProxy
williamr@2
    35
	{
williamr@2
    36
public:
williamr@2
    37
	/**
williamr@2
    38
	Delivers a new decoded picture to the client. The CMMFDevVideoPlay implementation will maintain 
williamr@2
    39
	a list of decoded pictures and implement GetNewPictureInfo() and NextPictureL() based on those. 
williamr@2
    40
	The pictures will be returned back to the hardware device using ReturnPicture().
williamr@2
    41
williamr@2
    42
	@param "aPicture" "The newly processed picture."
williamr@2
    43
	*/
williamr@2
    44
	virtual void MdvppNewPicture(TVideoPicture* aPicture) = 0;
williamr@2
    45
williamr@2
    46
	/**
williamr@2
    47
	Notifies the client that one or more new empty input buffers are available. Called by the decoder 
williamr@2
    48
	hardware device.
williamr@2
    49
	*/
williamr@2
    50
	virtual void MdvppNewBuffers() = 0;
williamr@2
    51
williamr@2
    52
	/**
williamr@2
    53
	Returns a used input video picture back to the caller. Called by a post-processor hardware device 
williamr@2
    54
	after the picture has been processed and the picture source was the client, not another plug-in.
williamr@2
    55
williamr@2
    56
	@param "aPicture" "The picture to return."
williamr@2
    57
	*/
williamr@2
    58
	virtual void MdvppReturnPicture(TVideoPicture* aPicture) = 0;
williamr@2
    59
williamr@2
    60
	/**
williamr@2
    61
	Delivers supplemental information from a decoder hardware device to the client. 
williamr@2
    62
	The information is codec-dependent. The method is synchronous - the client 
williamr@2
    63
	MMMFDevVideoPlayObserver::MdvppSupplementalInformation() method is called immediately, 
williamr@2
    64
	and the memory for the supplemental information can be re-used when the call returns.
williamr@2
    65
williamr@2
    66
	@param "aData"		"The supplemental data."
williamr@2
    67
	@param "aTimestamp" "The presentation timestamp for the picture that the supplemental data is part of."
williamr@2
    68
	@param "aPictureId" "Picture identifier for the picture. If a picture ID is not available, 
williamr@2
    69
						aPictureId.iIdType is set to ENone."
williamr@2
    70
	*/
williamr@2
    71
	virtual void MdvppSupplementalInformation(const TDesC8& aData, 
williamr@2
    72
		const TTimeIntervalMicroSeconds& aTimestamp, const TPictureId& aPictureId) = 0;
williamr@2
    73
williamr@2
    74
	/**
williamr@2
    75
	Back channel information, indicating a picture loss without specifying the lost picture.
williamr@2
    76
	*/
williamr@2
    77
	virtual void MdvppPictureLoss() = 0;
williamr@2
    78
williamr@2
    79
	/**
williamr@2
    80
	Back channel information, indicating the pictures that have been lost.
williamr@2
    81
	
williamr@2
    82
	@param "aPictures"	"Picture identifiers for the lost pictures. The reference is only valid
williamr@2
    83
						until the method returns."
williamr@2
    84
	*/
williamr@2
    85
	virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures) = 0;
williamr@2
    86
williamr@2
    87
	/**
williamr@2
    88
	Back channel information, indicating the loss of consecutive macroblocks in raster scan order.
williamr@2
    89
williamr@2
    90
	@param "aFirstMacroblock"	"The first lost macroblock.  The macroblocks are numbered 
williamr@2
    91
								such that the macroblock in the upper left corner of the picture is 
williamr@2
    92
								considered macroblock number 1 and the number for each macroblock increases 
williamr@2
    93
								from left to right and then from top to bottom in raster-scan order."
williamr@2
    94
	@param "aNumMacroblocks"	"The number of lost macroblocks that are consecutive in raster-scan order."
williamr@2
    95
	@param "aPicture"			"The picture identifier for the picture where the macroblocks were lost.  
williamr@2
    96
								If the picture is not known, aPicture.iIdType is set to ENone.  The 
williamr@2
    97
								reference is only valid until the method returns."
williamr@2
    98
	*/
williamr@2
    99
	virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
williamr@2
   100
williamr@2
   101
	/**
williamr@2
   102
	Back channel information from the decoder, indicating a reference picture selection request. 
williamr@2
   103
	The request is delivered as a coding-standard specific binary message.  Reference picture selection
williamr@2
   104
	can be used to select a pervious correctly transmitted picture to use as a reference in case later 
williamr@2
   105
	pictures have been lost.
williamr@2
   106
	
williamr@2
   107
	@param "aSelectionData"	"The reference picture selection request message. The message format is 
williamr@2
   108
							coding-standard specific, and defined separately. The reference is only 
williamr@2
   109
							valid until the method returns."
williamr@2
   110
	*/
williamr@2
   111
	virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData)= 0;
williamr@2
   112
williamr@2
   113
	/**
williamr@2
   114
	Delivers a timed snapshot result to the client. The memory reserved for the snapshot picture 
williamr@2
   115
	can no longer be used in the device.
williamr@2
   116
williamr@2
   117
	@param "aError"					"An error code, KErrNone if no errors occurred. 
williamr@2
   118
									If an error occurred, the data in the snapshot may not be valid, 
williamr@2
   119
									but the memory can still be freed."
williamr@2
   120
	@param "aPictureData"			"The snapshot picture data."
williamr@2
   121
	@param "aPresentationTimestamp"	"The presentation timestamp for the snapshot picture."
williamr@2
   122
	@param "aPictureId"				"Picture identifier for the picture. If a picture ID is not 
williamr@2
   123
									available, aPictureId.iIdType is set to ENone."
williamr@2
   124
	*/
williamr@2
   125
	virtual void MdvppTimedSnapshotComplete(TInt aError, TPictureData* aPictureData, 
williamr@2
   126
		const TTimeIntervalMicroSeconds& aPresentationTimestamp, const TPictureId& aPictureId) = 0;
williamr@2
   127
williamr@2
   128
	/**
williamr@2
   129
	Reports a fatal error to the client. The device must automatically stop processing 
williamr@2
   130
	video data when such errors occur, and may not do further processing before it has 
williamr@2
   131
	been deleted and re-created.
williamr@2
   132
williamr@2
   133
	@param "aDevice" "The device that reported the error."
williamr@2
   134
	@param "aError"	 "The error code."	
williamr@2
   135
	*/
williamr@2
   136
	virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
williamr@2
   137
williamr@2
   138
	/**
williamr@2
   139
	Reports that an asynchronous Initialize() method has completed. 
williamr@2
   140
	The device is now ready for playback.
williamr@2
   141
williamr@2
   142
	@param "aDevice" "The device that was initialzied."
williamr@2
   143
	@param "aError"	 "Initialization result error code, KErrNone if initialization was successful."	
williamr@2
   144
	*/
williamr@2
   145
	virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError) = 0;
williamr@2
   146
williamr@2
   147
	/**
williamr@2
   148
	Reports that the input video stream end has been reached and all pictures have been processed. 
williamr@2
   149
	Called by each hardware device after their InputEnd() methods have been called and all data has 
williamr@2
   150
	been processed. The proxy implementation will notify the client about stream end when all 
williamr@2
   151
	hardware devices have called this method.
williamr@2
   152
	*/
williamr@2
   153
	virtual void MdvppStreamEnd() = 0;
williamr@2
   154
	};
williamr@2
   155
williamr@2
   156
williamr@2
   157
/**
williamr@2
   158
A buffer for compressed video data, contains one coded data unit. Video buffers are used for writing 
williamr@2
   159
video data to the API.
williamr@2
   160
williamr@2
   161
@publishedAll
williamr@2
   162
@released
williamr@2
   163
*/
williamr@2
   164
class TVideoInputBuffer
williamr@2
   165
	{
williamr@2
   166
public:
williamr@2
   167
	/**
williamr@2
   168
	Default constructor. Zeroes all members (including iData which will point to garbage until manually
williamr@2
   169
	set to point to the real video buffer memory data area by the user).
williamr@2
   170
	*/
williamr@2
   171
	IMPORT_C TVideoInputBuffer();
williamr@2
   172
williamr@2
   173
public:
williamr@4
   174
	/**
williamr@4
   175
	 */
williamr@2
   176
	enum TVideoBufferOptions
williamr@2
   177
		{
williamr@2
   178
		/** The sequence number field is valid. */
williamr@2
   179
		ESequenceNumber	 = 0x00000001,
williamr@2
   180
		/** The decoding timestamp field is valid */
williamr@2
   181
		EDecodingTimestamp  = 0x00000002,
williamr@2
   182
		/** The presentation timestamp field is valid.*/
williamr@4
   183
		EPresentationTimestamp = 0x00000004,
williamr@4
   184
		/** Content protected pictures cannot be displayed on unprotected 
williamr@4
   185
		    external displays such as TV-out.
williamr@4
   186
		*/
williamr@4
   187
		EContentProtected = 0x00000008
williamr@2
   188
		};
williamr@2
   189
williamr@2
   190
	/**
williamr@2
   191
	Pointer to the video data.
williamr@2
   192
	*/
williamr@2
   193
	TPtr8 iData;
williamr@2
   194
williamr@2
   195
	/**
williamr@2
   196
	Data unit options. The value is a bitfield combined from values from TVideoBufferOptions.
williamr@2
   197
	@see TVideoBufferOptions
williamr@2
   198
	*/
williamr@2
   199
	TUint32 iOptions;
williamr@2
   200
williamr@2
   201
	/**
williamr@2
   202
	Data unit decoding timestamp. Valid if EDecodingTimestamp is set in the options.
williamr@2
   203
	*/
williamr@2
   204
	TTimeIntervalMicroSeconds iDecodingTimestamp;
williamr@2
   205
williamr@2
   206
	/**
williamr@2
   207
	Data unit presentation timestamp. Valid if EPresentationTimestamp is set in the options. 
williamr@2
   208
	If the input bitstream does not contain timestamp information, this field should be valid, 
williamr@2
   209
	otherwise pictures cannot be displayed at the correct time.   If the input bitstream contains 
williamr@2
   210
	timestamp information (such as the TR syntax element of H.263 bitstreams) and valid 
williamr@2
   211
	iPresentationTimestamp is provided, the value of iPresentationTimestamp is used in playback.
williamr@2
   212
	*/
williamr@2
   213
	TTimeIntervalMicroSeconds iPresentationTimestamp;
williamr@2
   214
williamr@2
   215
	/**
williamr@2
   216
	True if the data is part of a pre-roll period and may not be drawn. The decoder may skip 
williamr@2
   217
	display-related operations, but must still decode normally since pre-roll may not end in a key 
williamr@2
   218
	frame.
williamr@2
   219
	*/
williamr@2
   220
	TBool iPreRoll;
williamr@2
   221
williamr@2
   222
	/**
williamr@2
   223
	Data unit sequence number. Valid if ESequenceNumber is set in the options. If present, the 
williamr@2
   224
	sequence number is incremented once per coded data unit, a gap in the numbers indicates missing 
williamr@2
   225
	data.
williamr@2
   226
	*/
williamr@2
   227
	TUint iSequenceNumber;
williamr@2
   228
williamr@2
   229
	/**
williamr@2
   230
	True if the data unit is known to contain erroneous data.
williamr@2
   231
	*/
williamr@2
   232
	TBool iError;
williamr@2
   233
williamr@2
   234
	/**
williamr@2
   235
	A queue link used internally by the MSL API. The field must not be modified while the buffer is 
williamr@2
   236
	in the MSL API, but can be used by the client before the buffer has been written and after the 
williamr@2
   237
	buffer has been returned.
williamr@2
   238
	*/
williamr@2
   239
	TDblQueLink iLink;
williamr@2
   240
williamr@2
   241
	/**
williamr@2
   242
	A pointer for free-form user data. The pointer is set by the module that created the buffer, and 
williamr@2
   243
	is usually used for memory management purposes.
williamr@2
   244
	*/
williamr@2
   245
	TAny* iUser;
williamr@2
   246
	};
williamr@2
   247
williamr@2
   248
williamr@2
   249
/**
williamr@2
   250
This class contains information about the post-processing functionality that a single post-processor 
williamr@2
   251
or decoder hardware device has. Although it mainly contains static data, it is defined as a complete 
williamr@2
   252
CBase-derived class since the data is relatively complex and proper memory management is necessary.
williamr@2
   253
williamr@2
   254
The objects are created by the post-processor or decoder devices, and used by the MSL video client code.
williamr@2
   255
@publishedAll
williamr@2
   256
@released
williamr@2
   257
*/
williamr@2
   258
class CPostProcessorInfo : public CBase
williamr@2
   259
	{
williamr@2
   260
public:
williamr@2
   261
	/**
williamr@2
   262
	Creates and returns a new CPostProcessorInfo object.
williamr@2
   263
williamr@2
   264
	@param	"aUid"							"The UID of the post-processor."
williamr@2
   265
	@param	"aManufacturer"					"The manufacturer of the post-processor hw device."
williamr@2
   266
	@param	"aIdentifier"					"The post-processor hw device manufacturer-specific 
williamr@2
   267
											identifier."
williamr@2
   268
	@param	"aVersion"						"The post-processor version."
williamr@2
   269
	@param	"aSupportedFormats"				"The source formats supported by the post-processor."
williamr@2
   270
	@param	"aSupportedCombinations"		"The supported post-processing combinations.  An array of 
williamr@2
   271
											values created by the bitwise OR-ing of values from 
williamr@2
   272
											TPrePostProcessType."
williamr@2
   273
	@param	"aAccelerated"					"Whether the post processor is hardware-accelerated. 
williamr@2
   274
											Accelerated post-processors can run on an application DSP 
williamr@2
   275
											or dedicated hardware."
williamr@2
   276
	@param	"aSupportsDirectDisplay"		"Whether the hw device supports output directly to the 
williamr@2
   277
											screen."
williamr@2
   278
	@param	"aYuvToRgbCapabilities"			"The post-processor YUV to RGB conversion capabilities."
williamr@2
   279
	@param	"aSupportedRotations"			"A bitwise OR of values of TRotationType to indicate the 
williamr@2
   280
											supported rotation types."
williamr@2
   281
	@param	"aSupportArbitraryScaling"		"Whether the post-processor supports arbitrary scaling."
williamr@2
   282
	@param	"aSupportedScaleFactors"		"A list of the discrete scaling factors supported. If the
williamr@2
   283
											post-processor supports arbitrary scaling, this list should
williamr@2
   284
											be left zero-length."
williamr@2
   285
	@param	"aAntiAliasedScaling"			"Whether anti-aliasing filtering for scaling is supported."
williamr@2
   286
	@param	"aImplementationSpecificInfo"	"Implementation-specific information."
williamr@2
   287
williamr@2
   288
	@return "A new CPostProcessorInfo object."
williamr@2
   289
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   290
	*/
williamr@2
   291
	IMPORT_C static CPostProcessorInfo* NewL(TUid aUid,
williamr@2
   292
											 const TDesC& aManufacturer,
williamr@2
   293
											 const TDesC& aIdentifier,
williamr@2
   294
											 TVersion aVersion,
williamr@2
   295
											 const TArray<TUncompressedVideoFormat>& aSupportedFormats,
williamr@2
   296
											 const TArray<TUint32>& aSupportedCombinations,
williamr@2
   297
											 TBool aAccelerated,
williamr@2
   298
											 TBool aSupportsDirectDisplay,
williamr@2
   299
											 const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
williamr@2
   300
											 TUint32 aSupportedRotations,
williamr@2
   301
											 TBool aSupportArbitraryScaling,
williamr@2
   302
											 const TArray<TScaleFactor>& aSupportedScaleFactors,
williamr@2
   303
											 TBool aAntiAliasedScaling,
williamr@2
   304
											 const TDesC8& aImplementationSpecificInfo = KNullDesC8);
williamr@2
   305
williamr@2
   306
	/**
williamr@2
   307
	Destructor
williamr@2
   308
	*/
williamr@2
   309
	IMPORT_C ~CPostProcessorInfo();
williamr@2
   310
williamr@2
   311
	/**
williamr@2
   312
	Returns the post-processor UID.
williamr@2
   313
	@return "Post-processor UID"
williamr@2
   314
	*/
williamr@2
   315
	IMPORT_C TUid Uid() const;
williamr@2
   316
williamr@2
   317
	/**
williamr@2
   318
	Returns the post-processor hardware device manufacturer.
williamr@2
   319
	@return "The manufacturer name as a standard Symbian descriptor. The reference is valid until the 
williamr@2
   320
			CPostProcessorInfo object is destroyed."
williamr@2
   321
	*/
williamr@2
   322
	IMPORT_C const TDesC& Manufacturer() const;
williamr@2
   323
williamr@2
   324
	/**
williamr@2
   325
	Returns the post-processor hardware device manufacturer-specific identifier. 
williamr@2
   326
	The combination of the manufacturer and identifier uniquely identifies the device.
williamr@2
   327
	@return "The identifier as a standard Symbian descriptor. The reference is valid until the 
williamr@2
   328
			CPostProcessorInfo object is destroyed."
williamr@2
   329
	*/
williamr@2
   330
	IMPORT_C const TDesC& Identifier() const;
williamr@2
   331
williamr@2
   332
	/**
williamr@2
   333
	Returns the post-processor version.
williamr@2
   334
	@return "Post-processor version."
williamr@2
   335
	*/
williamr@2
   336
	IMPORT_C TVersion Version() const;
williamr@2
   337
williamr@2
   338
	/**
williamr@2
   339
	Checks if the post-processor supports the given format as a source format.
williamr@2
   340
	@param	"aFormat"	"The format to check. The reference is not used after the method returns."
williamr@2
   341
	@return "ETrue if the post-processor supports the given format, EFalse if not."
williamr@2
   342
	*/
williamr@2
   343
	IMPORT_C TBool SupportsFormat(const TUncompressedVideoFormat& aFormat) const;
williamr@2
   344
williamr@2
   345
	/**
williamr@2
   346
	Lists the source formats supported by the post-processor.
williamr@2
   347
	@return "A RArray table of supported video formats (TUncompressedVideoFormat). The reference is 
williamr@2
   348
			valid until the CPostProcessorInfo object is destroyed."
williamr@2
   349
	*/
williamr@2
   350
	IMPORT_C const RArray<TUncompressedVideoFormat>& SupportedFormats() const;
williamr@2
   351
williamr@2
   352
	/**
williamr@2
   353
	Checks if the post-processor supports the given post-processing combination.
williamr@2
   354
	@param	"aCombination" "Post-processing combination, a bitwise OR of values from TPrePostProcessType."
williamr@2
   355
	@return "ETrue if the post-processing combination is supported, EFalse if not."
williamr@2
   356
	*/
williamr@2
   357
	IMPORT_C TBool SupportsCombination(TUint32 aCombination) const;
williamr@2
   358
williamr@2
   359
	/**
williamr@2
   360
	Lists all supported post-processing combinations.
williamr@2
   361
	@return "A RArray table or post-processing combinations. Each value is a bitwise OR of values from 
williamr@2
   362
			TPrePostProcessType. The reference is valid until the CPostProcessorInfo object is destroyed."
williamr@2
   363
	*/
williamr@2
   364
	IMPORT_C const RArray<TUint32>& SupportedCombinations() const;
williamr@2
   365
williamr@2
   366
	/**
williamr@2
   367
	Returns whether the hardware device is hardware-accelerated. Hardware-accelerated post-processors 
williamr@2
   368
	can run on an application DSP or dedicated hardware.
williamr@2
   369
	@return "ETrue if the device is hardware-accelerated."
williamr@2
   370
	*/
williamr@2
   371
	IMPORT_C TBool Accelerated() const;
williamr@2
   372
williamr@2
   373
	/**
williamr@2
   374
	Returns whether the hardware device supports output directly to the screen. Output to memory buffers 
williamr@2
   375
	is always supported.
williamr@2
   376
	@return "ETrue if the post-processor supports direct screen output."
williamr@2
   377
	*/
williamr@2
   378
	IMPORT_C TBool SupportsDirectDisplay() const;
williamr@2
   379
williamr@2
   380
	/**
williamr@2
   381
	Returns the post-processor YUV to RGB color conversion capabilities.
williamr@2
   382
	@return "The conversion capabilities as a TYuvToRgbCapabilities structure. The reference is valid 
williamr@2
   383
			until the CPostProcessorInfo object is destroyed. If the post-processor does not support 
williamr@2
   384
			YUV to RGB conversion, the contents are undefined."
williamr@2
   385
	*/
williamr@2
   386
	IMPORT_C const TYuvToRgbCapabilities& YuvToRgbCapabilities() const;
williamr@2
   387
williamr@2
   388
	/**
williamr@2
   389
	Returns the rotation types the post-processor supports.
williamr@2
   390
	@return "The supported rotation types as a bitwise OR of TRotationType values. If the 
williamr@2
   391
			post-processor does not support rotation, the return value is zero."
williamr@2
   392
	*/
williamr@2
   393
	IMPORT_C TUint32 SupportedRotations() const;
williamr@2
   394
williamr@2
   395
	/**
williamr@2
   396
	Returns whether the post-processor supports arbitrary scaling. If arbitrary scaling is not 
williamr@2
   397
	supported, a limited selection of scaling factors may still be available, use 
williamr@2
   398
	SupportedScaleFactors() to retrieve those.
williamr@2
   399
	@return "ETrue if the post-processor supports arbitrary scaling, EFalse if not."
williamr@2
   400
	*/
williamr@2
   401
	IMPORT_C TBool SupportsArbitraryScaling() const;
williamr@2
   402
williamr@2
   403
	/**
williamr@2
   404
	Returns the scaling factors the post-processor supports. If the post-processor supports arbitrary 
williamr@2
   405
	scaling the list is empty - use SupportsArbitraryScaling() first.
williamr@2
   406
	@return "A RArray list of supported scale factors (TScaleFactor). The reference is valid until the 
williamr@2
   407
			CPostProcessorInfo object is destroyed. If the post-processor supports arbitrary scaling 
williamr@2
   408
			or no scaling at all, the list is empty."
williamr@2
   409
	*/
williamr@2
   410
	IMPORT_C const RArray<TScaleFactor>& SupportedScaleFactors() const;
williamr@2
   411
williamr@2
   412
	/**
williamr@2
   413
	Returns whether the hardware device supports anti-aliasing filtering for scaling.
williamr@2
   414
	@return "True if anti-aliasing filtering is supported."
williamr@2
   415
	*/
williamr@2
   416
	IMPORT_C TBool AntiAliasedScaling() const;
williamr@2
   417
williamr@2
   418
	/**
williamr@2
   419
	Returns implementation-specific information about the post-processor.
williamr@2
   420
	@return "Implementation- specific information about the post-processor. The data format is 
williamr@2
   421
			implementation-specific, and defined separately by the post-processor supplier. The 
williamr@2
   422
			reference is valid until the CPostProcessorInfo object is destroyed."
williamr@2
   423
	*/
williamr@2
   424
	IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
williamr@2
   425
	
williamr@2
   426
	/**
williamr@2
   427
	Adds the screen number into the list of screens supported by the post processor.
williamr@2
   428
	@leave	"KErrNoMemory when there is no memory to expand the list of supported screens. 
williamr@2
   429
			 KErrNotSupported if the secondary screen display is not supported in Multimedia Framework."
williamr@2
   430
	*/
williamr@2
   431
	IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
williamr@2
   432
	
williamr@2
   433
	/**
williamr@2
   434
	Lists the screens supported by the post processor.
williamr@2
   435
	@param	"aSupportedScreens"		"An array to retrieve the list of supported screens. 
williamr@2
   436
									 This method resets	the array before adding elements to it. 
williamr@2
   437
									 The array must be created and destroyed by the caller."
williamr@2
   438
	@leave "KErrNotSupported if the secondary screen display is not supported in Multimedia Framework.
williamr@2
   439
			KErrNoMemory when there is no memory to expand the list."
williamr@2
   440
	*/
williamr@2
   441
	IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
williamr@4
   442
	
williamr@4
   443
	/** Sets a flag indicating whether the PostProcessor supports per picture content protection.
williamr@4
   444
	    E.g. Where content protection within a video stream can alter.
williamr@4
   445
	 @param "aSetting" "Set to TRUE to indicate PostProcessor supports content protection. 
williamr@4
   446
	 @See TVideoPicture::TVideoPictureOptions::EContentProtected 
williamr@4
   447
	 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected 
williamr@4
   448
	*/
williamr@4
   449
	IMPORT_C void SetSupportsContentProtected(const TBool aSetting);
williamr@4
   450
		
williamr@4
   451
	/** Returns whether the PostProcessor supports per picture content protection.
williamr@4
   452
	    E.g. Where content protection within a video stream can alter.
williamr@4
   453
	 @return "True if the PostProcessor supports Content Protection." 
williamr@4
   454
	 @See TVideoPicture::TVideoPictureOptions::EContentProtected
williamr@4
   455
	 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected
williamr@4
   456
	*/
williamr@4
   457
	IMPORT_C TBool SupportsContentProtected() const;
williamr@4
   458
	
williamr@2
   459
private:
williamr@2
   460
	CPostProcessorInfo(TUid aUid,
williamr@2
   461
					   TVersion aVersion,
williamr@2
   462
					   TBool aAccelerated,
williamr@2
   463
					   TBool aSupportDirectDisplay,
williamr@2
   464
					   const TYuvToRgbCapabilities& aYuvToRgbCapabilities,
williamr@2
   465
					   TUint32 aSupportedRotations,
williamr@2
   466
					   TBool aSupportArbitraryScaling,
williamr@2
   467
					   TBool aAntiAliasedScaling);
williamr@2
   468
williamr@2
   469
	void ConstructL(const TDesC& aManufacturer,
williamr@2
   470
					const TDesC& aIdentifier,
williamr@2
   471
					const TArray<TUncompressedVideoFormat>& aSupportedFormats,
williamr@2
   472
					const TArray<TUint32>& aSupportedCombinations,
williamr@2
   473
					const TArray<TScaleFactor>& aSupportedScaleFactors,
williamr@2
   474
					const TDesC8& aImplementationSpecificInfo);
williamr@2
   475
private:
williamr@2
   476
	TUid iUid;
williamr@2
   477
	TVersion iVersion;
williamr@2
   478
	TBool iAccelerated;
williamr@2
   479
	TBool iSupportDirectDisplay;
williamr@2
   480
	TYuvToRgbCapabilities iYuvToRgbCapabilities;
williamr@2
   481
	TUint32 iSupportedRotations;
williamr@2
   482
	TBool iSupportArbitraryScaling;
williamr@2
   483
	TBool iAntiAliasedScaling;
williamr@2
   484
	HBufC* iManufacturer;
williamr@2
   485
	HBufC* iIdentifier;
williamr@2
   486
	HBufC8* iImplementationSpecificInfo;
williamr@2
   487
 	RArray<TUncompressedVideoFormat> iSupportedFormats;
williamr@2
   488
	RArray<TUint32> iSupportedCombinations;
williamr@2
   489
	RArray<TScaleFactor> iSupportedScaleFactors;
williamr@2
   490
	RArray<TInt> iSupportedScreens;
williamr@4
   491
	TBool iSupportsContentProtected;
williamr@2
   492
	};
williamr@2
   493
williamr@2
   494
williamr@2
   495
/**
williamr@2
   496
This class contains information about a single video decoder. Although it mainly contains static data, 
williamr@2
   497
it is defined as a complete CBase-derived class since the data is relatively complex and proper memory 
williamr@2
   498
management is necessary.
williamr@2
   499
williamr@2
   500
The objects are created by the video decoder hardware devices, and used by the MSL video client code.
williamr@2
   501
@publishedAll
williamr@2
   502
@released
williamr@2
   503
*/
williamr@2
   504
class CVideoDecoderInfo : public CBase
williamr@2
   505
	{
williamr@2
   506
public:
williamr@2
   507
	/**
williamr@2
   508
	Creates and returns a new CVideoDecoderInfo object.
williamr@2
   509
williamr@2
   510
	@param	"aUid"							"The uid of the decoder."
williamr@2
   511
	@param	"aManufacturer"					"The video decoder manufacturer."
williamr@2
   512
	@param	"aIdentifier"					"The manufacturer-specific identifier for this video decoder."
williamr@2
   513
	@param	"aVersion"						"The version of this video decoder."
williamr@2
   514
	@param	"aSupportedFormats"				"An array of the formats supported by the decoder. 
williamr@2
   515
											A copy will be taken of the array and the referenced 
williamr@2
   516
											CCompressedVideoFormat objects"
williamr@2
   517
	@param	"aAccelerated"					"Whether this decoder is accelerated or not."
williamr@2
   518
	@param	"aSupportsDirectDisplay"		"Whether this decoder supports direct display or not."
williamr@2
   519
	@param	"aMaxPictureSize"				"The maximum picture size supported by the decoder."
williamr@2
   520
	@param	"aMaxBitrate"					"The maximum bit rate supported by the decoder. Use KMaxTUint32 if there are no bit-rate restrictions."
williamr@2
   521
	@param	"aMaxPictureRates"				"An array of the maximum picture size/rate combinations supported by the decoder."
williamr@2
   522
	@param	"aSupportsPictureLoss"			"Whether the decoder supports picture loss indications."
williamr@2
   523
	@param	"aSupportsSliceLoss"			"Whether the decoder supports slice loss indications."
williamr@2
   524
	@param	"aCodingStandardSpecificInfo"	"Coding-standard specific information about the decoder."
williamr@2
   525
	@param	"aImplementationSpecificInfo"	"Implementation-specific information about the decoder."
williamr@2
   526
williamr@2
   527
	@return "A new CVideoDecoderInfo object."
williamr@2
   528
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   529
	*/
williamr@2
   530
	IMPORT_C static CVideoDecoderInfo* NewL(TUid aUid,
williamr@2
   531
											const TDesC& aManufacturer,
williamr@2
   532
											const TDesC& aIdentifier,
williamr@2
   533
											TVersion aVersion,
williamr@2
   534
											const TArray<CCompressedVideoFormat*>& aSupportedFormats,
williamr@2
   535
											TBool aAccelerated,
williamr@2
   536
											TBool aSupportsDirectDisplay,
williamr@2
   537
											const TSize& aMaxPictureSize,
williamr@2
   538
											TUint aMaxBitrate,
williamr@2
   539
											const TArray<TPictureRateAndSize>& aMaxPictureRates,
williamr@2
   540
											TBool aSupportsPictureLoss,
williamr@2
   541
											TBool aSupportsSliceLoss,
williamr@2
   542
											const TDesC8& aCodingStandardSpecificInfo = KNullDesC8,
williamr@2
   543
											const TDesC8& aImplementationSpecificInfo = KNullDesC8);
williamr@2
   544
williamr@2
   545
	/**
williamr@2
   546
	Destructor.
williamr@2
   547
	*/
williamr@2
   548
	IMPORT_C ~CVideoDecoderInfo();
williamr@2
   549
williamr@2
   550
	/**
williamr@2
   551
	Checks if the decoder supports the given format.
williamr@2
   552
	@param	"aFormat"	"The format to check. The reference is not used after the method returns."
williamr@2
   553
	@return "ETrue if the codec supports the given format, EFalse if not."
williamr@2
   554
	*/
williamr@2
   555
	IMPORT_C TBool SupportsFormat(const CCompressedVideoFormat& aFormat) const;
williamr@2
   556
williamr@2
   557
	/**
williamr@2
   558
	Lists the video formats, including submodes, supported by the decoder.
williamr@2
   559
	@return "A RPointerArray table of supported video formats (CCompressedVideoFormat). The reference 
williamr@2
   560
			is valid until the CVideoDecoderInfo object is destroyed."
williamr@2
   561
	*/
williamr@2
   562
	IMPORT_C const RPointerArray<CCompressedVideoFormat>& SupportedFormats() const;
williamr@2
   563
williamr@2
   564
	/**
williamr@2
   565
	Returns the codec device manufacturer.
williamr@2
   566
	@return "The manufacturer name as a standard Symbian descriptor. The reference is valid until the 
williamr@2
   567
	CVideoDecoderInfo object is destroyed."
williamr@2
   568
	*/
williamr@2
   569
	IMPORT_C const TDesC& Manufacturer() const;
williamr@2
   570
williamr@2
   571
	/**
williamr@2
   572
	Returns the codec device manufacturer-specific identifier. The combination of the manufacturer 
williamr@2
   573
	and identifier uniquely identifies the hardware device.
williamr@2
   574
	@return "The identifier as a standard Symbian descriptor. The reference is valid until the 
williamr@2
   575
			CVideoDecoderInfo object is destroyed."
williamr@2
   576
	*/
williamr@2
   577
	IMPORT_C const TDesC& Identifier() const;
williamr@2
   578
williamr@2
   579
	/**
williamr@2
   580
	Returns the decoder version.
williamr@2
   581
	@return "Decoder version."
williamr@2
   582
	*/
williamr@2
   583
	IMPORT_C TVersion Version() const;
williamr@2
   584
williamr@2
   585
	/**
williamr@2
   586
	Returns the decoder UID.
williamr@2
   587
	@return "Decoder UID."
williamr@2
   588
	*/
williamr@2
   589
	IMPORT_C TUid Uid() const;
williamr@2
   590
williamr@2
   591
	/**
williamr@2
   592
	Returns whether the decoder is hardware-accelerated. A hardware-accelerated decoder can run on 
williamr@2
   593
	an application DSP or dedicated hardware.
williamr@2
   594
	@return "True if the decoder is hardware-accelerated."
williamr@2
   595
	*/
williamr@2
   596
	IMPORT_C TBool Accelerated() const;
williamr@2
   597
williamr@2
   598
	/**
williamr@2
   599
	Returns whether the hardware device supports output directly to the screen. Output to memory 
williamr@2
   600
	buffers is always supported.
williamr@2
   601
	@return "True if the hardware device supports direct screen output."
williamr@2
   602
	*/
williamr@2
   603
	IMPORT_C TBool SupportsDirectDisplay() const;
williamr@2
   604
williamr@2
   605
	/**
williamr@2
   606
	Returns the maximum picture size the decoder supports.
williamr@2
   607
williamr@2
   608
	Note that if the decoder reports that it supports a certain profile and level, then it 
williamr@2
   609
	shall support all bitstreams corresponding to that profile/level.  This method can be used 
williamr@2
   610
	to specify capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams 
williamr@2
   611
	are encoded with picture sizes that are larger than those specified by the profile/level of the 
williamr@2
   612
	bitstream).
williamr@2
   613
williamr@2
   614
	@return "The maximum picture size supported. The reference is valid until the CVideoDecoderInfo 
williamr@2
   615
			object is destroyed."
williamr@2
   616
	*/
williamr@2
   617
	IMPORT_C const TSize& MaxPictureSize() const;
williamr@2
   618
williamr@2
   619
	/**
williamr@2
   620
	Returns the maximum bit-rate supported by the decoder.
williamr@2
   621
williamr@2
   622
	Note that if the decoder reports that it supports a certain profile and level, then it shall 
williamr@2
   623
	support all bitstreams corresponding to that profile/level.  This method can be used to 
williamr@2
   624
	specify capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams 
williamr@2
   625
	are encoded with bit rates that are higher than those specified by the profile/level of the
williamr@2
   626
	bitstream).
williamr@2
   627
williamr@2
   628
	@return "Maximum bit-rate supported, in bits per second. KMaxTUint32 can be used if the decoder 
williamr@2
   629
			has no bit-rate restrictions."
williamr@2
   630
	*/
williamr@2
   631
	IMPORT_C TUint MaxBitrate() const;
williamr@2
   632
williamr@2
   633
	/**
williamr@2
   634
	Returns the maximum picture size/rate combinations supported by the decoder.  
williamr@2
   635
	
williamr@2
   636
	Video decoders can have different maximum picture rate limitations depending on the picture size used.
williamr@2
   637
	Note that if the decoder reports that it supports a certain profile and level, then it shall 
williamr@2
   638
	support all bitstreams corresponding to that profile/level.  This method can be used to specify 
williamr@2
   639
	capabilities that are beyond the standard levels (for example some MPEG-4 bitstreams are encoded
williamr@2
   640
	with picture rates that are beyond those specified by the profile/level of the bitstream).
williamr@2
   641
williamr@2
   642
	@return "A reference to an array of picture size/rate combinations.  The reference remains valid
williamr@2
   643
			until this object is deleted."
williamr@2
   644
	*/
williamr@2
   645
	IMPORT_C const RArray<TPictureRateAndSize>& MaxPictureRates() const;
williamr@2
   646
williamr@2
   647
	/**
williamr@2
   648
	Returns whether the decoder supports picture loss indications. If true, the decoder indicates
williamr@2
   649
	lost pictures by calling MdvpoPictureLoss().
williamr@2
   650
williamr@2
   651
	@return "True if the decoder supports picture loss indications."
williamr@2
   652
	*/
williamr@2
   653
	IMPORT_C TBool SupportsPictureLoss() const;
williamr@2
   654
williamr@2
   655
	/**
williamr@2
   656
	Returns whether the decoder supports slice loss indications. If true, the decoder indicates 
williamr@2
   657
	lost macroblocks by calling MdvpoSliceLoss().
williamr@2
   658
williamr@2
   659
	@return "True if the decoder supports slice loss indications."
williamr@2
   660
	*/
williamr@2
   661
	IMPORT_C TBool SupportsSliceLoss() const;
williamr@2
   662
williamr@2
   663
	/**
williamr@2
   664
	Returns coding-standard specific information about the decoder.
williamr@2
   665
	@return "Coding-standard specific information about the decoder. The data format is coding-standard
williamr@2
   666
			specific, and defined separately. The reference is valid until the CVideoDecoderInfo object
williamr@2
   667
			is destroyed."
williamr@2
   668
	*/
williamr@2
   669
	IMPORT_C const TDesC8& CodingStandardSpecificInfo() const;
williamr@2
   670
williamr@2
   671
	/**
williamr@2
   672
	Returns implementation-specific information about the decoder.
williamr@2
   673
	@return "Implementation- specific information about the decoder. The data format is 
williamr@2
   674
			implementation-specific, and defined separately by the decoder supplier. The reference 
williamr@2
   675
			is valid until the CVideoDecoderInfo object is destroyed."
williamr@2
   676
	*/
williamr@2
   677
	IMPORT_C const TDesC8& ImplementationSpecificInfo() const;
williamr@2
   678
	
williamr@2
   679
	/**
williamr@2
   680
	Adds the screen number into the list of screens supported by the decoder.
williamr@2
   681
	@leave	"KErrNoMemory when there is no memory to expand the list of supported screens. 
williamr@2
   682
			 KErrNotSupported if the secondary screen display is not supported in Multimedia Framework."
williamr@2
   683
	*/
williamr@2
   684
	IMPORT_C void AddSupportedScreenL(TInt aScreenNo);
williamr@2
   685
	
williamr@2
   686
	/**
williamr@2
   687
	Lists the screens supported by the decoder.
williamr@2
   688
	@param	"aSupportedScreens"		"An array to retrieve the list of supported screens. 
williamr@2
   689
									 This method resets	the array before adding elements to it. 
williamr@2
   690
									 The array must be created and destroyed by the caller."
williamr@2
   691
	@leave "KErrNotSupported if the secondary screen display is not supported in Multimedia Framework.
williamr@2
   692
			KErrNoMemory when there is no memory to expand the list."
williamr@2
   693
	*/
williamr@2
   694
	IMPORT_C void GetSupportedScreensL(RArray<TInt>& aSupportedScreens) const;
williamr@4
   695
williamr@4
   696
	/** Sets a flag indicating whether the Decoder supports per picture content protection.
williamr@4
   697
	    E.g. Where content protection within a video stream can alter.
williamr@4
   698
	 @param "aSetting" "Set to TRUE to indicate decoder supports content protection. 
williamr@4
   699
	 @See TVideoPicture::TVideoPictureOptions::EContentProtected 
williamr@4
   700
	 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected 
williamr@4
   701
	*/
williamr@4
   702
	IMPORT_C void SetSupportsContentProtected(const TBool aSetting);
williamr@4
   703
		
williamr@4
   704
	/** Returns whether the Decoder supports per picture content protection.
williamr@4
   705
	    E.g. Where content protection within a video stream can alter.
williamr@4
   706
	 @return "True if the Decoder supports Content Protection." 
williamr@4
   707
	 @See TVideoPicture::TVideoPictureOptions::EContentProtected
williamr@4
   708
	 @See TVideoInputBuffer::TVideoBufferOptions::EContentProtected
williamr@4
   709
	*/
williamr@4
   710
	IMPORT_C TBool SupportsContentProtected() const;
williamr@4
   711
williamr@2
   712
private:
williamr@2
   713
	CVideoDecoderInfo(TUid aUid,
williamr@2
   714
					  TVersion aVersion,
williamr@2
   715
					  TBool aAccelerated,
williamr@2
   716
					  TBool aSupportsDirectDisplay,
williamr@2
   717
					  const TSize& aMaxPictureSize,
williamr@2
   718
					  TUint aMaxBitrate,
williamr@2
   719
					  TBool aSupportsPictureLoss,
williamr@2
   720
					  TBool aSupportsSliceLoss);
williamr@2
   721
williamr@2
   722
	void ConstructL(const TDesC& aManufacturer,
williamr@2
   723
					const TDesC& aIdentifier,
williamr@2
   724
					const TArray<CCompressedVideoFormat*>& aSupportedFormats,
williamr@2
   725
					const TArray<TPictureRateAndSize>& aMaxPictureRates,
williamr@2
   726
					const TDesC8& aCodingStandardSpecificInfo,
williamr@2
   727
					const TDesC8& aImplementationSpecificInfo);
williamr@2
   728
private:
williamr@2
   729
	TUid iUid;
williamr@2
   730
	TVersion iVersion;
williamr@2
   731
	TBool iAccelerated;
williamr@2
   732
	TBool iSupportsDirectDisplay;
williamr@2
   733
	TSize iMaxPictureSize;
williamr@2
   734
	TUint iMaxBitrate;
williamr@2
   735
	TBool iSupportsPictureLoss;
williamr@2
   736
	TBool iSupportsSliceLoss;
williamr@2
   737
	HBufC* iManufacturer;
williamr@2
   738
	HBufC* iIdentifier;
williamr@2
   739
	RPointerArray<CCompressedVideoFormat> iSupportedFormats;
williamr@2
   740
	RArray<TPictureRateAndSize> iMaxPictureRates;
williamr@2
   741
	HBufC8* iCodingStandardSpecificInfo;
williamr@2
   742
	HBufC8* iImplementationSpecificInfo;
williamr@2
   743
	RArray<TInt> iSupportedScreens;
williamr@4
   744
	TBool iSupportsContentProtected;
williamr@2
   745
	};
williamr@2
   746
williamr@2
   747
williamr@2
   748
williamr@2
   749
williamr@2
   750
/**
williamr@2
   751
CMMFDevVideoPlay is the main client API for DevVideoPlay.
williamr@2
   752
@publishedAll
williamr@2
   753
@released
williamr@2
   754
*/
williamr@2
   755
class CMMFDevVideoPlay : public CBase, private MMMFDevVideoPlayProxy
williamr@2
   756
	{
williamr@2
   757
public:
williamr@2
   758
	/**
williamr@2
   759
	Picture statistic counters. Used for following playback progress. The counters can be retrieved 
williamr@2
   760
	using GetPictureCounters() and are reset after each call. The client must keep track of the 
williamr@2
   761
	cumulative values for counters and picture processing rates itself if necessary.
williamr@2
   762
	*/
williamr@2
   763
	class TPictureCounters
williamr@2
   764
		{
williamr@2
   765
	public:
williamr@2
   766
		/**
williamr@2
   767
		Default constructor.  Zeros all members.
williamr@2
   768
		*/
williamr@2
   769
		inline TPictureCounters();
williamr@2
   770
	public:
williamr@2
   771
		/**
williamr@2
   772
		The number of pictures skipped due to lack of processing power. This does not include pictures 
williamr@2
   773
		inside data bytes discarded due to buffer overflows, but includes all pictures skipped at 
williamr@2
   774
		picture decoding, post-processing and rendering phase.
williamr@2
   775
		*/
williamr@2
   776
		TUint iPicturesSkipped;
williamr@2
   777
williamr@2
   778
		/**
williamr@2
   779
		The number of pictures decoded.
williamr@2
   780
		*/
williamr@2
   781
		TUint iPicturesDecoded;
williamr@2
   782
williamr@2
   783
		/**
williamr@2
   784
		The number of pictures "virtually" displayed. "Virtually" displayed pictures are pictures 
williamr@2
   785
		that have been drawn on the screen, when using direct rendering, or pictures that have been 
williamr@2
   786
		decoded, processed, and delivered to the client when not using direct rendering.
williamr@2
   787
		*/
williamr@2
   788
		TUint iPicturesDisplayed;
williamr@2
   789
williamr@2
   790
		/**
williamr@2
   791
		The total number of pictures in the input bitstream. This figure does not include pictures that 
williamr@2
   792
		have been lost due to transmission errors, since those have not been processed by the MSL 
williamr@2
   793
		hardware devices, but does include pictures that have been discarded by the HW devices due 
williamr@2
   794
		to buffer overflows or other reasons.
williamr@2
   795
		*/
williamr@2
   796
		TUint iTotalPictures;
williamr@2
   797
		};
williamr@2
   798
williamr@2
   799
	/**
williamr@2
   800
	Bitstream statistic counters, used for following decoding progress. The counters can be retrieved 
williamr@2
   801
	using GetBitstreamCounters() and are reset after each call. The client must keep track of the 
williamr@2
   802
	cumulative values for counters itself if necessary.
williamr@2
   803
	*/
williamr@2
   804
	class TBitstreamCounters
williamr@2
   805
		{
williamr@2
   806
	public:
williamr@2
   807
		/**
williamr@2
   808
		Default constructor.  Zeros all members.
williamr@2
   809
		*/
williamr@2
   810
		inline TBitstreamCounters();
williamr@2
   811
	public:
williamr@2
   812
		/**
williamr@2
   813
		Number of lost packets.  This figure includes all packets that have been dropped by the hardware 
williamr@2
   814
		devices due to buffer overruns, but it does not include packets lost due to transmission errors.
williamr@2
   815
		*/
williamr@2
   816
		TUint iLostPackets;
williamr@2
   817
williamr@2
   818
		/**
williamr@2
   819
		Total number of packets. This figure includes all the packets that have been received by the 
williamr@2
   820
		decoder, including packets that have been dropped due to buffer overruns.
williamr@2
   821
		*/
williamr@2
   822
		TUint iTotalPackets;
williamr@2
   823
		};
williamr@2
   824
williamr@2
   825
	/**
williamr@2
   826
	Buffer options used with SetBufferOptionsL().
williamr@2
   827
	*/
williamr@2
   828
	class TBufferOptions
williamr@2
   829
		{
williamr@2
   830
	public:
williamr@2
   831
		/**
williamr@2
   832
		Default constructor.  Zeros all members.
williamr@2
   833
		*/
williamr@2
   834
		inline TBufferOptions();
williamr@2
   835
williamr@2
   836
	public:
williamr@2
   837
		/**
williamr@2
   838
		Pre-decoder buffer size in bytes. Set to zero to use decoder default value.
williamr@2
   839
		*/
williamr@2
   840
		TUint iPreDecodeBufferSize;
williamr@2
   841
williamr@2
   842
		/**
williamr@2
   843
		Maximum post-decoder buffer size in bytes. Set to zero to remove limitations.
williamr@2
   844
		*/
williamr@2
   845
		TUint iMaxPostDecodeBufferSize;
williamr@2
   846
williamr@2
   847
		/**
williamr@2
   848
		Initial pre-decoder buffering period, the amount of coded data to be buffered before decoding 
williamr@2
   849
		starts. If the value is set to zero, decoding begins immediately when all data associated with 
williamr@2
   850
		the first decoding timestamp is received. Default value is zero.
williamr@2
   851
		*/
williamr@2
   852
		TTimeIntervalMicroSeconds iPreDecoderBufferPeriod;
williamr@2
   853
williamr@2
   854
		/**
williamr@2
   855
		The amount of data buffered after the decoding before playback starts. If the value is zero, 
williamr@2
   856
		playback begins immediately when the first picture has been decoded. The default value is zero.
williamr@2
   857
		*/
williamr@2
   858
		TTimeIntervalMicroSeconds iPostDecoderBufferPeriod;
williamr@2
   859
williamr@2
   860
		/**
williamr@2
   861
		The maximum input buffer size that the client will request. If the buffer options have been 
williamr@2
   862
		set successfully, the decoder must be able to supply buffers of this size. If no information 
williamr@2
   863
		is available about the bitstream, the client may have to set this value to a relatively large 
williamr@2
   864
		value, and thus the decoder should not by default allocate buffers of this size before they 
williamr@2
   865
		are explicitly requested.
williamr@2
   866
		*/
williamr@2
   867
		TUint iMaxInputBufferSize;
williamr@2
   868
williamr@2
   869
		/**
williamr@2
   870
		The minimum number of input buffers the decoder needs to have available. This is the number of 
williamr@2
   871
		buffers the client can request through GetBufferL() before writing any back using 
williamr@2
   872
		WriteCodedDataL().
williamr@2
   873
		*/
williamr@2
   874
		TUint iMinNumInputBuffers;
williamr@2
   875
		};
williamr@2
   876
williamr@2
   877
	/**
williamr@2
   878
	Information about a single computational complexity level.
williamr@2
   879
	*/
williamr@2
   880
	class TComplexityLevelInfo
williamr@2
   881
		{
williamr@2
   882
	public:
williamr@2
   883
		enum TOptions
williamr@2
   884
			{
williamr@2
   885
			/** The average picture rate field is valid. */
williamr@2
   886
			EAvgPictureRate	   = 0x00000001,
williamr@2
   887
			/** The picture size field is valid. */
williamr@2
   888
			EPictureSize		  = 0x00000002,
williamr@2
   889
			/** The relative image quality field is valid. */
williamr@2
   890
			ERelativeImageQuality = 0x00000004,
williamr@2
   891
			/** The required MIPS field is valid. */
williamr@2
   892
			ERequiredMIPS		 = 0x00000008,
williamr@2
   893
			/** The relative processing time field is valid. */
williamr@2
   894
			ERelativeProcessTime  = 0x00000010
williamr@2
   895
			};
williamr@2
   896
		/**
williamr@2
   897
		Structure options. The value is a bitfield combined from values from TOptions.
williamr@2
   898
		*/
williamr@2
   899
		TUint32 iOptions;
williamr@2
   900
williamr@2
   901
		/**
williamr@2
   902
		The average picture rate, in pictures per second. Valid only if EAvgPictureRate is set in the
williamr@2
   903
		options. This value depends on the input bitstream, and may not be available if enough 
williamr@2
   904
		bitstream has not been read.
williamr@2
   905
		*/
williamr@2
   906
		TReal iAvgPictureRate;
williamr@2
   907
williamr@2
   908
		/**
williamr@2
   909
		Picture size (spatial resolution), in pixels. Valid only if EPictureSize is set in the options.
williamr@2
   910
		*/
williamr@2
   911
		TSize iPictureSize;
williamr@2
   912
williamr@2
   913
		/**
williamr@2
   914
		Relative image quality, compared to the best available level. 1.0 is the quality at the 
williamr@2
   915
		maximum quality level (level zero). Valid only if ERelativeImageQuality is set in the options.
williamr@2
   916
		*/
williamr@2
   917
		TReal iRelativeImageQuality;
williamr@2
   918
williamr@2
   919
		/**
williamr@2
   920
		The number of MIPS required to process the data. Valid only if ERequiredMIPS is set in 
williamr@2
   921
		the options.
williamr@2
   922
		*/
williamr@2
   923
		TUint iRequiredMIPS;
williamr@2
   924
williamr@2
   925
		/**
williamr@2
   926
		Relative amount of processing time needed compared to standard-compliant decoding of all data. 
williamr@2
   927
		1.0 is the processing time required for full processing, which usually corresponds to 
williamr@2
   928
		complexity level zero. Valid only if ERelativeProcessTime is set in the options.
williamr@2
   929
		*/
williamr@2
   930
		TReal iRelativeProcessTime;
williamr@2
   931
		};
williamr@2
   932
williamr@2
   933
public:
williamr@2
   934
williamr@2
   935
	/**
williamr@2
   936
	Constructs a new MSL video client instance. Each client instance supports a single video bitstream.
williamr@2
   937
williamr@2
   938
	@param  aObserver
williamr@2
   939
	        The observer object to use.
williamr@2
   940
williamr@2
   941
	@return A pointer to a new CMMFDevVideoPlay object.
williamr@2
   942
	@leave  This method may leave with one of the system-wide error codes.
williamr@2
   943
	*/
williamr@2
   944
	IMPORT_C static CMMFDevVideoPlay* NewL(MMMFDevVideoPlayObserver& aObserver);
williamr@2
   945
williamr@2
   946
	/**
williamr@2
   947
	Destructor.
williamr@2
   948
	*/
williamr@2
   949
	IMPORT_C ~CMMFDevVideoPlay();
williamr@2
   950
williamr@2
   951
	/**
williamr@2
   952
	Finds a common format from two lists of uncompressed video formats. Used typically to find a 
williamr@2
   953
	suitable intermediate format between a video decoder and a post-processor. If multiple common 
williamr@2
   954
	formats are available, the lowest-cost format is selected, assuming that the cost of each format 
williamr@2
   955
	is equal to its position in the input array.
williamr@2
   956
	@param	"aFormats1"		"The first format list."
williamr@2
   957
	@param	"aFormats2"		"The second format list."
williamr@2
   958
	@param	"aCommonFormat"	"The target variable where the common format found (if any) is stored."
williamr@2
   959
	@return	"True if a common format was found, false if not. If no common format was found, 
williamr@2
   960
			aCommonFormat is not modified."
williamr@2
   961
	*/
williamr@2
   962
	IMPORT_C static TBool FindCommonFormat(const TArray<TUncompressedVideoFormat>& aFormats1, 
williamr@2
   963
										   const TArray<TUncompressedVideoFormat>& aFormats2, 
williamr@2
   964
										   TUncompressedVideoFormat& aCommonFormat);
williamr@2
   965
williamr@2
   966
	/**
williamr@2
   967
	Finds all available decoders for a given video type with support for certain post-processing 
williamr@2
   968
	operations. The video type is specified using its MIME type, which may include parameters 
williamr@2
   969
	specifying the supported level, version, and other information. Decoder HW devices can use 
williamr@2
   970
	wildcards when listing the supported video types in the ECom registration information, so it is 
williamr@2
   971
	possible that all the decoders returned do not support the specified submode, e.g. profile and 
williamr@2
   972
	level, unless aExactMatch is set.
williamr@2
   973
	The decoder capabilities can be checked with VideoCodecInfoLC().
williamr@2
   974
 
williamr@2
   975
	@param	"aMimeType"		"The video type that will be decoded."
williamr@2
   976
	@param	"aPostProcType"	"The post-processing types that the decoder has to support, a binary OR 
williamr@2
   977
							of TPrePostProcessType values. If no post-processing support is needed, 
williamr@2
   978
							set this value to zero."
williamr@2
   979
	@param	"aDecoders"		"An array for the result decoder UIDs. The array must be created and 
williamr@2
   980
							destroyed by the caller."
williamr@2
   981
	@param	"aExactMatch"	"True if exact matching should be used. In this only decoders that support 
williamr@2
   982
							exactly the MIME-type given will be returned. Since verifying this may 
williamr@2
   983
							require loading the decoders into memory, this can be a fairly expensive 
williamr@2
   984
							operation, and if the user needs to verify their capabilities further in 
williamr@2
   985
							any case this parameter should be set to EFalse."
williamr@2
   986
	@leave	"This method may leave with one of the system-wide error codes. Typical error codes used:
williamr@2
   987
				* KErrNotFound:	No decoders were found matching the search parameters."
williamr@2
   988
	*/
williamr@2
   989
	IMPORT_C void FindDecodersL(const TDesC8& aMimeType, 
williamr@2
   990
								TUint32 aPostProcType, 
williamr@2
   991
								RArray<TUid>& aDecoders, 
williamr@2
   992
								TBool aExactMatch=ETrue);
williamr@2
   993
williamr@2
   994
	/**
williamr@2
   995
	Finds all available post-processors for a given set of post-processing operations.
williamr@2
   996
	@param	"aPostProcType"		"The post-processing types that the hardware device has to support, 
williamr@2
   997
								a binary OR of TPrePostProcessType values."
williamr@2
   998
	@param	"aPostProcessors"	"An array for the result post-processor UIDs. The array must be 
williamr@2
   999
								created and destroyed by the caller."
williamr@2
  1000
	@leave	"This method may leave with one of the system-wide error codes. Typical error codes used:
williamr@2
  1001
				* KErrNotFound:	No post-processors were found matching the search parameters."
williamr@2
  1002
	*/
williamr@2
  1003
	IMPORT_C void FindPostProcessorsL(TUint32 aPostProcType, RArray<TUid>& aPostProcessors);
williamr@2
  1004
williamr@2
  1005
	/**
williamr@2
  1006
	Retrieves a list of available video decoders in the system.
williamr@2
  1007
	@param	"aDecoders"	"An array for the result decoder UIDs. The array must be created and 
williamr@2
  1008
						destroyed by the caller."
williamr@2
  1009
	@leave	"This method may leave with one of the system-wide error codes.  Not finding any decoders 
williamr@2
  1010
			is not treated as an error condition: in this situation, aDecoders will be empty."
williamr@2
  1011
	*/
williamr@2
  1012
	IMPORT_C void GetDecoderListL(RArray<TUid>& aDecoders);
williamr@2
  1013
williamr@2
  1014
	/**
williamr@2
  1015
	Retrieves a list of available video post-processors in the system.
williamr@2
  1016
williamr@2
  1017
	@param  aPostProcessors
williamr@2
  1018
	        An array for the result post-processor UIDs. The array must be created and
williamr@2
  1019
	        destroyed by the caller.
williamr@2
  1020
williamr@2
  1021
	@leave  This method may leave with one of the system-wide error codes.  Not finding any post-processors
williamr@2
  1022
	        is not treated as an error condition: in this situation, aDecoders will be empty.
williamr@2
  1023
	*/
williamr@2
  1024
	IMPORT_C void GetPostProcessorListL(RArray<TUid>& aPostProcessors);
williamr@2
  1025
williamr@2
  1026
	/**
williamr@2
  1027
	Retrieves information about an installed video decoder. Note that this method will need to load 
williamr@2
  1028
	the codec hardware device into memory, and can thus be relatively expensive.
williamr@2
  1029
	@param	"aVideoDecoder"	"The video decoder to query."
williamr@2
  1030
	@return "Decoder information as a CVideoDecoderInfo object. The object is pushed to the cleanup
williamr@2
  1031
			stack, and must be deallocated by the caller."
williamr@2
  1032
	@leave  "This method may leave with one of the system-wide error codes."
williamr@2
  1033
	*/
williamr@2
  1034
	IMPORT_C CVideoDecoderInfo* VideoDecoderInfoLC(TUid aVideoDecoder);
williamr@2
  1035
williamr@2
  1036
	/**
williamr@2
  1037
	Retrieves information about the post-processing capabilities of an installed post-processor or 
williamr@2
  1038
	decoder hardware device. Note that this method will need to load the device into memory, and can 
williamr@2
  1039
	thus be relatively expensive.
williamr@2
  1040
	@param	"aPostProcessor"	"The post-processor to query."
williamr@2
  1041
	@return "Post-processor information as a CPostProcessorInfo object. The object is pushed to the 
williamr@2
  1042
			cleanup stack, and must be deallocated by the caller."
williamr@2
  1043
	@leave  "This method may leave with one of the system-wide error codes."
williamr@2
  1044
	*/
williamr@2
  1045
	IMPORT_C CPostProcessorInfo* PostProcessorInfoLC(TUid aPostProcessor);
williamr@2
  1046
williamr@2
  1047
	/**
williamr@2
  1048
	Selects the video decoder to be used. This method must be called before any other video decoder 
williamr@2
  1049
	related methods are used. The decoder to use can be changed by calling this method again before 
williamr@2
  1050
	the API has been initialized with Initialize().
williamr@2
  1051
	All video decoder settings are reset to their default values, which are up to the implementation 
williamr@2
  1052
	to decide if not specified in any of the MSL specifications. By default no post-processing is 
williamr@2
  1053
	performed.
williamr@2
  1054
williamr@2
  1055
	@param  "aDecoder" "The video decoder to use."
williamr@2
  1056
	@return "Hardware device ID, used in other methods for configuring the decoder."
williamr@2
  1057
	@leave  "The method will leave if an error occurs. Typical error codes used:
williamr@2
  1058
			* KErrNotFound - No decoder was found with the given UID"
williamr@2
  1059
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1060
	*/
williamr@2
  1061
	IMPORT_C THwDeviceId SelectDecoderL(TUid aDecoder);
williamr@2
  1062
williamr@2
  1063
	/**
williamr@2
  1064
	Selects the video post-processor to be used. This method must be called before any other 
williamr@2
  1065
	post-processor related methods are used. The post-processor to use can be changed by calling
williamr@2
  1066
	this method again before the API has been initialized with Initialize().
williamr@2
  1067
	All post-processor settings are reset to their default values, which are up to the implementation
williamr@2
  1068
	to decide if not specified in any of the MSL specifications.
williamr@2
  1069
williamr@2
  1070
	@param  "aPostProcessor" "The post-processor to use."
williamr@2
  1071
	@return "Hardware device ID, used in other methods for configuring the post-processor."
williamr@2
  1072
	@leave  "The method will leave if an error occurs. Typical error codes used:
williamr@2
  1073
				* KErrNotFound - No post-processor was found with the given UID"
williamr@2
  1074
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1075
	*/
williamr@2
  1076
	IMPORT_C THwDeviceId SelectPostProcessorL(TUid aPostProcessor);
williamr@2
  1077
williamr@2
  1078
	/**
williamr@2
  1079
	Reads header information from a coded data unit. [1 #59] This method can be called only after 
williamr@2
  1080
	SelectDecoderL().
williamr@2
  1081
	@param	"aDataUnitType"				"The type of coded data unit that is contained in aDataUnit. If the 
williamr@2
  1082
										data is a simple piece of bitstream, use 
williamr@2
  1083
										EDuArbitraryStreamSection."
williamr@2
  1084
	@param	"aDataUnitEncapsulation"	"The encapsulation type used for the coded data. If the data 
williamr@2
  1085
										is a simple piece of bitstream, use EDuElementaryStream."
williamr@2
  1086
	@param	"aDataUnit"					"The coded data unit, contained in a TVideoInputBuffer."
williamr@2
  1087
	@return "Header information for the data unit, or NULL if the coded data unit did not contain 
williamr@2
  1088
			enough data to parse the header. The header data must be returned to the API using 
williamr@2
  1089
			ReturnHeader() before the API is shut down or the decoder is changed. The data remains 
williamr@2
  1090
			valid until it is returned."
williamr@2
  1091
	@leave	"The method will leave if an error occurs. Running out of data is not considered an error, 
williamr@2
  1092
			as described above. Typical error codes used:
williamr@2
  1093
				* KErrNotSupported - The data is not in a supported format.
williamr@2
  1094
				* KErrCorrupt - The data appears to be in a supported format, but is corrupted."
williamr@2
  1095
	*/
williamr@2
  1096
	IMPORT_C TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType, 
williamr@2
  1097
														TVideoDataUnitEncapsulation aDataUnitEncapsulation, 
williamr@2
  1098
														TVideoInputBuffer* aDataUnit);
williamr@2
  1099
williamr@2
  1100
	IMPORT_C void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
williamr@2
  1101
williamr@2
  1102
	/**
williamr@2
  1103
	Returns a header from GetHeaderInformationL() back to the decoder so that the memory can be freed.
williamr@2
  1104
	@param	"aHeader"	"The header to return."
williamr@2
  1105
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1106
	*/
williamr@2
  1107
	IMPORT_C void ReturnHeader(TVideoPictureHeader* aHeader);
williamr@2
  1108
williamr@2
  1109
	/**
williamr@2
  1110
	Sets a hardware device input format to an uncompressed video format. Only post-processors support 
williamr@2
  1111
	uncompressed video input.
williamr@2
  1112
	@param	"aHwDevice"	"The hardware device to configure. The value is returned from
williamr@2
  1113
						SelectPostProcessorL() when the device is selected."
williamr@2
  1114
	@param	"aFormat"	"The input format to use."
williamr@2
  1115
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1116
				* KErrNotSupported - The input format is not supported."
williamr@2
  1117
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1118
	*/
williamr@2
  1119
	IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat& aFormat);
williamr@2
  1120
williamr@2
  1121
	/**
williamr@2
  1122
	Sets a hardware device Input format to a compressed video format. Only decoders support compressed 
williamr@2
  1123
	video input.
williamr@2
  1124
	@param	"aHwDevice"			"The hardware device to configure. The value is returned from 
williamr@2
  1125
								SelectDecoderL() when the device is selected."
williamr@2
  1126
	@param	"aFormat"			"The input format to use."
williamr@2
  1127
	@param	"aDataUnitType"		"The data unit type for input data."
williamr@2
  1128
	@param	"aEncapsulation"	"The encapsulation type used for the coded data."
williamr@2
  1129
	@param	"aDataInOrder"		"True if the input data is written in correct decoding order, false if 
williamr@2
  1130
								the input data may be written in arbitrary order."
williamr@2
  1131
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1132
				* KErrNotSupported - The input format is not supported."
williamr@2
  1133
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1134
	*/
williamr@2
  1135
	IMPORT_C void SetInputFormatL(THwDeviceId aHwDevice, 
williamr@2
  1136
								  const CCompressedVideoFormat& aFormat, 
williamr@2
  1137
								  TVideoDataUnitType aDataUnitType, 
williamr@2
  1138
								  TVideoDataUnitEncapsulation aEncapsulation, 
williamr@2
  1139
								  TBool aDataInOrder);
williamr@2
  1140
williamr@2
  1141
	/**
williamr@2
  1142
	Retrieves the list of the output formats a hardware device supports. The list is ordered in 
williamr@2
  1143
	preference order, with the preferred formats at the beginning of the list. The list can depend 
williamr@2
  1144
	on the device source format, and therefore SetSourceFormatL() must be called for the device 
williamr@2
  1145
	before calling this method.
williamr@2
  1146
	@param	"aHwDevice"	"The hardware device to configure. The value is returned from SelectDecoderL() 
williamr@2
  1147
						or SelectPostProcessorL() when the device is selected."
williamr@2
  1148
	@param	"aFormats"	"An array for the result format list. The array must be created and destroyed 
williamr@2
  1149
						by the caller."
williamr@2
  1150
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
  1151
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1152
	*/
williamr@2
  1153
	IMPORT_C void GetOutputFormatListL(THwDeviceId aHwDevice, RArray<TUncompressedVideoFormat>& aFormats);
williamr@2
  1154
williamr@2
  1155
	/**
williamr@2
  1156
	Sets the output format for a hardware device. If a decoder and a post-processor are used, the 
williamr@2
  1157
	decoder output format must match the post-processor source format.
williamr@2
  1158
williamr@2
  1159
    If direct screen access is being used, then it is not necessary to call this method on the 
williamr@2
  1160
	hwdevice performing the direct screen access.
williamr@2
  1161
	
williamr@2
  1162
	@param	"aHwDevice"	"The hardware device to configure. The value is returned from SelectDecoderL() 
williamr@2
  1163
						or SelectPostProcessorL() when the device is selected."
williamr@2
  1164
	@param	"aFormat"	"The format to use."
williamr@2
  1165
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1166
				* KErrNotSupported - The output format is not supported."
williamr@2
  1167
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1168
	*/
williamr@2
  1169
	IMPORT_C void SetOutputFormatL(THwDeviceId aHwDevice, const TUncompressedVideoFormat &aFormat);
williamr@2
  1170
williamr@2
  1171
	/**
williamr@2
  1172
	Sets the clock source to use for video timing. When video playback is synchronized with audio, the 
williamr@2
  1173
	clock source is implemented by the audio playback subsystem, otherwise the clock source should get 
williamr@2
  1174
	the time from the system clock. If no clock source is set, video playback will not be synchronized,
williamr@2
  1175
	but will proceed as fast as possible, depending on input data and output buffer availability. This 
williamr@2
  1176
	method can be called after all hardware devices have been selected, but before calling Initialize().
williamr@2
  1177
williamr@2
  1178
	All decoders must support synchronization with an external clock source, as well as unsynchronized 
williamr@2
  1179
	non-realtime operation. When a clock source is set, the decoder can skip pictures to maintain 
williamr@2
  1180
	synchronization. When non-realtime operation is used and no clock source has been set, pictures 
williamr@2
  1181
	may not be skipped unless a lower complexity level is used that requires this.
williamr@2
  1182
williamr@2
  1183
	@param	"aClock"	"The clock source to use"
williamr@2
  1184
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1185
	*/
williamr@2
  1186
	IMPORT_C void SetClockSource(MMMFClockSource* aClock);
williamr@2
  1187
williamr@2
  1188
	/**
williamr@2
  1189
	Sets the video output destination. The destination can be the screen (using direct screen access) 
williamr@2
  1190
	or memory buffers. By default memory buffers are used. This method must be called after the 
williamr@2
  1191
	decoder and post-processor have been selected and their options set, since support for direct 
williamr@2
  1192
	screen access can vary between hardware devices.
williamr@2
  1193
	@param	"aScreen"	"True if video output destination is the screen, false if memory buffers."
williamr@2
  1194
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1195
				* KErrNotSupported - The selected video destination is not supported with the 
williamr@2
  1196
				  current codec and post-processor settings."
williamr@2
  1197
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1198
	*/
williamr@2
  1199
	IMPORT_C void SetVideoDestScreenL(TBool aScreen);
williamr@2
  1200
williamr@2
  1201
	/**
williamr@2
  1202
	Sets whether the decoder should synchronize decoding to the current clock source, if any, or 
williamr@2
  1203
	should decode all pictures as soon as possible. If decoding is synchronized, decoding timestamps 
williamr@2
  1204
	are used if available, presentation timestamps are used if not. When decoding is not synchronized, 
williamr@2
  1205
	pictures are decoded as soon as source data is available for them and the decoder has a free 
williamr@2
  1206
	output buffer. If a clock source is not available, decoding will not be synchronized.
williamr@2
  1207
williamr@2
  1208
	@param	"aSynchronize"	"True if decoding should be synchronized to a clock source."
williamr@2
  1209
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1210
	*/
williamr@2
  1211
	IMPORT_C void SynchronizeDecoding(TBool aSynchronize);
williamr@2
  1212
williamr@2
  1213
	/**
williamr@2
  1214
	Sets video decoder buffering options.
williamr@2
  1215
	@param	"aOptions"	"Buffering options."
williamr@2
  1216
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1217
				* KErrNotSupported - The specified buffering options are not supported. If the 
williamr@2
  1218
				  client receives this error code, it can call GetBufferOptions() to determine 
williamr@2
  1219
				  the options the decoder is able to support."
williamr@2
  1220
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1221
	*/
williamr@2
  1222
	IMPORT_C void SetBufferOptionsL(const TBufferOptions& aOptions);
williamr@2
  1223
williamr@2
  1224
	/**
williamr@2
  1225
	Gets the video decoder buffer options actually in use. This can be used before calling 
williamr@2
  1226
	SetBufferOptionsL() to determine the default options, or afterwards to check the values actually 
williamr@2
  1227
	in use (if some default values were used).
williamr@2
  1228
	@param	"aOptions"	"Buffering options structure to fill."
williamr@2
  1229
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1230
	*/
williamr@2
  1231
	IMPORT_C void GetBufferOptions(TBufferOptions& aOptions);
williamr@2
  1232
williamr@2
  1233
	/**
williamr@2
  1234
	Indicates which HRD/VBV specification is fulfilled in the input stream and any related parameters.
williamr@2
  1235
	@param	"aHrdVbvSpec"	"The HRD/VBV specification fulfilled, see the definition of 
williamr@2
  1236
							THrdVbvSpecification for details."
williamr@2
  1237
	@param	"aHrdVbvParams"	"HRD/VBV parameters. The data format depends on the parameters chosen. 
williamr@2
  1238
							For 3GPP TS 26.234 parameters (aHrdVbvSpec=EHrdVbv3GPP), the data in the 
williamr@2
  1239
							descriptor is a package of type TPckC<T3gppHrdVbvParams> 
williamr@2
  1240
							(see T3gppHrdVbvParams). If no HRD/VBV parameters are used, the descriptor 
williamr@2
  1241
							is empty."
williamr@2
  1242
	@pre	"This method can only be called before the API has been initialized with Initialize()."
williamr@2
  1243
	*/
williamr@2
  1244
	IMPORT_C void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams);
williamr@2
  1245
williamr@2
  1246
	/**
williamr@2
  1247
	Sets the post-processing types to be used. This method, like all post-processing configuration 
williamr@2
  1248
	methods, must be called before Initialize().
williamr@2
  1249
williamr@2
  1250
	Post-processing operations are carried out in the following order:
williamr@2
  1251
		1. Input cropping
williamr@2
  1252
		2. Mirroring
williamr@2
  1253
		3. Rotating
williamr@2
  1254
		4. Scaling
williamr@2
  1255
		5. Output cropping
williamr@2
  1256
	Color space conversion can be performed at any point in the post-processing flow.
williamr@2
  1257
williamr@2
  1258
	@param	"aHwDevice"				"The hardware device to configure. The value is returned from 
williamr@2
  1259
									SelectDecoderL() or SelectPostProcessorL() when the device is 
williamr@2
  1260
									selected."
williamr@2
  1261
	@param	"aPostProcCombination"	"The post-processing steps to perform, a bitwise OR of values 
williamr@2
  1262
									from TPrePostProcessType."
williamr@2
  1263
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1264
				* KErrNotSupported - The post-processing combination is not supported"
williamr@2
  1265
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1266
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1267
	*/
williamr@2
  1268
	IMPORT_C void SetPostProcessTypesL(THwDeviceId aHwDevice, TUint32 aPostProcCombination);
williamr@2
  1269
williamr@2
  1270
	/**
williamr@2
  1271
	Sets post-processing options for input (pan-scan) cropping. SetPostProcessTypesL() must be called 
williamr@2
  1272
	before this method is used.
williamr@2
  1273
	@param	"aHwDevice"	"The hardware device to configure. The value is returned from SelectDecoderL()
williamr@2
  1274
						or SelectPostProcessorL() when the device is selected."
williamr@2
  1275
	@param	"aRect"		"The cropping rectangle to use."
williamr@2
  1276
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1277
				* KErrNotSupported - Pan-scan cropping is not supported"
williamr@2
  1278
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1279
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1280
	*/
williamr@2
  1281
	IMPORT_C void SetInputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
williamr@2
  1282
williamr@2
  1283
	/**
williamr@2
  1284
	Sets post-processing options for YUV to RGB color space conversion. Specifies the input YUV and 
williamr@2
  1285
	output RGB formats to use explicitly. SetSourceFormatL() and SetOutputFormatL(), and 
williamr@2
  1286
	SetPostProcessTypesL() must be called before this method is used.
williamr@2
  1287
	@param	"aHwDevice"		"The hardware device to configure. The value is returned from 
williamr@2
  1288
							SelectDecoderL() or SelectPostProcessorL() when the device is selected."
williamr@2
  1289
	@param	"aOptions"		"The conversion options to use."
williamr@2
  1290
	@param	"aYuvFormat"	"Conversion source YUV format."
williamr@2
  1291
	@param	"aRgbFormat"	"Conversion target RGB format."
williamr@2
  1292
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1293
				* KErrNotSupported - The conversion options are not supported."
williamr@2
  1294
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1295
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1296
	*/
williamr@2
  1297
	IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice, 
williamr@2
  1298
									  const TYuvToRgbOptions& aOptions, 
williamr@2
  1299
									  const TYuvFormat& aYuvFormat, 
williamr@2
  1300
									  TRgbFormat aRgbFormat);
williamr@2
  1301
williamr@2
  1302
	/**
williamr@2
  1303
	Sets post-processing options for YUV to RGB color space conversion. Uses the device input and 
williamr@2
  1304
	output formats. For decoders the default YUV format used is the format specified in the input 
williamr@2
  1305
	bitstream. SetSourceFormatL() and SetOutputFormatL(), and SetPostProcessTypesL() must be called 
williamr@2
  1306
	before this method is used.
williamr@2
  1307
	@param	"aHwDevice"		"The hardware device to configure. The value is returned from 
williamr@2
  1308
							SelectDecoderL() or SelectPostProcessorL() when the device is selected."
williamr@2
  1309
	@param	"aOptions"		"The conversion options to use."
williamr@2
  1310
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1311
				* KErrNotSupported - The conversion options are not supported."
williamr@2
  1312
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1313
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1314
	*/
williamr@2
  1315
	IMPORT_C void SetYuvToRgbOptionsL(THwDeviceId aHwDevice, const TYuvToRgbOptions& aOptions);
williamr@2
  1316
williamr@2
  1317
	/**
williamr@2
  1318
	Sets post-processing options for rotation. SetPostProcessTypesL() must be called before this 
williamr@2
  1319
	method is used.
williamr@2
  1320
	@param	"aHwDevice"		"The hardware device to configure. The value is returned from 
williamr@2
  1321
							SelectDecoderL() or SelectPostProcessorL() when the device is selected."
williamr@2
  1322
	@param	"aRotationType"	"The rotation to perform."
williamr@2
  1323
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1324
				* KErrNotSupported - The rotation options are not supported."
williamr@2
  1325
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1326
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1327
	*/
williamr@2
  1328
	IMPORT_C void SetRotateOptionsL(THwDeviceId aHwDevice, TRotationType aRotationType);
williamr@2
  1329
williamr@2
  1330
	/**
williamr@2
  1331
	Sets post-processing options for scaling. SetPostProcessTypesL() must be called before this method 
williamr@2
  1332
	is used.
williamr@2
  1333
	@param	"aHwDevice"				"The hardware device to configure. The value is returned from 
williamr@2
  1334
									SelectDecoderL() or SelectPostProcessorL() when the device is 
williamr@2
  1335
									selected."
williamr@2
  1336
	@param	"aTargetSize"			"Scaling target size. If a fixed scale factor size is used, the 
williamr@2
  1337
									new dimensions must be set to width=floor(factor*width), 
williamr@2
  1338
									height=floor(factor*height). For example, scaling a QCIF (176x144) 
williamr@2
  1339
									picture up by a factor of 4/3 yields a size of 234x192."
williamr@2
  1340
	@param	"aAntiAliasFiltering"	"True if anti-aliasing filtering should be used. If the 
williamr@2
  1341
									post-processor does not support anti-aliased scaling, or supports 
williamr@2
  1342
									anti-aliased scaling only, this argument is ignored."
williamr@2
  1343
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1344
				* KErrNotSupported - The scale options are not supported."
williamr@2
  1345
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1346
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1347
	*/
williamr@2
  1348
	IMPORT_C void SetScaleOptionsL(THwDeviceId aHwDevice, 
williamr@2
  1349
								   const TSize& aTargetSize, 
williamr@2
  1350
								   TBool aAntiAliasFiltering);
williamr@2
  1351
williamr@2
  1352
	/**
williamr@2
  1353
	Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before this
williamr@2
  1354
	method is used.
williamr@2
  1355
	@param	"aHwDevice"	"The hardware device to configure. The value is returned from SelectDecoderL()
williamr@2
  1356
						# SelectPostProcessorL() when the device is selected."
williamr@2
  1357
	@param	"aRect"		"Output cropping area."
williamr@2
  1358
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1359
				* KErrNotSupported - Output cropping is not supported."
williamr@2
  1360
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1361
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1362
	*/
williamr@2
  1363
	IMPORT_C void SetOutputCropOptionsL(THwDeviceId aHwDevice, const TRect& aRect);
williamr@2
  1364
williamr@2
  1365
	/**
williamr@2
  1366
	Sets post-processing hardware device specific options. SetPostProcessTypesL() must be called 
williamr@2
  1367
	before this method is used.
williamr@2
  1368
	@param	"aHwDevice"	"The hardware device to configure. The value is returned from SelectDecoderL()
williamr@2
  1369
						or SelectPostProcessorL() when the device is selected."
williamr@2
  1370
	@param	"aOptions"	"The options. The format is plug-in specific."
williamr@2
  1371
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1372
				* KErrNotSupported - The options are not supported."
williamr@2
  1373
	@pre	"This method can be called either before or after the API has been initialized with Initialize().
williamr@2
  1374
			If called after initialization, the change will only be committed once CommitL() is called."
williamr@2
  1375
	*/
williamr@2
  1376
	IMPORT_C void SetPostProcSpecificOptionsL(THwDeviceId aHwDevice, const TDesC8& aOptions);
williamr@2
  1377
williamr@2
  1378
	/**
williamr@2
  1379
	Initializes the video device. This method is asynchronous, DevVideoPlay will call 
williamr@2
  1380
	MMMFDevVideoPlayObserver::MdvpoInitializeComplete() after initialization has completed. No 
williamr@2
  1381
	DevVideoPlay method may be called while initialization is in progress, the initialization process 
williamr@2
  1382
	can only be cancelled by destroying the DevVideoPlay object. After this initialization has been 
williamr@2
  1383
	successfully completed, further configuration changes are not possible except where separately 
williamr@2
  1384
	noted.
williamr@2
  1385
williamr@2
  1386
	If initialization fails for any reason, the DevVideoPlay object must be destroyed and set up from
williamr@2
  1387
	scratch.
williamr@2
  1388
	*/
williamr@2
  1389
	IMPORT_C void Initialize();
williamr@2
  1390
williamr@2
  1391
	/**
williamr@2
  1392
	Commit all configuration changes since the last CommitL(), Revert() or Initialize(). This only applies 
williamr@2
  1393
	to methods that can be called both before AND after DevVideoPlay has been initialized. 
williamr@2
  1394
	See the following methods for details.
williamr@2
  1395
williamr@2
  1396
	@see	SetPostProcessTypesL
williamr@2
  1397
	@see	SetInputCropOptionsL
williamr@2
  1398
	@see	SetYuvToRgbOptionsL
williamr@2
  1399
	@see	SetRotateOptionsL
williamr@2
  1400
	@see	SetScaleOptionsL
williamr@2
  1401
	@see	SetOutputCropOptionsL
williamr@2
  1402
	@see	SetPostProcSpecificOptionsL
williamr@2
  1403
williamr@2
  1404
	@leave  "The method will leave if an error occurs."
williamr@2
  1405
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1406
	*/
williamr@2
  1407
	IMPORT_C void CommitL();
williamr@2
  1408
williamr@2
  1409
	/**
williamr@2
  1410
	Revert any configuration changes that have not yet been committed using CommitL().  This only applies 
williamr@2
  1411
	to methods that can be called both before AND after DevVideoPlay has been initialized. 
williamr@2
  1412
	See the following methods for details.
williamr@2
  1413
williamr@2
  1414
	@see	SetPostProcessTypesL
williamr@2
  1415
	@see	SetInputCropOptionsL
williamr@2
  1416
	@see	SetYuvToRgbOptionsL
williamr@2
  1417
	@see	SetRotateOptionsL
williamr@2
  1418
	@see	SetScaleOptionsL
williamr@2
  1419
	@see	SetOutputCropOptionsL
williamr@2
  1420
	@see	SetPostProcSpecificOptionsL
williamr@2
  1421
williamr@2
  1422
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1423
	*/
williamr@2
  1424
	IMPORT_C void Revert();
williamr@2
  1425
williamr@2
  1426
	/**
williamr@2
  1427
	Starts video decoding directly to the display frame buffer using Direct Screen Access. 
williamr@2
  1428
	Playback to the display can start immediately.
williamr@2
  1429
	@param	"aVideoRect"	"The video output rectangle on screen. The rectangle size should be the 
williamr@2
  1430
							same as the output video size, otherwise results are undefined. Some 
williamr@2
  1431
							decoders may set limitations to the position and alignment of the 
williamr@2
  1432
							rectangle. The rectangle must be aligned to a 32-bit boundary on screen 
williamr@2
  1433
							(even X-coordinate on 12-bpp and 16-bpp displays) and must fit completely 
williamr@2
  1434
							on the screen."
williamr@2
  1435
	@param	"aScreenDevice"	"The screen device to use. The screen device will supply frame buffer 
williamr@2
  1436
							information, and is used to update the frame buffer to screen. The screen 
williamr@2
  1437
							device object must be valid in the current thread."
williamr@2
  1438
	@param	"aClipRegion"	"Initial clipping region to use."
williamr@2
  1439
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1440
				*KErrNotSupported - Direct Screen Access is not supported"
williamr@2
  1441
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1442
	*/
williamr@2
  1443
	IMPORT_C void StartDirectScreenAccessL(const TRect& aVideoRect, 
williamr@2
  1444
										   CFbsScreenDevice& aScreenDevice, 
williamr@2
  1445
										   const TRegion& aClipRegion);
williamr@2
  1446
williamr@2
  1447
	/**
williamr@2
  1448
	Sets a new clipping region for Direct Screen Access. After the method returns, no video will be 
williamr@2
  1449
	drawn outside of the region. (Note that in Symbian OS clipping regions are "positive" - that is, 
williamr@2
  1450
	they define the legal area inside which an application may draw.) 
williamr@2
  1451
williamr@2
  1452
	If clipping is not supported, or the clipping region is too complex, either playback will pause 
williamr@2
  1453
	or will resume without video display, depending on the current setting of SetPauseOnClipFail(), 
williamr@2
  1454
	and the result can be verified with IsPlaying(). Clipping can be disabled by setting a new 
williamr@2
  1455
	clipping region that includes the whole video window.
williamr@2
  1456
williamr@2
  1457
	@param	"aRegion"	"The new clipping region. After the method returns, no video will be drawn 
williamr@2
  1458
						outside the region."
williamr@2
  1459
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1460
	*/
williamr@2
  1461
	IMPORT_C void SetScreenClipRegion(const TRegion& aRegion);
williamr@2
  1462
williamr@2
  1463
	/**
williamr@2
  1464
	Sets whether the system should pause playback when it gets a clipping region it cannot handle, 
williamr@2
  1465
	or Direct Screen Access is aborted completely. If not, decoding will proceed normally, but no 
williamr@2
  1466
	video will be drawn. By default, playback is paused.
williamr@2
  1467
	@param	"aPause"	"True if playback should be paused when clipping fails, false if not. If 
williamr@2
  1468
						playback is not paused, it will be continued without video display."
williamr@2
  1469
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1470
	*/
williamr@2
  1471
	IMPORT_C void SetPauseOnClipFail(TBool aPause);
williamr@2
  1472
williamr@2
  1473
	/**
williamr@2
  1474
	Aborts Direct Screen Access completely, to be called from MAbortDirectScreenAccess::AbortNow() and 
williamr@2
  1475
	similar methods. DSA can be resumed by calling StartDirectScreenAccessL().
williamr@2
  1476
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1477
	*/
williamr@2
  1478
	IMPORT_C void AbortDirectScreenAccess();
williamr@2
  1479
williamr@2
  1480
	/**
williamr@2
  1481
	Indicates whether playback is proceeding. This method can be used to check whether playback was 
williamr@2
  1482
	paused or not in response to a new clipping region or DSA abort.
williamr@2
  1483
	@return "ETrue if video is still being played (even if not necessarily displayed)."
williamr@2
  1484
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1485
	*/
williamr@2
  1486
	IMPORT_C TBool IsPlaying();
williamr@2
  1487
williamr@2
  1488
	/**
williamr@2
  1489
	Re-draws the latest video picture. Only available when DSA is being used. If DSA is aborted 
williamr@2
  1490
	or a non-supported clipping region has been set, the request may be ignored.
williamr@2
  1491
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1492
	*/
williamr@2
  1493
	IMPORT_C void Redraw();
williamr@2
  1494
williamr@2
  1495
	/**
williamr@2
  1496
	Starts video playback, including decoding, post-processing, and rendering. Playback will proceed 
williamr@2
  1497
	until it has been stopped or paused, or the end of the bitstream is reached.
williamr@2
  1498
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1499
	*/
williamr@2
  1500
	IMPORT_C void Start();
williamr@2
  1501
williamr@2
  1502
	/**
williamr@2
  1503
	Stops video playback. No new pictures will be decoded, post-processed, or rendered.
williamr@2
  1504
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1505
	*/
williamr@2
  1506
	IMPORT_C void Stop();
williamr@2
  1507
williamr@2
  1508
	/**
williamr@2
  1509
	Pauses video playback, including decoding, post-processing, and rendering. No pictures will be 
williamr@2
  1510
	decoded, post-processed, or rendered until playback has been resumed. The client is responsible 
williamr@2
  1511
	for pausing the clock source (typically by pausing audio output) if necessary.
williamr@2
  1512
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1513
	*/
williamr@2
  1514
	IMPORT_C void Pause();
williamr@2
  1515
williamr@2
  1516
	/**
williamr@2
  1517
	Resumes video playback after a pause. The client is responsible for restarting the clock source 
williamr@2
  1518
	if necessary.
williamr@2
  1519
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1520
	*/
williamr@2
  1521
	IMPORT_C void Resume();
williamr@2
  1522
williamr@2
  1523
	/**
williamr@2
  1524
	Changes to a new decoding and playback position, used for randomly accessing (seeking) the input 
williamr@2
  1525
	stream. The position change flushes all input and output buffers. Pre-decoder and post-decoder 
williamr@2
  1526
	buffering are handled as if a new bitstream was started. If the MSL video subsystem still has 
williamr@2
  1527
	buffered pictures that precede the new playback position, they will be discarded. If playback is 
williamr@2
  1528
	synchronized to a clock source, the client is responsible for setting the clock source to the new 
williamr@2
  1529
	position.
williamr@2
  1530
	@param	"aPlaybackPosition"	"The new playback position in the video stream."
williamr@2
  1531
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1532
	*/
williamr@2
  1533
	IMPORT_C void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
williamr@2
  1534
williamr@2
  1535
	/**
williamr@2
  1536
	Freezes a picture on the screen. After the picture has been frozen, no picture is displayed until 
williamr@2
  1537
	the freeze is released with ReleaseFreeze(). If the video output is being written to memory 
williamr@2
  1538
	buffers, not the screen, decoded pictures will not be delivered to the client when a freeze is 
williamr@2
  1539
	active, but are simply discarded.
williamr@2
  1540
	@param	"aPlaybackPosition"	"The presentation timestamp of the picture to freeze. The frozen 
williamr@2
  1541
								picture will be the first picture with a timestamp greater than or 
williamr@2
  1542
								equal to this parameter."
williamr@2
  1543
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1544
	*/
williamr@2
  1545
	IMPORT_C void FreezePicture(const TTimeIntervalMicroSeconds& aPlaybackPosition);
williamr@2
  1546
williamr@2
  1547
	/**
williamr@2
  1548
	Releases a picture frozen with FreezePicture().
williamr@2
  1549
	@param	"aPlaybackPosition"	"The presentation timestamp of the picture to release. The first 
williamr@2
  1550
								picture displayed after the release will be the first picture with a 
williamr@2
  1551
								timestamp greater than or equal to this parameter. To release the 
williamr@2
  1552
								freeze immediately, set the timestamp to zero."
williamr@2
  1553
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1554
	*/
williamr@2
  1555
	IMPORT_C void ReleaseFreeze(const TTimeIntervalMicroSeconds& aPlaybackPosition);
williamr@2
  1556
williamr@2
  1557
	/**
williamr@2
  1558
	Returns the current decoding position, i.e. the timestamp for the most recently decoded picture.
williamr@2
  1559
	@return "Current decoding position."
williamr@2
  1560
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1561
	*/
williamr@2
  1562
	IMPORT_C TTimeIntervalMicroSeconds DecodingPosition();
williamr@2
  1563
williamr@2
  1564
	/**
williamr@2
  1565
	Returns the current playback position, i.e. the timestamp for the most recently displayed or 
williamr@2
  1566
	virtually displayed picture.
williamr@2
  1567
	@return "Current playback position."
williamr@2
  1568
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1569
	*/
williamr@2
  1570
	IMPORT_C TTimeIntervalMicroSeconds PlaybackPosition();
williamr@2
  1571
	
williamr@2
  1572
	/**
williamr@2
  1573
	Returns the current pre-decoder buffer size.
williamr@2
  1574
	@return "The number of bytes of data in the pre-decoder buffer."
williamr@2
  1575
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1576
	*/
williamr@2
  1577
	IMPORT_C TUint PreDecoderBufferBytes();
williamr@2
  1578
williamr@2
  1579
	/**
williamr@2
  1580
	Returns the total amount of memory allocated for uncompressed pictures.
williamr@2
  1581
	@return "Total number of bytes of memory allocated for uncompressed pictures."
williamr@2
  1582
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1583
	*/
williamr@2
  1584
	IMPORT_C TUint PictureBufferBytes();
williamr@2
  1585
williamr@2
  1586
	/**
williamr@2
  1587
	Reads various counters related to decoded pictures. See the definition of TPictureCounters for a 
williamr@2
  1588
	description of the counters. The counters are reset when Initialize() or this method is called, 
williamr@2
  1589
	and thus they only include pictures processed since the last call.
williamr@2
  1590
	@param	"aCounters"	"The counter structure to fill."
williamr@2
  1591
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1592
	*/
williamr@2
  1593
	IMPORT_C void GetPictureCounters(TPictureCounters& aCounters);
williamr@2
  1594
williamr@2
  1595
	/**
williamr@2
  1596
	Reads various counters related to the received input bitstream and coded data units. See the 
williamr@2
  1597
	definition of  TBitstreamCounters for a description about the counters. The counters are reset 
williamr@2
  1598
	when Initialize() or this method is called, and thus they only include data processed since the 
williamr@2
  1599
	last call.
williamr@2
  1600
	@param	"aCounters"	"The counter structure to fill."
williamr@2
  1601
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1602
	*/
williamr@2
  1603
	IMPORT_C void GetBitstreamCounters(TBitstreamCounters& aCounters);
williamr@2
  1604
williamr@2
  1605
	/**
williamr@2
  1606
	Retrieves the number of free input buffers the decoder has available. If only a post-processor 
williamr@2
  1607
	is used, the return value is undefined.
williamr@2
  1608
	@return "Number of free input buffers the decoder has available."
williamr@2
  1609
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1610
	*/
williamr@2
  1611
	IMPORT_C TUint NumFreeBuffers();
williamr@2
  1612
williamr@2
  1613
	/**
williamr@2
  1614
	Sets the computational complexity level to use. The level can be set separately for each hardware 
williamr@2
  1615
	device in use. If separate complexity levels are not available, the method call is ignored. If the 
williamr@2
  1616
	level specified is not available, the results are undefined. Typically the device will either 
williamr@2
  1617
	ignore the request or use the nearest suitable level.
williamr@2
  1618
williamr@2
  1619
	The complexity level can be changed at any point during playback.
williamr@2
  1620
williamr@2
  1621
	@param	"aHwDevice"	"The plug-in to control. The value is returned from SelectDecoderL()or 
williamr@2
  1622
						SelectPostProcessorL() when the device is selected."
williamr@2
  1623
	@param	"aLevel"	"The computational complexity level to use. Level zero (0) is the most 
williamr@2
  1624
						complex one, with the highest quality. Higher level numbers require less 
williamr@2
  1625
						processing and may have lower quality."
williamr@2
  1626
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1627
	*/
williamr@2
  1628
	IMPORT_C void SetComplexityLevel(THwDeviceId aHwDevice, TUint aLevel);
williamr@2
  1629
williamr@2
  1630
	/**
williamr@2
  1631
	Gets the number of complexity levels available.
williamr@2
  1632
	@param	"aHwDevice"	"The plug-in to query. The value is returned from SelectDecoderL()or 
williamr@2
  1633
						SelectPostProcessorL() when the device is selected."
williamr@2
  1634
	@return	"The number of complexity control levels available, or zero if the information is not 
williamr@2
  1635
			available yet. The information may not be available if the number of levels depends on 
williamr@2
  1636
			the input data, and enough input data has not been read yet. In that case, using level 
williamr@2
  1637
			zero is safe."
williamr@2
  1638
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1639
	*/
williamr@2
  1640
	IMPORT_C TUint NumComplexityLevels(THwDeviceId aHwDevice);
williamr@2
  1641
williamr@2
  1642
	/**
williamr@2
  1643
	Gets information about a computational complexity level. This method can be called after 
williamr@2
  1644
	NumComplexityLevels() has returned a non-zero value - at that point the information is guaranteed 
williamr@2
  1645
	to be available. Some hardware device implementations may not be able to provide all values, 
williamr@2
  1646
	in that case the values will be approximated.
williamr@2
  1647
	@param	"aHwDevice"	"The hw device to query. The value is returned from SelectDecoderL()or 
williamr@2
  1648
						SelectPostProcessorL() when the device is selected."
williamr@2
  1649
	@param	"aLevel"	"The computational complexity level to query. The level numbers range from 
williamr@2
  1650
						zero (the most complex) to NumComplexityLevels()-1."
williamr@2
  1651
	@param	"aInfo"		"The information structure to fill."
williamr@2
  1652
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1653
	*/
williamr@2
  1654
	IMPORT_C void GetComplexityLevelInfo(THwDeviceId aHwDevice, TUint aLevel, TComplexityLevelInfo& aInfo);
williamr@2
  1655
williamr@2
  1656
	/**
williamr@2
  1657
	Retrieves an empty video input buffer from the decoder. After input data has been written to the 
williamr@2
  1658
	buffer, it can be written to the decoder using WriteCodedDataL(). The maximum number of buffers 
williamr@2
  1659
	the client can retrieve before returning any to the decoder is determined by the 
williamr@2
  1660
	TBufferOptions.iMinNumInputBuffers value set with SetBufferOptionsL().
williamr@2
  1661
williamr@2
  1662
	If a buffer is not immediately available, the client can wait for a MdvpoNewBuffers() callback 
williamr@2
  1663
	before trying again, or poll for new buffer availability after a delay. Note that video decoding 
williamr@2
  1664
	may be performed in the same thread, in a separate active object, so the client must not block 
williamr@2
  1665
	the active scheduler while waiting for buffers to become available, otherwise the system can 
williamr@2
  1666
	deadlock. Assuming that the client does not keep too many buffers retrieved and playback is in 
williamr@2
  1667
	progress, new buffers will be available after some time.
williamr@2
  1668
williamr@2
  1669
	The decoder maintains ownership of the buffers even while they have been retrieved by the client, 
williamr@2
  1670
	and will take care of deallocating them. The client must not destroy the buffer objects, even if 
williamr@2
  1671
	it has retrieved buffers and it is being shut down. The buffers will be destroyed by the decoder, 
williamr@2
  1672
	and will not be valid after the decoder has been shut down.
williamr@2
  1673
williamr@2
  1674
	@param	"aBufferSize"	"Required buffer size, in bytes. The resulting buffer can be larger than 
williamr@2
  1675
							this, but not smaller"
williamr@2
  1676
	@return	"A new input data buffer. The buffer is at least as large as requested, but it may be 
williamr@2
  1677
			larger. If no free buffers are available, the return value is NULL."
williamr@2
  1678
	@leave	"The method will leave if an error occurs. Lack of free buffers is not considered an error."
williamr@2
  1679
	*/
williamr@2
  1680
	IMPORT_C TVideoInputBuffer* GetBufferL(TUint aBufferSize);
williamr@2
  1681
williamr@2
  1682
	/**
williamr@2
  1683
	Writes a piece of coded video data. The data will be passed to the video decoder and 
williamr@2
  1684
	post-processor to be used in video playback. The data buffer must be retrieved from the decoder 
williamr@2
  1685
	with GetBufferL().
williamr@2
  1686
	@param	"aBuffer"	"The coded data unit to write."
williamr@2
  1687
	@leave	"The method will leave if an error occurs."
williamr@2
  1688
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1689
	*/
williamr@2
  1690
	IMPORT_C void WriteCodedDataL(TVideoInputBuffer* aBuffer);
williamr@2
  1691
williamr@2
  1692
	/**
williamr@2
  1693
	Writes an uncompressed video picture. The picture must remain valid and unmodified until it is 
williamr@2
  1694
	returned with the MdvpoReturnPicture() callback.
williamr@2
  1695
	@param	"aPicture"	"The picture to write."
williamr@2
  1696
	@leave	"The method will leave if an error occurs."
williamr@2
  1697
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1698
	*/
williamr@2
  1699
	IMPORT_C void WritePictureL(TVideoPicture* aPicture);
williamr@2
  1700
williamr@2
  1701
	/**
williamr@2
  1702
	Notifies the system that the end of input data has been reached.
williamr@2
  1703
	
williamr@2
  1704
	The decoder and post-processor can use this signal to ensure that the remaining data gets processed,
williamr@2
  1705
	without waiting for new data.  For example when the data type is not EDuCodedPicture, calling this
williamr@2
  1706
	method is necessary otherwise a decoder implementation might be waiting for the start code for the
williamr@2
  1707
	next picture to ensure it has a complete picture before starting to decode the previous one. 
williamr@2
  1708
	
williamr@2
  1709
	  
williamr@2
  1710
	After the remaining data has been processed (and displayed, if applicable), the client gets 
williamr@2
  1711
	notified with the MdvpoStreamEnd() callback.  The client must then call Stop() on the interface.
williamr@2
  1712
williamr@2
  1713
	DevVideo clients are encouraged to call this method, but its use is not mandatory for synchronized 
williamr@2
  1714
	processing.  For synchronized playback, all video pictures are processed or discarded according to
williamr@2
  1715
	their timestamps, and so the client can easily infer when processing is complete.  However, it 
williamr@2
  1716
	should be noted that the last picture might not be displayed if this method is not called and the
williamr@2
  1717
	input data type is not EDuCodedPicture.
williamr@2
  1718
williamr@2
  1719
	For non-synchronized playback (e.g. file conversion), a client must call this method otherwise it
williamr@2
  1720
	will never find out when the hardware device has finished processing the data.
williamr@2
  1721
williamr@2
  1722
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1723
	*/
williamr@2
  1724
	IMPORT_C void InputEnd();
williamr@2
  1725
williamr@2
  1726
	/**
williamr@2
  1727
	Gets information about new decoded pictures. "New decoded pictures" are pictures that have not 
williamr@2
  1728
	been returned to the caller using NextPicture(). This method can only be called if video 
williamr@2
  1729
	destination is memory buffers, i.e. Direct Screen Access is not used.
williamr@2
  1730
	@param	"aNumPictures"			"Target for the number of new decoded pictures. If no pictures are 
williamr@2
  1731
									available, the value written is zero, and the timestamps are not 
williamr@2
  1732
									valid."
williamr@2
  1733
	@param	"aEarliestTimestamp"	"Timestamp for the earliest available new decoded picture. If the 
williamr@2
  1734
									number of new decoded pictures (aNumPictures) is zero, the 
williamr@2
  1735
									timestamp is not valid."
williamr@2
  1736
	@param	"aLatestTimestamp"		"Timestamp for the latest available new decoded picture. If the 
williamr@2
  1737
									number of new decoded pictures (aNumPictures) is zero, the 
williamr@2
  1738
									timestamp is not valid."
williamr@2
  1739
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1740
	*/
williamr@2
  1741
	IMPORT_C void GetNewPictureInfo(TUint& aNumPictures, 
williamr@2
  1742
									TTimeIntervalMicroSeconds& aEarliestTimestamp, 
williamr@2
  1743
									TTimeIntervalMicroSeconds& aLatestTimestamp);
williamr@2
  1744
williamr@2
  1745
	/**
williamr@2
  1746
	Gets the next (in displaying order) new decoded picture. Only one picture can be retrieved at a 
williamr@2
  1747
	time, the current picture must be returned with ReturnPicture() before a new one can be read.
williamr@2
  1748
	@return	"The next new decoded picture. The pointer and the related data is valid until the picture 
williamr@2
  1749
			is returned using ReturnPicture(), or the API is shut down. If no new picture is available,
williamr@2
  1750
			the method returns NULL."
williamr@2
  1751
	@leave	"The method will leave if an error occurs."
williamr@2
  1752
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1753
	*/
williamr@2
  1754
	IMPORT_C TVideoPicture* NextPictureL();
williamr@2
  1755
williamr@2
  1756
	/**
williamr@2
  1757
	Returns a picture from NextPicture() back to the device. The picture data cannot be used afterwards.
williamr@2
  1758
	@param	"aPicture"	"The picture to return. After this method returns, the pointer is no longer
williamr@2
  1759
						valid and the picture data cannot be used."
williamr@2
  1760
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1761
	*/
williamr@2
  1762
	IMPORT_C void ReturnPicture(TVideoPicture* aPicture);
williamr@2
  1763
williamr@2
  1764
	/**
williamr@2
  1765
	Gets a copy of the latest picture displayed.
williamr@2
  1766
	@param	"aPictureData"	"Target picture. The memory for the picture must be allocated by the 
williamr@2
  1767
							caller, and initialized properly. The data formats must match the snapshot 
williamr@2
  1768
							format requested."
williamr@2
  1769
	@param	"aFormat"		"The picture format to use for the snapshot."
williamr@2
  1770
	@return "ETrue if the snapshot was taken, EFalse if a picture is not available. The picture may not 
williamr@2
  1771
			be available if decoding has not progressed far enough yet."
williamr@2
  1772
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1773
				*KErrNotSupported - The requested data format or picture size is not supported."
williamr@2
  1774
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1775
	*/
williamr@2
  1776
	IMPORT_C TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
williamr@2
  1777
williamr@2
  1778
	/**
williamr@2
  1779
	Gets a copy of a specified picture. Timed snapshots are required for implementing the video 
williamr@2
  1780
	telephony use-case. Simply using the latest picture may not work, since the latest picture 
williamr@2
  1781
	is typically not the one whose supplemental information is being processed.
williamr@2
  1782
williamr@2
  1783
	The picture is specified using its presentation timestamp. The timestamp must match the timestamp 
williamr@2
  1784
	in the picture exactly, otherwise no snapshot will be taken. The timestamp must refer to the 
williamr@2
  1785
	currently displayed picture or a future picture. Typically the timestamp is received with 
williamr@2
  1786
	supplemental information (with the MdvpoSupplementalInformation() callback) indicating a snapshot 
williamr@2
  1787
	picture.
williamr@2
  1788
williamr@2
  1789
	When the snapshot is available, it will be returned to the client using the 
williamr@2
  1790
	MdvpoTimedSnapshotComplete() callback. To cancel a timed snapshot request, use 
williamr@2
  1791
	CancelTimedSnapshot(). Only one timed snapshot request can be active at a time.
williamr@2
  1792
williamr@2
  1793
	@param	"aPictureData"				"Target picture. The memory for the picture must be allocated 
williamr@2
  1794
										by the caller, and initialized properly. The data formats must 
williamr@2
  1795
										match the snapshot format requested. The picture must remain 
williamr@2
  1796
										valid until the snapshot has been taken or until the request 
williamr@2
  1797
										has been cancelled with CancelTimedSnapshot()."
williamr@2
  1798
	@param	"aFormat"					"The picture format to use for the snapshot."
williamr@2
  1799
	@param	"aPresentationTimestamp"	"Presentation timestamp for the picture to copy. The timestamp 
williamr@2
  1800
										must match the timestamp in the picture exactly"
williamr@2
  1801
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1802
				*KErrNotSupported - The requested data format or picture size is not supported."
williamr@2
  1803
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1804
	*/
williamr@2
  1805
	IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData, 
williamr@2
  1806
									const TUncompressedVideoFormat& aFormat, 
williamr@2
  1807
									const TTimeIntervalMicroSeconds& aPresentationTimestamp);
williamr@2
  1808
williamr@2
  1809
	/**
williamr@2
  1810
	Gets a copy of a specified picture. Timed snapshots are required for implementing the video 
williamr@2
  1811
	telephony use-case. Simply using the latest picture may not work, since the latest picture 
williamr@2
  1812
	is typically not the one whose supplemental information is being processed.
williamr@2
  1813
williamr@2
  1814
	The picture is specified using either its picture identifier. The id must refer to the currently 
williamr@2
  1815
	displayed picture or a future picture. Typically the picture ID is received with supplemental 
williamr@2
  1816
	information (with the MdvpoSupplementalInformation() callback) indicating a snapshot picture.
williamr@2
  1817
williamr@2
  1818
	When the snapshot is available, it will be returned to the client using the 
williamr@2
  1819
	MdvpoTimedSnapshotComplete() callback. To cancel a timed snapshot request, use 
williamr@2
  1820
	CancelTimedSnapshot(). Only one timed snapshot request can be active at a time.
williamr@2
  1821
williamr@2
  1822
	@param	"aPictureData"	"Target picture. The memory for the picture must be allocated by the 
williamr@2
  1823
							caller, and initialized properly. The data formats must match the snapshot 
williamr@2
  1824
							format requested. The picture must remain valid until the snapshot has been
williamr@2
  1825
							taken or until the request has been cancelled with CancelTimedSnapshot()."
williamr@2
  1826
	@param	"aFormat"		"The picture format to use for the snapshot."
williamr@2
  1827
	@param	"aPictureId"	"Picture identifier for the picture to copy."
williamr@2
  1828
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
  1829
				*KErrNotSupported - The requested data format or picture size is not supported."
williamr@2
  1830
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1831
	*/
williamr@2
  1832
	IMPORT_C void GetTimedSnapshotL(TPictureData* aPictureData, 
williamr@2
  1833
									const TUncompressedVideoFormat& aFormat, 
williamr@2
  1834
									const TPictureId& aPictureId);
williamr@2
  1835
williamr@2
  1836
	/**
williamr@2
  1837
	Cancels a timed snapshot request.
williamr@2
  1838
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1839
	*/
williamr@2
  1840
	IMPORT_C void CancelTimedSnapshot();
williamr@2
  1841
williamr@2
  1842
	/**
williamr@2
  1843
	Gets a list of the supported snapshot picture formats.
williamr@2
  1844
	@param	"aFormats"	"An array for the result format list. The array must be created and destroyed by the caller."
williamr@2
  1845
	@leave	"The method will leave if an error occurs."
williamr@2
  1846
	@pre	"This method can only be called after the API has been initialized with Initialize()."
williamr@2
  1847
	*/
williamr@2
  1848
	IMPORT_C void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats);
williamr@2
  1849
williamr@2
  1850
	/**
williamr@2
  1851
	Retrieves a custom interface to the specified hardware device.
williamr@2
  1852
	@param	"aHwDevice"		"The hardware device from which the custom interface shall be requested. 
williamr@2
  1853
							The value is returned from SelectDecoderL() or SelectPostProcessorL() when
williamr@2
  1854
							the device is selected."
williamr@2
  1855
	@param  "aInterface"	"Interface UID, defined with the custom interface."
williamr@2
  1856
	@return "Pointer to the interface implementation, or NULL if the device does not 
williamr@2
  1857
			implement the interface requested. The return value must be cast to the 
williamr@2
  1858
			correct type by the user."
williamr@2
  1859
	*/
williamr@2
  1860
	IMPORT_C TAny* CustomInterface(THwDeviceId aHwDevice, TUid aInterface);
williamr@2
  1861
	
williamr@2
  1862
private:
williamr@2
  1863
	enum TInitializationState 
williamr@2
  1864
		{
williamr@2
  1865
		ENotInitialized = 0x01, 
williamr@2
  1866
		EInitializing = 0x02,
williamr@2
  1867
		EInitialized = 0x04,
williamr@2
  1868
		EInitializationFailed = 0x08
williamr@2
  1869
		};
williamr@2
  1870
private:
williamr@2
  1871
	CMMFDevVideoPlay(MMMFDevVideoPlayObserver& aObserver);
williamr@2
  1872
williamr@2
  1873
	// Methods to check aHwDevice is valid and return the appropriate HwDevice
williamr@2
  1874
	CMMFVideoPlayHwDevice& VideoPlayHwDevice(THwDeviceId aHwDevice) const;
williamr@2
  1875
	CMMFVideoPlayHwDevice& RenderingHwDevice() const; //returns the last plugin in the chain
williamr@2
  1876
	CMMFVideoDecodeHwDevice& VideoDecodeHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
williamr@2
  1877
	CMMFVideoPostProcHwDevice& VideoPostProcHwDevice(THwDeviceId aHwDevice) const;// Checks that aHwDevice is valid
williamr@2
  1878
	CMMFVideoDecodeHwDevice& VideoDecodeHwDevice() const;
williamr@2
  1879
	CMMFVideoPostProcHwDevice& VideoPostProcHwDevice() const;
williamr@2
  1880
	CMMFVideoHwDevice& VideoHwDevice(THwDeviceId aHwDevice) const;
williamr@2
  1881
williamr@2
  1882
	// Connects the plugins together
williamr@2
  1883
	void ConnectPlugins();
williamr@2
  1884
williamr@2
  1885
	// Check that we are in a valid initialization state
williamr@2
  1886
	// Panics if iInitializationState is not one of aExpected
williamr@2
  1887
	void CheckInitializationState(TUint aExpected);
williamr@2
  1888
williamr@2
  1889
	// Methods to handle init complete callbacks from the hw devices
williamr@2
  1890
	void HandlePostProcInitializeComplete(TInt aError);
williamr@2
  1891
	void HandleDecodeInitializeComplete(TInt aError);
williamr@2
  1892
		
williamr@2
  1893
	CMMFVideoDecodeHwDevice* CreateDecoderL(TUid aVideoDecoder);
williamr@2
  1894
williamr@2
  1895
williamr@2
  1896
	// From MMMFDevVideoPlayProxy
williamr@2
  1897
	virtual void MdvppNewPicture(TVideoPicture* aPicture);
williamr@2
  1898
	virtual void MdvppNewBuffers();
williamr@2
  1899
	virtual void MdvppReturnPicture(TVideoPicture* aPicture);
williamr@2
  1900
	virtual void MdvppSupplementalInformation(const TDesC8& aData, 
williamr@2
  1901
											  const TTimeIntervalMicroSeconds& aTimestamp, 
williamr@2
  1902
											  const TPictureId& aPictureId);
williamr@2
  1903
	virtual void MdvppPictureLoss();
williamr@2
  1904
	virtual void MdvppPictureLoss(const TArray<TPictureId>& aPictures);
williamr@2
  1905
	virtual void MdvppSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture);
williamr@2
  1906
	virtual void MdvppReferencePictureSelection(const TDesC8& aSelectionData);
williamr@2
  1907
	virtual void MdvppTimedSnapshotComplete(TInt aError, 
williamr@2
  1908
											TPictureData* aPictureData, 
williamr@2
  1909
											const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
williamr@2
  1910
											const TPictureId& aPictureId);
williamr@2
  1911
	virtual void MdvppFatalError(CMMFVideoHwDevice* aDevice, TInt aError);
williamr@2
  1912
	virtual void MdvppInitializeComplete(CMMFVideoHwDevice* aDevice, TInt aError);
williamr@2
  1913
	virtual void MdvppStreamEnd();
williamr@2
  1914
	
williamr@2
  1915
private:
williamr@2
  1916
	MMMFDevVideoPlayObserver& iObserver;
williamr@2
  1917
	CMMFVideoDecodeHwDevice* iVideoDecodeHwDevice;
williamr@2
  1918
	CMMFVideoPostProcHwDevice* iVideoPostProcHwDevice;
williamr@2
  1919
	TUint iInitializationState;
williamr@2
  1920
williamr@2
  1921
	TDblQue<TVideoPicture> iVideoPictureQue;
williamr@2
  1922
	TDblQueIter<TVideoPicture> iVideoPictureQueIter;
williamr@2
  1923
	TUint iNumberOfVideoPictures;
williamr@2
  1924
	// Not to be used, but kept for BC purposes
williamr@2
  1925
	TInt iReserved;
williamr@2
  1926
williamr@2
  1927
	TUint iNumberOfMdvppStreamEndCallbacks;
williamr@2
  1928
	TBool iIsDecodeComplete;
williamr@2
  1929
	
williamr@2
  1930
#ifdef SYMBIAN_MULTIMEDIA_CODEC_API
williamr@2
  1931
	RImplInfoPtrArray iPuImplementations;
williamr@2
  1932
	TBool iPuListCreated;
williamr@2
  1933
#endif // SYMBIAN_MULTIMEDIA_CODEC_API
williamr@2
  1934
	};
williamr@2
  1935
williamr@2
  1936
williamr@2
  1937
/**
williamr@2
  1938
The MMMFDevVideoPlayObserver mixin class defines a set of callback functions that the client using 
williamr@2
  1939
the MSL video API needs to implement. The callbacks are called in the context of the same thread that 
williamr@2
  1940
uses the API. DevVideo API methods can be safely called from the callbacks.
williamr@2
  1941
@publishedAll
williamr@2
  1942
@released
williamr@2
  1943
*/
williamr@2
  1944
class MMMFDevVideoPlayObserver
williamr@2
  1945
	{
williamr@2
  1946
public:
williamr@2
  1947
	/**
williamr@2
  1948
	Notifies the client that one or more new empty input buffers are available. The client can fetch 
williamr@2
  1949
	the input buffer with GetBufferL().
williamr@2
  1950
	*/
williamr@2
  1951
	virtual void MdvpoNewBuffers() = 0;
williamr@2
  1952
williamr@2
  1953
	/**
williamr@2
  1954
	Returns a used input video picture back to the caller. The picture memory can be re-used or freed.
williamr@2
  1955
	@param	"aPicture"	"The picture to return."
williamr@2
  1956
	*/
williamr@2
  1957
	virtual void MdvpoReturnPicture(TVideoPicture* aPicture) = 0;
williamr@2
  1958
williamr@2
  1959
	/**
williamr@2
  1960
	Delivers supplemental information from a coded data unit. The information is codec-dependent.
williamr@2
  1961
	@param	"aData"			"The supplemental data. The reference is only valid until the method 
williamr@2
  1962
							returns, and thus the data must be processed or copied immediately."
williamr@2
  1963
	@param	"aTimestamp"	"The presentation timestamp for the picture that the supplemental data 
williamr@2
  1964
							is part of."
williamr@2
  1965
	@param	"aPictureId"	"Picture identifier for the picture. If a picture ID is not available, 
williamr@2
  1966
							aPictureId.iIdType is set to ENone."
williamr@2
  1967
	*/
williamr@2
  1968
	virtual void MdvpoSupplementalInformation(const TDesC8& aData, 
williamr@2
  1969
											  const TTimeIntervalMicroSeconds& aTimestamp, 
williamr@2
  1970
											  const TPictureId& aPictureId) = 0;
williamr@2
  1971
williamr@2
  1972
	/**
williamr@2
  1973
	Back channel information from the decoder, indicating a picture loss without specifying the lost picture.
williamr@2
  1974
	*/
williamr@2
  1975
	virtual void MdvpoPictureLoss() = 0;
williamr@2
  1976
williamr@2
  1977
	/**
williamr@2
  1978
	Back channel information from the decoder, indicating the pictures that have been lost.
williamr@2
  1979
williamr@2
  1980
	@param "aPictures"	"Picture identifiers for the lost pictures. The reference is only valid until the 
williamr@2
  1981
						method returns, and thus the data must be processed or copied immediately."
williamr@2
  1982
	*/
williamr@2
  1983
	virtual void MdvpoPictureLoss(const TArray<TPictureId>& aPictures) = 0;
williamr@2
  1984
williamr@2
  1985
	/**
williamr@2
  1986
	Back channel information from the decoder, indicating the loss of consecutive macroblocks in raster 
williamr@2
  1987
	scan order.
williamr@2
  1988
williamr@2
  1989
	@param "aFirstMacroblock"	"The first lost macroblock.  The macroblocks are numbered such 
williamr@2
  1990
								that the macroblock in the upper left corner of the picture is considered 
williamr@2
  1991
								macroblock number 1 and the number for each macroblock increases from left 
williamr@2
  1992
								to right and then from top to bottom in raster-scan order."
williamr@2
  1993
	@param "aNumMacroblocks"	"The number of lost macroblocks that are consecutive in raster-scan order."
williamr@2
  1994
	@param "aPicture"			"The picture identifier for the picture where the macroblocks were lost.  
williamr@2
  1995
								If the picture is not known, aPicture.iIdType is set to ENone.  The reference 
williamr@2
  1996
								is only valid until the method returns."
williamr@2
  1997
	*/
williamr@2
  1998
	virtual void MdvpoSliceLoss(TUint aFirstMacroblock, TUint aNumMacroblocks, const TPictureId& aPicture)= 0;
williamr@2
  1999
williamr@2
  2000
	/**
williamr@2
  2001
	Back channel information from the decoder, indicating a reference picture selection request. The 
williamr@2
  2002
	request is delivered as a coding-standard specific binary message.  Reference picture selection can 
williamr@2
  2003
	be used to select a pervious correctly transmitted picture to use as a reference in case later pictures 
williamr@2
  2004
	have been lost.
williamr@2
  2005
	
williamr@2
  2006
	@param "aSelectionData" "The reference picture selection request message. The message format is 
williamr@2
  2007
							coding-standard specific, and defined separately. The reference is only 
williamr@2
  2008
							valid until the method returns, and thus the data must be processed or 
williamr@2
  2009
							copied immediately."
williamr@2
  2010
	*/
williamr@2
  2011
	virtual void MdvpoReferencePictureSelection(const TDesC8& aSelectionData)= 0;
williamr@2
  2012
williamr@2
  2013
	/**
williamr@2
  2014
	Called when a timed snapshot request has been completed. When this method is called, the snapshot 
williamr@2
  2015
	has been taken, and the memory reserved for the picture can be re-used or freed.
williamr@2
  2016
	@param	"aError"					"An error code, KErrNone if no errors occurred. If an error 
williamr@2
  2017
										occurred, the data in the snapshot may not be valid, but the 
williamr@2
  2018
										memory can still be freed."
williamr@2
  2019
	@param	"aPictureData"				"The snapshot picture data."
williamr@2
  2020
	@param	"aPresentationTimestamp"	"The presentation timestamp for the snapshot picture. "
williamr@2
  2021
	@param	"aPictureId"				"Picture identifier for the picture. If a picture ID is not
williamr@2
  2022
										available, aPictureId.iIdType is set to ENone."
williamr@2
  2023
	*/
williamr@2
  2024
	virtual void MdvpoTimedSnapshotComplete(TInt aError, 
williamr@2
  2025
											TPictureData* aPictureData, 
williamr@2
  2026
											const TTimeIntervalMicroSeconds& aPresentationTimestamp, 
williamr@2
  2027
											const TPictureId& aPictureId) = 0;
williamr@2
  2028
williamr@2
  2029
	/**
williamr@2
  2030
	Notifies the client that one or more new output pictures are available. The client can then use 
williamr@2
  2031
	GetNewPictureInfo() and NextPicture() to fetch the pictures.
williamr@2
  2032
	*/
williamr@2
  2033
	virtual void MdvpoNewPictures() = 0;
williamr@2
  2034
williamr@2
  2035
	/**
williamr@2
  2036
	Reports a fatal decoding or playback error to the client. When these errors
williamr@2
  2037
	occur, decoding and playback is stopped automatically. The client must
williamr@2
  2038
	destroy the CMMFDevVideoPlay object and create a new instance before
williamr@2
  2039
	attempting to continue. Note that scenarios have been identified where
williamr@2
  2040
	MdvpoFatalError may get referenced at some point during the execution of a
williamr@2
  2041
	CMMFDevVideoPlay procedure. Therefore CMMFDevVideoPlay object should be
williamr@2
  2042
	deleted outside of MdvpoFatalError context in order to avoid accidental
williamr@2
  2043
	access to de-allocated CMMFDevVideoPlay data members.
williamr@2
  2044
williamr@2
  2045
	Note that running out of processing power or encountering corrupted
williamr@2
  2046
	bitstream data should not be classified as errors if the decoder and
williamr@2
  2047
	post-processor can recover automatically.
williamr@2
  2048
	
williamr@2
  2049
	@param	"aError"	"The error code."
williamr@2
  2050
	*/
williamr@2
  2051
	virtual void MdvpoFatalError(TInt aError) = 0;
williamr@2
  2052
williamr@2
  2053
	/**
williamr@2
  2054
	Reports that DevVideoPlay initialization has completed. The interface can now be used for video 
williamr@2
  2055
	playback.
williamr@2
  2056
	@param	"aError"	"Initialization error code, KErrNone if no error occurred."
williamr@2
  2057
	*/
williamr@2
  2058
	virtual void MdvpoInitComplete(TInt aError) = 0;
williamr@2
  2059
williamr@2
  2060
	/**
williamr@2
  2061
	Reports that the input video stream end has been reached and all pictures have been processed. 
williamr@2
  2062
	This method is only called after the client has called InputEnd(). No more output pictures will 
williamr@2
  2063
	be available.
williamr@2
  2064
	*/
williamr@2
  2065
	virtual void MdvpoStreamEnd() = 0;
williamr@2
  2066
	};
williamr@4
  2067
	
williamr@4
  2068
	
williamr@2
  2069
#include <mmf/devvideo/devvideoplay.inl>
williamr@2
  2070
williamr@2
  2071
#endif