os/mm/mdfdevvideoextensions/nga_mdf_postprocessor_shai/inc/NGAPostProcSurfaceHandler.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/NGAPostProcSurfaceHandler.h	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,143 @@
     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 __NGAPOSTPROCSURFACEHANDLER_H__
    1.23 +#define __NGAPOSTPROCSURFACEHANDLER_H__
    1.24 +
    1.25 +#include <e32std.h>
    1.26 +#include <graphics/surface.h>
    1.27 +
    1.28 +class RSurfaceManager;
    1.29 +
    1.30 +class CNGAPostProcSurfaceHandler: public CBase
    1.31 +{
    1.32 +
    1.33 +public: 
    1.34 +    //  === Constructors and destructor ===
    1.35 +    /**
    1.36 +    * Two-phased constructor.   
    1.37 +    * @return pointer to an instance of CMMFVideoPostProcHwDevice
    1.38 +    */
    1.39 +    static CNGAPostProcSurfaceHandler* NewL();
    1.40 +
    1.41 +    /**
    1.42 +    * Destructor.
    1.43 +    */
    1.44 +    ~CNGAPostProcSurfaceHandler();
    1.45 +
    1.46 +public: 
    1.47 +    
    1.48 +    /**
    1.49 +    Sets the device input format to an uncompressed video format.
    1.50 +
    1.51 +    @param  "aFormat"   "The input format to use."
    1.52 +    @leave  "The method will leave if an error occurs. Typical error codes used:
    1.53 +            * KErrNotSupported - The input format is not supported."    
    1.54 +    @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
    1.55 +    */
    1.56 +    TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributes & aAttributes, TSurfaceId& aSurfaceId, const RChunk& aChunk);
    1.57 +    TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf & aAttributes, TSurfaceId& aSurfaceId);
    1.58 +
    1.59 +    /**
    1.60 +    Sets the decoder device that will write data to this post-processor. Decoded pictures will be 
    1.61 +    written with WritePictureL() or through a custom interface. After pictures have been processed, 
    1.62 +    they must be returned to the decoder using ReturnPicture().
    1.63 +
    1.64 +    @param  "aDevice"   "The decoder source plug-in to use."
    1.65 +    @pre    "This method can only be called before the hwdevice has been initialized with Initialize()."
    1.66 +    */
    1.67 +    TInt OpenSurface(const TSurfaceId& aSurfaceId);
    1.68 +
    1.69 +    /**
    1.70 +    Writes an uncompressed video picture to the post-processor. The picture must be returned to the 
    1.71 +    client or source plug-in after it has been used.
    1.72 +
    1.73 +    @param  "aPicture"  "The picture to write."
    1.74 +    @leave  "This method may leave with one of the system-wide error codes."
    1.75 +    @pre    "This method can only be called after the hwdevice has been initialized with Initialize()."
    1.76 +    */
    1.77 +    TInt MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle);    
    1.78 +
    1.79 +    /**
    1.80 +    Retrieves post-processing information about this hardware device. 
    1.81 +    The device creates a CPostProcessorInfo structure, fills it with correct data, pushes it 
    1.82 +    to the cleanup stack and returns it. The client will delete the object when it is no 
    1.83 +    longer needed.
    1.84 +
    1.85 +    @return "Post-processor information as a CPostProcessorInfo object. 
    1.86 +            The object is pushed to the cleanup stack, and must be deallocated by the caller."
    1.87 +    @leave  "This method may leave with one of the system-wide error codes.
    1.88 +    */
    1.89 +    TInt SurfaceInfo(const TSurfaceId& aSurfaceId, RSurfaceManager::TInfoBuf& aInfo);
    1.90 +
    1.91 +    /**
    1.92 +    Retrieves the list of the output formats that the device supports. The list is ordered in 
    1.93 +    plug-in preference order, with the preferred formats at the beginning of the list. The list 
    1.94 +    can depend on the device source format, and therefore SetSourceFormatL() must be called before 
    1.95 +    calling this method.
    1.96 +
    1.97 +    @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
    1.98 +    @leave  "This method may leave with one of the system-wide error codes.
    1.99 +    @pre    "This method may only be called before the hwdevice has been initialized using Initialize()."
   1.100 +    */
   1.101 +    TInt DestroySurface(const TSurfaceId& aSurfaceId);
   1.102 +    
   1.103 +    /**
   1.104 +	Get the offset of the specified buffer from the base address of the underlying
   1.105 +	chunk.
   1.106 +	
   1.107 +	To obtain the address of the buffer, the offset returned must be added onto the
   1.108 +	base address of the RChunk returned in a call to MapSurface(). Note that
   1.109 +	buffer offsets are immutable during the lifetime of the surface.
   1.110 +	@param aParam The input parameters including the surface ID and buffer index.
   1.111 +	@pre The surface is open in the calling process.
   1.112 +	@return KErrNone if successful, KErrArgument if aSurfaceId or aBuffer are invalid,
   1.113 +	KErrAccessDenied if the surface is not open in the current process, KErrNotSupported if
   1.114 +	the surface is not mappable, otherwise a system wide error code.
   1.115 +	*/
   1.116 +    TInt GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset);
   1.117 +    
   1.118 +     /**
   1.119 +    Adds a Surface hint to the video surface. 
   1.120 +    
   1.121 +    */
   1.122 +    TInt AddSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint);
   1.123 +    
   1.124 +    /**
   1.125 +    Updates an existing Surface hint. 
   1.126 +    
   1.127 +    */
   1.128 +    TInt SetSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint);
   1.129 +    
   1.130 +protected:
   1.131 +	CNGAPostProcSurfaceHandler();
   1.132 +    /**
   1.133 +     *  Symbian 2nd phase constructor .
   1.134 +     */
   1.135 +    void ConstructL();
   1.136 +
   1.137 +private: 
   1.138 +
   1.139 +    RSurfaceManager*      iSurfaceManager;
   1.140 +
   1.141 +    RSurfaceManager::TSurfaceCreationAttributesBuf iSurfaceAttributesBuf;
   1.142 +    // A surface attribute.
   1.143 +    RSurfaceManager::TSurfaceCreationAttributes& iSurfaceAttributes;
   1.144 +};    
   1.145 +
   1.146 +#endif //__NGAPOSTPROCSURFACEHANDLER_H__
   1.147 \ No newline at end of file