epoc32/include/mmf/devvideo/videoplayhwdevice.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 __VIDEOPLAYHWDEVICE_H__
williamr@2
    17
#define __VIDEOPLAYHWDEVICE_H__
williamr@2
    18
williamr@2
    19
#include <mmf/devvideo/devvideobase.h>
williamr@2
    20
#include <mmf/devvideo/devvideoplay.h>
williamr@4
    21
#include <mmf/common/mmfvideo.h>
williamr@2
    22
williamr@2
    23
/**
williamr@2
    24
A base class for all video playback (decoder and post-processor) hardware devices. 
williamr@2
    25
Since both decoders and post-processors can implement post-processing functionality, 
williamr@2
    26
this class includes all post-processing related methods. The main difference between decoder 
williamr@2
    27
and post-processor devices is that decoders can input coded data and write decoded pictures 
williamr@2
    28
to another device, while post-processor devices can accept decoded pictures from the client 
williamr@2
    29
or from another device.
williamr@2
    30
@publishedAll
williamr@2
    31
@released
williamr@2
    32
*/
williamr@2
    33
class CMMFVideoPlayHwDevice : public CMMFVideoHwDevice
williamr@2
    34
	{
williamr@2
    35
public:
williamr@2
    36
	/**
williamr@2
    37
	Retrieves post-processing information about this hardware device. 
williamr@2
    38
	The device creates a CPostProcessorInfo structure, fills it with correct data, pushes it 
williamr@2
    39
	to the cleanup stack and returns it. The client will delete the object when it is no 
williamr@2
    40
	longer needed.
williamr@2
    41
williamr@2
    42
	@return "Post-processor information as a CPostProcessorInfo object. 
williamr@2
    43
			The object is pushed to the cleanup stack, and must be deallocated by the caller."
williamr@2
    44
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
    45
	*/
williamr@2
    46
	virtual CPostProcessorInfo* PostProcessorInfoLC() = 0;
williamr@2
    47
williamr@2
    48
	/**
williamr@2
    49
	Retrieves the list of the output formats that the device supports. The list is ordered in 
williamr@2
    50
	plug-in preference order, with the preferred formats at the beginning of the list. The list 
williamr@2
    51
	can depend on the device source format, and therefore SetSourceFormatL() must be called before 
williamr@2
    52
	calling this method.
williamr@2
    53
williamr@2
    54
	@param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
williamr@2
    55
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
    56
	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
williamr@2
    57
	*/
williamr@2
    58
	virtual void GetOutputFormatListL(RArray<TUncompressedVideoFormat>& aFormats) = 0;
williamr@2
    59
williamr@2
    60
	/**
williamr@2
    61
	Sets the device output format.
williamr@2
    62
williamr@2
    63
	@param  "aFormat" "The format to use."
williamr@2
    64
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
    65
	@pre	"This method may only be called before the hwdevice has been initialized using Initialize()."
williamr@2
    66
	*/
williamr@2
    67
	virtual void SetOutputFormatL(const TUncompressedVideoFormat &aFormat) = 0;
williamr@2
    68
williamr@2
    69
	/**
williamr@2
    70
	Sets the clock source to use for video timing. If no clock source is set. video playback 
williamr@2
    71
	will not be synchronized, but will proceed as fast as possible, depending on input data 
williamr@2
    72
	and output buffer availability.	
williamr@2
    73
williamr@2
    74
	@param  "aClock" "The clock source to be used."
williamr@2
    75
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
    76
	*/
williamr@2
    77
	virtual void SetClockSource(MMMFClockSource* aClock) = 0;
williamr@2
    78
williamr@2
    79
	/**
williamr@2
    80
	Sets the device video output destination. The destination can be the screen (using direct 
williamr@2
    81
	screen access) or memory buffers. By default memory buffers are used. If data is written 
williamr@2
    82
	to another device, this method is ignored, and suitable memory buffers are always used.
williamr@2
    83
	
williamr@2
    84
	@param  "aScreen" "True if video output destination is the screen, false if memory buffers."
williamr@2
    85
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
    86
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
    87
	*/
williamr@2
    88
	virtual void SetVideoDestScreenL(TBool aScreen) = 0;
williamr@2
    89
williamr@2
    90
	/**
williamr@2
    91
	Sets the post-processing types to be used.
williamr@2
    92
williamr@2
    93
	@param  "aPostProcCombination" "The post-processing steps to perform, a bitwise OR of values from TPostProcessType."
williamr@2
    94
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
    95
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
    96
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
    97
	*/
williamr@2
    98
	virtual void SetPostProcessTypesL(TUint32 aPostProcCombination) = 0;
williamr@2
    99
williamr@2
   100
	/**
williamr@2
   101
	Sets post-processing options for input (pan-scan) cropping.
williamr@2
   102
williamr@2
   103
	@param  "aRect" "The cropping rectangle to use."
williamr@2
   104
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   105
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   106
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   107
	*/
williamr@2
   108
	virtual void SetInputCropOptionsL(const TRect& aRect) = 0;
williamr@2
   109
williamr@2
   110
	/**
williamr@2
   111
	Sets post-processing options for YUV to RGB color space conversion. 
williamr@2
   112
	Specifies the input YUV and output RGB formats to use explicitly. SetSourceFormatL(), 
williamr@2
   113
	SetOutputFormatL(), and SetPostProcessTypesL() must be called before this method is used.
williamr@2
   114
williamr@2
   115
	@param  "aOptions"		"The conversion options to use."
williamr@2
   116
	@param  "aYuvFormat"	"Conversion source YUV format"
williamr@2
   117
	@param  "aRgbFormat"	"Conversion target RGB format"
williamr@2
   118
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   119
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   120
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   121
	*/
williamr@2
   122
	virtual void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, TRgbFormat aRgbFormat) = 0;
williamr@2
   123
williamr@2
   124
	/**
williamr@2
   125
	Sets post-processing options for YUV to RGB color space conversion.
williamr@2
   126
	Uses the device input and output formats. For decoder devices the default YUV format used is 
williamr@2
   127
	the format specified in the input bitstream. SetSourceFormatL(), SetOutputFormatL(), and 
williamr@2
   128
	SetPostProcessTypesL() must be called before this method is used.
williamr@2
   129
williamr@2
   130
	@param  "aOptions"		"The conversion options to use."
williamr@2
   131
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   132
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   133
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   134
	*/
