sl@0
|
1 |
// Copyright (c) 2003-2009 Nokia Corporation and/or its subsidiary(-ies).
|
sl@0
|
2 |
// All rights reserved.
|
sl@0
|
3 |
// This component and the accompanying materials are made available
|
sl@0
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
sl@0
|
5 |
// which accompanies this distribution, and is available
|
sl@0
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
sl@0
|
7 |
//
|
sl@0
|
8 |
// Initial Contributors:
|
sl@0
|
9 |
// Nokia Corporation - initial contribution.
|
sl@0
|
10 |
//
|
sl@0
|
11 |
// Contributors:
|
sl@0
|
12 |
//
|
sl@0
|
13 |
// Description:
|
sl@0
|
14 |
//
|
sl@0
|
15 |
|
sl@0
|
16 |
#include "postproc.h"
|
sl@0
|
17 |
#include "../TestDevVideoPlayTestData.h"
|
sl@0
|
18 |
|
sl@0
|
19 |
_LIT(KDevVideoPostProcPanicCategory, "DevVideoPostProcessor");
|
sl@0
|
20 |
void DevVideoPostProcPanic(TInt aReason)
|
sl@0
|
21 |
{
|
sl@0
|
22 |
User::Panic(KDevVideoPostProcPanicCategory, aReason);
|
sl@0
|
23 |
}
|
sl@0
|
24 |
|
sl@0
|
25 |
CMMFVideoPostProcHwDevice* CMMFTestVideoPostProcHwDevice::NewL(TAny* /*aInitParams*/)
|
sl@0
|
26 |
{
|
sl@0
|
27 |
CMMFTestVideoPostProcHwDevice* s = new(ELeave) CMMFTestVideoPostProcHwDevice;
|
sl@0
|
28 |
return (STATIC_CAST(CMMFVideoPostProcHwDevice*, s));
|
sl@0
|
29 |
}
|
sl@0
|
30 |
|
sl@0
|
31 |
CMMFTestVideoPostProcHwDevice::CMMFTestVideoPostProcHwDevice()
|
sl@0
|
32 |
{
|
sl@0
|
33 |
}
|
sl@0
|
34 |
|
sl@0
|
35 |
CMMFTestVideoPostProcHwDevice::~CMMFTestVideoPostProcHwDevice()
|
sl@0
|
36 |
{
|
sl@0
|
37 |
iVideoPictures.Close();
|
sl@0
|
38 |
|
sl@0
|
39 |
iVidFormats.Reset();
|
sl@0
|
40 |
iVidFormats.Close();
|
sl@0
|
41 |
|
sl@0
|
42 |
iScaleFactors.Reset();
|
sl@0
|
43 |
iScaleFactors.Close();
|
sl@0
|
44 |
|
sl@0
|
45 |
iCombinations.Reset();
|
sl@0
|
46 |
iCombinations.Close();
|
sl@0
|
47 |
}
|
sl@0
|
48 |
|
sl@0
|
49 |
TAny* CMMFTestVideoPostProcHwDevice::CustomInterface(TUid aInterface)
|
sl@0
|
50 |
{
|
sl@0
|
51 |
if (aInterface == KUidCustomInterfaceTwo)
|
sl@0
|
52 |
{
|
sl@0
|
53 |
return this;//just want to return something non-null!
|
sl@0
|
54 |
}
|
sl@0
|
55 |
else
|
sl@0
|
56 |
{
|
sl@0
|
57 |
return NULL;
|
sl@0
|
58 |
}
|
sl@0
|
59 |
}
|
sl@0
|
60 |
|
sl@0
|
61 |
CPostProcessorInfo* CMMFTestVideoPostProcHwDevice::PostProcessorInfoLC()
|
sl@0
|
62 |
{
|
sl@0
|
63 |
// construct array of test types
|
sl@0
|
64 |
for (TUint i = 0; i < KTestPostProcInfoCount; i++)
|
sl@0
|
65 |
{
|
sl@0
|
66 |
// append the video formats
|
sl@0
|
67 |
TUncompressedVideoFormat vid = KTestPostProcInfoFormatArray[i];
|
sl@0
|
68 |
User::LeaveIfError(iVidFormats.Append(vid));
|
sl@0
|
69 |
|
sl@0
|
70 |
// append the combinations
|
sl@0
|
71 |
TUint32 comb = KTestPostProcInfoCombsArray[i];
|
sl@0
|
72 |
User::LeaveIfError(iCombinations.Append(comb));
|
sl@0
|
73 |
|
sl@0
|
74 |
// append the scale factors
|
sl@0
|
75 |
TScaleFactor scale = KTestPostProcInfoScaleFactorsArray[i];
|
sl@0
|
76 |
User::LeaveIfError(iScaleFactors.Append(scale));
|
sl@0
|
77 |
}
|
sl@0
|
78 |
|
sl@0
|
79 |
// construct the video decoder info object
|
sl@0
|
80 |
CPostProcessorInfo* vInfo = CPostProcessorInfo::NewL(
|
sl@0
|
81 |
KUidDevVideoTestPostProcHwDevice,
|
sl@0
|
82 |
KTestPostProcInfoManufacturer,
|
sl@0
|
83 |
KTestPostProcInfoIdentifier,
|
sl@0
|
84 |
TVersion(KTestPostProcInfoVersionMaj, KTestPostProcInfoVersionMin, KTestPostProcInfoVersionBuild),
|
sl@0
|
85 |
iVidFormats.Array(),
|
sl@0
|
86 |
iCombinations.Array(),
|
sl@0
|
87 |
ETrue, // accelerated
|
sl@0
|
88 |
ETrue, // supports direct display
|
sl@0
|
89 |
KTestPostProcInfoYuvToRgbCaps,
|
sl@0
|
90 |
KTestPostProcInfoRotations,
|
sl@0
|
91 |
ETrue, // scaling
|
sl@0
|
92 |
iScaleFactors.Array(),
|
sl@0
|
93 |
ETrue, // anti-aliasing
|
sl@0
|
94 |
KTestPostProcInfoISInfo );
|
sl@0
|
95 |
CleanupStack::PushL(vInfo);
|
sl@0
|
96 |
#ifdef SYMBIAN_ENABLE_MMF_MULTISCREEN_SUPPORT
|
sl@0
|
97 |
vInfo->AddSupportedScreenL(KPostProcDefaultScreenNumber);
|
sl@0
|
98 |
vInfo->AddSupportedScreenL(KPostProcSecondaryScreenNumber);
|
sl@0
|
99 |
#endif
|
sl@0
|
100 |
vInfo->SetSupportsContentProtected(ETrue);
|
sl@0
|
101 |
return vInfo;
|
sl@0
|
102 |
}
|
sl@0
|
103 |
|
sl@0
|
104 |
void CMMFTestVideoPostProcHwDevice::GetOutputFormatListL(RArray<TUncompressedVideoFormat>& aFormats)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
// append in order 3, 2, 1
|
sl@0
|
107 |
User::LeaveIfError(aFormats.Append(KTestVidFormat3));
|
sl@0
|
108 |
User::LeaveIfError(aFormats.Append(KTestVidFormat2));
|
sl@0
|
109 |
User::LeaveIfError(aFormats.Append(KTestVidFormat1));
|
sl@0
|
110 |
}
|
sl@0
|
111 |
|
sl@0
|
112 |
void CMMFTestVideoPostProcHwDevice::SetOutputFormatL(const TUncompressedVideoFormat &aFormat)
|
sl@0
|
113 |
{
|
sl@0
|
114 |
if (!(aFormat == KTestVidFormat2))
|
sl@0
|
115 |
User::Leave(KErrCorrupt);
|
sl@0
|
116 |
}
|
sl@0
|
117 |
|
sl@0
|
118 |
void CMMFTestVideoPostProcHwDevice::SetPostProcessTypesL(TUint32 aPostProcCombination)
|
sl@0
|
119 |
{
|
sl@0
|
120 |
if (!(aPostProcCombination == KTestProcessType2))
|
sl@0
|
121 |
User::Leave(KErrCorrupt);
|
sl@0
|
122 |
}
|
sl@0
|
123 |
|
sl@0
|
124 |
void CMMFTestVideoPostProcHwDevice::SetInputCropOptionsL(const TRect& aRect)
|
sl@0
|
125 |
{
|
sl@0
|
126 |
TRect testRect(KTestInputCropRectD, KTestInputCropRectC, KTestInputCropRectB, KTestInputCropRectA);
|
sl@0
|
127 |
if (!(aRect == testRect))
|
sl@0
|
128 |
User::Leave(KErrCorrupt);
|
sl@0
|
129 |
}
|
sl@0
|
130 |
|
sl@0
|
131 |
void CMMFTestVideoPostProcHwDevice::SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions, const TYuvFormat& aYuvFormat, TRgbFormat aRgbFormat)
|
sl@0
|
132 |
{
|
sl@0
|
133 |
// check options first
|
sl@0
|
134 |
if (!CompareYuvRgbOptions(aOptions, KTestYuvToRgb2))
|
sl@0
|
135 |
User::Leave(KErrCorrupt);
|
sl@0
|
136 |
|
sl@0
|
137 |
// now check formats
|
sl@0
|
138 |
if ( !(CompareYuvFormats(aYuvFormat, KTestYuvFormat2)) ||
|
sl@0
|
139 |
!(aRgbFormat == KTestRgbFormat2) )
|
sl@0
|
140 |
User::Leave(KErrCorrupt);
|
sl@0
|
141 |
}
|
sl@0
|
142 |
|
sl@0
|
143 |
void CMMFTestVideoPostProcHwDevice::SetYuvToRgbOptionsL(const TYuvToRgbOptions& aOptions)
|
sl@0
|
144 |
{
|
sl@0
|
145 |
if (!CompareYuvRgbOptions(aOptions, KTestYuvToRgb2))
|
sl@0
|
146 |
User::Leave(KErrCorrupt);
|
sl@0
|
147 |
}
|
sl@0
|
148 |
|
sl@0
|
149 |
void CMMFTestVideoPostProcHwDevice::SetRotateOptionsL(TRotationType aRotationType)
|
sl@0
|
150 |
{
|
sl@0
|
151 |
if (!(aRotationType == KTestRotate2))
|
sl@0
|
152 |
User::Leave(KErrCorrupt);
|
sl@0
|
153 |
}
|
sl@0
|
154 |
|
sl@0
|
155 |
void CMMFTestVideoPostProcHwDevice::SetScaleOptionsL(const TSize& aTargetSize, TBool aAntiAliasFiltering)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
TSize testScale(KTestScaleY, KTestScaleX);
|
sl@0
|
158 |
if (!(aTargetSize == testScale) || !aAntiAliasFiltering)
|
sl@0
|
159 |
User::Leave(KErrCorrupt);
|
sl@0
|
160 |
}
|
sl@0
|
161 |
|
sl@0
|
162 |
void CMMFTestVideoPostProcHwDevice::SetOutputCropOptionsL(const TRect& aRect)
|
sl@0
|
163 |
{
|
sl@0
|
164 |
TRect testRect(KTestOutputCropRectD, KTestOutputCropRectC, KTestOutputCropRectB, KTestOutputCropRectA);
|
sl@0
|
165 |
if (!(aRect == testRect))
|
sl@0
|
166 |
User::Leave(KErrCorrupt);
|
sl@0
|
167 |
}
|
sl@0
|
168 |
|
sl@0
|
169 |
void CMMFTestVideoPostProcHwDevice::SetPostProcSpecificOptionsL(const TDesC8& aOptions)
|
sl@0
|
170 |
{
|
sl@0
|
171 |
if (!(aOptions == KTestPostProcOptions2))
|
sl@0
|
172 |
User::Leave(KErrCorrupt);
|
sl@0
|
173 |
}
|
sl@0
|
174 |
|
sl@0
|
175 |
void CMMFTestVideoPostProcHwDevice::SetClockSource(MMMFClockSource* aClock)
|
sl@0
|
176 |
{
|
sl@0
|
177 |
__ASSERT_ALWAYS(aClock, DevVideoPostProcPanic(EPostProcPanicClockSource));
|
sl@0
|
178 |
|
sl@0
|
179 |
// call Time() to check that clock can be used
|
sl@0
|
180 |
TTimeIntervalMicroSeconds currTime(0); // done this way to remove compiler warning
|
sl@0
|
181 |
currTime = aClock->Time();
|
sl@0
|
182 |
}
|
sl@0
|
183 |
|
sl@0
|
184 |
void CMMFTestVideoPostProcHwDevice::SetVideoDestScreenL(TBool aScreen)
|
sl@0
|
185 |
{
|
sl@0
|
186 |
if (aScreen)
|
sl@0
|
187 |
{
|
sl@0
|
188 |
// Must be normal devvideo test. Leave with special number to show we got the
|
sl@0
|
189 |
// value through ok
|
sl@0
|
190 |
User::Leave(KErrHardwareNotAvailable);
|
sl@0
|
191 |
}
|
sl@0
|
192 |
else
|
sl@0
|
193 |
{
|
sl@0
|
194 |
// Special test plugin feature: we're being told to start outputing
|
sl@0
|
195 |
// video pictures up to DevVideo.
|
sl@0
|
196 |
// Create 10 video pictures
|
sl@0
|
197 |
iVideoPictures.Reset();
|
sl@0
|
198 |
for (TInt i=0; i<10; i++)
|
sl@0
|
199 |
{
|
sl@0
|
200 |
// Create a video picture that only has a valid timestamp
|
sl@0
|
201 |
TVideoPicture picture;
|
sl@0
|
202 |
picture.iTimestamp = TTimeIntervalMicroSeconds(i);
|
sl@0
|
203 |
picture.iOptions = TVideoPicture::ETimestamp;
|
sl@0
|
204 |
User::LeaveIfError(iVideoPictures.Append(picture));
|
sl@0
|
205 |
}
|
sl@0
|
206 |
}
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
void CMMFTestVideoPostProcHwDevice::Initialize()
|
sl@0
|
210 |
{
|
sl@0
|
211 |
iProxy->MdvppInitializeComplete(this, KErrNone);
|
sl@0
|
212 |
}
|
sl@0
|
213 |
|
sl@0
|
214 |
void CMMFTestVideoPostProcHwDevice::StartDirectScreenAccessL(const TRect& aVideoRect, CFbsScreenDevice& /*aScreenDevice*/, const TRegion& aClipRegion)
|
sl@0
|
215 |
{
|
sl@0
|
216 |
TRect dsaRect(KTestDSARectA, KTestDSARectB, KTestDSARectC, KTestDSARectD);
|
sl@0
|
217 |
TRegionFix<1> dsaReg(dsaRect);
|
sl@0
|
218 |
|
sl@0
|
219 |
// probably no need to check aScreenDevice
|
sl@0
|
220 |
if ( /*!(&aScreenDevice) || */!(dsaRect == aVideoRect) ||
|
sl@0
|
221 |
!(dsaReg.BoundingRect() == aClipRegion.BoundingRect()) )
|
sl@0
|
222 |
User::Leave(KErrNotSupported);
|
sl@0
|
223 |
|
sl@0
|
224 |
}
|
sl@0
|
225 |
|
sl@0
|
226 |
void CMMFTestVideoPostProcHwDevice::SetScreenClipRegion(const TRegion& aRegion)
|
sl@0
|
227 |
{
|
sl@0
|
228 |
TRect dsaRect(KTestDSARectA, KTestDSARectB, KTestDSARectC, KTestDSARectD);
|
sl@0
|
229 |
TRegionFix<1> dsaReg(dsaRect);
|
sl@0
|
230 |
|
sl@0
|
231 |
__ASSERT_ALWAYS(dsaReg.BoundingRect() == aRegion.BoundingRect(),
|
sl@0
|
232 |
DevVideoPostProcPanic(EPostProcPanicScreenClipRegion));
|
sl@0
|
233 |
}
|
sl@0
|
234 |
|
sl@0
|
235 |
void CMMFTestVideoPostProcHwDevice::SetPauseOnClipFail(TBool aPause)
|
sl@0
|
236 |
{
|
sl@0
|
237 |
__ASSERT_ALWAYS(aPause, DevVideoPostProcPanic(EPostProcPanicPauseClipFail));
|
sl@0
|
238 |
}
|
sl@0
|
239 |
|
sl@0
|
240 |
void CMMFTestVideoPostProcHwDevice::AbortDirectScreenAccess()
|
sl@0
|
241 |
{
|
sl@0
|
242 |
// do nothing - there is no way to check this
|
sl@0
|
243 |
}
|
sl@0
|
244 |
|
sl@0
|
245 |
TBool CMMFTestVideoPostProcHwDevice::IsPlaying()
|
sl@0
|
246 |
{
|
sl@0
|
247 |
return iIsPlaying;
|
sl@0
|
248 |
}
|
sl@0
|
249 |
|
sl@0
|
250 |
void CMMFTestVideoPostProcHwDevice::Redraw()
|
sl@0
|
251 |
{
|
sl@0
|
252 |
// do nothing - there is no way to check this
|
sl@0
|
253 |
}
|
sl@0
|
254 |
|
sl@0
|
255 |
void CMMFTestVideoPostProcHwDevice::Start()
|
sl@0
|
256 |
{
|
sl@0
|
257 |
// set iIsPlaying flag
|
sl@0
|
258 |
iIsPlaying = ETrue;
|
sl@0
|
259 |
|
sl@0
|
260 |
// if we're doing the picture tests, start sending pictures to DevVideo
|
sl@0
|
261 |
if (iVideoPictures.Count() > 0)
|
sl@0
|
262 |
{
|
sl@0
|
263 |
iProxy->MdvppNewPicture(&(iVideoPictures[0]));
|
sl@0
|
264 |
}
|
sl@0
|
265 |
}
|
sl@0
|
266 |
|
sl@0
|
267 |
void CMMFTestVideoPostProcHwDevice::Stop()
|
sl@0
|
268 |
{
|
sl@0
|
269 |
iIsPlaying = EFalse;
|
sl@0
|
270 |
}
|
sl@0
|
271 |
|
sl@0
|
272 |
void CMMFTestVideoPostProcHwDevice::Pause()
|
sl@0
|
273 |
{
|
sl@0
|
274 |
iIsPlaying = EFalse;
|
sl@0
|
275 |
}
|
sl@0
|
276 |
|
sl@0
|
277 |
void CMMFTestVideoPostProcHwDevice::Resume()
|
sl@0
|
278 |
{
|
sl@0
|
279 |
iIsPlaying = ETrue;
|
sl@0
|
280 |
}
|
sl@0
|
281 |
|
sl@0
|
282 |
void CMMFTestVideoPostProcHwDevice::SetPosition(const TTimeIntervalMicroSeconds& aPlaybackPosition)
|
sl@0
|
283 |
{
|
sl@0
|
284 |
if (aPlaybackPosition == TTimeIntervalMicroSeconds(KTestPositionFatal))
|
sl@0
|
285 |
{
|
sl@0
|
286 |
iProxy->MdvppFatalError(this, KErrDied);
|
sl@0
|
287 |
}
|
sl@0
|
288 |
else
|
sl@0
|
289 |
{
|
sl@0
|
290 |
__ASSERT_ALWAYS(aPlaybackPosition == TTimeIntervalMicroSeconds(KTestPosition), DevVideoPostProcPanic(EPostProcPanicSetPosition));
|
sl@0
|
291 |
}
|
sl@0
|
292 |
}
|
sl@0
|
293 |
|
sl@0
|
294 |
void CMMFTestVideoPostProcHwDevice::FreezePicture(const TTimeIntervalMicroSeconds& aTimestamp)
|
sl@0
|
295 |
{
|
sl@0
|
296 |
__ASSERT_ALWAYS(aTimestamp == TTimeIntervalMicroSeconds(KTestPosition), DevVideoPostProcPanic(EPostProcPanicFreezePicture));
|
sl@0
|
297 |
}
|
sl@0
|
298 |
|
sl@0
|
299 |
void CMMFTestVideoPostProcHwDevice::ReleaseFreeze(const TTimeIntervalMicroSeconds& aTimestamp)
|
sl@0
|
300 |
{
|
sl@0
|
301 |
__ASSERT_ALWAYS(aTimestamp == TTimeIntervalMicroSeconds(KTestPosition), DevVideoPostProcPanic(EPostProcPanicReleaseFreeze));
|
sl@0
|
302 |
}
|
sl@0
|
303 |
|
sl@0
|
304 |
TTimeIntervalMicroSeconds CMMFTestVideoPostProcHwDevice::PlaybackPosition()
|
sl@0
|
305 |
{
|
sl@0
|
306 |
return TTimeIntervalMicroSeconds(KTestPlayPosition);
|
sl@0
|
307 |
}
|
sl@0
|
308 |
|
sl@0
|
309 |
TUint CMMFTestVideoPostProcHwDevice::PictureBufferBytes()
|
sl@0
|
310 |
{
|
sl@0
|
311 |
return KTestPictureBytes;
|
sl@0
|
312 |
}
|
sl@0
|
313 |
|
sl@0
|
314 |
void CMMFTestVideoPostProcHwDevice::GetPictureCounters(CMMFDevVideoPlay::TPictureCounters& aCounters)
|
sl@0
|
315 |
{
|
sl@0
|
316 |
aCounters = GetTestPictureCounters();
|
sl@0
|
317 |
}
|
sl@0
|
318 |
|
sl@0
|
319 |
void CMMFTestVideoPostProcHwDevice::SetComplexityLevel(TUint aLevel)
|
sl@0
|
320 |
{
|
sl@0
|
321 |
__ASSERT_ALWAYS(aLevel == KTestComplexityLevel2, DevVideoPostProcPanic(EPostProcPanicComplexityLevel));
|
sl@0
|
322 |
}
|
sl@0
|
323 |
|
sl@0
|
324 |
TUint CMMFTestVideoPostProcHwDevice::NumComplexityLevels()
|
sl@0
|
325 |
{
|
sl@0
|
326 |
return KTestNumComplexityLevels2;
|
sl@0
|
327 |
}
|
sl@0
|
328 |
|
sl@0
|
329 |
void CMMFTestVideoPostProcHwDevice::GetComplexityLevelInfo(TUint aLevel, CMMFDevVideoPlay::TComplexityLevelInfo& aInfo)
|
sl@0
|
330 |
{
|
sl@0
|
331 |
__ASSERT_ALWAYS(aLevel == KTestComplexityLevel2, DevVideoPostProcPanic(EPostProcPanicComplexityLevelInfo));
|
sl@0
|
332 |
|
sl@0
|
333 |
aInfo = GetTestLevelInfo(aLevel);;
|
sl@0
|
334 |
}
|
sl@0
|
335 |
|
sl@0
|
336 |
void CMMFTestVideoPostProcHwDevice::ReturnPicture(TVideoPicture* /*aPicture*/)
|
sl@0
|
337 |
{
|
sl@0
|
338 |
switch (iCurrentPicture)
|
sl@0
|
339 |
{
|
sl@0
|
340 |
case 0:
|
sl@0
|
341 |
// Send two more pictures
|
sl@0
|
342 |
iCurrentPicture = 1;
|
sl@0
|
343 |
iProxy->MdvppNewPicture(&(iVideoPictures[1]));
|
sl@0
|
344 |
iCurrentPicture = 2;
|
sl@0
|
345 |
iProxy->MdvppNewPicture(&(iVideoPictures[2]));
|
sl@0
|
346 |
break;
|
sl@0
|
347 |
case 2:
|
sl@0
|
348 |
// Send three more pictures
|
sl@0
|
349 |
iCurrentPicture = 3;
|
sl@0
|
350 |
iProxy->MdvppNewPicture(&(iVideoPictures[3]));
|
sl@0
|
351 |
iCurrentPicture = 4;
|
sl@0
|
352 |
iProxy->MdvppNewPicture(&(iVideoPictures[4]));
|
sl@0
|
353 |
iCurrentPicture = 5;
|
sl@0
|
354 |
iProxy->MdvppNewPicture(&(iVideoPictures[5]));
|
sl@0
|
355 |
break;
|
sl@0
|
356 |
case 5:
|
sl@0
|
357 |
// Send the rest of the pictures
|
sl@0
|
358 |
iCurrentPicture = 6;
|
sl@0
|
359 |
iProxy->MdvppNewPicture(&(iVideoPictures[6]));
|
sl@0
|
360 |
iCurrentPicture = 7;
|
sl@0
|
361 |
iProxy->MdvppNewPicture(&(iVideoPictures[7]));
|
sl@0
|
362 |
iCurrentPicture = 8;
|
sl@0
|
363 |
iProxy->MdvppNewPicture(&(iVideoPictures[8]));
|
sl@0
|
364 |
iCurrentPicture = 9;
|
sl@0
|
365 |
iProxy->MdvppNewPicture(&(iVideoPictures[9]));
|
sl@0
|
366 |
break;
|
sl@0
|
367 |
default:
|
sl@0
|
368 |
break;
|
sl@0
|
369 |
};
|
sl@0
|
370 |
}
|
sl@0
|
371 |
|
sl@0
|
372 |
TBool CMMFTestVideoPostProcHwDevice::GetSnapshotL(TPictureData& aPictureData, const TUncompressedVideoFormat& aFormat)
|
sl@0
|
373 |
{
|
sl@0
|
374 |
TBool ret = EFalse;
|
sl@0
|
375 |
|
sl@0
|
376 |
if (aFormat.iDataFormat == EYuvRawData)
|
sl@0
|
377 |
{
|
sl@0
|
378 |
if (CompareYuvFormats(aFormat.iYuvFormat, KTestYuvFormat1))
|
sl@0
|
379 |
{
|
sl@0
|
380 |
ret = ETrue;
|
sl@0
|
381 |
aPictureData.iDataFormat = EYuvRawData;
|
sl@0
|
382 |
aPictureData.iDataSize = TSize(KTestPictureDataSizeX, KTestPictureDataSizeY);
|
sl@0
|
383 |
aPictureData.iRawData = NULL;
|
sl@0
|
384 |
}
|
sl@0
|
385 |
}
|
sl@0
|
386 |
|
sl@0
|
387 |
return ret;
|
sl@0
|
388 |
}
|
sl@0
|
389 |
|
sl@0
|
390 |
void CMMFTestVideoPostProcHwDevice::GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, const TTimeIntervalMicroSeconds& aPresentationTimestamp)
|
sl@0
|
391 |
{
|
sl@0
|
392 |
if ((aFormat.iDataFormat == EYuvRawData) && (aPresentationTimestamp == TTimeIntervalMicroSeconds(KTestSnapshotTimestamp)) )
|
sl@0
|
393 |
{
|
sl@0
|
394 |
if (CompareYuvFormats(aFormat.iYuvFormat, KTestYuvFormat1))
|
sl@0
|
395 |
{
|
sl@0
|
396 |
aPictureData->iDataFormat = EYuvRawData;
|
sl@0
|
397 |
aPictureData->iDataSize = TSize(KTestPictureDataSizeX, KTestPictureDataSizeY);
|
sl@0
|
398 |
aPictureData->iRawData = NULL;
|
sl@0
|
399 |
|
sl@0
|
400 |
// call the snapshot callback
|
sl@0
|
401 |
iProxy->MdvppTimedSnapshotComplete(KErrNone, aPictureData, aPresentationTimestamp, iPictureId);
|
sl@0
|
402 |
}
|
sl@0
|
403 |
}
|
sl@0
|
404 |
else
|
sl@0
|
405 |
{
|
sl@0
|
406 |
User::Leave(KErrCorrupt);
|
sl@0
|
407 |
}
|
sl@0
|
408 |
}
|
sl@0
|
409 |
|
sl@0
|
410 |
void CMMFTestVideoPostProcHwDevice::GetTimedSnapshotL(TPictureData* aPictureData, const TUncompressedVideoFormat& aFormat, const TPictureId& aPictureId)
|
sl@0
|
411 |
{
|
sl@0
|
412 |
if ((aFormat.iDataFormat == EYuvRawData) &&
|
sl@0
|
413 |
(aPictureId.iIdType == KTestSnapshotId.iIdType) &&
|
sl@0
|
414 |
(aPictureId.iId == KTestSnapshotId.iId) )
|
sl@0
|
415 |
{
|
sl@0
|
416 |
if (CompareYuvFormats(aFormat.iYuvFormat, KTestYuvFormat1))
|
sl@0
|
417 |
{
|
sl@0
|
418 |
aPictureData->iDataFormat = EYuvRawData;
|
sl@0
|
419 |
aPictureData->iDataSize = TSize(KTestPictureDataSizeX, KTestPictureDataSizeY);
|
sl@0
|
420 |
aPictureData->iRawData = NULL;
|
sl@0
|
421 |
|
sl@0
|
422 |
iPictureTimestamp = 0;
|
sl@0
|
423 |
|
sl@0
|
424 |
// call the snapshot callback
|
sl@0
|
425 |
iProxy->MdvppTimedSnapshotComplete(KErrNone, aPictureData, iPictureTimestamp, aPictureId);
|
sl@0
|
426 |
}
|
sl@0
|
427 |
}
|
sl@0
|
428 |
else
|
sl@0
|
429 |
{
|
sl@0
|
430 |
User::Leave(KErrCorrupt);
|
sl@0
|
431 |
}
|
sl@0
|
432 |
}
|
sl@0
|
433 |
|
sl@0
|
434 |
void CMMFTestVideoPostProcHwDevice::CancelTimedSnapshot()
|
sl@0
|
435 |
{
|
sl@0
|
436 |
// call the snapshot callback with error
|
sl@0
|
437 |
iProxy->MdvppTimedSnapshotComplete(KErrAbort, &iPictureData, iPictureTimestamp, iPictureId);
|
sl@0
|
438 |
}
|
sl@0
|
439 |
|
sl@0
|
440 |
void CMMFTestVideoPostProcHwDevice::GetSupportedSnapshotFormatsL(RArray<TUncompressedVideoFormat>& aFormats)
|
sl@0
|
441 |
{
|
sl@0
|
442 |
// append in order 3, 2, 1
|
sl@0
|
443 |
User::LeaveIfError(aFormats.Append(KTestVidFormat1));
|
sl@0
|
444 |
User::LeaveIfError(aFormats.Append(KTestVidFormat2));
|
sl@0
|
445 |
User::LeaveIfError(aFormats.Append(KTestVidFormat3));
|
sl@0
|
446 |
}
|
sl@0
|
447 |
|
sl@0
|
448 |
void CMMFTestVideoPostProcHwDevice::InputEnd()
|
sl@0
|
449 |
{
|
sl@0
|
450 |
iProxy->MdvppStreamEnd();
|
sl@0
|
451 |
}
|
sl@0
|
452 |
|
sl@0
|
453 |
void CMMFTestVideoPostProcHwDevice::SetInputFormatL(const TUncompressedVideoFormat& aFormat)
|
sl@0
|
454 |
{
|
sl@0
|
455 |
if (!(aFormat == KTestVidFormat2))
|
sl@0
|
456 |
{
|
sl@0
|
457 |
User::Leave(KErrCorrupt);
|
sl@0
|
458 |
}
|
sl@0
|
459 |
}
|
sl@0
|
460 |
|
sl@0
|
461 |
void CMMFTestVideoPostProcHwDevice::SetInputDevice(CMMFVideoDecodeHwDevice* /*aDevice*/)
|
sl@0
|
462 |
{
|
sl@0
|
463 |
}
|
sl@0
|
464 |
|
sl@0
|
465 |
void CMMFTestVideoPostProcHwDevice::WritePictureL(TVideoPicture* aPicture)
|
sl@0
|
466 |
{
|
sl@0
|
467 |
iProxy->MdvppReturnPicture(aPicture);
|
sl@0
|
468 |
}
|
sl@0
|
469 |
|
sl@0
|
470 |
void CMMFTestVideoPostProcHwDevice::CommitL()
|
sl@0
|
471 |
{
|
sl@0
|
472 |
}
|
sl@0
|
473 |
|
sl@0
|
474 |
void CMMFTestVideoPostProcHwDevice::Revert()
|
sl@0
|
475 |
{
|
sl@0
|
476 |
}
|
sl@0
|
477 |
|
sl@0
|
478 |
void CMMFTestVideoPostProcHwDevice::SetProxy(MMMFDevVideoPlayProxy& aProxy)
|
sl@0
|
479 |
{
|
sl@0
|
480 |
iProxy = &aProxy;
|
sl@0
|
481 |
}
|
sl@0
|
482 |
|