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