williamr@2
   135
	virtual void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions) = 0;
williamr@2
   136
williamr@2
   137
	/**
williamr@2
   138
	Sets post-processing options for rotation. SetPostProcessTypesL() must be called before 
williamr@2
   139
	this method is used.
williamr@2
   140
williamr@2
   141
	@param  "aRotationType" "The rotation to perform."	
williamr@2
   142
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   143
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   144
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   145
	*/
williamr@2
   146
	virtual void SetRotateOptionsL(TRotationType aRotationType) = 0;
williamr@2
   147
williamr@2
   148
	/**
williamr@2
   149
	Sets post-processing options for scaling. SetPostProcessTypesL() must be called before 
williamr@2
   150
	this method is used.
williamr@2
   151
	
williamr@2
   152
	@param  "aTargetSize"			"Scaling target size. If a fixed scale factor size is used, 
williamr@2
   153
									the new dimensions must be set to width=floor(factor*width), 
williamr@2
   154
									height=floor(factor*height). For example, scaling a 
williamr@2
   155
									QCIF (176x144) picture up by a factor of 4/3 yields a size 
williamr@2
   156
									of 234x192."
williamr@2
   157
	@param  "aAntiAliasFiltering"	"True if anti-aliasing filtering should be used. 
williamr@2
   158
									If the post-processor does not support anti-aliased scaling, 
williamr@2
   159
									or supports anti-aliased scaling only, this argument is ignored."
williamr@2
   160
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   161
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   162
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   163
	*/
williamr@2
   164
	virtual void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering) = 0;
williamr@2
   165
williamr@2
   166
	/**
williamr@2
   167
	Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before 
williamr@2
   168
	this method is used.
williamr@2
   169
	
williamr@2
   170
	@param  "aRect" "Output cropping area."
williamr@2
   171
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   172
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   173
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   174
	*/
williamr@2
   175
	virtual void SetOutputCropOptionsL(const TRect& aRect) = 0;
williamr@2
   176
williamr@2
   177
	/**
williamr@2
   178
	Sets post-processing plug-in specific options. SetPostProcessTypesL() must be called before 
williamr@2
   179
	this method is used.
williamr@2
   180
williamr@2
   181
	@param  "aOptions" "The options. The format is plug-in specific."
williamr@2
   182
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   183
	@pre	"This method can be called either before or after the hwdevice has been initialized with Initialize().
williamr@2
   184
			If called after initialization, the change must only be committed when CommitL() is called."
williamr@2
   185
	*/
williamr@2
   186
	virtual void SetPostProcSpecificOptionsL(const TDesC8& aOptions) = 0;
williamr@2
   187
williamr@2
   188
	/**
williamr@2
   189
	Initializes the device. This method is asynchronous, the device will call 
williamr@2
   190
	MMFVideoPlayProxy::MdvppInitializeComplete() after initialization has completed. After this 
williamr@2
   191
	method has successfully completed, further configuration changes are not possible except where 
williamr@2
   192
	separately noted.
williamr@2
   193
	*/
williamr@2
   194
	virtual void Initialize() = 0;
williamr@2
   195
williamr@2
   196
	/**
williamr@2
   197
	Commit all changes since the last CommitL(), Revert() or Initialize()
williamr@2
   198
	to the hardware device.  This only applies to methods which can be called both
williamr@2
   199
	before AND after DevVideoPlay has been initialized.
williamr@2
   200
williamr@2
   201
	@see	SetPostProcessTypesL
williamr@2
   202
	@see	SetInputCropOptionsL
williamr@2
   203
	@see	SetYuvToRgbOptionsL
williamr@2
   204
	@see	SetRotateOptionsL
williamr@2
   205
	@see	SetScaleOptionsL
williamr@2
   206
	@see	SetOutputCropOptionsL
williamr@2
   207
	@see	SetPostProcSpecificOptionsL
williamr@2
   208
williamr@2
   209
	@leave  "The method will leave if an error occurs."
williamr@2
   210
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   211
	*/
williamr@2
   212
	virtual void CommitL() = 0;
williamr@2
   213
williamr@2
   214
	/**
williamr@2
   215
	Revert all changes since the last CommitL(), Revert() or Initialize()
williamr@2
   216
	back to their previous settings.  This only applies to methods which can 
williamr@2
   217
	be called both before AND after DevVideoPlay has been initialized.
williamr@2
   218
williamr@2
   219
	@see	SetPostProcessTypesL
williamr@2
   220
	@see	SetInputCropOptionsL
williamr@2
   221
	@see	SetYuvToRgbOptionsL
williamr@2
   222
	@see	SetRotateOptionsL
williamr@2
   223
	@see	SetScaleOptionsL
williamr@2
   224
	@see	SetOutputCropOptionsL
williamr@2
   225
	@see	SetPostProcSpecificOptionsL
williamr@2
   226
williamr@2
   227
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   228
	*/
williamr@2
   229
	virtual void Revert() = 0;
williamr@2
   230
williamr@2
   231
	/**
williamr@2
   232
	Starts writing output directly to the display frame buffer using Direct Screen Access.
williamr@2
   233
williamr@2
   234
	@param  "aVideoRect"	"The video output rectangle on screen."
williamr@2
   235
	@param  "aScreenDevice"	"The screen device to use. The screen device object must be valid in the current thread."
williamr@2
   236
	@param  "aClipRegion"	"Initial clipping region to use."
williamr@2
   237
	
williamr@2
   238
	@leave  "This method may leave with one of the system-wide error codes.
williamr@2
   239
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   240
	*/
williamr@2
   241
	virtual void StartDirectScreenAccessL(const TRect& aVideoRect, 
williamr@2
   242
		CFbsScreenDevice& aScreenDevice, const TRegion& aClipRegion) = 0;
williamr@2
   243
