|
1 /* |
|
2 * Copyright (c) 2004 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: DisplaySink subsystem. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef CDISPLAYSINKDSA_H |
|
22 #define CDISPLAYSINKDSA_H |
|
23 |
|
24 // INCLUDE FILES |
|
25 |
|
26 #include "CDisplaySink.h" |
|
27 #include "TDisplaySinkParamsDSA.h" |
|
28 |
|
29 // CLASS DECLARATION |
|
30 |
|
31 /** |
|
32 * Displaysink implementation for Direct Screen access. |
|
33 * |
|
34 * @lib displaysink.lib |
|
35 * @since Series 60 3.1 |
|
36 */ |
|
37 NONSHARABLE_CLASS( CDisplaySinkDSA ) : public CDisplaySink, |
|
38 public MVtImageRotatorObserver |
|
39 { |
|
40 public: // static constructor |
|
41 |
|
42 /** |
|
43 * Static constructor that may leave. |
|
44 */ |
|
45 static CDisplaySinkDSA* NewL( TDisplaySinkParams& aParams, |
|
46 const TDesC8& aInitData ); |
|
47 |
|
48 private: // constructors and destructor |
|
49 |
|
50 /** |
|
51 * C++ default constructor. |
|
52 */ |
|
53 CDisplaySinkDSA(); |
|
54 |
|
55 /** |
|
56 * destructor |
|
57 */ |
|
58 ~CDisplaySinkDSA(); |
|
59 |
|
60 private: // from CDisplaySink |
|
61 |
|
62 /** |
|
63 * @see CDisplaySink::BaseConstructL |
|
64 */ |
|
65 void BaseConstructL( TDisplaySinkParams& aParams, |
|
66 const TDesC8& aInitData ); |
|
67 |
|
68 /** |
|
69 * @see CDisplaySink::BaseConvert |
|
70 */ |
|
71 TBool BaseConvert( const TVtMMFDataBuffer& aBuffer ); |
|
72 |
|
73 /** |
|
74 * @see CDisplaySink::BaseSinkThreadLogonL |
|
75 */ |
|
76 void BaseSinkThreadLogonL(); |
|
77 |
|
78 /** |
|
79 * @see CDisplaySink::BaseSinkThreadLogoff |
|
80 */ |
|
81 void BaseSinkThreadLogoff(); |
|
82 |
|
83 /** |
|
84 * @see CDisplaySink::BaseUpdateSinkParamsL |
|
85 */ |
|
86 void BaseUpdateSinkParamsL( const TDisplaySinkParams& aParams ); |
|
87 |
|
88 /** |
|
89 * @see CDisplaySink::BaseDoUpdateParamsL |
|
90 */ |
|
91 void BaseDoUpdateParamsL(); |
|
92 |
|
93 /** |
|
94 * @see CDisplaySink::BaseDoUpdateParamsL |
|
95 */ |
|
96 void BaseSetVideoFrameSizeL( const TSize& aSize ); |
|
97 |
|
98 /** |
|
99 * @see CDisplaySink::BaseSizesMatch |
|
100 */ |
|
101 TBool BaseSizesMatch( const TSize& aSize ); |
|
102 |
|
103 /** |
|
104 * @see CDisplaySink::BitmapEntry |
|
105 */ |
|
106 TBitmapEntry& BitmapEntry( TInt aIndex ); |
|
107 |
|
108 /** |
|
109 * @see CDisplaySink::BaseEmptyBufferL |
|
110 */ |
|
111 void BaseEmptyBufferL( TVtMMFDataBuffer& aVTMMFBuffer ); |
|
112 |
|
113 /** |
|
114 * @see CDisplaySink::BaseSetBitmapAvailable |
|
115 */ |
|
116 void BaseSetBitmapAvailable( TBitmapNo aBitmapNo ); |
|
117 |
|
118 /** |
|
119 * @see CDisplaySink::BaseVideoFrameSizeChangedL |
|
120 */ |
|
121 void BaseVideoFrameSizeChangedL( const TSize& aNewSize ); |
|
122 |
|
123 private: // from MVtImageRotatorObserver |
|
124 |
|
125 /** |
|
126 * @see MVtImageRotatorObserver::RotationFinished |
|
127 */ |
|
128 void RotationFinished( TInt aError ); |
|
129 |
|
130 private: // new methods |
|
131 |
|
132 /** |
|
133 * Updates expected frame size. |
|
134 * @exception May leave with KErrNotSupported, if bitmap sizes do not match. |
|
135 */ |
|
136 void UpdateExpectedFrameSizeL(); |
|
137 |
|
138 /** |
|
139 * Converts image. Calls DoConvertL() to do the task. |
|
140 * @param "aBitmapNo" CFbsBitmap number to use for converted image. |
|
141 * @param "aConverted" Reference to boolean that will be ETrue if buffer |
|
142 * was converted, EFalse otherwise. |
|
143 * @return KErrNone or one of the system wide error codes. |
|
144 */ |
|
145 void ConvertL( const TPtrC8& aBuffer, TBool& aConverted ); |
|
146 |
|
147 /** |
|
148 * Convert YUV420Planar image to a CFbsBitmap. |
|
149 * @param "aBitmapNo" CFbsBitmap number to use for converted image. |
|
150 * @return KErrNone or one of the system wide error codes. |
|
151 */ |
|
152 void DoConvertL( const TPtrC8& aBuffer, TBitmapNo aBitmapNo ); |
|
153 |
|
154 private: // new classes |
|
155 |
|
156 // Class containing bitmap related data |
|
157 class TBitmapEntryDSA : public TBitmapEntry |
|
158 { |
|
159 public: // data |
|
160 |
|
161 // Handle to target bitmap |
|
162 TInt iHandle; // QCIF |
|
163 }; |
|
164 |
|
165 private: // data |
|
166 |
|
167 // Array of bitmap related structures |
|
168 TBitmapEntryDSA iBitmapTable[ KBitmapTableCount ]; |
|
169 |
|
170 // Converter for bitmap 1, created into Protocol thread's heap |
|
171 CVTYUVFbsBitmapConverter* iYUVBitmapConverter1; // owned |
|
172 |
|
173 // Converter for bitmap 2, created into Protocol thread's heap |
|
174 CVTYUVFbsBitmapConverter* iYUVBitmapConverter2; // owned |
|
175 |
|
176 // Converter for bitmap, created into VT thread's heap |
|
177 CVTYUVFbsBitmapConverter* iYUVBitmapConverterVT; |
|
178 |
|
179 // Pointer to image rotator instance. |
|
180 CVtImageRotator* iRotator; // owned |
|
181 |
|
182 // Source YUV image for image transforms |
|
183 CVtImageIYUV* iSourceImg; |
|
184 |
|
185 // Target YUV image for image transforms |
|
186 CVtImageIYUV* iTargetImg; |
|
187 |
|
188 // Rotation angle |
|
189 CVtImageRotator::TRotationAngle iRotationAngle; |
|
190 |
|
191 // Store for saving new parameters in UpdateSinkParamsL() call |
|
192 TDisplaySinkParamsDSA iNewParams; |
|
193 }; |
|
194 |
|
195 #endif // CDISPLAYSINKDSA_H |
|
196 |
|
197 // End of File |