mdfdevvideoextensions/nga_mdf_postprocessor/inc/NGAPostProcHwDevice.h
changeset 0 40261b775718
child 7 94dbab0a2133
child 13 efebd1779a59
equal deleted inserted replaced
-1:000000000000 0:40261b775718
       
     1 /*
       
     2 * Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __NGAPOSTPROCHWDEVICE_H__
       
    20 #define __NGAPOSTPROCHWDEVICE_H__
       
    21 
       
    22 #include <e32std.h> 
       
    23 #include <w32std.h>
       
    24 #include <e32base.h>
       
    25 #include <e32def.h>
       
    26 #include <e32cmn.h>
       
    27 #include <STDIO.H>
       
    28 #include <string.h>
       
    29 #include <stdarg.h>
       
    30 
       
    31 #include <mmf/devvideo/videoplayhwdevice.h>
       
    32 #include <mmf/devvideo/devvideostandardcustominterfaces.h>
       
    33 #include <mmf/devvideo/devvideovideosurfacecustominterface.h>
       
    34 #include <graphics/surfacemanager.h> //RSurfaceManager
       
    35 #include <graphics/surface.h> //TSurfaceId
       
    36 #include <mmf/common/mmfvideo.h> //TVideoAspectRatio
       
    37 #include <mmf/devvideo/devvideosurfacehandlecustominterface.h>
       
    38 #include <mmf/devvideo/devvideoplayratecustominterface.h>  
       
    39 #include <surface_hints.h>
       
    40 #include <secureoutputci.h>
       
    41 #include <advancedsecureoutputci.h>
       
    42 #include <graphics/suerror.h>
       
    43 
       
    44 #include "MdfRDebug.h"
       
    45 #include "NGAPostProcHwDevice_UID.hrh"
       
    46 #include "NGAPostProcSessionManagerObserver.h"
       
    47 
       
    48 class CNGAPostProcSessionManager;
       
    49 class CNGAPostProcSurfaceHandler;
       
    50 class CNGAPostProcTimer;
       
    51 class RWsSession;
       
    52 
       
    53 class CNGAPostProcHwDevice: public CMMFVideoPostProcHwDevice,
       
    54 							public MMmfVideoBufferManagement,
       
    55 							public MNGAPostProcSessionManagerObserver,
       
    56 							public MMMFVideoSurfaceSupport,
       
    57 							public MMmfVideoPropertiesObserver,
       
    58 							public MMmfVideoResourceObserver,
       
    59 							public MMmfVideoSurfaceHandleControl,
       
    60 							public MMmfVideoPropertiesNotifier,
       
    61 							public MMmfVideoPlayRateControl,
       
    62 							public MMmfVideoSecureOutput,
       
    63 							public MMmfAdvancedVideoSecureOutput
       
    64 {
       
    65 
       
    66 public: 
       
    67     //  === Constructors and destructor ===
       
    68     /**
       
    69     * Two-phased constructor.   
       
    70     * @return pointer to an instance of CMMFVideoPostProcHwDevice
       
    71     */
       
    72     static CMMFVideoPostProcHwDevice* NewL();
       
    73 
       
    74     /**
       
    75     * Destructor.
       
    76     */
       
    77     ~CNGAPostProcHwDevice();
       
    78 
       
    79 public: 
       
    80     
       
    81     // === CMMFVideoPostProcHwDevice ===
       
    82     
       
    83     /**
       
    84     Sets the device input format to an uncompressed video format.
       
    85 
       
    86     @param  "aFormat"   "The input format to use."
       
    87     @leave  "The method will leave if an error occurs. Typical error codes used:
       
    88             * KErrNotSupported - The input format is not supported."    
       
    89     @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
       
    90     */
       
    91     void SetInputFormatL(const TUncompressedVideoFormat& aFormat);
       
    92 
       
    93     /**
       
    94     Sets the decoder device that will write data to this post-processor. Decoded pictures will be 
       
    95     written with WritePictureL() or through a custom interface. After pictures have been processed, 
       
    96     they must be returned to the decoder using ReturnPicture().
       
    97 
       
    98     @param  "aDevice"   "The decoder source plug-in to use."
       
    99     @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
       
   100     */
       
   101     void SetInputDevice(CMMFVideoDecodeHwDevice* aDevice);
       
   102 
       
   103     /**
       
   104     Writes an uncompressed video picture to the post-processor. The picture must be returned to the 
       
   105     client or source plug-in after it has been used.
       
   106 
       
   107     @param  "aPicture"  "The picture to write."
       
   108     @leave  "This method may leave with one of the system-wide error codes."
       
   109     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   110     */
       
   111     void WritePictureL(TVideoPicture* aPicture);    
       
   112 
       
   113     /**
       
   114     Retrieves post-processing information about this hardware device. 
       
   115     The device creates a CPostProcessorInfo structure, fills it with correct data, pushes it 
       
   116     to the cleanup stack and returns it. The client will delete the object when it is no 
       
   117     longer needed.
       
   118 
       
   119     @return "Post-processor information as a CPostProcessorInfo object. 
       
   120             The object is pushed to the cleanup stack, and must be deallocated by the caller."
       
   121     @leave  "This method may leave with one of the system-wide error codes.
       
   122     */
       
   123     CPostProcessorInfo* PostProcessorInfoLC();
       
   124 
       
   125     /**
       
   126     Retrieves the list of the output formats that the device supports. The list is ordered in 
       
   127     plug-in preference order, with the preferred formats at the beginning of the list. The list 
       
   128     can depend on the device source format, and therefore SetSourceFormatL() must be called before 
       
   129     calling this method.
       
   130 
       
   131     @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
       
   132     @leave  "This method may leave with one of the system-wide error codes.
       
   133     @pre    "This method may only be called before the hwdevice has been initialized using Initialize()."
       
   134     */
       
   135     void GetOutputFormatListL(RArray<TUncompressedVideoFormat>& aFormats);
       
   136 
       
   137     /**
       
   138     Sets the device output format.
       
   139 
       
   140     @param  "aFormat" "The format to use."
       
   141     @leave  "This method may leave with one of the system-wide error codes.
       
   142     @pre    "This method may only be called before the hwdevice has been initialized using Initialize()."
       
   143     */
       
   144     void SetOutputFormatL(const TUncompressedVideoFormat &aFormat);
       
   145 
       
   146     /**
       
   147     Sets the clock source to use for video timing. If no clock source is set. video playback 
       
   148     will not be synchronized, but will proceed as fast as possible, depending on input data 
       
   149     and output buffer availability. 
       
   150 
       
   151     @param  "aClock" "The clock source to be used."
       
   152     @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
       
   153     */
       
   154     void SetClockSource(MMMFClockSource* aClock);
       
   155 
       
   156     /**
       
   157     Sets the device video output destination. The destination can be the screen (using direct 
       
   158     screen access) or memory buffers. By default memory buffers are used. If data is written 
       
   159     to another device, this method is ignored, and suitable memory buffers are always used.
       
   160     
       
   161     @param  "aScreen" "True if video output destination is the screen, false if memory buffers."
       
   162     @leave  "This method may leave with one of the system-wide error codes.
       
   163     @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
       
   164     */
       
   165     void SetVideoDestScreenL(TBool aScreen);
       
   166 
       
   167     /**
       
   168     Sets the post-processing types to be used.
       
   169 
       
   170     @param  "aPostProcCombination" "The post-processing steps to perform, a bitwise OR of values from TPostProcessType."
       
   171     @leave  "This method may leave with one of the system-wide error codes.
       
   172     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   173             If called after initialization, the change must only be committed when CommitL() is called."
       
   174     */
       
   175     void SetPostProcessTypesL(TUint32 aPostProcCombination);
       
   176 
       
   177     /**
       
   178     Sets post-processing options for input (pan-scan) cropping.
       
   179 
       
   180     @param  "aRect" "The cropping rectangle to use."
       
   181     @leave  "This method may leave with one of the system-wide error codes.
       
   182     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   183             If called after initialization, the change must only be committed when CommitL() is called."
       
   184     */
       
   185     void SetInputCropOptionsL(const TRect& aRect);
       
   186 
       
   187     /**
       
   188     Sets post-processing options for YUV to RGB color space conversion. 
       
   189     Specifies the input YUV and output RGB formats to use explicitly. SetSourceFormatL(), 
       
   190     SetOutputFormatL(), and SetPostProcessTypesL() must be called before this method is used.
       
   191 
       
   192     @param  "aOptions"      "The conversion options to use."
       
   193     @param  "aYuvFormat"    "Conversion source YUV format"
       
   194     @param  "aRgbFormat"    "Conversion target RGB format"
       
   195     @leave  "This method may leave with one of the system-wide error codes.
       
   196     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   197             If called after initialization, the change must only be committed when CommitL() is called."
       
   198     */
       
   199     void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, 
       
   200                                 TRgbFormat aRgbFormat);
       
   201 
       
   202     /**
       
   203     Sets post-processing options for YUV to RGB color space conversion.
       
   204     Uses the device input and output formats. For decoder devices the default YUV format used is 
       
   205     the format specified in the input bitstream. SetSourceFormatL(), SetOutputFormatL(), and 
       
   206     SetPostProcessTypesL() must be called before this method is used.
       
   207 
       
   208     @param  "aOptions"      "The conversion options to use."
       
   209     @leave  "This method may leave with one of the system-wide error codes.
       
   210     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   211             If called after initialization, the change must only be committed when CommitL() is called."
       
   212     */
       
   213     void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions);
       
   214 
       
   215     /**
       
   216     Sets post-processing options for rotation. SetPostProcessTypesL() must be called before 
       
   217     this method is used.
       
   218 
       
   219     @param  "aRotationType" "The rotation to perform."  
       
   220     @leave  "This method may leave with one of the system-wide error codes.
       
   221     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   222             If called after initialization, the change must only be committed when CommitL() is called."
       
   223     */
       
   224     void SetRotateOptionsL(TRotationType aRotationType);
       
   225 
       
   226     /**
       
   227     Sets post-processing options for scaling. SetPostProcessTypesL() must be called before 
       
   228     this method is used.
       
   229     
       
   230     @param  "aTargetSize"           "Scaling target size. If a fixed scale factor size is used, 
       
   231                                     the new dimensions must be set to width=floor(factor*width), 
       
   232                                     height=floor(factor*height). For example, scaling a 
       
   233                                     QCIF (176x144) picture up by a factor of 4/3 yields a size 
       
   234                                     of 234x192."
       
   235     @param  "aAntiAliasFiltering"   "True if anti-aliasing filtering should be used. 
       
   236                                     If the post-processor does not support anti-aliased scaling, 
       
   237                                     or supports anti-aliased scaling only, this argument is ignored."
       
   238     @leave  "This method may leave with one of the system-wide error codes.
       
   239     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   240             If called after initialization, the change must only be committed when CommitL() is called."
       
   241     */
       
   242     void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering);
       
   243 
       
   244     /**
       
   245     Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before 
       
   246     this method is used.
       
   247     
       
   248     @param  "aRect" "Output cropping area."
       
   249     @leave  "This method may leave with one of the system-wide error codes.
       
   250     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   251             If called after initialization, the change must only be committed when CommitL() is called."
       
   252     */
       
   253     void SetOutputCropOptionsL(const TRect& aRect);
       
   254 
       
   255     /**
       
   256     Sets post-processing plug-in specific options. SetPostProcessTypesL() must be called before 
       
   257     this method is used.
       
   258 
       
   259     @param  "aOptions" "The options. The format is plug-in specific."
       
   260     @leave  "This method may leave with one of the system-wide error codes.
       
   261     @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
       
   262             If called after initialization, the change must only be committed when CommitL() is called."
       
   263     */
       
   264     void SetPostProcSpecificOptionsL(const TDesC8& aOptions);
       
   265 
       
   266     /**
       
   267     Initializes the device. This method is asynchronous, the device will call 
       
   268     MMFVideoPlayProxy::MdvppInitializeComplete() after initialization has completed. After this 
       
   269     method has successfully completed, further configuration changes are not possible except where 
       
   270     separately noted.
       
   271     */
       
   272     void Initialize();
       
   273 
       
   274     /**
       
   275     Commit all changes since the last CommitL(), Revert() or Initialize()
       
   276     to the hardware device.  This only applies to methods which can be called both
       
   277     before AND after DevVideoPlay has been initialized.
       
   278 
       
   279     @see    SetPostProcessTypesL
       
   280     @see    SetInputCropOptionsL
       
   281     @see    SetYuvToRgbOptionsL
       
   282     @see    SetRotateOptionsL
       
   283     @see    SetScaleOptionsL
       
   284     @see    SetOutputCropOptionsL
       
   285     @see    SetPostProcSpecificOptionsL
       
   286 
       
   287     @leave  "The method will leave if an error occurs."
       
   288     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   289     */
       
   290     void CommitL();
       
   291 
       
   292     /**
       
   293     Revert all changes since the last CommitL(), Revert() or Initialize()
       
   294     back to their previous settings.  This only applies to methods which can 
       
   295     be called both before AND after DevVideoPlay has been initialized.
       
   296 
       
   297     @see    SetPostProcessTypesL
       
   298     @see    SetInputCropOptionsL
       
   299     @see    SetYuvToRgbOptionsL
       
   300     @see    SetRotateOptionsL
       
   301     @see    SetScaleOptionsL
       
   302     @see    SetOutputCropOptionsL
       
   303     @see    SetPostProcSpecificOptionsL
       
   304 
       
   305     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   306     */
       
   307     void Revert();
       
   308 
       
   309     /**
       
   310     Starts writing output directly to the display frame buffer using Direct Screen Access.
       
   311 
       
   312     @param  "aVideoRect"    "The video output rectangle on screen."
       
   313     @param  "aScreenDevice" "The screen device to use. The screen device object must be valid in the current thread."
       
   314     @param  "aClipRegion"   "Initial clipping region to use."
       
   315     
       
   316     @leave  "This method may leave with one of the system-wide error codes.
       
   317     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   318     */
       
   319     void StartDirectScreenAccessL(const TRect& aVideoRect, 
       
   320         CFbsScreenDevice& aScreenDevice, const TRegion& aClipRegion);
       
   321 
       
   322     /**
       
   323     Sets a new clipping region for Direct Screen Access. After the method returns, no video will 
       
   324     be drawn outside of the region. If clipping is not supported, or the clipping region is too 
       
   325     complex, either playback will pause or will resume without video display, depending on the 
       
   326     current setting of SetPauseOnClipFail(), and the result can be verified with IsPlaying(). 
       
   327     Clipping can be disabled by setting a new clipping region that includes the whole video window.
       
   328 
       
   329     @param  "aRegion" "The new clipping region. After the method returns, no video will be drawn outside the region."
       
   330     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   331     */
       
   332     void SetScreenClipRegion(const TRegion& aRegion);
       
   333 
       
   334     /**
       
   335     Sets whether the system should pause playback when it gets a clipping region it cannot handle, 
       
   336     or Direct Screen Access is aborted completely. If not, processing will proceed normally, but no 
       
   337     video will be drawn. By default, playback is paused.
       
   338 
       
   339     @param "aPause" "True if playback should be paused when clipping fails, false if not. 
       
   340                     If playback is not paused, it will be continued without video display."
       
   341     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   342     */
       
   343     void SetPauseOnClipFail(TBool aPause);
       
   344 
       
   345     /**
       
   346     Aborts Direct Screen Access completely, to be called from MAbortDirectScreenAccess::AbortNow() 
       
   347     and similar methods. DSA can be resumed by calling StartDirectScreenAccessL().
       
   348     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   349     */
       
   350     void AbortDirectScreenAccess();
       
   351 
       
   352     /**
       
   353     Indicates whether playback is proceeding. This method can be used to check whether playback was 
       
   354     paused or not in response to a new clipping region or DSA abort.
       
   355 
       
   356     @return "ETrue if video is still being played (even if not necessarily displayed)."
       
   357     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   358     */
       
   359     TBool IsPlaying();
       
   360 
       
   361     /**
       
   362     Re-draws the latest video picture. Only available when DSA is being used. If DSA is aborted or a 
       
   363     non-supported clipping region has been set, the request may be ignored.
       
   364     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   365     */
       
   366     void Redraw();
       
   367 
       
   368 
       
   369     /**
       
   370     Starts video playback, including decoding, post-processing, and rendering. Playback will proceed 
       
   371     until it has been stopped or paused, or the end of the bitstream is reached.
       
   372     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   373     */
       
   374     void Start();
       
   375 
       
   376     /**
       
   377     Stops video playback. No new pictures will be decoded, post-processed, or rendered.
       
   378     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   379     */
       
   380     void Stop();
       
   381 
       
   382     /**
       
   383     Pauses video playback, including decoding, post-processing, and rendering. No pictures will be 
       
   384     decoded, post-processed, or rendered until playback has been resumed.
       
   385     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   386     */
       
   387     void Pause();
       
   388 
       
   389     /**
       
   390     Resumes video playback after a pause.
       
   391     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   392     */
       
   393     void Resume();
       
   394 
       
   395     /**
       
   396     Changes to a new decoding and playback position, used for randomly accessing (seeking) the 
       
   397     input stream. The position change flushes all input and output buffers. Pre-decoder and 
       
   398     post-decoder buffering are handled as if a new bitstream was being decoded. If the device still
       
   399     has buffered pictures that precede the new playback position, they will be discarded. If playback
       
   400     is synchronized to a clock source, the client is responsible for setting the clock source to the 
       
   401     new position.
       
   402     
       
   403     @param "aPlaybackPosition" "The new playback position in the video stream."
       
   404     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   405     */
       
   406     void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
       
   407 
       
   408     /**
       
   409     Freezes a picture on the screen. After the picture has been frozen, no new pictures are 
       
   410     displayed until the freeze is released with ReleaseFreeze(). If the device output is being 
       
   411     written to memory buffers or to another plug-in, instead of the screen, no decoded pictures 
       
   412     will be delivered while the freeze is active, and they are simply discarded.
       
   413 
       
   414     @param "aTimestamp" "The presentation timestamp of the picture to freeze. The frozen picture 
       
   415                         will be the first picture with a timestamp greater than or equal to this 
       
   416                         parameter."
       
   417     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   418     */
       
   419     void FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp);
       
   420 
       
   421     /**
       
   422     Releases a picture frozen with FreezePicture().
       
   423 
       
   424     @param "aTimestamp" "The presentation timestamp of the picture to release. The first picture 
       
   425                         displayed after the release will be the first picture with a timestamp 
       
   426                         greater than or equal to this parameter. To release the freeze immediately, 
       
   427                         set the timestamp to zero."
       
   428     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   429     */
       
   430     void ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp);
       
   431 
       
   432 
       
   433     /**
       
   434     Returns the current playback position, i.e. the timestamp for the most recently displayed or 
       
   435     virtually displayed picture. If the device output is written to another device, the most recent 
       
   436     output picture is used.
       
   437 
       
   438     @return "Current playback position."
       
   439     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   440     */
       
   441     TTimeIntervalMicroSeconds PlaybackPosition();
       
   442 
       
   443     /**
       
   444     Returns the total amount of memory allocated for uncompressed pictures. This figure only 
       
   445     includes the pictures actually allocated by the plug-in itself, so that the total number of 
       
   446     bytes allocated in the system can be calculated by taking the sum of the values from all plug-ins.
       
   447 
       
   448     @return "Total number of bytes of memory allocated for uncompressed pictures."
       
   449     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   450     */
       
   451     TUint PictureBufferBytes();
       
   452 
       
   453     /**
       
   454     Reads various counters related to decoded pictures. The counters are reset when Initialize() 
       
   455     or this method is called, and thus they only include pictures processed since the last call.
       
   456 
       
   457     Post-processor devices return the number of input pictures in iPicturesDecoded and 
       
   458     iTotalPictures. If the decoded pictures are written to another plug-in, they are considered 
       
   459     to be "virtually displayed".
       
   460 
       
   461     @param "aCounters" "The counter structure to fill."
       
   462     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   463     */
       
   464     void GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters);
       
   465 
       
   466 
       
   467     /**
       
   468     Sets the computational complexity level to use. If separate complexity levels are not available, 
       
   469     the method call is ignored. If the level specified is not available, the results are undefined. 
       
   470     Typically the device will either ignore the request or use the nearest suitable level.
       
   471 
       
   472     The complexity level can be changed at any point during playback.
       
   473 
       
   474     @param "aLevel" "The computational complexity level to use. Level zero (0) is the most complex 
       
   475                     one, with the highest quality. Higher level numbers require less processing 
       
   476                     and may have lower quality."
       
   477     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   478     */
       
   479     void SetComplexityLevel(TUint aLevel);
       
   480 
       
   481     /**
       
   482     Gets the number of complexity levels available.
       
   483     
       
   484     @return "The number of complexity control levels available, or zero if the information is not 
       
   485             available yet. The information may not be available if the number of levels depends on 
       
   486             the input data, and enough input data has not been read yet. In that case, using level 
       
   487             zero is safe."
       
   488     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   489     */
       
   490     TUint NumComplexityLevels();
       
   491 
       
   492     /**
       
   493     Gets information about a computational complexity level. This method can be called after 
       
   494     NumComplexityLevels() has returned a non-zero value - at that point the information is guaranteed 
       
   495     to be available. Some hardware device implementations may not be able to provide all values, 
       
   496     in that case the values will be approximated.
       
   497 
       
   498     @param "aLevel" "The computational complexity level to query. The level numbers range from zero 
       
   499                     (the most complex) to NumComplexityLevels()-1."
       
   500     @param "aInfo"  "The information structure to fill."
       
   501     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   502     */
       
   503     void GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo);
       
   504 
       
   505     /**
       
   506     Returns a picture back to the device. This method is called by CMMFDevVideoPlay to return pictures 
       
   507     from the client (after they have been written with NewPicture()), or by the output device when 
       
   508     it has finished using a picture.
       
   509 
       
   510     @param "aPicture" "The picture to return. The device can re-use the memory for the picture."
       
   511     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   512     */
       
   513     void ReturnPicture(TVideoPicture* aPicture);
       
   514 
       
   515     /**
       
   516     Gets a copy of the latest picture sent to output.
       
   517 
       
   518     @param "aPictureData"   "Target picture. The memory for the picture must be allocated by the 
       
   519                             caller, and initialized properly. The data formats must match the snapshot 
       
   520                             format requested."
       
   521     @param "aFormat"        "The picture format to use for the snapshot."
       
   522 
       
   523     @return "ETrue if the snapshot was taken, EFalse if a picture is not available. The picture may not 
       
   524             be available if decoding has not progressed far enough yet."
       
   525 
       
   526     @leave  "The method will leave if an error occurs. Typical error codes used:
       
   527             * KErrNotSupported - The requested data format or picture size is not supported, or the 
       
   528             plug-in does not support snapshots."
       
   529     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   530     */
       
   531 //    TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat) {return EFalse;};
       
   532     TBool GetSnapshotL(TPictureData&, const TUncompressedVideoFormat& ) {return EFalse;};
       
   533 
       
   534     /**
       
   535     When the snapshot is available, it will be returned to the client using the TimedSnapshotComplete()
       
   536     callback. To cancel a timed snapshot request, use CancelTimedSnapshot(). Only one timed snapshot 
       
   537     request can be active at a time.
       
   538 
       
   539     @param "aPictureData"           "Target picture. The memory for the picture must be allocated by 
       
   540                                     the caller, and initialized properly. The data formats must match 
       
   541                                     the snapshot format requested. The picture must remain valid until 
       
   542                                     the snapshot has been taken or until the request has been cancelled 
       
   543                                     with CancelTimedSnapshot()."
       
   544     @param "aFormat"                "The picture format to use for the snapshot."
       
   545     @param "aPresentationTimestamp" "Presentation timestamp for the picture to copy."
       
   546 
       
   547     @leave  "The method will leave if an error occurs. Typical error codes used:
       
   548             * KErrNotSupported - The requested data format or picture size is not supported or 
       
   549             the plug-in does not support timed snapshots."
       
   550     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   551     */
       
   552     //void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, 
       
   553     //                        const TTimeIntervalMicroSeconds& aPresentationTimestamp){};
       
   554     void GetTimedSnapshotL(TPictureData*, const TUncompressedVideoFormat&, const TTimeIntervalMicroSeconds&){};
       
   555 
       
   556 
       
   557     /**
       
   558     When the snapshot is available, it will be returned to the client using the TimedSnapshotComplete()
       
   559     callback. To cancel a timed snapshot request, use CancelTimedSnapshot(). Only one timed snapshot 
       
   560     request can be active at a time.
       
   561 
       
   562     @param "aPictureData"           "Target picture. The memory for the picture must be allocated by 
       
   563                                     the caller, and initialized properly. The data formats must match 
       
   564                                     the snapshot format requested. The picture must remain valid until 
       
   565                                     the snapshot has been taken or until the request has been cancelled 
       
   566                                     with CancelTimedSnapshot()."
       
   567     @param "aFormat"                "The picture format to use for the snapshot."
       
   568     @param "aPictureId"             "Picture identifier for the picture to copy."
       
   569 
       
   570     @leave  "The method will leave if an error occurs. Typical error codes used:
       
   571             * KErrNotSupported - The requested data format or picture size is not supported or 
       
   572             the plug-in does not support timed snapshots."
       
   573     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   574     */
       
   575 //    void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, 
       
   576 //                            const TPictureId& aPictureId){};
       
   577     void GetTimedSnapshotL(TPictureData*, const TUncompressedVideoFormat&, const TPictureId& ){};
       
   578 
       
   579     /**
       
   580     Cancels a timed snapshot request.
       
   581     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   582     */
       
   583     void CancelTimedSnapshot(){};
       
   584 
       
   585     /**
       
   586     Gets a list of the supported snapshot picture formats.
       
   587 
       
   588     @param "aFormats" "An array for the result format list. The array must be created and destroyed by 
       
   589     the caller."
       
   590 
       
   591     @leave "This method may leave with one of the standard error codes."
       
   592     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   593     */
       
   594     void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>&){};
       
   595 
       
   596 
       
   597     /**
       
   598 
       
   599     Notifies the hardware device that the end of input data has been reached and no more input data 
       
   600     will be written. The hardware device can use this signal to ensure that the remaining data gets 
       
   601     processed, without waiting for new data. For example when the data type is not EDuCodedPicture,
       
   602     calling this method is necessary otherwise a hardware device implementation might be looking for 
       
   603     the start code for the next picture to ensure it has a complete picture before starting to decode
       
   604     the previous one. 
       
   605     
       
   606       
       
   607     After the remaining data has been processed (and displayed, if applicable), the hardware 
       
   608     device must notify the proxy with the MdvppStreamEnd() callback.
       
   609 
       
   610     DevVideo clients are encouraged to call this method, but its use is not mandatory for synchronized
       
   611     processing.  For synchronized playback, all video pictures are processed or discarded according to 
       
   612     their timestamps, and so the client can easily infer when processing is complete.  However, it 
       
   613     should be noted that the last picture might not be displayed if this method is not called and the 
       
   614     input data type is not EDuCodedPicture.
       
   615 
       
   616     For non-synchronized playback (e.g. file conversion), a client must call this method otherwise it
       
   617     will never find out when the hardware device has finished processing the data.
       
   618     
       
   619     @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
       
   620     */
       
   621     void InputEnd();
       
   622 
       
   623     /**
       
   624     Retrieves a custom interface to the device.
       
   625     @param  "aInterface"    "Interface UID, defined with the custom interface."
       
   626     @return "Pointer to the interface implementation, or NULL if the device does not 
       
   627             implement the interface requested. The return value must be cast to the 
       
   628             correct type by the user."
       
   629     */
       
   630     TAny* CustomInterface(TUid aInterface);  
       
   631     
       
   632     // === MNGAPostProcSessionManagerObserver ===
       
   633     /**
       
   634     Set the proxy implementation to be used. Called just after the object is constructed.
       
   635     @param  "aProxy"    "The proxy to use."
       
   636     */
       
   637     void BufferAvailable(TInt aBufId, TInt aStatus);
       
   638     
       
   639 public: 
       
   640 
       
   641     // === MMmfVideoBufferManagement ===
       
   642     
       
   643     /** 
       
   644      * Sets the observer object to use. The observer gets notified
       
   645      * when new buffers are available and when buffers need to be
       
   646      * released back to the media device.
       
   647      *
       
   648      * This method can only be called before the media device has
       
   649      * been Initialized with InitializeL().
       
   650      * 
       
   651      * @param aObserver The observer object to use.
       
   652      */
       
   653     void MmvbmSetObserver(MMmfVideoBufferManagementObserver* aObserver);
       
   654     
       
   655     /** 
       
   656      * Enables input buffer management mode. In buffer management mode
       
   657      * the target media device allocates memory for input buffers and
       
   658      * the client can only use input buffers allocated with
       
   659      * MmvbmGetBufferL().
       
   660      *
       
   661      * This method can only be called before the media device has been
       
   662      * Initialized with InitializeL(). This method must be called if
       
   663      * the client uses MmvbmGetBufferL().
       
   664      * 
       
   665      * @param aEnable ETrue if input buffer management mode is used.
       
   666      */
       
   667     void MmvbmEnable(TBool aEnable);
       
   668     
       
   669     /** 
       
   670      * Sets the buffer options to use. The client can request the
       
   671      * number of input buffers that should be available, but typically
       
   672      * only few (one or two) buffers can be used.
       
   673      *
       
   674      * This method can only be called before the media device has been
       
   675      * Initialized with InitializeL().
       
   676      * 
       
   677      * @param aOptions The buffer options to use, see TBufferOptions.
       
   678      *
       
   679      * @leave KErrNotSupported The requested buffer options are not
       
   680      *   supported. Typically the client has requested too many input
       
   681      *   buffers.
       
   682      */
       
   683     void MmvbmSetBufferOptionsL(const TBufferOptions& aOptions);
       
   684     
       
   685     /** 
       
   686      * Gets the buffer options currently in use.
       
   687      *
       
   688      * This method can only be called before the media device has been
       
   689      * Initialized with InitializeL().
       
   690      * 
       
   691      * @param aOptions Target buffer options data structure.
       
   692      */
       
   693     void MmvbmGetBufferOptions(TBufferOptions& aOptions);
       
   694     
       
   695     /** 
       
   696      * Gets a new input picture buffer. The client can then write data
       
   697      * into the buffer and write it back to the media device with
       
   698      * WritePictureL().
       
   699      *
       
   700      * This method can only be called after the media device has been
       
   701      * Initialized with InitializeL(). This method can only be called
       
   702      * in buffer management mode, i.e. if the client has called
       
   703      * MmvbmEnable(ETrue).
       
   704      *
       
   705      * Note that target-allocated and client-allocated input buffers
       
   706      * cannot be mixed. In buffer management mode only input buffers
       
   707      * allocated with this method can be sent to the media device.
       
   708      *
       
   709      * If a client has retrieved buffers with MmvbmGetBufferL(), it
       
   710      * must be prepated to release them synchronously at any point if
       
   711      * MmmfBufferManagementObserver::MmvbmoReleaseBuffers() is
       
   712      * called. This may happen if the target media device suddenly
       
   713      * loses access to the buffers due to DSA abort, resource
       
   714      * management conflict, or media device destruction.
       
   715      * 
       
   716      * @param aSize The requested buffer size, in pixels. The buffer
       
   717      *   size should match the picture size set at initialisation phase,
       
   718      *   or otherwise suitable buffer may not be available. If the size
       
   719      *   is smaller than the size set at initialisation phase, the
       
   720      *   allocated buffer may be larger than requested.
       
   721      * 
       
   722      * @return A new input picture buffer. If no free buffers are
       
   723      * available, the return value is NULL.
       
   724      *
       
   725      * @leave General The method will leave if an error occurs. Lack
       
   726      * of free buffers is not considered an error.
       
   727      */
       
   728     TVideoPicture* MmvbmGetBufferL(const TSize& aSize);
       
   729     
       
   730     /** 
       
   731      * Releases an input buffer back to the media device without using
       
   732      * it. This method is mainly used as a response to a
       
   733      * MmvbmReleaseBuffers() callback.
       
   734      * 
       
   735      * @param aBuffer The buffer to release.
       
   736      */
       
   737     void MmvbmReleaseBuffer(TVideoPicture* aBuffer);    
       
   738     
       
   739 public:
       
   740     
       
   741      // === MMMFVideoSurfaceSupport ===
       
   742     
       
   743 	/** 
       
   744     Requests the media device to use graphics surfaces for video rendering. 
       
   745     The client must call this method before Initialize() to ensure the media 
       
   746     device allocates the right types of resources for rendering.
       
   747     */
       
   748     void MmvssUseSurfaces();
       
   749     
       
   750     /** 
       
   751     Sets a new video surface support observer to receive surface management events 
       
   752     from the media device.
       
   753      
       
   754     @param aObserver New observer object to use.
       
   755     */
       
   756     void MmvssSetObserver(MMMFVideoSurfaceObserver& aObserver);
       
   757     
       
   758     /** 
       
   759     Retrieves surface parameters for a display. The client typically calls this in response 
       
   760     to a MmvsoSurfaceCreated() or MmvsoSurfaceParametersUpdated() observer callback.
       
   761      
       
   762     @param  aSurfaceId
       
   763 	        Surface ID for the display.
       
   764 	@param  aCropRect
       
   765 	        Cropping rectangle within the surface. The crop rectangle identifies the area of 
       
   766 	        the surface that should be shown on the screen.
       
   767 	@param  aPixelAspectRatio
       
   768 	        Video picture pixel aspect ratio.
       
   769 
       
   770 	@leave KErrNotReady if no surface is available for the display.
       
   771     */
       
   772     
       
   773     void MmvssGetSurfaceParametersL(TSurfaceId& aSurfaceId, TRect& aCropRect, 
       
   774     					TVideoAspectRatio& aPixelAspectRatio);
       
   775     /** 
       
   776     Indicates that the surface is no longer in use and can be destroyed. The client typically calls
       
   777     this in response to MmvsoSurfaceCreated() (while old surface is already in use and the current
       
   778     should be removed) or MmvsoRemoveSurface() observer callback.  
       
   779          
       
   780     @param aSurfaceId Surface ID that is no longer in use
       
   781     
       
   782     @leave KErrNotFound if the surface does not exist
       
   783     */
       
   784     void MmvssSurfaceRemovedL(const TSurfaceId& aSurfaceId);    
       
   785 
       
   786 public:    
       
   787 
       
   788     // === MMmfVideoPropertiesObserver ===
       
   789     
       
   790     /** 
       
   791     Decoded video properties updated. The media device implementing the
       
   792     MMmfVideoPropertiesNotifier extension will call this method immediately
       
   793     before outputting a picture with the updated properties.
       
   794     
       
   795     When the extension is used between a decoder and a post-processor media
       
   796     device, the post-processor can associate the changed properties with the
       
   797     correct picture, since the next incoming picture after this call will
       
   798     be the first updated one. 
       
   799     
       
   800     When the extension is used between a DevVideoPlay client and a
       
   801     post-processor media device, the client can synchronously reconfigure
       
   802     video display options using SetScaleOptionsL() and related methods. This
       
   803     lets the client reconfigure the display for the correct picture.
       
   804     
       
   805     @param aYuvFormat Updated YUV format parameters. The updated fields are
       
   806                       iAspectRatioDenom, iAspectRatioNum, and iCoefficients     
       
   807     @param aPictureSize	Updated picture size. This size will be the true
       
   808                        	picture display size, excluding any padding that
       
   809                        	the codec might use.
       
   810     */
       
   811     virtual void MmvpoUpdateVideoProperties(const TYuvFormat& aYuvFormat, const TSize& aPictureSize);
       
   812     
       
   813 public:
       
   814 
       
   815     // === MMmfVideoResourceObserver ===
       
   816     
       
   817     /** 
       
   818     Indicates that a media device has lost its resources. The client must
       
   819     synchronously pause or stop processing before returning from this method
       
   820     so that the media device can release its resources to the system. If
       
   821     the client does not pause or stop, resource loss will be handled as a
       
   822     fatal error.
       
   823      
       
   824     The client may start again or resume after receiving a
       
   825     MvroResourcesRestored() callback.
       
   826      
       
   827     @param aMediaDevice UID for the media device that lost resources. The
       
   828                         client can use this e.g. to determine whether the
       
   829                         decoder or the post-processor lost resources. This
       
   830                         is typically not required though since the client
       
   831                         must pause DevVideo entirely.
       
   832     */
       
   833     virtual void MmvroResourcesLost(TUid aMediaDevice);
       
   834 
       
   835     /** 
       
   836     Indicates that a media device has regained its resources after a
       
   837     previous resource loss. The client can restart or resume processing.
       
   838     This can be done either synchronously or asynchronously.
       
   839      
       
   840     @param aMediaDevice UID for the media device that regained resources.
       
   841     */
       
   842     virtual void MmvroResourcesRestored(TUid aMediaDevice);
       
   843             
       
   844     
       
   845     // === MMmfVideoSurfaceHandleControl ===
       
   846     
       
   847     /** 
       
   848     Sets an external surface ID. This should be called as soon as external surface is created.    
       
   849      
       
   850     @param aSurfaceID external surface ID.
       
   851         
       
   852     */
       
   853     
       
   854     virtual void MmvshcSetSurfaceHandle(const TSurfaceId& aSurfaceHandle);
       
   855     
       
   856     /** 
       
   857     Sets a redraw buffer to be used during resource loss.    
       
   858      
       
   859     @param aRedrawBuffer redraw buffer.
       
   860         
       
   861     */
       
   862      virtual void MmvshcRedrawBufferToSurface(TPtrC8& aRedrawBuffer);
       
   863 public:
       
   864 	// === MMmfVideoPropertiesNotifier ===
       
   865     /** 
       
   866     Sets a new video properties observer. This method can be called at any
       
   867     time after the media device has been instantiated.
       
   868      
       
   869     @param aObserver New observer object.
       
   870     */
       
   871     virtual void MmvpnSetObserver(MMmfVideoPropertiesObserver* aObserver);
       
   872 
       
   873 public:
       
   874 	
       
   875 	void ReturnPicToDecoder(TVideoPicture* aPic);
       
   876 	TInt AttemptToPost();
       
   877 	
       
   878 public:
       
   879     //=== MMdfTrickPlayControl === =     
       
   880     /**        
       
   881      * Query the Direction capabilities from the MDF decoders and       
       
   882      * post processor.       
       
   883      *        
       
   884     */       
       
   885     virtual void MmvprcGetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities);
       
   886 
       
   887     /**       
       
   888      * Sets the playback speed. A negative rate means play backward.       
       
   889      * +/- percentage.       
       
   890      *        
       
   891      */       
       
   892     virtual void MmvprcSetPlayRateL(const TInt aRate);
       
   893 
       
   894     /**       
       
   895      * Gets the playback speed. A negative rate means play backward.       
       
   896      * +/- percentage.       
       
   897      *        
       
   898      */       
       
   899     virtual TInt MmvprcPlayRateL();
       
   900 
       
   901     /**       
       
   902      * Sets the step frame number in frame step mode       
       
   903      * +/- frames       
       
   904      */       
       
   905     virtual void MmvprcStepFrameL(const TInt aStep);
       
   906 
       
   907     /**       
       
   908      * Registers the observer       
       
   909      */       
       
   910     virtual void MmvprcSetObserver(MMmfVideoPlayRateObserver& aObserver); 
       
   911 
       
   912 public: 
       
   913      
       
   914     // === MMmfVideoSecureOutput ===
       
   915     /**
       
   916      * Notifies the media device if the content can only be sent to a
       
   917      * secure output. The device display is typically considered a
       
   918      * secure output, but a high-quality unprotected analog or digital
       
   919      * video output connector is not. By default all content can be
       
   920      * sent to both secure and insecure outputs.
       
   921      *
       
   922      * This method can only be called before the media device has been
       
   923      * initialised with InitializeL().
       
   924      *
       
   925      * @param aSecure Set to ETrue if the content can only be sent to
       
   926      *     a secure output, EFalse if both secure and unsecure outputs can
       
   927      *     be used.
       
   928      *
       
   929      * @leave KErrNotSupported Insecure outputs cannot be
       
   930      * disabled. The client should not play protected content.
       
   931      */    
       
   932      virtual void MmvsoSetSecureOutputL(TBool aSecure);
       
   933 
       
   934 public:
       
   935      //=== AdvancedVideoSecureOutput === =     
       
   936      virtual void MmavsoSetAllowedOutputL(TUint aAllowedOutputMask);
       
   937     
       
   938 protected: 
       
   939 
       
   940     // === CMMFVideoPostProcHwDevice ===
       
   941     /**
       
   942     Set the proxy implementation to be used. Called just after the object is constructed.
       
   943     @param  "aProxy"    "The proxy to use."
       
   944     */
       
   945     void SetProxy(MMMFDevVideoPlayProxy& aProxy);
       
   946     
       
   947 protected:
       
   948 
       
   949     /**
       
   950      *  Symbian 2nd phase constructor .
       
   951      */
       
   952     void ConstructL();
       
   953     
       
   954 private:    
       
   955 	TInt IsTimeToPost(TVideoPicture* frame, TInt64& delta);
       
   956 	TVideoPicture* CreateBuffersL(TInt aBufId);
       
   957     void CreateVBMBuffersL();
       
   958     TInt SetupExternalSurface(const TSurfaceId &aSurfaceID);
       
   959     void ReleaseInputQ();
       
   960     void ReleaseProcessQ();
       
   961     void ReleasePicture(TVideoPicture *pic);
       
   962     void PublishSurfaceCreated();
       
   963     void PublishSurfaceUpdated();
       
   964     TInt SetupSurface(const TSize& aSize);
       
   965     void SetSurfaceAttributes(const TSize& aSize, TInt aNumBuf);
       
   966     TInt GetID(TVideoPicture *aPicture);
       
   967     TInt GetExternalBufferID(TVideoPicture *aPicture);
       
   968     TInt RegisterSurface(const TSurfaceId& aSurfaceId);
       
   969     TInt IsGceReady();
       
   970     void SetTimer(TInt64 aDelta);
       
   971     TInt ConvertPostProcBuffer(TVideoPicture* pSrc, TVideoPicture* pDest);
       
   972     void AddPictureToVBMQ(TVideoPicture *pic);
       
   973     void AddPictureToColorConversionQ(TVideoPicture *pic);
       
   974     void ResetCountingBuffer();
       
   975     void PicturesSkipped();
       
   976     TVideoPicture* DoColorConvert(TVideoPicture* aPicture);
       
   977 
       
   978     /**       
       
   979      Adds a picture to the Input queue. Based on the timestamp of the picture,
       
   980      it is either appeneded at the end of the queue or inserted at the 
       
   981      appropriate position. The queue is arranged in the ascending order. 
       
   982      The ret value indicates if the head of the queue was changed or not.         
       
   983     */  
       
   984     TInt AddToQ(TVideoPicture* aPicture);
       
   985     
       
   986     /**       
       
   987      Removes a picture from Input queue based on the playrate.
       
   988      If the playrate is +ve ie forward playback head will be removed
       
   989      and if the playrate is -ve ie backward playback tail
       
   990      will be removed.         
       
   991     */  
       
   992     void RemoveFromQ();
       
   993     
       
   994     /**       
       
   995      Returns a picture from Input queue based on the playrate.
       
   996      If the playrate is +ve ie forward playback head will be returned
       
   997      and if the playrate is -ve ie backward playback tail  
       
   998      will be returned.       
       
   999     */  
       
  1000     TVideoPicture* PeekQ();
       
  1001 
       
  1002     /**
       
  1003     Adds a surface hint to a video surface. If there is any hint already added, 
       
  1004     the surface is updated with the new hint. 
       
  1005     */		
       
  1006     TInt AddHints();
       
  1007     
       
  1008 	#ifdef _DUMP_YUV_FRAMES
       
  1009     void captureYuv(TVideoPicture* aPicture);
       
  1010     #endif
       
  1011 
       
  1012 private:
       
  1013 
       
  1014     //
       
  1015     // C++ default constructor.  
       
  1016     //
       
  1017     CNGAPostProcHwDevice();
       
  1018 
       
  1019     //
       
  1020     // State of post processor
       
  1021     //
       
  1022     enum TPPState
       
  1023     {
       
  1024         EInitializing,
       
  1025         EInitialized,
       
  1026         EPlaying,
       
  1027         EPaused,
       
  1028         EStopped
       
  1029     };
       
  1030     
       
  1031     enum TTimeToPost
       
  1032     {
       
  1033         ESkipIt = -1,
       
  1034         EPostIt = 0,
       
  1035         EDelayIt = 1,
       
  1036     };
       
  1037     
       
  1038 private: 
       
  1039 
       
  1040     MMMFDevVideoPlayProxy*      				iProxy;															
       
  1041     CMMFVideoDecodeHwDevice*    				iInputDecoderDevice;															
       
  1042     RArray<TVideoPicture*>              		iInputQ;															
       
  1043     RArray<TVideoPicture*>              		iProcessQ;															
       
  1044     MMMFClockSource*            				iClockSource;															
       
  1045     TTimeIntervalMicroSeconds					iCurrentPlaybackPosition;															
       
  1046     TPPState        							iPPState;															
       
  1047     CNGAPostProcSurfaceHandler*					iSurfaceHandler;
       
  1048     CNGAPostProcSessionManager*					iSessionManager;
       
  1049 	
       
  1050 	RSurfaceManager::TSurfaceCreationAttributesBuf	iAttributes;
       
  1051 	RChunk										iChunk;
       
  1052 	RSurfaceManager::TInfoBuf 					iInfo;
       
  1053 	TSurfaceId									iSurfaceId;
       
  1054 	TSurfaceId									iRedrawSurfaceId;
       
  1055 	TBool           							iIsInputEnded;
       
  1056 	CNGAPostProcTimer*							iPostingTimer;
       
  1057 	CMMFDevVideoPlay::TPictureCounters  		iPictureCounters;
       
  1058 	TBool 										iFirstPictureUpdated;
       
  1059 	TBool 										iUsingExternalSurface;
       
  1060     TBool           							iIsColorConversionNeeded;
       
  1061     RArray<TVideoPicture*>              		iColorConversionQ;
       
  1062     TBool 										iSurfaceCreatedEventPublished;
       
  1063     TInt                                		iOverflowPictureCounter;
       
  1064     TInt 								    	iVideoFrameBufSize;	
       
  1065     TBool 										iResourceLost;
       
  1066     
       
  1067     //-- members for buffer management --
       
  1068     MMmfVideoBufferManagementObserver*  		iVBMObserver;
       
  1069     TBufferOptions                      		iVBMBufferOptions;
       
  1070     RArray<TVideoPicture*>              		iVBMBufferReferenceQ;
       
  1071     RArray<TVideoPicture*>              		iVBMBufferQ;
       
  1072     TBool                               		iVBMEnabled;
       
  1073     RArray<TUncompressedVideoFormat>    		iSupportedInputFormats;
       
  1074     TInt										count;
       
  1075     
       
  1076     //-- members for Surface Hints --
       
  1077     RSurfaceManager::THintPair					iHint;
       
  1078     TUint 										iSurfaceMask;
       
  1079     TUid										iSurfaceKey;
       
  1080             
       
  1081     //-- members for Surface support --
       
  1082     MMMFVideoSurfaceObserver*					iVideoSurfaceObserver;
       
  1083 	MMmfVideoPropertiesObserver*				iVPObserver;
       
  1084 	RWsSession									iWsSession;
       
  1085 	TSize										iPicSize;
       
  1086 	//-- members for Trickplay support --
       
  1087 	TInt                                iStepFrameCount;
       
  1088     TInt                                iPlayRate;       
       
  1089     TBool                               iKeyFrameMode;       
       
  1090     MMmfVideoPlayRateObserver*          iFPObserver;       
       
  1091     TUint8                              iSkippedFramesCountingBuffer[64];       
       
  1092     TUint8                              iSkippedFramesInLast64Frames;       
       
  1093     TUint8                              iCurrentPosInFramesCountingBuffer; 
       
  1094 };    
       
  1095 
       
  1096 /**
       
  1097  * Timer of Posting
       
  1098  */
       
  1099 
       
  1100 class CNGAPostProcTimer: public CTimer
       
  1101     {
       
  1102 public:
       
  1103     static CNGAPostProcTimer* NewL( CNGAPostProcHwDevice& aParent );
       
  1104     ~CNGAPostProcTimer();
       
  1105     
       
  1106 protected:    
       
  1107     void RunL();
       
  1108     
       
  1109 private:
       
  1110     CNGAPostProcTimer( CNGAPostProcHwDevice& aParent );
       
  1111     void ConstructL();
       
  1112     
       
  1113 private:
       
  1114     CNGAPostProcHwDevice& iParent;
       
  1115 };
       
  1116 
       
  1117 #endif //__NGAPOSTPROCHWDEVICE_H__
       
  1118