williamr@2
   244
	/**
williamr@2
   245
	Sets a new clipping region for Direct Screen Access. After the method returns, no video will 
williamr@2
   246
	be drawn outside of the region. If clipping is not supported, or the clipping region is too 
williamr@2
   247
	complex, either playback will pause or will resume without video display, depending on the 
williamr@2
   248
	current setting of SetPauseOnClipFail(), and the result can be verified with IsPlaying(). 
williamr@2
   249
	Clipping can be disabled by setting a new clipping region that includes the whole video window.
williamr@2
   250
williamr@2
   251
	@param  "aRegion" "The new clipping region. After the method returns, no video will be drawn outside the region."
williamr@2
   252
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   253
	*/
williamr@2
   254
	virtual void SetScreenClipRegion(const TRegion& aRegion) = 0;
williamr@2
   255
williamr@2
   256
	/**
williamr@2
   257
	Sets whether the system should pause playback when it gets a clipping region it cannot handle, 
williamr@2
   258
	or Direct Screen Access is aborted completely. If not, processing will proceed normally, but no 
williamr@2
   259
	video will be drawn. By default, playback is paused.
williamr@2
   260
williamr@2
   261
	@param "aPause" "True if playback should be paused when clipping fails, false if not. 
williamr@2
   262
					If playback is not paused, it will be continued without video display."
williamr@2
   263
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   264
	*/
williamr@2
   265
	virtual void SetPauseOnClipFail(TBool aPause) = 0;
williamr@2
   266
williamr@2
   267
	/**
williamr@2
   268
	Aborts Direct Screen Access completely, to be called from MAbortDirectScreenAccess::AbortNow() 
williamr@2
   269
	and similar methods. DSA can be resumed by calling StartDirectScreenAccessL().
williamr@2
   270
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   271
	*/
williamr@2
   272
	virtual void AbortDirectScreenAccess() = 0;
williamr@2
   273
williamr@2
   274
	/**
williamr@2
   275
	Indicates whether playback is proceeding. This method can be used to check whether playback was 
williamr@2
   276
	paused or not in response to a new clipping region or DSA abort.
williamr@2
   277
williamr@2
   278
	@return "ETrue if video is still being played (even if not necessarily displayed)."
williamr@2
   279
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   280
	*/
williamr@2
   281
	virtual TBool IsPlaying() = 0;
williamr@2
   282
williamr@2
   283
	/**
williamr@2
   284
	Re-draws the latest video picture. Only available when DSA is being used. If DSA is aborted or a 
williamr@2
   285
	non-supported clipping region has been set, the request may be ignored.
williamr@2
   286
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   287
	*/
williamr@2
   288
	virtual void Redraw() = 0;
williamr@2
   289
williamr@2
   290
williamr@2
   291
	/**
williamr@2
   292
	Starts video playback, including decoding, post-processing, and rendering. Playback will proceed 
williamr@2
   293
	until it has been stopped or paused, or the end of the bitstream is reached.
williamr@2
   294
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   295
	*/
williamr@2
   296
	virtual void Start() = 0;
williamr@2
   297
williamr@2
   298
	/**
williamr@2
   299
	Stops video playback. No new pictures will be decoded, post-processed, or rendered.
williamr@2
   300
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   301
	*/
williamr@2
   302
	virtual void Stop() = 0;
williamr@2
   303
williamr@2
   304
	/**
williamr@2
   305
	Pauses video playback, including decoding, post-processing, and rendering. No pictures will be 
williamr@2
   306
	decoded, post-processed, or rendered until playback has been resumed.
williamr@2
   307
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   308
	*/
williamr@2
   309
	virtual void Pause() = 0;
williamr@2
   310
williamr@2
   311
	/**
williamr@2
   312
	Resumes video playback after a pause.
williamr@2
   313
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   314
	*/
williamr@2
   315
	virtual void Resume() = 0;
williamr@2
   316
williamr@2
   317
	/**
williamr@2
   318
	Changes to a new decoding and playback position, used for randomly accessing (seeking) the 
williamr@2
   319
	input stream. The position change flushes all input and output buffers. Pre-decoder and 
williamr@2
   320
	post-decoder buffering are handled as if a new bitstream was being decoded. If the device still has buffered 
williamr@2
   321
	pictures that precede the new playback position, they will be discarded. If playback is 
williamr@2
   322
	synchronized to a clock source, the client is responsible for setting the clock source to the 
williamr@2
   323
	new position.
williamr@2
   324
	
williamr@2
   325
	@param "aPlaybackPosition" "The new playback position in the video stream."
williamr@2
   326
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   327
	*/
williamr@2
   328
	virtual void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition) = 0;
williamr@2
   329
williamr@2
   330
	/**
williamr@2
   331
	Freezes a picture on the screen. After the picture has been frozen, no new pictures are 
williamr@2
   332
	displayed until the freeze is released with ReleaseFreeze(). If the device output is being 
williamr@2
   333
	written to memory buffers or to another plug-in, instead of the screen, no decoded pictures 
williamr@2
   334
	will be delivered while the freeze is active, and they are simply discarded.
williamr@2
   335
williamr@2
   336
	@param "aTimestamp" "The presentation timestamp of the picture to freeze. The frozen picture 
williamr@2
   337
						will be the first picture with a timestamp greater than or equal to this 
williamr@2
   338
						parameter."
williamr@2
   339
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   340
	*/
williamr@2
   341
	virtual void FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp) = 0;
williamr@2
   342
williamr@2
   343
	/**
williamr@2
   344
	Releases a picture frozen with FreezePicture().
williamr@2
   345
williamr@2
   346
	@param "aTimestamp" "The presentation timestamp of the picture to release. The first picture 
williamr@2
   347
						displayed after the release will be the first picture with a timestamp 
williamr@2
   348
						greater than or equal to this parameter. To release the freeze immediately, 
williamr@2
   349
						set the timestamp to zero."
williamr@2
   350
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   351
	*/
williamr@2
   352
	virtual void ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp) = 0;
williamr@2
   353
williamr@2
   354
williamr@2
   355
	/**
williamr@2
   356
	Returns the current playback position, i.e. the timestamp for the most recently displayed or 
williamr@2
   357
	virtually displayed picture. If the device output is written to another device, the most recent 
williamr@2
   358
	output picture is used.
williamr@2
   359
williamr@2
   360
	@return "Current playback position."
williamr@2
   361
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   362
	*/
williamr@2
   363
	virtual TTimeIntervalMicroSeconds PlaybackPosition() = 0;
williamr@2
   364
