0
|
1 |
// Copyright (c) 2005-2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
2 |
// All rights reserved.
|
|
3 |
// This component and the accompanying materials are made available
|
|
4 |
// under the terms of "Eclipse Public License v1.0"
|
|
5 |
// which accompanies this distribution, and is available
|
|
6 |
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
|
|
16 |
#include "tsu_mdf_audiocodecs_resolver.h"
|
|
17 |
#include <openmax/il/khronos/v1_x/OMX_Core.h>
|
|
18 |
#include <mmf/server/mmfhwdevicesetup.h>
|
|
19 |
#include <mdf/codecapiresolverdata.h>
|
|
20 |
#include <mdf/codecapiuids.hrh>
|
|
21 |
#include <mmf/server/mmfhwdevicesetup.h>
|
|
22 |
#include <mmf/common/mmffourcc.h>
|
|
23 |
#include <mdf/codecapiresolverutils.h>
|
|
24 |
#include <mdf/codecapivideoresolverutils.h>
|
|
25 |
#include <mdf/codecapiresolverutils.h>
|
|
26 |
#include <mmf/devvideo/devvideoplay.h>
|
|
27 |
#include <mm/mmcleanup.h>
|
|
28 |
|
|
29 |
const TInt KPicSizeX = 320;
|
|
30 |
const TInt KPicSizeY = 200;
|
|
31 |
|
|
32 |
const TReal KPicRate = 100;
|
|
33 |
const TInt KPicWidth = 20;
|
|
34 |
const TInt KPicHeight = 4000;
|
|
35 |
_LIT8(KTextManufactor, "Manufacturer");
|
|
36 |
|
|
37 |
// *********************************************************
|
|
38 |
// Loads a PU using the FourCC and using the Custom Resolver
|
|
39 |
// *********************************************************
|
|
40 |
|
|
41 |
RTestStepAudioCodecLoadFourCC::RTestStepAudioCodecLoadFourCC()
|
|
42 |
{
|
|
43 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0004");
|
|
44 |
}
|
|
45 |
|
|
46 |
TVerdict RTestStepAudioCodecLoadFourCC::DoTestStepL()
|
|
47 |
{
|
|
48 |
__UHEAP_MARK;
|
|
49 |
TFourCC aSrcDataType, aDestDataType;
|
|
50 |
INFO_PRINTF1(_L("Test loading two PU using 2 FourCCs"));
|
|
51 |
// create the OMX Core
|
|
52 |
CCodecApiResolverData* customMatchData = CCodecApiResolverData::NewLC();
|
|
53 |
customMatchData->SetMatchType(EMatchInputAndOutputDataFormat);
|
|
54 |
customMatchData->SetImplementationType(TUid::Uid(0x1027379e));
|
|
55 |
// string value of the input source data
|
|
56 |
HBufC8* packageData = HBufC8::NewLC(KMaxDataTypeLength);
|
|
57 |
TPtr8 sourceData = packageData->Des();
|
|
58 |
TFourCC srcDataType = KMMFFourCCCodeTestPCM8;
|
|
59 |
srcDataType.FourCC(&sourceData);
|
|
60 |
customMatchData->SetInputDataL(sourceData);
|
|
61 |
|
|
62 |
TFourCC destDataType = KMMFFourCCCodePCM16;
|
|
63 |
destDataType.FourCC(&sourceData);
|
|
64 |
customMatchData->SetOutputDataL(sourceData);
|
|
65 |
|
|
66 |
HBufC8* package = customMatchData->NewPackLC();
|
|
67 |
TPtr8 packageDes = package->Des();
|
|
68 |
TEComResolverParams resolverParams; // Parameters on which to match
|
|
69 |
resolverParams.SetDataType(packageDes);
|
|
70 |
|
|
71 |
RImplInfoPtrArray ecomArray;
|
|
72 |
CleanupResetAndDestroyPushL(ecomArray);
|
|
73 |
|
|
74 |
TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidMdfProcessingUnit),
|
|
75 |
resolverParams, TUid::Uid(0x1027379b), ecomArray));
|
|
76 |
|
|
77 |
if (error != KErrNone)
|
|
78 |
{
|
|
79 |
CleanupStack::PopAndDestroy(3); // customMatchData, packageData, package
|
|
80 |
return EFail;
|
|
81 |
}
|
|
82 |
|
|
83 |
// verify if the resolver found any PUs
|
|
84 |
TInt noOfProcessingUnits = ecomArray.Count();
|
|
85 |
if(noOfProcessingUnits == 0)
|
|
86 |
{
|
|
87 |
INFO_PRINTF1(_L("PU Resolver did not find any PU with these data"));
|
|
88 |
return EFail;
|
|
89 |
}
|
|
90 |
|
|
91 |
// verify if one of the PUs found is what we are looking for
|
|
92 |
for(TInt index = 0; index < noOfProcessingUnits; index++)
|
|
93 |
{
|
|
94 |
TUid uid = ecomArray[index]->ImplementationUid();
|
|
95 |
CCodecApiOpaqueData* parse = NULL;
|
|
96 |
const TDesC8* opaqueData = &(ecomArray[index]->OpaqueData());
|
|
97 |
// if opaque data is empty, move to the next element in the list
|
|
98 |
if (opaqueData->Length() == 0)
|
|
99 |
{
|
|
100 |
INFO_PRINTF1(_L("PU Resolver returned a PU with empty opaque data"));
|
|
101 |
return EFail;
|
|
102 |
}
|
|
103 |
|
|
104 |
TRAPD(error, parse = CCodecApiOpaqueData::NewL(*opaqueData));
|
|
105 |
if (error!=KErrNone)
|
|
106 |
{
|
|
107 |
if (error==KErrNotSupported)
|
|
108 |
{
|
|
109 |
// means that the resource entry was not valid
|
|
110 |
INFO_PRINTF1(_L("PU Resolver returned a PU with invalid opaque data"));
|
|
111 |
return EFail;
|
|
112 |
}
|
|
113 |
}
|
|
114 |
CleanupStack::PushL(parse);
|
|
115 |
HBufC8* inputDataFormat = customMatchData->InputDataFormat().AllocLC();
|
|
116 |
HBufC8* outputDataFormat = customMatchData->OutputDataFormat().AllocLC();
|
|
117 |
if(!parse->CompareInputDataType(*inputDataFormat)
|
|
118 |
&& !parse->CompareOutputDataType(*outputDataFormat))
|
|
119 |
{
|
|
120 |
INFO_PRINTF1(_L("PU Resolver returned a PU with a different input and output data type"));
|
|
121 |
return EFail;
|
|
122 |
}
|
|
123 |
CleanupStack::PopAndDestroy(3);
|
|
124 |
}
|
|
125 |
|
|
126 |
CleanupStack::PopAndDestroy(4); // customMatchData, packageData, package, ecomArray
|
|
127 |
REComSession::FinalClose();
|
|
128 |
__UHEAP_MARKEND;
|
|
129 |
|
|
130 |
INFO_PRINTF1(_L("PU Resolver returned the correct PU"));
|
|
131 |
return EPass;
|
|
132 |
}
|
|
133 |
|
|
134 |
// ***************************************************************
|
|
135 |
// Finds a PU using the FourCC and Custom Resolver with P8 src
|
|
136 |
// ***************************************************************
|
|
137 |
|
|
138 |
RTestStepAudioCodecFindP8InputFourCC::RTestStepAudioCodecFindP8InputFourCC()
|
|
139 |
{
|
|
140 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0005");
|
|
141 |
}
|
|
142 |
|
|
143 |
TVerdict RTestStepAudioCodecFindP8InputFourCC::DoTestStepL()
|
|
144 |
{
|
|
145 |
__UHEAP_MARK;
|
|
146 |
TFourCC aSrcDataType;
|
|
147 |
INFO_PRINTF1(_L("Test locates the PU using just the source data type (P8) and the version"));
|
|
148 |
// create the OMX Core
|
|
149 |
CCodecApiResolverData* customMatchData = CCodecApiResolverData::NewLC();
|
|
150 |
customMatchData->SetMatchType(EMatchInputDataFormat);
|
|
151 |
customMatchData->SetImplementationType(TUid::Uid(0x1027379e));
|
|
152 |
// string value of the input source data
|
|
153 |
HBufC8* packageData = HBufC8::NewLC(KMaxDataTypeLength);
|
|
154 |
TPtr8 sourceData = packageData->Des();
|
|
155 |
TFourCC srcDataType = KMMFFourCCCodeTestPCM8;
|
|
156 |
srcDataType.FourCC(&sourceData);
|
|
157 |
customMatchData->SetInputDataL(sourceData);
|
|
158 |
|
|
159 |
// Not setting destination type
|
|
160 |
HBufC8* package = customMatchData->NewPackLC();
|
|
161 |
TPtr8 packageDes = package->Des();
|
|
162 |
TEComResolverParams resolverParams; // Parameters on which to match
|
|
163 |
resolverParams.SetDataType(packageDes);
|
|
164 |
|
|
165 |
RImplInfoPtrArray ecomArray;
|
|
166 |
CleanupResetAndDestroyPushL(ecomArray);
|
|
167 |
|
|
168 |
TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidMdfProcessingUnit),
|
|
169 |
resolverParams, TUid::Uid(0x1027379b), ecomArray));
|
|
170 |
|
|
171 |
if (error != KErrNone)
|
|
172 |
{
|
|
173 |
CleanupStack::PopAndDestroy(3); // customMatchData, packageData, package
|
|
174 |
return EFail;
|
|
175 |
}
|
|
176 |
|
|
177 |
// check if there are any
|
|
178 |
TInt noOfProcessingUnits = ecomArray.Count();
|
|
179 |
if(noOfProcessingUnits == 0)
|
|
180 |
{
|
|
181 |
return EFail;
|
|
182 |
}
|
|
183 |
// verify if one of the PUs found is what we are looking for
|
|
184 |
for(TInt index = 0; index < noOfProcessingUnits; index++)
|
|
185 |
{
|
|
186 |
TUid uid = ecomArray[index]->ImplementationUid();
|
|
187 |
CCodecApiOpaqueData* parse = NULL;
|
|
188 |
const TDesC8* opaqueData = &(ecomArray[index]->OpaqueData());
|
|
189 |
// if opaque data is empty, move to the next element in the list
|
|
190 |
if (opaqueData->Length() == 0)
|
|
191 |
{
|
|
192 |
INFO_PRINTF1(_L("PU Resolver returned a PU with empty opaque data"));
|
|
193 |
return EFail;
|
|
194 |
}
|
|
195 |
|
|
196 |
TRAPD(error, parse = CCodecApiOpaqueData::NewL(*opaqueData));
|
|
197 |
if (error!=KErrNone)
|
|
198 |
{
|
|
199 |
if (error==KErrNotSupported)
|
|
200 |
{
|
|
201 |
// means that the resource entry was not valid
|
|
202 |
INFO_PRINTF1(_L("PU Resolver returned a PU with invalid opaque data"));
|
|
203 |
return EFail;
|
|
204 |
}
|
|
205 |
}
|
|
206 |
CleanupStack::PushL(parse);
|
|
207 |
HBufC8* inputDataFormat = customMatchData->InputDataFormat().AllocLC();
|
|
208 |
if(!parse->CompareInputDataType(*inputDataFormat) )
|
|
209 |
{
|
|
210 |
INFO_PRINTF1(_L("PU Resolver returned a PU with a different input data type"));
|
|
211 |
return EFail;
|
|
212 |
}
|
|
213 |
CleanupStack::PopAndDestroy(2);
|
|
214 |
}
|
|
215 |
|
|
216 |
CleanupStack::PopAndDestroy(4); // customMatchData, packageData, package, ecomArray
|
|
217 |
REComSession::FinalClose();
|
|
218 |
__UHEAP_MARKEND;
|
|
219 |
INFO_PRINTF1(_L("The resolver located correctly the PU using just the source data type (P8) and the version"));
|
|
220 |
return EPass;
|
|
221 |
}
|
|
222 |
|
|
223 |
// ********************************************************************************
|
|
224 |
// Finds a PU using the FourCC and using the Custom Resolver with PU8 destination
|
|
225 |
// ********************************************************************************
|
|
226 |
|
|
227 |
RTestStepAudioCodecFindPU8OutputFourCC::RTestStepAudioCodecFindPU8OutputFourCC()
|
|
228 |
{
|
|
229 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0006");
|
|
230 |
}
|
|
231 |
|
|
232 |
TVerdict RTestStepAudioCodecFindPU8OutputFourCC::DoTestStepL()
|
|
233 |
{
|
|
234 |
__UHEAP_MARK;
|
|
235 |
TFourCC aDestDataType;
|
|
236 |
INFO_PRINTF1(_L("Test locates the PU using just the destination data type (PU8) and the version"));
|
|
237 |
// create the OMX Core
|
|
238 |
CCodecApiResolverData* customMatchData = CCodecApiResolverData::NewLC();
|
|
239 |
customMatchData->SetMatchType(EMatchOutputDataFormat);
|
|
240 |
customMatchData->SetImplementationType(TUid::Uid(0x1027379e));
|
|
241 |
// string value of the input source data
|
|
242 |
HBufC8* packageData = HBufC8::NewLC(KMaxDataTypeLength);
|
|
243 |
TPtr8 destData = packageData->Des();
|
|
244 |
|
|
245 |
// Not setting source type
|
|
246 |
|
|
247 |
TFourCC destDataType = KMMFFourCCCodeTestPCMU8;
|
|
248 |
destDataType.FourCC(&destData);
|
|
249 |
customMatchData->SetOutputDataL(destData);
|
|
250 |
|
|
251 |
HBufC8* package = customMatchData->NewPackLC();
|
|
252 |
TPtr8 packageDes = package->Des();
|
|
253 |
TEComResolverParams resolverParams; // Parameters on which to match
|
|
254 |
resolverParams.SetDataType(packageDes);
|
|
255 |
|
|
256 |
RImplInfoPtrArray ecomArray;
|
|
257 |
CleanupResetAndDestroyPushL(ecomArray);
|
|
258 |
|
|
259 |
TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidMdfProcessingUnit),
|
|
260 |
resolverParams, TUid::Uid(0x1027379b), ecomArray));
|
|
261 |
|
|
262 |
if (error != KErrNone)
|
|
263 |
{
|
|
264 |
CleanupStack::PopAndDestroy(3); // customMatchData, packageData, package
|
|
265 |
return EFail;
|
|
266 |
}
|
|
267 |
|
|
268 |
// check if there are any
|
|
269 |
TInt noOfProcessingUnits = ecomArray.Count();
|
|
270 |
if(noOfProcessingUnits == 0)
|
|
271 |
{
|
|
272 |
return EFail;
|
|
273 |
}
|
|
274 |
|
|
275 |
// verify if one of the PUs found is what we are looking for
|
|
276 |
for(TInt index = 0; index < noOfProcessingUnits; index++)
|
|
277 |
{
|
|
278 |
TUid uid = ecomArray[index]->ImplementationUid();
|
|
279 |
CCodecApiOpaqueData* parse = NULL;
|
|
280 |
const TDesC8* opaqueData = &(ecomArray[index]->OpaqueData());
|
|
281 |
// if opaque data is empty, move to the next element in the list
|
|
282 |
if (opaqueData->Length() == 0)
|
|
283 |
{
|
|
284 |
INFO_PRINTF1(_L("PU Resolver returned a PU with empty opaque data"));
|
|
285 |
return EFail;
|
|
286 |
}
|
|
287 |
|
|
288 |
TRAPD(error, parse = CCodecApiOpaqueData::NewL(*opaqueData));
|
|
289 |
if (error!=KErrNone)
|
|
290 |
{
|
|
291 |
if (error==KErrNotSupported)
|
|
292 |
{
|
|
293 |
// means that the resource entry was not valid
|
|
294 |
INFO_PRINTF1(_L("PU Resolver returned a PU with invalid opaque data"));
|
|
295 |
return EFail;
|
|
296 |
}
|
|
297 |
}
|
|
298 |
CleanupStack::PushL(parse);
|
|
299 |
HBufC8* outputDataFormat = customMatchData->OutputDataFormat().AllocLC();
|
|
300 |
if(!parse->CompareOutputDataType(*outputDataFormat))
|
|
301 |
{
|
|
302 |
INFO_PRINTF1(_L("PU Resolver returned a PU with a different output data type"));
|
|
303 |
return EFail;
|
|
304 |
}
|
|
305 |
CleanupStack::PopAndDestroy(2);
|
|
306 |
}
|
|
307 |
|
|
308 |
|
|
309 |
CleanupStack::PopAndDestroy(4); // customMatchData, packageData, package, ecomArray
|
|
310 |
REComSession::FinalClose();
|
|
311 |
__UHEAP_MARKEND;
|
|
312 |
INFO_PRINTF1(_L("The resolver located the PU using just the destination data type (PU8) and the version"));
|
|
313 |
return EPass;
|
|
314 |
}
|
|
315 |
|
|
316 |
// **************************************************************************************************
|
|
317 |
// Attempts to find a PU using the FourCC and Custom Resolver with correct version but incorrect src
|
|
318 |
// **************************************************************************************************
|
|
319 |
|
|
320 |
RTestStepAudioCodecFindIncorrectInputFourCC::RTestStepAudioCodecFindIncorrectInputFourCC()
|
|
321 |
{
|
|
322 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0008");
|
|
323 |
}
|
|
324 |
|
|
325 |
TVerdict RTestStepAudioCodecFindIncorrectInputFourCC::DoTestStepL()
|
|
326 |
{
|
|
327 |
__UHEAP_MARK;
|
|
328 |
TFourCC aSrcDataType;
|
|
329 |
INFO_PRINTF1(_L("Test attempts to locate the PU using the correct version, but incorrect source data type"));
|
|
330 |
// create the OMX Core
|
|
331 |
CCodecApiResolverData* customMatchData = CCodecApiResolverData::NewLC();
|
|
332 |
customMatchData->SetMatchType(EMatchInputDataFormat);
|
|
333 |
customMatchData->SetImplementationType(TUid::Uid(0x1027379e));
|
|
334 |
// string value of the input source data
|
|
335 |
HBufC8* packageData = HBufC8::NewLC(KMaxDataTypeLength);
|
|
336 |
TPtr8 sourceData = packageData->Des();
|
|
337 |
TFourCC srcDataType = KMMFFourCCCodeNULL;
|
|
338 |
srcDataType.FourCC(&sourceData);
|
|
339 |
customMatchData->SetInputDataL(sourceData);
|
|
340 |
|
|
341 |
// Not setting destination type
|
|
342 |
|
|
343 |
HBufC8* package = customMatchData->NewPackLC();
|
|
344 |
TPtr8 packageDes = package->Des();
|
|
345 |
TEComResolverParams resolverParams; // Parameters on which to match
|
|
346 |
resolverParams.SetDataType(packageDes);
|
|
347 |
|
|
348 |
RImplInfoPtrArray ecomArray;
|
|
349 |
CleanupResetAndDestroyPushL(ecomArray);
|
|
350 |
|
|
351 |
TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidMdfProcessingUnit),
|
|
352 |
resolverParams, TUid::Uid(0x1027379b), ecomArray));
|
|
353 |
|
|
354 |
if (error != KErrNone)
|
|
355 |
{
|
|
356 |
CleanupStack::PopAndDestroy(3); // customMatchData, packageData, package
|
|
357 |
return EFail;
|
|
358 |
}
|
|
359 |
|
|
360 |
// check if there are any
|
|
361 |
TInt noOfProcessingUnits = ecomArray.Count();
|
|
362 |
CleanupStack::PopAndDestroy(4); // customMatchData, packageData, package, ecomArray
|
|
363 |
REComSession::FinalClose();
|
|
364 |
__UHEAP_MARK;
|
|
365 |
if(noOfProcessingUnits == 0)
|
|
366 |
{
|
|
367 |
// Should be zero, since no implementations of type KCMdfProcessingUnit can deal with KMMFFourCCCodeNULL
|
|
368 |
return EPass;
|
|
369 |
}
|
|
370 |
|
|
371 |
return EFail;
|
|
372 |
}
|
|
373 |
|
|
374 |
|
|
375 |
// *******************************************************************************************
|
|
376 |
// Attempts to find a PU using the FourCC and Custom Resolver with the correct interface UID,
|
|
377 |
// but incorrect implementation UID.
|
|
378 |
// *******************************************************************************************
|
|
379 |
|
|
380 |
RTestStepAudioCodecFindIncorrectImpUid::RTestStepAudioCodecFindIncorrectImpUid()
|
|
381 |
{
|
|
382 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0009");
|
|
383 |
}
|
|
384 |
|
|
385 |
TVerdict RTestStepAudioCodecFindIncorrectImpUid::DoTestStepL()
|
|
386 |
{
|
|
387 |
__UHEAP_MARK;
|
|
388 |
TFourCC aSrcDataType;
|
|
389 |
INFO_PRINTF1(_L("Test attempts to locate the PU with the correct interface UID, but incorrect implementation UID."));
|
|
390 |
// create the OMX Core
|
|
391 |
CCodecApiResolverData* customMatchData = CCodecApiResolverData::NewLC();
|
|
392 |
customMatchData->SetMatchType(EMatchInputDataFormat);
|
|
393 |
// Set implementation interface as incorrect - from KUidMediaTypeAudio
|
|
394 |
customMatchData->SetImplementationType(TUid::Uid(0x101f5d07));
|
|
395 |
// string value of the input source data
|
|
396 |
HBufC8* packageData = HBufC8::NewLC(KMaxDataTypeLength);
|
|
397 |
TPtr8 sourceData = packageData->Des();
|
|
398 |
TFourCC srcDataType = KMMFFourCCCodeTestPCM8;
|
|
399 |
srcDataType.FourCC(&sourceData);
|
|
400 |
customMatchData->SetInputDataL(sourceData);
|
|
401 |
|
|
402 |
TFourCC destDataType = KMMFFourCCCodePCM16;
|
|
403 |
destDataType.FourCC(&sourceData);
|
|
404 |
customMatchData->SetOutputDataL(sourceData);
|
|
405 |
|
|
406 |
HBufC8* package = customMatchData->NewPackLC();
|
|
407 |
TPtr8 packageDes = package->Des();
|
|
408 |
TEComResolverParams resolverParams; // Parameters on which to match
|
|
409 |
resolverParams.SetDataType(packageDes);
|
|
410 |
|
|
411 |
RImplInfoPtrArray ecomArray;
|
|
412 |
CleanupResetAndDestroyPushL(ecomArray);
|
|
413 |
|
|
414 |
// Interface Uid is correct
|
|
415 |
TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(KUidMdfProcessingUnit),
|
|
416 |
resolverParams, TUid::Uid(0x1027379b), ecomArray));
|
|
417 |
|
|
418 |
if (error != KErrNone)
|
|
419 |
{
|
|
420 |
CleanupStack::PopAndDestroy(3); // customMatchData, packageData, package
|
|
421 |
return EFail;
|
|
422 |
}
|
|
423 |
|
|
424 |
// check if there are any
|
|
425 |
TInt noOfProcessingUnits = ecomArray.Count();
|
|
426 |
CleanupStack::PopAndDestroy(4); // customMatchData, packageData, package, ecomArray
|
|
427 |
REComSession::FinalClose();
|
|
428 |
__UHEAP_MARKEND;
|
|
429 |
if(noOfProcessingUnits == 0)
|
|
430 |
{
|
|
431 |
// Should be zero, since no implementations
|
|
432 |
return EPass;
|
|
433 |
}
|
|
434 |
|
|
435 |
return EFail;
|
|
436 |
}
|
|
437 |
|
|
438 |
// *******************************************************************************************
|
|
439 |
// Attempts to find a PU using the FourCC and Custom Resolver with the correct implementation
|
|
440 |
// UID, but incorrect interface UID.
|
|
441 |
// *******************************************************************************************
|
|
442 |
|
|
443 |
RTestStepAudioCodecFindIncorrectInterfaceUid::RTestStepAudioCodecFindIncorrectInterfaceUid()
|
|
444 |
{
|
|
445 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0010");
|
|
446 |
}
|
|
447 |
|
|
448 |
TVerdict RTestStepAudioCodecFindIncorrectInterfaceUid::DoTestStepL()
|
|
449 |
{
|
|
450 |
__UHEAP_MARK;
|
|
451 |
TFourCC aSrcDataType;
|
|
452 |
INFO_PRINTF1(_L("Test attempts to locate the PU with the correct interface UID, but incorrect implementation UID."));
|
|
453 |
// create the OMX Core
|
|
454 |
CCodecApiResolverData* customMatchData = CCodecApiResolverData::NewLC();
|
|
455 |
customMatchData->SetMatchType(EMatchInputDataFormat);
|
|
456 |
// Set implementation interface as correct
|
|
457 |
customMatchData->SetImplementationType(TUid::Uid(0x1027379e));
|
|
458 |
// string value of the input source data
|
|
459 |
HBufC8* packageData = HBufC8::NewLC(KMaxDataTypeLength);
|
|
460 |
TPtr8 sourceData = packageData->Des();
|
|
461 |
TFourCC srcDataType = KMMFFourCCCodeTestPCM8;
|
|
462 |
srcDataType.FourCC(&sourceData);
|
|
463 |
customMatchData->SetInputDataL(sourceData);
|
|
464 |
|
|
465 |
TFourCC destDataType = KMMFFourCCCodePCM16;
|
|
466 |
destDataType.FourCC(&sourceData);
|
|
467 |
customMatchData->SetOutputDataL(sourceData);
|
|
468 |
|
|
469 |
HBufC8* package = customMatchData->NewPackLC();
|
|
470 |
TPtr8 packageDes = package->Des();
|
|
471 |
TEComResolverParams resolverParams; // Parameters on which to match
|
|
472 |
resolverParams.SetDataType(packageDes);
|
|
473 |
|
|
474 |
RImplInfoPtrArray ecomArray;
|
|
475 |
CleanupResetAndDestroyPushL(ecomArray);
|
|
476 |
|
|
477 |
// Interface Uid is incorrect - from KMmfUidPluginInterfaceDataSource
|
|
478 |
TRAPD(error, REComSession::ListImplementationsL(TUid::Uid(0x101F53AF),
|
|
479 |
resolverParams, TUid::Uid(0x1027379b), ecomArray));
|
|
480 |
|
|
481 |
if (error != KErrNone)
|
|
482 |
{
|
|
483 |
CleanupStack::PopAndDestroy(3); // customMatchData, packageData, package
|
|
484 |
return EFail;
|
|
485 |
}
|
|
486 |
|
|
487 |
// check if there are any
|
|
488 |
TInt noOfProcessingUnits = ecomArray.Count();
|
|
489 |
CleanupStack::PopAndDestroy(4); // customMatchData, packageData, package, ecomArray
|
|
490 |
REComSession::FinalClose();
|
|
491 |
__UHEAP_MARKEND;
|
|
492 |
if(noOfProcessingUnits == 0)
|
|
493 |
{
|
|
494 |
// Should be zero, since no implementations
|
|
495 |
return EPass;
|
|
496 |
}
|
|
497 |
|
|
498 |
return EFail;
|
|
499 |
}
|
|
500 |
|
|
501 |
|
|
502 |
RTestStepVideoResolverUtils::RTestStepVideoResolverUtils()
|
|
503 |
{
|
|
504 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0011");
|
|
505 |
}
|
|
506 |
|
|
507 |
TVerdict RTestStepVideoResolverUtils::DoTestStepL()
|
|
508 |
{
|
|
509 |
INFO_PRINTF1(_L("Tests the video resolver utility "));
|
|
510 |
_LIT8(KText, "<m>Manufacturer<p>320,200<l>100,20,4000");
|
|
511 |
TBufC8<50> data(KText);
|
|
512 |
TPtr8 ptrData = data.Des();
|
|
513 |
|
|
514 |
CCodecApiVideoOpaqueData* codecApiVideoOpaqueData = CCodecApiVideoOpaqueData::NewLC(ptrData);
|
|
515 |
|
|
516 |
// verify the picture size
|
|
517 |
TSize picSize = codecApiVideoOpaqueData->MaxPictureSize();
|
|
518 |
if (picSize.iWidth != KPicSizeX &&
|
|
519 |
picSize.iHeight != KPicSizeY)
|
|
520 |
{
|
|
521 |
INFO_PRINTF1(_L("Incorrect picture size"));
|
|
522 |
return EFail;
|
|
523 |
}
|
|
524 |
|
|
525 |
RArray<TPictureRateAndSize> pictureRateAndSize = codecApiVideoOpaqueData->MaxPictureRates();
|
|
526 |
TUint arraySize = pictureRateAndSize.Count();
|
|
527 |
if (arraySize == 0)
|
|
528 |
{
|
|
529 |
INFO_PRINTF1(_L("No picture rate and size extracted from the opaque data"));
|
|
530 |
CleanupStack::PopAndDestroy(codecApiVideoOpaqueData);
|
|
531 |
return EFail;
|
|
532 |
}
|
|
533 |
|
|
534 |
INFO_PRINTF2(_L("No picture rate and size extracted from the opaque data, %d"), pictureRateAndSize[0].iPictureRate);
|
|
535 |
if (pictureRateAndSize[0].iPictureRate != KPicRate)
|
|
536 |
{
|
|
537 |
INFO_PRINTF1(_L("Incorrect picture rate"));
|
|
538 |
CleanupStack::PopAndDestroy(codecApiVideoOpaqueData);
|
|
539 |
return EFail;
|
|
540 |
}
|
|
541 |
|
|
542 |
if (pictureRateAndSize[0].iPictureSize.iWidth != KPicWidth)
|
|
543 |
{
|
|
544 |
INFO_PRINTF1(_L("Incorrect picture width"));
|
|
545 |
CleanupStack::PopAndDestroy(codecApiVideoOpaqueData);
|
|
546 |
return EFail;
|
|
547 |
}
|
|
548 |
|
|
549 |
if (pictureRateAndSize[0].iPictureSize.iHeight != KPicHeight)
|
|
550 |
{
|
|
551 |
INFO_PRINTF1(_L("Incorrect picture heigh"));
|
|
552 |
CleanupStack::PopAndDestroy(codecApiVideoOpaqueData);
|
|
553 |
return EFail;
|
|
554 |
}
|
|
555 |
|
|
556 |
TDesC8 manufacturer = codecApiVideoOpaqueData->Manufacturer();
|
|
557 |
if(manufacturer.Compare(KTextManufactor) == 0)
|
|
558 |
{
|
|
559 |
INFO_PRINTF1(_L("Incorrect manufacturer"));
|
|
560 |
CleanupStack::PopAndDestroy(codecApiVideoOpaqueData);
|
|
561 |
return EFail;
|
|
562 |
}
|
|
563 |
|
|
564 |
CleanupStack::PopAndDestroy(codecApiVideoOpaqueData);
|
|
565 |
return EPass;
|
|
566 |
}
|
|
567 |
|
|
568 |
|
|
569 |
// *******************************************************************************************
|
|
570 |
// Attempts to find a PU using the FourCC and Custom Resolver with the correct implementation
|
|
571 |
// UID, but incorrect interface UID.
|
|
572 |
// *******************************************************************************************
|
|
573 |
RTestStepResolverUtils::RTestStepResolverUtils()
|
|
574 |
{
|
|
575 |
iTestStepName = _L("MM-MDF-AUDIOCODECS-0012");
|
|
576 |
}
|
|
577 |
|
|
578 |
TVerdict RTestStepResolverUtils::DoTestStepL()
|
|
579 |
{
|
|
580 |
INFO_PRINTF1(_L("Tests the video resolver utility "));
|
|
581 |
_LIT8(KText, "<s>");
|
|
582 |
TBufC8<50> data(KText);
|
|
583 |
TPtr8 ptrData = data.Des();
|
|
584 |
|
|
585 |
CCodecApiOpaqueData* codecApiOpaqueData = CCodecApiOpaqueData::NewLC(ptrData);
|
|
586 |
const TDesC8 inputData = codecApiOpaqueData->InputDataType();
|
|
587 |
if (inputData.CompareF(KNullDesC8) != 0)
|
|
588 |
{
|
|
589 |
INFO_PRINTF1(_L("Incorrect manufacturer"));
|
|
590 |
CleanupStack::PopAndDestroy(codecApiOpaqueData);
|
|
591 |
return EFail;
|
|
592 |
}
|
|
593 |
|
|
594 |
const TDesC8 outputData = codecApiOpaqueData->OutputDataType();
|
|
595 |
if (outputData.CompareF(KNullDesC8) != 0)
|
|
596 |
{
|
|
597 |
INFO_PRINTF1(_L("Incorrect manufacturer"));
|
|
598 |
CleanupStack::PopAndDestroy(codecApiOpaqueData);
|
|
599 |
return EFail;
|
|
600 |
}
|
|
601 |
|
|
602 |
CleanupStack::PopAndDestroy(codecApiOpaqueData);
|
|
603 |
return EPass;
|
|
604 |
}
|
|
605 |
|