os/mm/mdfdevvideoextensions/nga_mdf_postprocessor_shai/inc/NGAPostProcHwDevice.h
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/mm/mdfdevvideoextensions/nga_mdf_postprocessor_shai/inc/NGAPostProcHwDevice.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,1161 @@
     1.4 +/*
     1.5 +* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef __NGAPOSTPROCHWDEVICE_H__
    1.23 +#define __NGAPOSTPROCHWDEVICE_H__
    1.24 +
    1.25 +#include <e32std.h> 
    1.26 +#include <w32std.h>
    1.27 +#include <e32base.h>
    1.28 +#include <e32def.h>
    1.29 +#include <e32cmn.h>
    1.30 +#include <stdio.h>
    1.31 +#include <string.h>
    1.32 +#include <stdarg.h>
    1.33 +
    1.34 +#include <mmf/devvideo/videoplayhwdevice.h>
    1.35 +#include <mmf/devvideo/devvideostandardcustominterfaces.h>
    1.36 +#include <mmf/devvideo/devvideovideosurfacecustominterface.h>
    1.37 +#include <graphics/surfacemanager.h> //RSurfaceManager
    1.38 +#include <graphics/surface.h> //TSurfaceId
    1.39 +#include <mmf/common/mmfvideo.h> //TVideoAspectRatio
    1.40 +//TBC++
    1.41 +//#include <mmf/devvideo/devvideosurfacehandlecustominterface.h>
    1.42 +#include "devvideosurfacehandlecustominterface.h"
    1.43 +#include "postinitializeci.h"
    1.44 +//TBC--
    1.45 +#include <mmf/devvideo/devvideoplayratecustominterface.h>  
    1.46 +#include <surface_hints.h>
    1.47 +#include <secureoutputci.h>
    1.48 +#include <advancedsecureoutputci.h>
    1.49 +#include <graphics/suerror.h>
    1.50 +
    1.51 +#include "fetchframecustominterface.h"
    1.52 +#include "MdfRDebug.h"
    1.53 +#include "NGAPostProcHwDevice_UID.hrh"
    1.54 +#include "NGAPostProcSessionManagerObserver.h"
    1.55 +#include "common.h"
    1.56 +
    1.57 +class CNGAPostProcSessionManager;
    1.58 +class CNGAPostProcSurfaceHandler;
    1.59 +class CNGAPostProcTimer;
    1.60 +class RWsSession;
    1.61 +
    1.62 +class CNGAPostProcHwDevice: public CMMFVideoPostProcHwDevice,
    1.63 +							public MMmfVideoBufferManagement,
    1.64 +							public MNGAPostProcSessionManagerObserver,
    1.65 +							public MMMFVideoSurfaceSupport,
    1.66 +							public MMmfVideoPropertiesObserver,
    1.67 +							public MMmfVideoResourceObserver,
    1.68 +							public MMmfVideoSurfaceHandleControl,
    1.69 +							public MMmfVideoPropertiesNotifier,
    1.70 +							public MMmfVideoPlayRateControl,
    1.71 +							public MMmfVideoSecureOutput,
    1.72 +							public MMmfAdvancedVideoSecureOutput,
    1.73 +							public MMmfPostInitializeRequest
    1.74 +{
    1.75 +
    1.76 +public: 
    1.77 +    //  === Constructors and destructor ===
    1.78 +    /**
    1.79 +    * Two-phased constructor.   
    1.80 +    * @return pointer to an instance of CMMFVideoPostProcHwDevice
    1.81 +    */
    1.82 +    static CMMFVideoPostProcHwDevice* NewL();
    1.83 +
    1.84 +    /**
    1.85 +    * Destructor.
    1.86 +    */
    1.87 +    ~CNGAPostProcHwDevice();
    1.88 +
    1.89 +public: 
    1.90 +    
    1.91 +    // === CMMFVideoPostProcHwDevice ===
    1.92 +    
    1.93 +    /**
    1.94 +    Sets the device input format to an uncompressed video format.
    1.95 +
    1.96 +    @param  "aFormat"   "The input format to use."
    1.97 +    @leave  "The method will leave if an error occurs. Typical error codes used:
    1.98 +            * KErrNotSupported - The input format is not supported."    
    1.99 +    @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
   1.100 +    */
   1.101 +    void SetInputFormatL(const TUncompressedVideoFormat& aFormat);
   1.102 +
   1.103 +    /**
   1.104 +    Sets the decoder device that will write data to this post-processor. Decoded pictures will be 
   1.105 +    written with WritePictureL() or through a custom interface. After pictures have been processed, 
   1.106 +    they must be returned to the decoder using ReturnPicture().
   1.107 +
   1.108 +    @param  "aDevice"   "The decoder source plug-in to use."
   1.109 +    @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
   1.110 +    */
   1.111 +    void SetInputDevice(CMMFVideoDecodeHwDevice* aDevice);
   1.112 +
   1.113 +    /**
   1.114 +    Writes an uncompressed video picture to the post-processor. The picture must be returned to the 
   1.115 +    client or source plug-in after it has been used.
   1.116 +
   1.117 +    @param  "aPicture"  "The picture to write."
   1.118 +    @leave  "This method may leave with one of the system-wide error codes."
   1.119 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.120 +    */
   1.121 +    void WritePictureL(TVideoPicture* aPicture);    
   1.122 +
   1.123 +    /**
   1.124 +    Retrieves post-processing information about this hardware device. 
   1.125 +    The device creates a CPostProcessorInfo structure, fills it with correct data, pushes it 
   1.126 +    to the cleanup stack and returns it. The client will delete the object when it is no 
   1.127 +    longer needed.
   1.128 +
   1.129 +    @return "Post-processor information as a CPostProcessorInfo object. 
   1.130 +            The object is pushed to the cleanup stack, and must be deallocated by the caller."
   1.131 +    @leave  "This method may leave with one of the system-wide error codes.
   1.132 +    */
   1.133 +    CPostProcessorInfo* PostProcessorInfoLC();
   1.134 +
   1.135 +    /**
   1.136 +    Retrieves the list of the output formats that the device supports. The list is ordered in 
   1.137 +    plug-in preference order, with the preferred formats at the beginning of the list. The list 
   1.138 +    can depend on the device source format, and therefore SetSourceFormatL() must be called before 
   1.139 +    calling this method.
   1.140 +
   1.141 +    @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
   1.142 +    @leave  "This method may leave with one of the system-wide error codes.
   1.143 +    @pre    "This method may only be called before the hwdevice has been initialized using Initialize()."
   1.144 +    */
   1.145 +    void GetOutputFormatListL(RArray<TUncompressedVideoFormat>& aFormats);
   1.146 +
   1.147 +    /**
   1.148 +    Sets the device output format.
   1.149 +
   1.150 +    @param  "aFormat" "The format to use."
   1.151 +    @leave  "This method may leave with one of the system-wide error codes.
   1.152 +    @pre    "This method may only be called before the hwdevice has been initialized using Initialize()."
   1.153 +    */
   1.154 +    void SetOutputFormatL(const TUncompressedVideoFormat &aFormat);
   1.155 +
   1.156 +    /**
   1.157 +    Sets the clock source to use for video timing. If no clock source is set. video playback 
   1.158 +    will not be synchronized, but will proceed as fast as possible, depending on input data 
   1.159 +    and output buffer availability. 
   1.160 +
   1.161 +    @param  "aClock" "The clock source to be used."
   1.162 +    @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
   1.163 +    */
   1.164 +    void SetClockSource(MMMFClockSource* aClock);
   1.165 +
   1.166 +    /**
   1.167 +    Sets the device video output destination. The destination can be the screen (using direct 
   1.168 +    screen access) or memory buffers. By default memory buffers are used. If data is written 
   1.169 +    to another device, this method is ignored, and suitable memory buffers are always used.
   1.170 +    
   1.171 +    @param  "aScreen" "True if video output destination is the screen, false if memory buffers."
   1.172 +    @leave  "This method may leave with one of the system-wide error codes.
   1.173 +    @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
   1.174 +    */
   1.175 +    void SetVideoDestScreenL(TBool aScreen);
   1.176 +
   1.177 +    /**
   1.178 +    Sets the post-processing types to be used.
   1.179 +
   1.180 +    @param  "aPostProcCombination" "The post-processing steps to perform, a bitwise OR of values from TPostProcessType."
   1.181 +    @leave  "This method may leave with one of the system-wide error codes.
   1.182 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.183 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.184 +    */
   1.185 +    void SetPostProcessTypesL(TUint32 aPostProcCombination);
   1.186 +
   1.187 +    /**
   1.188 +    Sets post-processing options for input (pan-scan) cropping.
   1.189 +
   1.190 +    @param  "aRect" "The cropping rectangle to use."
   1.191 +    @leave  "This method may leave with one of the system-wide error codes.
   1.192 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.193 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.194 +    */
   1.195 +    void SetInputCropOptionsL(const TRect& aRect);
   1.196 +
   1.197 +    /**
   1.198 +    Sets post-processing options for YUV to RGB color space conversion. 
   1.199 +    Specifies the input YUV and output RGB formats to use explicitly. SetSourceFormatL(), 
   1.200 +    SetOutputFormatL(), and SetPostProcessTypesL() must be called before this method is used.
   1.201 +
   1.202 +    @param  "aOptions"      "The conversion options to use."
   1.203 +    @param  "aYuvFormat"    "Conversion source YUV format"
   1.204 +    @param  "aRgbFormat"    "Conversion target RGB format"
   1.205 +    @leave  "This method may leave with one of the system-wide error codes.
   1.206 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.207 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.208 +    */
   1.209 +    void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, 
   1.210 +                                TRgbFormat aRgbFormat);
   1.211 +
   1.212 +    /**
   1.213 +    Sets post-processing options for YUV to RGB color space conversion.
   1.214 +    Uses the device input and output formats. For decoder devices the default YUV format used is 
   1.215 +    the format specified in the input bitstream. SetSourceFormatL(), SetOutputFormatL(), and 
   1.216 +    SetPostProcessTypesL() must be called before this method is used.
   1.217 +
   1.218 +    @param  "aOptions"      "The conversion options to use."
   1.219 +    @leave  "This method may leave with one of the system-wide error codes.
   1.220 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.221 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.222 +    */
   1.223 +    void SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions);
   1.224 +
   1.225 +    /**
   1.226 +    Sets post-processing options for rotation. SetPostProcessTypesL() must be called before 
   1.227 +    this method is used.
   1.228 +
   1.229 +    @param  "aRotationType" "The rotation to perform."  
   1.230 +    @leave  "This method may leave with one of the system-wide error codes.
   1.231 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.232 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.233 +    */
   1.234 +    void SetRotateOptionsL(TRotationType aRotationType);
   1.235 +
   1.236 +    /**
   1.237 +    Sets post-processing options for scaling. SetPostProcessTypesL() must be called before 
   1.238 +    this method is used.
   1.239 +    
   1.240 +    @param  "aTargetSize"           "Scaling target size. If a fixed scale factor size is used, 
   1.241 +                                    the new dimensions must be set to width=floor(factor*width), 
   1.242 +                                    height=floor(factor*height). For example, scaling a 
   1.243 +                                    QCIF (176x144) picture up by a factor of 4/3 yields a size 
   1.244 +                                    of 234x192."
   1.245 +    @param  "aAntiAliasFiltering"   "True if anti-aliasing filtering should be used. 
   1.246 +                                    If the post-processor does not support anti-aliased scaling, 
   1.247 +                                    or supports anti-aliased scaling only, this argument is ignored."
   1.248 +    @leave  "This method may leave with one of the system-wide error codes.
   1.249 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.250 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.251 +    */
   1.252 +    void SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering);
   1.253 +
   1.254 +    /**
   1.255 +    Sets post-processing options for output cropping. SetPostProcessTypesL() must be called before 
   1.256 +    this method is used.
   1.257 +    
   1.258 +    @param  "aRect" "Output cropping area."
   1.259 +    @leave  "This method may leave with one of the system-wide error codes.
   1.260 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.261 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.262 +    */
   1.263 +    void SetOutputCropOptionsL(const TRect& aRect);
   1.264 +
   1.265 +    /**
   1.266 +    Sets post-processing plug-in specific options. SetPostProcessTypesL() must be called before 
   1.267 +    this method is used.
   1.268 +
   1.269 +    @param  "aOptions" "The options. The format is plug-in specific."
   1.270 +    @leave  "This method may leave with one of the system-wide error codes.
   1.271 +    @pre    "This method can be called either before or after the hwdevice has been initialized with Initialize().
   1.272 +            If called after initialization, the change must only be committed when CommitL() is called."
   1.273 +    */
   1.274 +    void SetPostProcSpecificOptionsL(const TDesC8& aOptions);
   1.275 +
   1.276 +    /**
   1.277 +    Initializes the device. This method is asynchronous, the device will call 
   1.278 +    MMFVideoPlayProxy::MdvppInitializeComplete() after initialization has completed. After this 
   1.279 +    method has successfully completed, further configuration changes are not possible except where 
   1.280 +    separately noted.
   1.281 +    */
   1.282 +    void Initialize();
   1.283 +
   1.284 +    /**
   1.285 +    Commit all changes since the last CommitL(), Revert() or Initialize()
   1.286 +    to the hardware device.  This only applies to methods which can be called both
   1.287 +    before AND after DevVideoPlay has been initialized.
   1.288 +
   1.289 +    @see    SetPostProcessTypesL
   1.290 +    @see    SetInputCropOptionsL
   1.291 +    @see    SetYuvToRgbOptionsL
   1.292 +    @see    SetRotateOptionsL
   1.293 +    @see    SetScaleOptionsL
   1.294 +    @see    SetOutputCropOptionsL
   1.295 +    @see    SetPostProcSpecificOptionsL
   1.296 +
   1.297 +    @leave  "The method will leave if an error occurs."
   1.298 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.299 +    */
   1.300 +    void CommitL();
   1.301 +
   1.302 +    /**
   1.303 +    Revert all changes since the last CommitL(), Revert() or Initialize()
   1.304 +    back to their previous settings.  This only applies to methods which can 
   1.305 +    be called both before AND after DevVideoPlay has been initialized.
   1.306 +
   1.307 +    @see    SetPostProcessTypesL
   1.308 +    @see    SetInputCropOptionsL
   1.309 +    @see    SetYuvToRgbOptionsL
   1.310 +    @see    SetRotateOptionsL
   1.311 +    @see    SetScaleOptionsL
   1.312 +    @see    SetOutputCropOptionsL
   1.313 +    @see    SetPostProcSpecificOptionsL
   1.314 +
   1.315 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.316 +    */
   1.317 +    void Revert();
   1.318 +
   1.319 +    /**
   1.320 +    Starts writing output directly to the display frame buffer using Direct Screen Access.
   1.321 +
   1.322 +    @param  "aVideoRect"    "The video output rectangle on screen."
   1.323 +    @param  "aScreenDevice" "The screen device to use. The screen device object must be valid in the current thread."
   1.324 +    @param  "aClipRegion"   "Initial clipping region to use."
   1.325 +    
   1.326 +    @leave  "This method may leave with one of the system-wide error codes.
   1.327 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.328 +    */
   1.329 +    void StartDirectScreenAccessL(const TRect& aVideoRect, 
   1.330 +        CFbsScreenDevice& aScreenDevice, const TRegion& aClipRegion);
   1.331 +
   1.332 +    /**
   1.333 +    Sets a new clipping region for Direct Screen Access. After the method returns, no video will 
   1.334 +    be drawn outside of the region. If clipping is not supported, or the clipping region is too 
   1.335 +    complex, either playback will pause or will resume without video display, depending on the 
   1.336 +    current setting of SetPauseOnClipFail(), and the result can be verified with IsPlaying(). 
   1.337 +    Clipping can be disabled by setting a new clipping region that includes the whole video window.
   1.338 +
   1.339 +    @param  "aRegion" "The new clipping region. After the method returns, no video will be drawn outside the region."
   1.340 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.341 +    */
   1.342 +    void SetScreenClipRegion(const TRegion& aRegion);
   1.343 +
   1.344 +    /**
   1.345 +    Sets whether the system should pause playback when it gets a clipping region it cannot handle, 
   1.346 +    or Direct Screen Access is aborted completely. If not, processing will proceed normally, but no 
   1.347 +    video will be drawn. By default, playback is paused.
   1.348 +
   1.349 +    @param "aPause" "True if playback should be paused when clipping fails, false if not. 
   1.350 +                    If playback is not paused, it will be continued without video display."
   1.351 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.352 +    */
   1.353 +    void SetPauseOnClipFail(TBool aPause);
   1.354 +
   1.355 +    /**
   1.356 +    Aborts Direct Screen Access completely, to be called from MAbortDirectScreenAccess::AbortNow() 
   1.357 +    and similar methods. DSA can be resumed by calling StartDirectScreenAccessL().
   1.358 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.359 +    */
   1.360 +    void AbortDirectScreenAccess();
   1.361 +
   1.362 +    /**
   1.363 +    Indicates whether playback is proceeding. This method can be used to check whether playback was 
   1.364 +    paused or not in response to a new clipping region or DSA abort.
   1.365 +
   1.366 +    @return "ETrue if video is still being played (even if not necessarily displayed)."
   1.367 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.368 +    */
   1.369 +    TBool IsPlaying();
   1.370 +
   1.371 +    /**
   1.372 +    Re-draws the latest video picture. Only available when DSA is being used. If DSA is aborted or a 
   1.373 +    non-supported clipping region has been set, the request may be ignored.
   1.374 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.375 +    */
   1.376 +    void Redraw();
   1.377 +
   1.378 +
   1.379 +    /**
   1.380 +    Starts video playback, including decoding, post-processing, and rendering. Playback will proceed 
   1.381 +    until it has been stopped or paused, or the end of the bitstream is reached.
   1.382 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.383 +    */
   1.384 +    void Start();
   1.385 +
   1.386 +    /**
   1.387 +    Stops video playback. No new pictures will be decoded, post-processed, or rendered.
   1.388 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.389 +    */
   1.390 +    void Stop();
   1.391 +
   1.392 +    /**
   1.393 +    Pauses video playback, including decoding, post-processing, and rendering. No pictures will be 
   1.394 +    decoded, post-processed, or rendered until playback has been resumed.
   1.395 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.396 +    */
   1.397 +    void Pause();
   1.398 +
   1.399 +    /**
   1.400 +    Resumes video playback after a pause.
   1.401 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.402 +    */
   1.403 +    void Resume();
   1.404 +
   1.405 +    /**
   1.406 +    Changes to a new decoding and playback position, used for randomly accessing (seeking) the 
   1.407 +    input stream. The position change flushes all input and output buffers. Pre-decoder and 
   1.408 +    post-decoder buffering are handled as if a new bitstream was being decoded. If the device still
   1.409 +    has buffered pictures that precede the new playback position, they will be discarded. If playback
   1.410 +    is synchronized to a clock source, the client is responsible for setting the clock source to the 
   1.411 +    new position.
   1.412 +    
   1.413 +    @param "aPlaybackPosition" "The new playback position in the video stream."
   1.414 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.415 +    */
   1.416 +    void SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition);
   1.417 +
   1.418 +    /**
   1.419 +    Freezes a picture on the screen. After the picture has been frozen, no new pictures are 
   1.420 +    displayed until the freeze is released with ReleaseFreeze(). If the device output is being 
   1.421 +    written to memory buffers or to another plug-in, instead of the screen, no decoded pictures 
   1.422 +    will be delivered while the freeze is active, and they are simply discarded.
   1.423 +
   1.424 +    @param "aTimestamp" "The presentation timestamp of the picture to freeze. The frozen picture 
   1.425 +                        will be the first picture with a timestamp greater than or equal to this 
   1.426 +                        parameter."
   1.427 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.428 +    */
   1.429 +    void FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp);
   1.430 +
   1.431 +    /**
   1.432 +    Releases a picture frozen with FreezePicture().
   1.433 +
   1.434 +    @param "aTimestamp" "The presentation timestamp of the picture to release. The first picture 
   1.435 +                        displayed after the release will be the first picture with a timestamp 
   1.436 +                        greater than or equal to this parameter. To release the freeze immediately, 
   1.437 +                        set the timestamp to zero."
   1.438 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.439 +    */
   1.440 +    void ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp);
   1.441 +
   1.442 +
   1.443 +    /**
   1.444 +    Returns the current playback position, i.e. the timestamp for the most recently displayed or 
   1.445 +    virtually displayed picture. If the device output is written to another device, the most recent 
   1.446 +    output picture is used.
   1.447 +
   1.448 +    @return "Current playback position."
   1.449 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.450 +    */
   1.451 +    TTimeIntervalMicroSeconds PlaybackPosition();
   1.452 +
   1.453 +    /**
   1.454 +    Returns the total amount of memory allocated for uncompressed pictures. This figure only 
   1.455 +    includes the pictures actually allocated by the plug-in itself, so that the total number of 
   1.456 +    bytes allocated in the system can be calculated by taking the sum of the values from all plug-ins.
   1.457 +
   1.458 +    @return "Total number of bytes of memory allocated for uncompressed pictures."
   1.459 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.460 +    */
   1.461 +    TUint PictureBufferBytes();
   1.462 +
   1.463 +    /**
   1.464 +    Reads various counters related to decoded pictures. The counters are reset when Initialize() 
   1.465 +    or this method is called, and thus they only include pictures processed since the last call.
   1.466 +
   1.467 +    Post-processor devices return the number of input pictures in iPicturesDecoded and 
   1.468 +    iTotalPictures. If the decoded pictures are written to another plug-in, they are considered 
   1.469 +    to be "virtually displayed".
   1.470 +
   1.471 +    @param "aCounters" "The counter structure to fill."
   1.472 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.473 +    */
   1.474 +    void GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters);
   1.475 +
   1.476 +
   1.477 +    /**
   1.478 +    Sets the computational complexity level to use. If separate complexity levels are not available, 
   1.479 +    the method call is ignored. If the level specified is not available, the results are undefined. 
   1.480 +    Typically the device will either ignore the request or use the nearest suitable level.
   1.481 +
   1.482 +    The complexity level can be changed at any point during playback.
   1.483 +
   1.484 +    @param "aLevel" "The computational complexity level to use. Level zero (0) is the most complex 
   1.485 +                    one, with the highest quality. Higher level numbers require less processing 
   1.486 +                    and may have lower quality."
   1.487 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.488 +    */
   1.489 +    void SetComplexityLevel(TUint aLevel);
   1.490 +
   1.491 +    /**
   1.492 +    Gets the number of complexity levels available.
   1.493 +    
   1.494 +    @return "The number of complexity control levels available, or zero if the information is not 
   1.495 +            available yet. The information may not be available if the number of levels depends on 
   1.496 +            the input data, and enough input data has not been read yet. In that case, using level 
   1.497 +            zero is safe."
   1.498 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.499 +    */
   1.500 +    TUint NumComplexityLevels();
   1.501 +
   1.502 +    /**
   1.503 +    Gets information about a computational complexity level. This method can be called after 
   1.504 +    NumComplexityLevels() has returned a non-zero value - at that point the information is guaranteed 
   1.505 +    to be available. Some hardware device implementations may not be able to provide all values, 
   1.506 +    in that case the values will be approximated.
   1.507 +
   1.508 +    @param "aLevel" "The computational complexity level to query. The level numbers range from zero 
   1.509 +                    (the most complex) to NumComplexityLevels()-1."
   1.510 +    @param "aInfo"  "The information structure to fill."
   1.511 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.512 +    */
   1.513 +    void GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo);
   1.514 +
   1.515 +    /**
   1.516 +    Returns a picture back to the device. This method is called by CMMFDevVideoPlay to return pictures 
   1.517 +    from the client (after they have been written with NewPicture()), or by the output device when 
   1.518 +    it has finished using a picture.
   1.519 +
   1.520 +    @param "aPicture" "The picture to return. The device can re-use the memory for the picture."
   1.521 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.522 +    */
   1.523 +    void ReturnPicture(TVideoPicture* aPicture);
   1.524 +
   1.525 +    /**
   1.526 +    Gets a copy of the latest picture sent to output.
   1.527 +
   1.528 +    @param "aPictureData"   "Target picture. The memory for the picture must be allocated by the 
   1.529 +                            caller, and initialized properly. The data formats must match the snapshot 
   1.530 +                            format requested."
   1.531 +    @param "aFormat"        "The picture format to use for the snapshot."
   1.532 +
   1.533 +    @return "ETrue if the snapshot was taken, EFalse if a picture is not available. The picture may not 
   1.534 +            be available if decoding has not progressed far enough yet."
   1.535 +
   1.536 +    @leave  "The method will leave if an error occurs. Typical error codes used:
   1.537 +            * KErrNotSupported - The requested data format or picture size is not supported, or the 
   1.538 +            plug-in does not support snapshots."
   1.539 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.540 +    */
   1.541 +//  TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat) {return EFalse;};
   1.542 +    TBool GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat);
   1.543 +
   1.544 +    /**
   1.545 +    When the snapshot is available, it will be returned to the client using the TimedSnapshotComplete()
   1.546 +    callback. To cancel a timed snapshot request, use CancelTimedSnapshot(). Only one timed snapshot 
   1.547 +    request can be active at a time.
   1.548 +
   1.549 +    @param "aPictureData"           "Target picture. The memory for the picture must be allocated by 
   1.550 +                                    the caller, and initialized properly. The data formats must match 
   1.551 +                                    the snapshot format requested. The picture must remain valid until 
   1.552 +                                    the snapshot has been taken or until the request has been cancelled 
   1.553 +                                    with CancelTimedSnapshot()."
   1.554 +    @param "aFormat"                "The picture format to use for the snapshot."
   1.555 +    @param "aPresentationTimestamp" "Presentation timestamp for the picture to copy."
   1.556 +
   1.557 +    @leave  "The method will leave if an error occurs. Typical error codes used:
   1.558 +            * KErrNotSupported - The requested data format or picture size is not supported or 
   1.559 +            the plug-in does not support timed snapshots."
   1.560 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.561 +    */
   1.562 +    //void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, 
   1.563 +    //                        const TTimeIntervalMicroSeconds& aPresentationTimestamp){};
   1.564 +    void GetTimedSnapshotL(TPictureData*, const TUncompressedVideoFormat&, const TTimeIntervalMicroSeconds&){};
   1.565 +
   1.566 +
   1.567 +    /**
   1.568 +    When the snapshot is available, it will be returned to the client using the TimedSnapshotComplete()
   1.569 +    callback. To cancel a timed snapshot request, use CancelTimedSnapshot(). Only one timed snapshot 
   1.570 +    request can be active at a time.
   1.571 +
   1.572 +    @param "aPictureData"           "Target picture. The memory for the picture must be allocated by 
   1.573 +                                    the caller, and initialized properly. The data formats must match 
   1.574 +                                    the snapshot format requested. The picture must remain valid until 
   1.575 +                                    the snapshot has been taken or until the request has been cancelled 
   1.576 +                                    with CancelTimedSnapshot()."
   1.577 +    @param "aFormat"                "The picture format to use for the snapshot."
   1.578 +    @param "aPictureId"             "Picture identifier for the picture to copy."
   1.579 +
   1.580 +    @leave  "The method will leave if an error occurs. Typical error codes used:
   1.581 +            * KErrNotSupported - The requested data format or picture size is not supported or 
   1.582 +            the plug-in does not support timed snapshots."
   1.583 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.584 +    */
   1.585 +//    void GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, 
   1.586 +//                            const TPictureId& aPictureId){};
   1.587 +    void GetTimedSnapshotL(TPictureData*, const TUncompressedVideoFormat&, const TPictureId& ){};
   1.588 +
   1.589 +    /**
   1.590 +    Cancels a timed snapshot request.
   1.591 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.592 +    */
   1.593 +    void CancelTimedSnapshot(){};
   1.594 +
   1.595 +    /**
   1.596 +    Gets a list of the supported snapshot picture formats.
   1.597 +
   1.598 +    @param "aFormats" "An array for the result format list. The array must be created and destroyed by 
   1.599 +    the caller."
   1.600 +
   1.601 +    @leave "This method may leave with one of the standard error codes."
   1.602 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.603 +    */
   1.604 +    void GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>&){};
   1.605 +
   1.606 +
   1.607 +    /**
   1.608 +
   1.609 +    Notifies the hardware device that the end of input data has been reached and no more input data 
   1.610 +    will be written. The hardware device can use this signal to ensure that the remaining data gets 
   1.611 +    processed, without waiting for new data. For example when the data type is not EDuCodedPicture,
   1.612 +    calling this method is necessary otherwise a hardware device implementation might be looking for 
   1.613 +    the start code for the next picture to ensure it has a complete picture before starting to decode
   1.614 +    the previous one. 
   1.615 +    
   1.616 +      
   1.617 +    After the remaining data has been processed (and displayed, if applicable), the hardware 
   1.618 +    device must notify the proxy with the MdvppStreamEnd() callback.
   1.619 +
   1.620 +    DevVideo clients are encouraged to call this method, but its use is not mandatory for synchronized
   1.621 +    processing.  For synchronized playback, all video pictures are processed or discarded according to 
   1.622 +    their timestamps, and so the client can easily infer when processing is complete.  However, it 
   1.623 +    should be noted that the last picture might not be displayed if this method is not called and the 
   1.624 +    input data type is not EDuCodedPicture.
   1.625 +
   1.626 +    For non-synchronized playback (e.g. file conversion), a client must call this method otherwise it
   1.627 +    will never find out when the hardware device has finished processing the data.
   1.628 +    
   1.629 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
   1.630 +    */
   1.631 +    void InputEnd();
   1.632 +
   1.633 +    /**
   1.634 +    Retrieves a custom interface to the device.
   1.635 +    @param  "aInterface"    "Interface UID, defined with the custom interface."
   1.636 +    @return "Pointer to the interface implementation, or NULL if the device does not 
   1.637 +            implement the interface requested. The return value must be cast to the 
   1.638 +            correct type by the user."
   1.639 +    */
   1.640 +    TAny* CustomInterface(TUid aInterface);  
   1.641 +    
   1.642 +    // === MNGAPostProcSessionManagerObserver ===
   1.643 +    /**
   1.644 +    Set the proxy implementation to be used. Called just after the object is constructed.
   1.645 +    @param  "aProxy"    "The proxy to use."
   1.646 +    */
   1.647 +    void BufferAvailable(TInt aBufId, TInt aStatus);
   1.648 +    
   1.649 +public: 
   1.650 +
   1.651 +    // === MMmfVideoBufferManagement ===
   1.652 +    
   1.653 +    /** 
   1.654 +     * Sets the observer object to use. The observer gets notified
   1.655 +     * when new buffers are available and when buffers need to be
   1.656 +     * released back to the media device.
   1.657 +     *
   1.658 +     * This method can only be called before the media device has
   1.659 +     * been Initialized with InitializeL().
   1.660 +     * 
   1.661 +     * @param aObserver The observer object to use.
   1.662 +     */
   1.663 +    void MmvbmSetObserver(MMmfVideoBufferManagementObserver* aObserver);
   1.664 +    
   1.665 +    /** 
   1.666 +     * Enables input buffer management mode. In buffer management mode
   1.667 +     * the target media device allocates memory for input buffers and
   1.668 +     * the client can only use input buffers allocated with
   1.669 +     * MmvbmGetBufferL().
   1.670 +     *
   1.671 +     * This method can only be called before the media device has been
   1.672 +     * Initialized with InitializeL(). This method must be called if
   1.673 +     * the client uses MmvbmGetBufferL().
   1.674 +     * 
   1.675 +     * @param aEnable ETrue if input buffer management mode is used.
   1.676 +     */
   1.677 +    void MmvbmEnable(TBool aEnable);
   1.678 +    
   1.679 +    /** 
   1.680 +     * Sets the buffer options to use. The client can request the
   1.681 +     * number of input buffers that should be available, but typically
   1.682 +     * only few (one or two) buffers can be used.
   1.683 +     *
   1.684 +     * This method can only be called before the media device has been
   1.685 +     * Initialized with InitializeL().
   1.686 +     * 
   1.687 +     * @param aOptions The buffer options to use, see TBufferOptions.
   1.688 +     *
   1.689 +     * @leave KErrNotSupported The requested buffer options are not
   1.690 +     *   supported. Typically the client has requested too many input
   1.691 +     *   buffers.
   1.692 +     */
   1.693 +    void MmvbmSetBufferOptionsL(const TBufferOptions& aOptions);
   1.694 +    
   1.695 +    /** 
   1.696 +     * Gets the buffer options currently in use.
   1.697 +     *
   1.698 +     * This method can only be called before the media device has been
   1.699 +     * Initialized with InitializeL().
   1.700 +     * 
   1.701 +     * @param aOptions Target buffer options data structure.
   1.702 +     */
   1.703 +    void MmvbmGetBufferOptions(TBufferOptions& aOptions);
   1.704 +    
   1.705 +    /** 
   1.706 +     * Gets a new input picture buffer. The client can then write data
   1.707 +     * into the buffer and write it back to the media device with
   1.708 +     * WritePictureL().
   1.709 +     *
   1.710 +     * This method can only be called after the media device has been
   1.711 +     * Initialized with InitializeL(). This method can only be called
   1.712 +     * in buffer management mode, i.e. if the client has called
   1.713 +     * MmvbmEnable(ETrue).
   1.714 +     *
   1.715 +     * Note that target-allocated and client-allocated input buffers
   1.716 +     * cannot be mixed. In buffer management mode only input buffers
   1.717 +     * allocated with this method can be sent to the media device.
   1.718 +     *
   1.719 +     * If a client has retrieved buffers with MmvbmGetBufferL(), it
   1.720 +     * must be prepated to release them synchronously at any point if
   1.721 +     * MmmfBufferManagementObserver::MmvbmoReleaseBuffers() is
   1.722 +     * called. This may happen if the target media device suddenly
   1.723 +     * loses access to the buffers due to DSA abort, resource
   1.724 +     * management conflict, or media device destruction.
   1.725 +     * 
   1.726 +     * @param aSize The requested buffer size, in pixels. The buffer
   1.727 +     *   size should match the picture size set at initialisation phase,
   1.728 +     *   or otherwise suitable buffer may not be available. If the size
   1.729 +     *   is smaller than the size set at initialisation phase, the
   1.730 +     *   allocated buffer may be larger than requested.
   1.731 +     * 
   1.732 +     * @return A new input picture buffer. If no free buffers are
   1.733 +     * available, the return value is NULL.
   1.734 +     *
   1.735 +     * @leave General The method will leave if an error occurs. Lack
   1.736 +     * of free buffers is not considered an error.
   1.737 +     */
   1.738 +    TVideoPicture* MmvbmGetBufferL(const TSize& aSize);
   1.739 +    
   1.740 +    /** 
   1.741 +     * Releases an input buffer back to the media device without using
   1.742 +     * it. This method is mainly used as a response to a
   1.743 +     * MmvbmReleaseBuffers() callback.
   1.744 +     * 
   1.745 +     * @param aBuffer The buffer to release.
   1.746 +     */
   1.747 +    void MmvbmReleaseBuffer(TVideoPicture* aBuffer);    
   1.748 +    
   1.749 +public:
   1.750 +    
   1.751 +     // === MMMFVideoSurfaceSupport ===
   1.752 +    
   1.753 +	/** 
   1.754 +    Requests the media device to use graphics surfaces for video rendering. 
   1.755 +    The client must call this method before Initialize() to ensure the media 
   1.756 +    device allocates the right types of resources for rendering.
   1.757 +    */
   1.758 +    void MmvssUseSurfaces();
   1.759 +         
   1.760 +    /** 
   1.761 +    Sets a new video surface support observer to receive surface management events 
   1.762 +    from the media device.
   1.763 +     
   1.764 +    @param aObserver New observer object to use.
   1.765 +    */
   1.766 +    void MmvssSetObserver(MMMFVideoSurfaceObserver& aObserver);
   1.767 +    
   1.768 +    /** 
   1.769 +    Retrieves surface parameters for a display. The client typically calls this in response 
   1.770 +    to a MmvsoSurfaceCreated() or MmvsoSurfaceParametersUpdated() observer callback.
   1.771 +     
   1.772 +    @param  aSurfaceId
   1.773 +	        Surface ID for the display.
   1.774 +	@param  aCropRect
   1.775 +	        Cropping rectangle within the surface. The crop rectangle identifies the area of 
   1.776 +	        the surface that should be shown on the screen.
   1.777 +	@param  aPixelAspectRatio
   1.778 +	        Video picture pixel aspect ratio.
   1.779 +
   1.780 +	@leave KErrNotReady if no surface is available for the display.
   1.781 +    */
   1.782 +    
   1.783 +    void MmvssGetSurfaceParametersL(TSurfaceId& aSurfaceId, TRect& aCropRect, 
   1.784 +    					TVideoAspectRatio& aPixelAspectRatio);
   1.785 +    /** 
   1.786 +    Indicates that the surface is no longer in use and can be destroyed. The client typically calls
   1.787 +    this in response to MmvsoSurfaceCreated() (while old surface is already in use and the current
   1.788 +    should be removed) or MmvsoRemoveSurface() observer callback.  
   1.789 +         
   1.790 +    @param aSurfaceId Surface ID that is no longer in use
   1.791 +    
   1.792 +    @leave KErrNotFound if the surface does not exist
   1.793 +    */
   1.794 +    void MmvssSurfaceRemovedL(const TSurfaceId& aSurfaceId);    
   1.795 +
   1.796 +public:    
   1.797 +
   1.798 +    // === MMmfVideoPropertiesObserver ===
   1.799 +    
   1.800 +    /** 
   1.801 +    Decoded video properties updated. The media device implementing the
   1.802 +    MMmfVideoPropertiesNotifier extension will call this method immediately
   1.803 +    before outputting a picture with the updated properties.
   1.804 +    
   1.805 +    When the extension is used between a decoder and a post-processor media
   1.806 +    device, the post-processor can associate the changed properties with the
   1.807 +    correct picture, since the next incoming picture after this call will
   1.808 +    be the first updated one. 
   1.809 +    
   1.810 +    When the extension is used between a DevVideoPlay client and a
   1.811 +    post-processor media device, the client can synchronously reconfigure
   1.812 +    video display options using SetScaleOptionsL() and related methods. This
   1.813 +    lets the client reconfigure the display for the correct picture.
   1.814 +    
   1.815 +    @param aYuvFormat Updated YUV format parameters. The updated fields are
   1.816 +                      iAspectRatioDenom, iAspectRatioNum, and iCoefficients     
   1.817 +    @param aPictureSize	Updated picture size. This size will be the true
   1.818 +                       	picture display size, excluding any padding that
   1.819 +                       	the codec might use.
   1.820 +    */
   1.821 +    virtual void MmvpoUpdateVideoProperties(const TYuvFormat& aYuvFormat, const TSize& aPictureSize);
   1.822 +    
   1.823 +public:
   1.824 +
   1.825 +    // === MMmfVideoResourceObserver ===
   1.826 +    
   1.827 +    /** 
   1.828 +    Indicates that a media device has lost its resources. The client must
   1.829 +    synchronously pause or stop processing before returning from this method
   1.830 +    so that the media device can release its resources to the system. If
   1.831 +    the client does not pause or stop, resource loss will be handled as a
   1.832 +    fatal error.
   1.833 +     
   1.834 +    The client may start again or resume after receiving a
   1.835 +    MvroResourcesRestored() callback.
   1.836 +     
   1.837 +    @param aMediaDevice UID for the media device that lost resources. The
   1.838 +                        client can use this e.g. to determine whether the
   1.839 +                        decoder or the post-processor lost resources. This
   1.840 +                        is typically not required though since the client
   1.841 +                        must pause DevVideo entirely.
   1.842 +    */
   1.843 +    virtual void MmvroResourcesLost(TUid aMediaDevice);
   1.844 +
   1.845 +    /** 
   1.846 +    Indicates that a media device has regained its resources after a
   1.847 +    previous resource loss. The client can restart or resume processing.
   1.848 +    This can be done either synchronously or asynchronously.
   1.849 +     
   1.850 +    @param aMediaDevice UID for the media device that regained resources.
   1.851 +    */
   1.852 +    virtual void MmvroResourcesRestored(TUid aMediaDevice);
   1.853 +            
   1.854 +    
   1.855 +    // === MMmfVideoSurfaceHandleControl ===
   1.856 +    
   1.857 +    /** 
   1.858 +    Sets an external surface ID. This should be called as soon as external surface is created.    
   1.859 +     
   1.860 +    @param aSurfaceID external surface ID.
   1.861 +        
   1.862 +    */
   1.863 +    
   1.864 +    virtual void MmvshcSetSurfaceHandle(const TSurfaceId& aSurfaceHandle);
   1.865 +    
   1.866 +    /** 
   1.867 +    Sets a redraw buffer to be used during resource loss.    
   1.868 +     
   1.869 +    @param aRedrawBuffer redraw buffer.
   1.870 +        
   1.871 +    */
   1.872 +     virtual void MmvshcRedrawBufferToSurface(TPtrC8& aRedrawBuffer);
   1.873 +     
   1.874 +     /**
   1.875 +      * Creates a surface and maps the surface with the chunk handle passed in.
   1.876 +      * @param aAttributes
   1.877 +      * @param aHandle is the Chunk handle for the data.
   1.878 +      * @param aSurfaceId returns the surfaceId that was just created
   1.879 +      * 
   1.880 +      * @return error code
   1.881 +      */
   1.882 +         
   1.883 +     virtual TInt MmvshcCreateSurface(const RSurfaceManager::TSurfaceCreationAttributes& aAttributes, TInt aHandle, TSurfaceId& aSurfaceId);
   1.884 +   
   1.885 +public:
   1.886 +	// === MMmfVideoPropertiesNotifier ===
   1.887 +    /** 
   1.888 +    Sets a new video properties observer. This method can be called at any
   1.889 +    time after the media device has been instantiated.
   1.890 +     
   1.891 +    @param aObserver New observer object.
   1.892 +    */
   1.893 +    virtual void MmvpnSetObserver(MMmfVideoPropertiesObserver* aObserver);
   1.894 +
   1.895 +public:
   1.896 +	
   1.897 +	void ReturnPicToDecoder(TVideoPicture* aPic);
   1.898 +	TInt AttemptToPost();
   1.899 +	
   1.900 +public:
   1.901 +    //=== MMdfTrickPlayControl === =     
   1.902 +    /**        
   1.903 +     * Query the Direction capabilities from the MDF decoders and       
   1.904 +     * post processor.       
   1.905 +     *        
   1.906 +    */       
   1.907 +    virtual void MmvprcGetPlayRateCapabilitiesL(TVideoPlayRateCapabilities& aCapabilities);
   1.908 +
   1.909 +    /**       
   1.910 +     * Sets the playback speed. A negative rate means play backward.       
   1.911 +     * +/- percentage.       
   1.912 +     *        
   1.913 +     */       
   1.914 +    virtual void MmvprcSetPlayRateL(const TInt aRate);
   1.915 +
   1.916 +    /**       
   1.917 +     * Gets the playback speed. A negative rate means play backward.       
   1.918 +     * +/- percentage.       
   1.919 +     *        
   1.920 +     */       
   1.921 +    virtual TInt MmvprcPlayRateL();
   1.922 +
   1.923 +    /**       
   1.924 +     * Sets the step frame number in frame step mode       
   1.925 +     * +/- frames       
   1.926 +     */       
   1.927 +    virtual void MmvprcStepFrameL(const TInt aStep);
   1.928 +
   1.929 +    /**       
   1.930 +     * Registers the observer       
   1.931 +     */       
   1.932 +    virtual void MmvprcSetObserver(MMmfVideoPlayRateObserver& aObserver); 
   1.933 +
   1.934 +public: 
   1.935 +     
   1.936 +    // === MMmfVideoSecureOutput ===
   1.937 +    /**
   1.938 +     * Notifies the media device if the content can only be sent to a
   1.939 +     * secure output. The device display is typically considered a
   1.940 +     * secure output, but a high-quality unprotected analog or digital
   1.941 +     * video output connector is not. By default all content can be
   1.942 +     * sent to both secure and insecure outputs.
   1.943 +     *
   1.944 +     * This method can only be called before the media device has been
   1.945 +     * initialised with InitializeL().
   1.946 +     *
   1.947 +     * @param aSecure Set to ETrue if the content can only be sent to
   1.948 +     *     a secure output, EFalse if both secure and unsecure outputs can
   1.949 +     *     be used.
   1.950 +     *
   1.951 +     * @leave KErrNotSupported Insecure outputs cannot be
   1.952 +     * disabled. The client should not play protected content.
   1.953 +     */    
   1.954 +     virtual void MmvsoSetSecureOutputL(TBool aSecure);
   1.955 +
   1.956 +public:
   1.957 +     //=== AdvancedVideoSecureOutput === =     
   1.958 +     virtual void MmavsoSetAllowedOutputL(TUint aAllowedOutputMask);
   1.959 +    
   1.960 +public:
   1.961 +     // === MMmfPostInitializeRequest ===
   1.962 +     virtual void MmpirPostInitializeRequest(MMmfPostInitializeResponse& aResponse);
   1.963 +     
   1.964 +protected: 
   1.965 +
   1.966 +    // === CMMFVideoPostProcHwDevice ===
   1.967 +    /**
   1.968 +    Set the proxy implementation to be used. Called just after the object is constructed.
   1.969 +    @param  "aProxy"    "The proxy to use."
   1.970 +    */
   1.971 +    void SetProxy(MMMFDevVideoPlayProxy& aProxy);
   1.972 +    
   1.973 +protected:
   1.974 +
   1.975 +    /**
   1.976 +     *  Symbian 2nd phase constructor .
   1.977 +     */
   1.978 +    void ConstructL();
   1.979 +    
   1.980 +private:    
   1.981 +	TInt IsTimeToPost(TVideoPicture* frame, TInt64& delta);
   1.982 +	TVideoPicture* CreateBuffersL(TInt aBufId);
   1.983 +    void CreateVBMBuffersL();
   1.984 +    TInt SetupExternalSurface(const TSurfaceId &aSurfaceID);
   1.985 +    void ReleaseInputQ();
   1.986 +    void ReleaseProcessQ();
   1.987 +    void ReleasePicture(TVideoPicture *pic);
   1.988 +    void PublishSurfaceCreated();
   1.989 +    void PublishSurfaceUpdated();
   1.990 +    TInt SetupSurface();
   1.991 +    void SetSurfaceAttributes(const TSize& aSize, TInt aNumBuf);
   1.992 +    TInt GetID(TVideoPicture *aPicture);
   1.993 +    TInt GetExternalBufferID(TVideoPicture *aPicture);
   1.994 +    TInt RegisterSurface(const TSurfaceId& aSurfaceId);
   1.995 +    TInt IsGceReady();
   1.996 +    void SetTimer(TInt64 aDelta);
   1.997 +    TInt ConvertPostProcBuffer(TVideoPicture* pSrc, TVideoPicture* pDest);
   1.998 +    void AddPictureToVBMQ(TVideoPicture *pic);
   1.999 +    void AddPictureToColorConversionQ(TVideoPicture *pic);
  1.1000 +    void ResetCountingBuffer();
  1.1001 +    void PicturesSkipped();
  1.1002 +    TVideoPicture* DoColorConvert(TVideoPicture* aPicture);
  1.1003 +
  1.1004 +    /**       
  1.1005 +     Adds a picture to the Input queue. Based on the timestamp of the picture,
  1.1006 +     it is either appeneded at the end of the queue or inserted at the 
  1.1007 +     appropriate position. The queue is arranged in the ascending order. 
  1.1008 +     The ret value indicates if the head of the queue was changed or not.         
  1.1009 +    */  
  1.1010 +    TInt AddToQ(TVideoPicture* aPicture);
  1.1011 +    
  1.1012 +    /**       
  1.1013 +     Removes a picture from Input queue based on the playrate.
  1.1014 +     If the playrate is +ve ie forward playback head will be removed
  1.1015 +     and if the playrate is -ve ie backward playback tail
  1.1016 +     will be removed.         
  1.1017 +    */  
  1.1018 +    void RemoveFromQ();
  1.1019 +    
  1.1020 +    /**       
  1.1021 +     Returns a picture from Input queue based on the playrate.
  1.1022 +     If the playrate is +ve ie forward playback head will be returned
  1.1023 +     and if the playrate is -ve ie backward playback tail  
  1.1024 +     will be returned.       
  1.1025 +    */  
  1.1026 +    TVideoPicture* PeekQ();
  1.1027 +
  1.1028 +    /**
  1.1029 +    Adds a surface hint to a video surface. If there is any hint already added, 
  1.1030 +    the surface is updated with the new hint. 
  1.1031 +    */		
  1.1032 +    TInt AddHints();
  1.1033 +    
  1.1034 +	#ifdef _DUMP_YUV_FRAMES
  1.1035 +    void captureYuv(TVideoPicture* aPicture);
  1.1036 +    #endif
  1.1037 +    
  1.1038 +    TInt SetSourceFormat();
  1.1039 +    TInt SetSourceRange();
  1.1040 +    TInt ColorConvert(tBaseVideoFrame* aInputFrame, TUint8* aDestPtr, tWndParam* aInputCropWindow, tWndParam* aOutputCropWindow);
  1.1041 +
  1.1042 +private:
  1.1043 +
  1.1044 +    //
  1.1045 +    // C++ default constructor.  
  1.1046 +    //
  1.1047 +    CNGAPostProcHwDevice();
  1.1048 +
  1.1049 +    //
  1.1050 +    // State of post processor
  1.1051 +    //
  1.1052 +    enum TPPState
  1.1053 +    {
  1.1054 +        EInitializing,
  1.1055 +        EInitialized,
  1.1056 +        EPlaying,
  1.1057 +        EPaused,
  1.1058 +        EStopped
  1.1059 +    };
  1.1060 +    
  1.1061 +    enum TTimeToPost
  1.1062 +    {
  1.1063 +        ESkipIt = -1,
  1.1064 +        EPostIt = 0,
  1.1065 +        EDelayIt = 1,
  1.1066 +    };
  1.1067 +    
  1.1068 +private: 
  1.1069 +
  1.1070 +    MMMFDevVideoPlayProxy*      				iProxy;															
  1.1071 +    CMMFVideoDecodeHwDevice*    				iInputDecoderDevice;															
  1.1072 +    RArray<TVideoPicture*>              		iInputQ;															
  1.1073 +    RArray<TVideoPicture*>              		iProcessQ;															
  1.1074 +    MMMFClockSource*            				iClockSource;															
  1.1075 +    TTimeIntervalMicroSeconds					iCurrentPlaybackPosition;															
  1.1076 +    TPPState        							iPPState;															
  1.1077 +    CNGAPostProcSurfaceHandler*					iSurfaceHandler;
  1.1078 +    CNGAPostProcSessionManager*					iSessionManager;
  1.1079 +	
  1.1080 +	RSurfaceManager::TSurfaceCreationAttributesBuf	iAttributes;
  1.1081 +	RChunk										iChunk;
  1.1082 +	RSurfaceManager::TInfoBuf 					iInfo;
  1.1083 +	TSurfaceId									iSurfaceId;
  1.1084 +	TBool           							iIsInputEnded;
  1.1085 +	CNGAPostProcTimer*							iPostingTimer;
  1.1086 +	CMMFDevVideoPlay::TPictureCounters  		iPictureCounters;
  1.1087 +	TBool 										iFirstPictureUpdated;
  1.1088 +	TBool 										iUsingExternalSurface;
  1.1089 +    TBool           							iIsColorConversionNeeded;
  1.1090 +    RArray<TVideoPicture*>              		iColorConversionQ;
  1.1091 +    TBool 										iSurfaceCreatedEventPublished;
  1.1092 +    TInt                                		iOverflowPictureCounter;
  1.1093 +    TInt 								    	iVideoFrameBufSize;	
  1.1094 +    TBool 										iResourceLost;
  1.1095 +    TBool 										iRedrawDone;
  1.1096 +	// Flag to indicate that the redraw surface has been created, and
  1.1097 +	// can be used in a subsequent call ro Redraw()
  1.1098 +	TBool										iRedrawSurfaceInUse;
  1.1099 +
  1.1100 +    //-- members for buffer management --
  1.1101 +    MMmfVideoBufferManagementObserver*  		iVBMObserver;
  1.1102 +    TBufferOptions                      		iVBMBufferOptions;
  1.1103 +    RArray<TVideoPicture*>              		iVBMBufferReferenceQ;
  1.1104 +    RArray<TVideoPicture*>              		iVBMBufferQ;
  1.1105 +    TBool                               		iVBMEnabled;
  1.1106 +    RArray<TUncompressedVideoFormat>    		iSupportedInputFormats;
  1.1107 +    TInt										count;
  1.1108 +    
  1.1109 +    //-- members for Surface Hints --
  1.1110 +    RSurfaceManager::THintPair					iHint;
  1.1111 +    TUint 										iSurfaceMask;
  1.1112 +    TUid										iSurfaceKey;
  1.1113 +            
  1.1114 +    //-- members for Surface support --
  1.1115 +    MMMFVideoSurfaceObserver*					iVideoSurfaceObserver;
  1.1116 +	MMmfVideoPropertiesObserver*				iVPObserver;
  1.1117 +	RWsSession									iWsSession;
  1.1118 +	TSize										iPicSize;
  1.1119 +	TUint										iAspectRatioNum;
  1.1120 +	TUint										iAspectRatioDenom;
  1.1121 +	//-- members for Trickplay support --
  1.1122 +	TInt                                iStepFrameCount;
  1.1123 +    TInt                                iPlayRate;       
  1.1124 +    TBool                               iKeyFrameMode;       
  1.1125 +    MMmfVideoPlayRateObserver*          iFPObserver;       
  1.1126 +    TUint8                              iSkippedFramesCountingBuffer[64];       
  1.1127 +    TUint8                              iSkippedFramesInLast64Frames;       
  1.1128 +    TUint8                              iCurrentPosInFramesCountingBuffer; 
  1.1129 +	TUncompressedVideoFormat 			iVideoFormat;
  1.1130 +        //---------- utility variables -------
  1.1131 +	// Image source format
  1.1132 +	TUint8 								iSourceFormat;
  1.1133 +
  1.1134 +	//Image range
  1.1135 +	TUint8		 						iSourceRange;
  1.1136 +
  1.1137 +    //-- members for PostInitializeRequest support --
  1.1138 +    MMmfPostInitializeResponse* iPostInitializeResponse;
  1.1139 +    TBool iIsExternalChunk;
  1.1140 +};    
  1.1141 +
  1.1142 +/**
  1.1143 + * Timer of Posting
  1.1144 + */
  1.1145 +
  1.1146 +class CNGAPostProcTimer: public CTimer
  1.1147 +    {
  1.1148 +public:
  1.1149 +    static CNGAPostProcTimer* NewL( CNGAPostProcHwDevice& aParent );
  1.1150 +    ~CNGAPostProcTimer();
  1.1151 +    
  1.1152 +protected:    
  1.1153 +    void RunL();
  1.1154 +    
  1.1155 +private:
  1.1156 +    CNGAPostProcTimer( CNGAPostProcHwDevice& aParent );
  1.1157 +    void ConstructL();
  1.1158 +    
  1.1159 +private:
  1.1160 +    CNGAPostProcHwDevice& iParent;
  1.1161 +};
  1.1162 +
  1.1163 +#endif //__NGAPOSTPROCHWDEVICE_H__
  1.1164 +