williamr@2
   365
	/**
williamr@2
   366
	Returns the total amount of memory allocated for uncompressed pictures. This figure only 
williamr@2
   367
	includes the pictures actually allocated by the plug-in itself, so that the total number of 
williamr@2
   368
	bytes allocated in the system can be calculated by taking the sum of the values from all plug-ins.
williamr@2
   369
williamr@2
   370
	@return "Total number of bytes of memory allocated for uncompressed pictures."
williamr@2
   371
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   372
	*/
williamr@2
   373
	virtual TUint PictureBufferBytes() = 0;
williamr@2
   374
williamr@2
   375
	/**
williamr@2
   376
	Reads various counters related to decoded pictures. The counters are reset when Initialize() 
williamr@2
   377
	or this method is called, and thus they only include pictures processed since the last call.
williamr@2
   378
williamr@2
   379
	Post-processor devices return the number of input pictures in iPicturesDecoded and 
williamr@2
   380
	iTotalPictures. If the decoded pictures are written to another plug-in, they are considered 
williamr@2
   381
	to be "virtually displayed".
williamr@2
   382
williamr@2
   383
	@param "aCounters" "The counter structure to fill."
williamr@2
   384
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   385
	*/
williamr@2
   386
	virtual void GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters) = 0;
williamr@2
   387
williamr@2
   388
williamr@2
   389
	/**
williamr@2
   390
	Sets the computational complexity level to use. If separate complexity levels are not available, 
williamr@2
   391
	the method call is ignored. If the level specified is not available, the results are undefined. 
williamr@2
   392
	Typically the device will either ignore the request or use the nearest suitable level.
williamr@2
   393
williamr@2
   394
	The complexity level can be changed at any point during playback.
williamr@2
   395
williamr@2
   396
	@param "aLevel" "The computational complexity level to use. Level zero (0) is the most complex 
williamr@2
   397
					one, with the highest quality. Higher level numbers require less processing 
williamr@2
   398
					and may have lower quality."
williamr@2
   399
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   400
	*/
williamr@2
   401
	virtual void SetComplexityLevel(TUint aLevel) = 0;
williamr@2
   402
williamr@2
   403
	/**
williamr@2
   404
	Gets the number of complexity levels available.
williamr@2
   405
	
williamr@2
   406
	@return "The number of complexity control levels available, or zero if the information is not 
williamr@2
   407
			available yet. The information may not be available if the number of levels depends on 
williamr@2
   408
			the input data, and enough input data has not been read yet. In that case, using level 
williamr@2
   409
			zero is safe."
williamr@2
   410
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   411
	*/
williamr@2
   412
	virtual TUint NumComplexityLevels() = 0;
williamr@2
   413
williamr@2
   414
	/**
williamr@2
   415
	Gets information about a computational complexity level. This method can be called after 
williamr@2
   416
	NumComplexityLevels() has returned a non-zero value - at that point the information is guaranteed 
williamr@2
   417
	to be available. Some hardware device implementations may not be able to provide all values, 
williamr@2
   418
	in that case the values will be approximated.
williamr@2
   419
williamr@2
   420
	@param "aLevel"	"The computational complexity level to query. The level numbers range from zero 
williamr@2
   421
					(the most complex) to NumComplexityLevels()-1."
williamr@2
   422
	@param "aInfo"	"The information structure to fill."
williamr@2
   423
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   424
	*/
williamr@2
   425
	virtual void GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo) = 0;
williamr@2
   426
williamr@2
   427
	/**
williamr@2
   428
	Returns a picture back to the device. This method is called by CMMFDevVideoPlay to return pictures 
williamr@2
   429
	from the client (after they have been written with NewPicture()), or by the output device when 
williamr@2
   430
	it has finished using a picture.
williamr@2
   431
williamr@2
   432
	@param "aPicture" "The picture to return. The device can re-use the memory for the picture."
williamr@2
   433
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   434
	*/
williamr@2
   435
	virtual void ReturnPicture(TVideoPicture* aPicture) = 0;
williamr@2
   436
williamr@2
   437
	/**
williamr@2
   438
	Gets a copy of the latest picture sent to output.
williamr@2
   439
williamr@2
   440
	@param "aPictureData"	"Target picture. The memory for the picture must be allocated by the 
williamr@2
   441
							caller, and initialized properly. The data formats must match the snapshot 
williamr@2
   442
							format requested."
williamr@2
   443
	@param "aFormat"		"The picture format to use for the snapshot."
williamr@2
   444
williamr@2
   445
	@return "ETrue if the snapshot was taken, EFalse if a picture is not available. The picture may not 
williamr@2
   446
			be available if decoding has not progressed far enough yet."
williamr@2
   447
williamr@2
   448
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
   449
			* KErrNotSupported - The requested data format or picture size is not supported, or the 
williamr@2
   450
			plug-in does not support snapshots."
williamr@2
   451
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   452
	*/
williamr@2
   453
	virtual TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat) = 0;
williamr@2
   454
williamr@2
   455
	/**
williamr@2
   456
	When the snapshot is available, it will be returned to the client using the TimedSnapshotComplete()
williamr@2
   457
	callback. To cancel a timed snapshot request, use CancelTimedSnapshot(). Only one timed snapshot 
williamr@2
   458
	request can be active at a time.
williamr@2
   459
williamr@2
   460
	@param "aPictureData"			"Target picture. The memory for the picture must be allocated by 
williamr@2
   461
									the caller, and initialized properly. The data formats must match 
williamr@2
   462
									the snapshot format requested. The picture must remain valid until 
williamr@2
   463
									the snapshot has been taken or until the request has been cancelled 
williamr@2
   464
									with CancelTimedSnapshot()."
williamr@2
   465
	@param "aFormat"				"The picture format to use for the snapshot."
williamr@2
   466
	@param "aPresentationTimestamp"	"Presentation timestamp for the picture to copy."
williamr@2
   467
williamr@2
   468
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
   469
			* KErrNotSupported - The requested data format or picture size is not supported or 
williamr@2
   470
			the plug-in does not support timed snapshots."
williamr@2
   471
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   472
	*/
williamr@2
   473
	virtual void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, 
williamr@2
   474
		const TTimeIntervalMicroSeconds& aPresentationTimestamp) = 0;
williamr@2
   475
