os/mm/mdfdevvideoextensions/nga_mdf_postprocessor/inc/NGAPostProcSurfaceHandler.h
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/mm/mdfdevvideoextensions/nga_mdf_postprocessor/inc/NGAPostProcSurfaceHandler.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,138 @@
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
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::TSurfaceCreationAttributesBuf & aAttributes, TSurfaceId& aSurfaceId);
1.57 +
1.58 + /**
1.59 + Sets the decoder device that will write data to this post-processor. Decoded pictures will be
1.60 + written with WritePictureL() or through a custom interface. After pictures have been processed,
1.61 + they must be returned to the decoder using ReturnPicture().
1.62 +
1.63 + @param "aDevice" "The decoder source plug-in to use."
1.64 + @pre "This method can only be called before the hwdevice has been initialized with Initialize()."
1.65 + */
1.66 + TInt OpenSurface(const TSurfaceId& aSurfaceId);
1.67 +
1.68 + /**
1.69 + Writes an uncompressed video picture to the post-processor. The picture must be returned to the
1.70 + client or source plug-in after it has been used.
1.71 +
1.72 + @param "aPicture" "The picture to write."
1.73 + @leave "This method may leave with one of the system-wide error codes."
1.74 + @pre "This method can only be called after the hwdevice has been initialized with Initialize()."
1.75 + */
1.76 + TInt MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle);
1.77 +
1.78 + /**
1.79 + Retrieves post-processing information about this hardware device.
1.80 + The device creates a CPostProcessorInfo structure, fills it with correct data, pushes it
1.81 + to the cleanup stack and returns it. The client will delete the object when it is no
1.82 + longer needed.
1.83 +
1.84 + @return "Post-processor information as a CPostProcessorInfo object.
1.85 + The object is pushed to the cleanup stack, and must be deallocated by the caller."
1.86 + @leave "This method may leave with one of the system-wide error codes.
1.87 + */
1.88 + TInt SurfaceInfo(const TSurfaceId& aSurfaceId, RSurfaceManager::TInfoBuf& aInfo);
1.89 +
1.90 + /**
1.91 + Retrieves the list of the output formats that the device supports. The list is ordered in
1.92 + plug-in preference order, with the preferred formats at the beginning of the list. The list
1.93 + can depend on the device source format, and therefore SetSourceFormatL() must be called before
1.94 + calling this method.
1.95 +
1.96 + @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller."
1.97 + @leave "This method may leave with one of the system-wide error codes.
1.98 + @pre "This method may only be called before the hwdevice has been initialized using Initialize()."
1.99 + */
1.100 + TInt DestroySurface(const TSurfaceId& aSurfaceId);
1.101 +
1.102 + /**
1.103 + Get the offset of the specified buffer from the base address of the underlying
1.104 + chunk.
1.105 +
1.106 + To obtain the address of the buffer, the offset returned must be added onto the
1.107 + base address of the RChunk returned in a call to MapSurface(). Note that
1.108 + buffer offsets are immutable during the lifetime of the surface.
1.109 + @param aParam The input parameters including the surface ID and buffer index.
1.110 + @pre The surface is open in the calling process.
1.111 + @return KErrNone if successful, KErrArgument if aSurfaceId or aBuffer are invalid,
1.112 + KErrAccessDenied if the surface is not open in the current process, KErrNotSupported if
1.113 + the surface is not mappable, otherwise a system wide error code.
1.114 + */
1.115 + TInt GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset);
1.116 +
1.117 + /**
1.118 + Adds a Surface hint to the video surface.
1.119 +
1.120 + */
1.121 + TInt AddSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint);
1.122 +
1.123 + /**
1.124 + Updates an existing Surface hint.
1.125 +
1.126 + */
1.127 + TInt SetSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint);
1.128 +
1.129 +protected:
1.130 + CNGAPostProcSurfaceHandler();
1.131 + /**
1.132 + * Symbian 2nd phase constructor .
1.133 + */
1.134 + void ConstructL();
1.135 +
1.136 +private:
1.137 +
1.138 + RSurfaceManager* iSurfaceManager;
1.139 +};
1.140 +
1.141 +#endif //__NGAPOSTPROCSURFACEHANDLER_H__
1.142 \ No newline at end of file