|
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 __NGAPOSTPROCSURFACEHANDLER_H__ |
|
20 #define __NGAPOSTPROCSURFACEHANDLER_H__ |
|
21 |
|
22 #include <e32std.h> |
|
23 #include <graphics/surface.h> |
|
24 |
|
25 class RSurfaceManager; |
|
26 |
|
27 class CNGAPostProcSurfaceHandler |
|
28 { |
|
29 |
|
30 public: |
|
31 // === Constructors and destructor === |
|
32 /** |
|
33 * Two-phased constructor. |
|
34 * @return pointer to an instance of CMMFVideoPostProcHwDevice |
|
35 */ |
|
36 static CNGAPostProcSurfaceHandler* NewL(); |
|
37 |
|
38 /** |
|
39 * Destructor. |
|
40 */ |
|
41 ~CNGAPostProcSurfaceHandler(); |
|
42 |
|
43 public: |
|
44 |
|
45 /** |
|
46 Sets the device input format to an uncompressed video format. |
|
47 |
|
48 @param "aFormat" "The input format to use." |
|
49 @leave "The method will leave if an error occurs. Typical error codes used: |
|
50 * KErrNotSupported - The input format is not supported." |
|
51 @pre "This method can only be called before the hwdevice has been initialized with Initialize()." |
|
52 */ |
|
53 TInt CreateSurface(const RSurfaceManager::TSurfaceCreationAttributesBuf & aAttributes, TSurfaceId& aSurfaceId); |
|
54 |
|
55 /** |
|
56 Sets the decoder device that will write data to this post-processor. Decoded pictures will be |
|
57 written with WritePictureL() or through a custom interface. After pictures have been processed, |
|
58 they must be returned to the decoder using ReturnPicture(). |
|
59 |
|
60 @param "aDevice" "The decoder source plug-in to use." |
|
61 @pre "This method can only be called before the hwdevice has been initialized with Initialize()." |
|
62 */ |
|
63 TInt OpenSurface(const TSurfaceId& aSurfaceId); |
|
64 |
|
65 /** |
|
66 Writes an uncompressed video picture to the post-processor. The picture must be returned to the |
|
67 client or source plug-in after it has been used. |
|
68 |
|
69 @param "aPicture" "The picture to write." |
|
70 @leave "This method may leave with one of the system-wide error codes." |
|
71 @pre "This method can only be called after the hwdevice has been initialized with Initialize()." |
|
72 */ |
|
73 TInt MapSurface(const TSurfaceId& aSurfaceId, RChunk& aHandle); |
|
74 |
|
75 /** |
|
76 Retrieves post-processing information about this hardware device. |
|
77 The device creates a CPostProcessorInfo structure, fills it with correct data, pushes it |
|
78 to the cleanup stack and returns it. The client will delete the object when it is no |
|
79 longer needed. |
|
80 |
|
81 @return "Post-processor information as a CPostProcessorInfo object. |
|
82 The object is pushed to the cleanup stack, and must be deallocated by the caller." |
|
83 @leave "This method may leave with one of the system-wide error codes. |
|
84 */ |
|
85 TInt SurfaceInfo(const TSurfaceId& aSurfaceId, RSurfaceManager::TInfoBuf& aInfo); |
|
86 |
|
87 /** |
|
88 Retrieves the list of the output formats that the device supports. The list is ordered in |
|
89 plug-in preference order, with the preferred formats at the beginning of the list. The list |
|
90 can depend on the device source format, and therefore SetSourceFormatL() must be called before |
|
91 calling this method. |
|
92 |
|
93 @param "aFormats" "An array for the result format list. The array must be created and destroyed by the caller." |
|
94 @leave "This method may leave with one of the system-wide error codes. |
|
95 @pre "This method may only be called before the hwdevice has been initialized using Initialize()." |
|
96 */ |
|
97 TInt DestroySurface(const TSurfaceId& aSurfaceId); |
|
98 |
|
99 /** |
|
100 Get the offset of the specified buffer from the base address of the underlying |
|
101 chunk. |
|
102 |
|
103 To obtain the address of the buffer, the offset returned must be added onto the |
|
104 base address of the RChunk returned in a call to MapSurface(). Note that |
|
105 buffer offsets are immutable during the lifetime of the surface. |
|
106 @param aParam The input parameters including the surface ID and buffer index. |
|
107 @pre The surface is open in the calling process. |
|
108 @return KErrNone if successful, KErrArgument if aSurfaceId or aBuffer are invalid, |
|
109 KErrAccessDenied if the surface is not open in the current process, KErrNotSupported if |
|
110 the surface is not mappable, otherwise a system wide error code. |
|
111 */ |
|
112 TInt GetBufferOffset(const TSurfaceId& aSurfaceId, TInt aBuffer, TInt& aOffset); |
|
113 |
|
114 /** |
|
115 Adds a Surface hint to the video surface. |
|
116 |
|
117 */ |
|
118 TInt AddSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint); |
|
119 |
|
120 /** |
|
121 Updates an existing Surface hint. |
|
122 |
|
123 */ |
|
124 TInt SetSurfaceHint(const TSurfaceId& aSurfaceId,const RSurfaceManager::THintPair& aHint); |
|
125 |
|
126 protected: |
|
127 CNGAPostProcSurfaceHandler(); |
|
128 /** |
|
129 * Symbian 2nd phase constructor . |
|
130 */ |
|
131 void ConstructL(); |
|
132 |
|
133 private: |
|
134 |
|
135 RSurfaceManager* iSurfaceManager; |
|
136 }; |
|
137 |
|
138 #endif //__NGAPOSTPROCSURFACEHANDLER_H__ |