williamr@2
   476
	/**
williamr@2
   477
	When the snapshot is available, it will be returned to the client using the TimedSnapshotComplete()
williamr@2
   478
	callback. To cancel a timed snapshot request, use CancelTimedSnapshot(). Only one timed snapshot 
williamr@2
   479
	request can be active at a time.
williamr@2
   480
williamr@2
   481
	@param "aPictureData"			"Target picture. The memory for the picture must be allocated by 
williamr@2
   482
									the caller, and initialized properly. The data formats must match 
williamr@2
   483
									the snapshot format requested. The picture must remain valid until 
williamr@2
   484
									the snapshot has been taken or until the request has been cancelled 
williamr@2
   485
									with CancelTimedSnapshot()."
williamr@2
   486
	@param "aFormat"				"The picture format to use for the snapshot."
williamr@2
   487
	@param "aPictureId"				"Picture identifier for the picture to copy."
williamr@2
   488
williamr@2
   489
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
   490
			* KErrNotSupported - The requested data format or picture size is not supported or 
williamr@2
   491
			the plug-in does not support timed snapshots."
williamr@2
   492
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   493
	*/
williamr@2
   494
	virtual void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, 
williamr@2
   495
		const TPictureId& aPictureId) = 0;
williamr@2
   496
williamr@2
   497
	/**
williamr@2
   498
	Cancels a timed snapshot request.
williamr@2
   499
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   500
	*/
williamr@2
   501
	virtual void CancelTimedSnapshot() = 0;
williamr@2
   502
williamr@2
   503
	/**
williamr@2
   504
	Gets a list of the supported snapshot picture formats.
williamr@2
   505
williamr@2
   506
	@param "aFormats" "An array for the result format list. The array must be created and destroyed by 
williamr@2
   507
	the caller."
williamr@2
   508
williamr@2
   509
	@leave "This method may leave with one of the standard error codes."
williamr@2
   510
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   511
	*/
williamr@2
   512
	virtual void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats) = 0;
williamr@2
   513
williamr@2
   514
williamr@2
   515
	/**
williamr@2
   516
williamr@2
   517
	Notifies the hardware device that the end of input data has been reached and no more input data 
williamr@2
   518
	will be written. The hardware device can use this signal to ensure that the remaining data gets 
williamr@2
   519
	processed, without waiting for new data. For example when the data type is not EDuCodedPicture,
williamr@2
   520
	calling this method is necessary otherwise a hardware device implementation might be looking for 
williamr@2
   521
	the start code for the next picture to ensure it has a complete picture before starting to decode
williamr@2
   522
	the previous one. 
williamr@2
   523
	
williamr@2
   524
	  
williamr@2
   525
	After the remaining data has been processed (and displayed, if applicable), the hardware 
williamr@2
   526
	device must notify the proxy with the MdvppStreamEnd() callback.
williamr@2
   527
williamr@2
   528
	DevVideo clients are encouraged to call this method, but its use is not mandatory for synchronized
williamr@2
   529
	processing.  For synchronized playback, all video pictures are processed or discarded according to 
williamr@2
   530
	their timestamps, and so the client can easily infer when processing is complete.  However, it 
williamr@2
   531
	should be noted that the last picture might not be displayed if this method is not called and the 
williamr@2
   532
	input data type is not EDuCodedPicture.
williamr@2
   533
williamr@2
   534
	For non-synchronized playback (e.g. file conversion), a client must call this method otherwise it
williamr@2
   535
	will never find out when the hardware device has finished processing the data.
williamr@2
   536
	
williamr@2
   537
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   538
	*/
williamr@2
   539
	virtual void InputEnd() = 0;
williamr@2
   540
	};
williamr@2
   541
williamr@2
   542
williamr@2
   543
williamr@2
   544
williamr@2
   545
/**
williamr@2
   546
CMMFVideoDecodeHwDevice is the MSL video decoder hardware device interface. 
williamr@2
   547
All video decoders must implement this interface.
williamr@2
   548
@publishedAll
williamr@2
   549
@released
williamr@2
   550
*/
williamr@2
   551
class CMMFVideoDecodeHwDevice : public CMMFVideoPlayHwDevice
williamr@2
   552
	{
williamr@2
   553
public:
williamr@2
   554
	/**
williamr@2
   555
	Creates a new video decoder hardware device object, based on the implementation UID.
williamr@2
   556
williamr@2
   557
	@param	"aUid"		"Decoder implementation UID."
williamr@2
   558
	@param	"aProxy"	"The proxy implementation to use."
williamr@2
   559
	@return	"A new CMMFVideoDecodeHwDevice object."
williamr@2
   560
	@leave	"This method may leave with one of the system-wide error codes.
williamr@2
   561
	*/
williamr@2
   562
	IMPORT_C static CMMFVideoDecodeHwDevice* NewL(TUid aUid, MMMFDevVideoPlayProxy& aProxy);
williamr@2
   563
	
williamr@2
   564
	/**
williamr@2
   565
	Creates a new video decoder hardware device adapter object, based on the Implementation Information of a Processing Unit.
williamr@2
   566
williamr@2
   567
	@param	"aImplInfo"	"The registration data relating to the Interface Implementation of the Processing Unit."
williamr@2
   568
	@param	"aProxy"	"The proxy implementation to use."
williamr@2
   569
	@return	"A new CMMFVideoDecodeHwDevice object."
williamr@2
   570
	@leave	"This method will leave if an error occurs."
williamr@2
   571
	*/
williamr@2
   572
	IMPORT_C static CMMFVideoDecodeHwDevice* NewPuAdapterL(const CImplementationInformation& aImplInfo, MMMFDevVideoPlayProxy& aProxy);
williamr@2
   573
williamr@2
   574
williamr@2
   575
	/**
williamr@2
   576
	Destructor.
williamr@2
   577
	*/
williamr@2
   578
	IMPORT_C virtual ~CMMFVideoDecodeHwDevice();
williamr@2
   579
williamr@2
   580
williamr@2
   581
	/**
williamr@2
   582
	Retrieves decoder information about this hardware device. The device creates a CVideoDecoderInfo 
williamr@2
   583
	structure, fills it with correct data, pushes it to the cleanup stack and returns it. The client 
williamr@2
   584
	will delete the object when it is no longer needed.
williamr@2
   585
	
williamr@2
   586
	@return	"Decoder information as a CVideoDecoderInfo object. The object is pushed to the cleanup 
williamr@2
   587
			stack, and must be deallocated by the caller."
williamr@2
   588
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   589
williamr@2
   590
	@see CVideoDecoderInfo
williamr@2
   591
	*/
williamr@2
   592
	virtual CVideoDecoderInfo* VideoDecoderInfoLC() = 0;
williamr@2
   593
williamr@2
   594
	/**
williamr@2
   595
	Reads header information from a coded data unit.
williamr@2
   596
	@param	"aDataUnitType"		"The type of the coded data unit that is contained in aDataUnit. If the data is a 
williamr@2
   597
								simple piece of bitstream, use EDuArbitraryStreamSection."
williamr@2
   598
	@param	"aEncapsulation"	"The encapsulation type used for the coded data. If the data is a 
williamr@2
   599
								simple piece of bitstream, use EDuElementaryStream."
williamr@2
   600
	@param	"aDataUnit"			"The coded data unit, contained in a TVideoInputBuffer."
williamr@2
   601
	@return "Header information for the data unit, or NULL if the coded data unit did not contain 
williamr@2
   602
			enough data to parse the header. The header data must be returned to the device using 
williamr@2
   603
			ReturnHeader() before Initialize() is called or the decoder is destroyed. The data remains 
williamr@2
   604
			valid until it is returned."
williamr@2
   605
	@leave	"The method will leave if an error occurs. Running out of data is not considered an error, 
williamr@2
   606
			as described above. Typical error codes used:
williamr@2
   607
				* KErrNotSupported - The data is not in a supported format.
williamr@2
   608
				* KErrCorrupt - The data appears to be in a supported format, but is corrupted."
williamr@2
   609
	*/
williamr@2
   610
	virtual TVideoPictureHeader* GetHeaderInformationL(TVideoDataUnitType aDataUnitType, 
williamr@2
   611
		TVideoDataUnitEncapsulation aEncapsulation, TVideoInputBuffer* aDataUnit) = 0;
williamr@2
   612
williamr@2
   613
williamr@2
   614
	/**
williamr@2
   615
	Returns a header from GetHeaderInformationL() back to the decoder so that the memory can be freed.
williamr@2
   616
williamr@2
   617
	@param  "aHeader" "The header to return."
williamr@2
   618
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   619
	*/
williamr@2
   620
	virtual void ReturnHeader(TVideoPictureHeader* aHeader) = 0;
williamr@2
   621
williamr@2
   622
	/**
williamr@2
   623
	Sets the device input format to a compressed video format.
williamr@2
   624
williamr@2
   625
	@param	"aFormat"			"The input format to use."
williamr@2
   626
	@param	"aDataUnitType"		"The data unit type for input data."
williamr@2
   627
	@param	"aEncapsulation"	"The encapsulation type used for the coded data."
williamr@2
   628
	@param	"aDataInOrder"		"ETrue if the input data is written in correct decoding order, 
williamr@2
   629
								 EFalse if will be written in arbitrary order."
williamr@2
   630
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
   631
				* KErrNotSupported - The source format is not supported."
williamr@2
   632
williamr@2
   633
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   634
	*/
williamr@2
   635
	virtual void SetInputFormatL(const CCompressedVideoFormat& aFormat, 
williamr@2
   636
		TVideoDataUnitType aDataUnitType, TVideoDataUnitEncapsulation aEncapsulation, 
williamr@2
   637
		TBool aDataInOrder) = 0;
williamr@2
   638
williamr@2
   639
	/**
williamr@2
   640
	Sets whether decoding should be synchronized to the current clock source, if any, or if pictures 
williamr@2
   641
	should instead be decoded as soon as possible. If decoding is synchronized, decoding timestamps 
williamr@2
   642
	are used if available, presentation timestamps are used if not. When decoding is not synchronized, 
williamr@2
   643
	pictures are decoded as soon as source data is available for them, and the decoder has a free 
williamr@2
   644
	output buffer. If a clock source is not available, decoding will not be synchronized.
williamr@2
   645
williamr@2
   646
	@param "aSynchronize" "True if decoding should be synchronized to a clock source."
williamr@2
   647
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   648
	*/
williamr@2
   649
	virtual void SynchronizeDecoding(TBool aSynchronize) = 0;
williamr@2
   650
williamr@2
   651
	/**
williamr@2
   652
	Sets decoder buffering options. See [3] for a description of the options available.
williamr@2
   653
	
williamr@2
   654
	@param "aOptions" "Buffering options."
williamr@2
   655
	@leave "The method will leave if an error occurs. Typical error codes used:
williamr@2
   656
			* KErrNotSupported - The specified buffering options are not supported. 
williamr@2
   657
			  If the client receives this error code, it can call GetBufferOptions() 
williamr@2
   658
			  to determine the options the decoder is able to support."
williamr@2
   659
williamr@2
   660
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   661
	*/
williamr@2
   662
	virtual void SetBufferOptionsL(const CMMFDevVideoPlay::TBufferOptions& aOptions) = 0;
williamr@2
   663
williamr@2
   664
	/**
williamr@2
   665
	Gets the video decoder buffer options actually in use. This can be used before calling 
williamr@2
   666
	SetBufferOptions() to determine the default options, or afterwards to check the values 
williamr@2
   667
	actually in use (if some default values were used).
williamr@2
   668
williamr@2
   669
	@param "aOptions" "Buffering options structure to fill."
williamr@2
   670
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   671
	*/
williamr@2
   672
	virtual void GetBufferOptions(CMMFDevVideoPlay::TBufferOptions& aOptions) = 0;
williamr@2
   673
williamr@2
   674
	/**
williamr@2
   675
	Indicates which HRD/VBV specification is fulfilled in the input stream and any related parameters.
williamr@2
   676
williamr@2
   677
	@param "aHrdVbvSpec"	"The HRD/VBV specification fulfilled."
williamr@2
   678
	@param "aHrdVbvParams"	"HRD/VBV parameters. The data format depends on the parameters chosen. 
williamr@2
   679
							For 3GPP TS 26.234 parameters (aHrdVbvSpec=EHrdVbv3GPP), the data in the 
williamr@2
   680
							descriptor is a package of type TPckC<T3gppHrdVbvParams> 
williamr@2
   681
							(see T3gppHrdVbvParams). If no HRD/VBV parameters are used, the descriptor 
williamr@2
   682
							is zero length."
williamr@2
   683
	@see THrdVbvSpecification
williamr@2
   684
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   685
	*/
williamr@2
   686
	virtual void SetHrdVbvSpec(THrdVbvSpecification aHrdVbvSpec, const TDesC8& aHrdVbvParams) = 0;
williamr@2
   687
williamr@2
   688
	/**
williamr@2
   689
	Sets the output post-processor device to use. If an output device is set, all decoded pictures 
williamr@2
   690
	are delivered to that device, and not drawn on screen or returned to the client. Pictures are 
williamr@2
   691
	written using CMMDVideoPostProcDevice::WritePictureL() or a custom interface after they have been 
williamr@2
   692
	decoded. The post-processor must then synchronize rendering to the clock source if necessary.
williamr@2
   693
williamr@2
   694
	@param "aDevice" "The output post-processor device to use."
williamr@2
   695
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   696
	*/
williamr@2
   697
	virtual void SetOutputDevice(CMMFVideoPostProcHwDevice* aDevice) = 0;
williamr@2
   698
williamr@2
   699
	/**
williamr@2
   700
	Returns the current decoding position, i.e. the timestamp for the most recently decoded picture.
williamr@2
   701
williamr@2
   702
	@return "Current decoding position."
williamr@2
   703
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   704
	*/
williamr@2
   705
	virtual TTimeIntervalMicroSeconds DecodingPosition() = 0;
williamr@2
   706
williamr@2
   707
	/**
williamr@2
   708
	Returns the current pre-decoder buffer size.
williamr@2
   709
williamr@2
   710
	@return "The number of bytes of data in the pre-decoder buffer."
williamr@2
   711
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   712
	*/
williamr@2
   713
	virtual TUint PreDecoderBufferBytes() = 0;
williamr@2
   714
williamr@2
   715
	/**
williamr@2
   716
	Reads various counters related to the received input bitstream and coded data units. The counters 
williamr@2
   717
	are reset when Initialize() or this method is called, and thus they only include data processed 
williamr@2
   718
	since the last call.
williamr@2
   719
williamr@2
   720
	@param "aCounters" "The counter structure to fill."
williamr@2
   721
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   722
	*/
williamr@2
   723
	virtual void GetBitstreamCounters(CMMFDevVideoPlay::TBitstreamCounters& aCounters) = 0;
williamr@2
   724
williamr@2
   725
	/**
williamr@2
   726
	Retrieves the number of free input buffers the decoder has available.
williamr@2
   727
williamr@2
   728
	@return "Number of free input buffers the decoder has available."
williamr@2
   729
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   730
	*/
williamr@2
   731
	virtual TUint NumFreeBuffers() = 0;
williamr@2
   732
williamr@2
   733
	/**
williamr@2
   734
	Retrieves an empty video input buffer from the decoder. After input data has been written to the 
williamr@2
   735
	buffer, it can be written to the decoder using WriteCodedDataL(). The number of buffers the decoder
williamr@2
   736
	must be able to provide before expecting any back, and the maximum size for each buffer, are 
williamr@2
   737
	specified in the buffer options.
williamr@2
   738
williamr@2
   739
	The decoder maintains ownership of the buffers even while they have been retrieved by the client, 
williamr@2
   740
	and will take care of deallocating them.
williamr@2
   741
williamr@2
   742
	@param	"aBufferSize"	"Required buffer size, in bytes. The resulting buffer can be larger than 
williamr@2
   743
							this, but not smaller."
williamr@2
   744
	@return "A new input data buffer. The buffer is at least as large as requested, but it may be 
williamr@2
   745
			larger. If no free buffers are available, the return value is NULL."
williamr@2
   746
	@leave  "The method will leave if an error occurs. Lack of free buffers is not considered an error."
williamr@2
   747
	*/
williamr@2
   748
	virtual TVideoInputBuffer* GetBufferL(TUint aBufferSize) = 0;
williamr@2
   749
williamr@2
   750
	/**
williamr@2
   751
	Writes a piece of coded video data to the decoder. The data buffer must be retrieved from the 
williamr@2
   752
	decoder with GetBufferL().
williamr@2
   753
williamr@2
   754
	@param "aBuffer" "The coded data unit to write."
williamr@2
   755
	@leave "This method may leave with one of the system-wide error codes."
williamr@2
   756
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   757
	*/
williamr@2
   758
	virtual void WriteCodedDataL(TVideoInputBuffer* aBuffer) = 0;
williamr@2
   759
	
williamr@2
   760
	/**
williamr@2
   761
	Configures the Decoder using header information known by the client.
williamr@2
   762
	@param	"aVideoPictureHeader"	"Header information to configure the decoder with"
williamr@2
   763
	@leave	"The method will leave if an error occurs. Running out of data is not considered an error, 
williamr@2
   764
			as described above.
williamr@2
   765
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   766
	*/
williamr@2
   767
	virtual void ConfigureDecoderL(const TVideoPictureHeader& aVideoPictureHeader);
williamr@2
   768
		
williamr@2
   769
williamr@2
   770
williamr@2
   771
protected:
williamr@2
   772
	/**
williamr@2
   773
	Constructor.
williamr@2
   774
	*/
williamr@2
   775
	IMPORT_C CMMFVideoDecodeHwDevice();
williamr@2
   776
williamr@2
   777
	/**
williamr@2
   778
	Set the proxy implementation to be used. Called just after the object is constructed.
williamr@2
   779
	@param	"aProxy"	"The proxy to use."
williamr@2
   780
	*/
williamr@2
   781
	virtual void SetProxy(MMMFDevVideoPlayProxy& aProxy) = 0;
williamr@2
   782
private:
williamr@2
   783
	TUid iDtor_ID_Key;
williamr@2
   784
	};
williamr@2
   785
williamr@2
   786
williamr@2
   787
/**
williamr@2
   788
CMMFVideoPostProcHwDevice is the MSL video post-processor plug-in interface. All MSL video 
williamr@2
   789
post-processors must implement this interface.
williamr@2
   790
@publishedAll
williamr@2
   791
@released
williamr@2
   792
*/
williamr@2
   793
class CMMFVideoPostProcHwDevice : public CMMFVideoPlayHwDevice
williamr@2
   794
	{
williamr@2
   795
public:
williamr@2
   796
	/**
williamr@2
   797
	Creates a new video post-processor hardware device object, based on the implementation UID.
williamr@2
   798
williamr@2
   799
	@param	"aUid"		"Post-processor implementation UID."
williamr@2
   800
	@param	"aProxy"	"The proxy implementation to use."
williamr@2
   801
	@return	"A new CMMFVideoPostProcHwDevice object."
williamr@2
   802
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   803
	*/
williamr@2
   804
	IMPORT_C static CMMFVideoPostProcHwDevice* NewL(TUid aUid, MMMFDevVideoPlayProxy& aProxy);
williamr@2
   805
williamr@2
   806
	/**
williamr@2
   807
	Destructor.
williamr@2
   808
	*/
williamr@2
   809
	IMPORT_C virtual ~CMMFVideoPostProcHwDevice();
williamr@2
   810
williamr@2
   811
	/**
williamr@2
   812
	Sets the device input format to an uncompressed video format.
williamr@2
   813
williamr@2
   814
	@param	"aFormat"	"The input format to use."
williamr@2
   815
	@leave	"The method will leave if an error occurs. Typical error codes used:
williamr@2
   816
			* KErrNotSupported - The input format is not supported."	
williamr@2
   817
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   818
	*/
williamr@2
   819
	virtual void SetInputFormatL(const TUncompressedVideoFormat& aFormat) = 0;
williamr@2
   820
williamr@2
   821
	/**
williamr@2
   822
	Sets the decoder device that will write data to this post-processor. Decoded pictures will be 
williamr@2
   823
	written with WritePictureL() or through a custom interface. After pictures have been processed, 
williamr@2
   824
	they must be returned to the decoder using ReturnPicture().
williamr@2
   825
williamr@2
   826
	@param	"aDevice"	"The decoder source plug-in to use."
williamr@2
   827
	@pre	"This method can only be called before the hwdevice has been initialized with Initialize()."
williamr@2
   828
	*/
williamr@2
   829
	virtual void SetInputDevice(CMMFVideoDecodeHwDevice* aDevice) = 0;
williamr@2
   830
williamr@2
   831
	/**
williamr@2
   832
	Writes an uncompressed video picture to the post-processor. The picture must be returned to the 
williamr@2
   833
	client or source plug-in after it has been used.
williamr@2
   834
williamr@2
   835
	@param	"aPicture"	"The picture to write."
williamr@2
   836
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   837
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   838
	*/
williamr@2
   839
	virtual void WritePictureL(TVideoPicture* aPicture) = 0;
williamr@2
   840
protected:
williamr@2
   841
	/**
williamr@2
   842
	Constructor.
williamr@2
   843
	*/
williamr@2
   844
	IMPORT_C CMMFVideoPostProcHwDevice();
williamr@2
   845
williamr@2
   846
	/**
williamr@2
   847
	Set the proxy implementation to be used. Called just after the object is constructed.
williamr@2
   848
	@param	"aProxy"	"The proxy to use."
williamr@2
   849
	*/
williamr@2
   850
	virtual void SetProxy(MMMFDevVideoPlayProxy& aProxy) = 0;
williamr@2
   851
private:
williamr@2
   852
	TUid iDtor_ID_Key;
williamr@2
   853
	};
williamr@2
   854
williamr@2
   855
williamr@2
   856
williamr@2
   857
/**
williamr@2
   858
A custom interface extending the functionality of CMMFVideoPlayHwDevice, adding support for the decoder to handle the 
williamr@2
   859
copying of the bitstream data into the buffers, combining this with a scan of the data and support for the passing of 
williamr@2
   860
information from the client to the decoder describing what part of a frame the data contains.
williamr@2
   861
@publishedAll
williamr@2
   862
@released
williamr@2
   863
*/
williamr@2
   864
class MMMFVideoPlayHwDeviceExtensionScanCopy
williamr@2
   865
	{
williamr@2
   866
public:
williamr@2
   867
	/**
williamr@2
   868
	Writes a piece of coded video data to the decoder. The data buffer must be retrieved from the
williamr@2
   869
	decoder with GetBufferL().
williamr@2
   870
williamr@2
   871
	@param	"aBuffer"	"The coded data unit to write."
williamr@2
   872
	@param	"aPortion"	"The portion of the frame that the data contains. Defaults to EFramePortionUnknown."
williamr@2
   873
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   874
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   875
	*/
williamr@2
   876
	virtual void WriteCodedDataL(TVideoInputBuffer* aBuffer, TFramePortion aPortion = EFramePortionUnknown) = 0;
williamr@2
   877
	/**
williamr@2
   878
	Passes a pointer to a piece of coded video data to the decoder. The data buffer, which is left empty by the client,
williamr@2
   879
	must be retrieved from the decoder with GetBufferL().
williamr@2
   880
williamr@2
   881
	@param	"aCodedData"	"A pointer to the coded data unit to scan and copy."
williamr@2
   882
	@param	"aBuffer"		"The empty data buffer."
williamr@2
   883
	@param	"aPortion"		"The portion of the frame that the data contains. Defaults to EFramePortionUnknown."
williamr@2
   884
	@leave	"This method may leave with one of the system-wide error codes."
williamr@2
   885
	@pre	"This method can only be called after the hwdevice has been initialized with Initialize()."
williamr@2
   886
	*/
williamr@2
   887
	virtual void ScanAndCopyCodedDataL(TPtr8 aCodedData, TVideoInputBuffer* aBuffer, TInt& aConsumed, TFramePortion aPortion = EFramePortionUnknown) = 0;
williamr@2
   888
	};
williamr@2
   889
williamr@2
   890
inline void CMMFVideoDecodeHwDevice::ConfigureDecoderL(const TVideoPictureHeader& /*aVideoPictureHeader*/) 
williamr@2
   891
	{
williamr@2
   892
	User::Leave(KErrNotSupported);
williamr@2
   893
	}
williamr@2
   894
		
williamr@2
   895
williamr@2
   896
williamr@2
   897
#endif