sl@0
|
1 |
// Copyright (c) 2008-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 <e32std.h>
|
sl@0
|
17 |
#include "tsu_3gplibrary_composer_api.h"
|
sl@0
|
18 |
|
sl@0
|
19 |
_LIT8(KDummyData, "DummyData");
|
sl@0
|
20 |
_LIT8(KFtypAtom, "ftyp");
|
sl@0
|
21 |
_LIT8(K3g2Brand, "3g2a"); // 3g2a
|
sl@0
|
22 |
_LIT8(K3gpBrand, "3gp"); // 3gp4, 3gp6
|
sl@0
|
23 |
_LIT8(KMp4Brand, "mp42"); // mp42
|
sl@0
|
24 |
|
sl@0
|
25 |
_LIT(KLargeVideoFile, "c:\\3gplibrary\\cube-xvid-640x480-10fps-10s.3gp");
|
sl@0
|
26 |
const TInt KLargeFileWriteBufferSize = 16384; // 16K
|
sl@0
|
27 |
const TInt KLargeFileWriteBufferMaxCount = 15;
|
sl@0
|
28 |
const TInt64 K3GigaBytes = 0xC0000000;
|
sl@0
|
29 |
|
sl@0
|
30 |
// -----------------------------------------------------------------------------
|
sl@0
|
31 |
// C3GPLibComposeBase - this should not be used directly
|
sl@0
|
32 |
// -----------------------------------------------------------------------------
|
sl@0
|
33 |
//
|
sl@0
|
34 |
C3GPLibComposeBase::C3GPLibComposeBase()
|
sl@0
|
35 |
{
|
sl@0
|
36 |
}
|
sl@0
|
37 |
|
sl@0
|
38 |
TVerdict C3GPLibComposeBase::doTestStepPreambleL()
|
sl@0
|
39 |
{
|
sl@0
|
40 |
// ensure there's always a Active Scheduler for the Composer
|
sl@0
|
41 |
if (!CActiveScheduler::Current())
|
sl@0
|
42 |
{
|
sl@0
|
43 |
iScheduler = new (ELeave) CActiveScheduler;
|
sl@0
|
44 |
CActiveScheduler::Install(iScheduler);
|
sl@0
|
45 |
}
|
sl@0
|
46 |
|
sl@0
|
47 |
SetTestStepResult(EPass);
|
sl@0
|
48 |
return TestStepResult();
|
sl@0
|
49 |
}
|
sl@0
|
50 |
|
sl@0
|
51 |
TVerdict C3GPLibComposeBase::doTestStepPostambleL()
|
sl@0
|
52 |
{
|
sl@0
|
53 |
if (iScheduler)
|
sl@0
|
54 |
{
|
sl@0
|
55 |
CActiveScheduler::Install(NULL);
|
sl@0
|
56 |
delete iScheduler;
|
sl@0
|
57 |
}
|
sl@0
|
58 |
|
sl@0
|
59 |
return TestStepResult();
|
sl@0
|
60 |
}
|
sl@0
|
61 |
|
sl@0
|
62 |
TVerdict C3GPLibComposeBase::doTestStepL()
|
sl@0
|
63 |
{
|
sl@0
|
64 |
if (TestStepResult() != EPass)
|
sl@0
|
65 |
{
|
sl@0
|
66 |
return TestStepResult();
|
sl@0
|
67 |
}
|
sl@0
|
68 |
SetTestStepError(KErrNone);
|
sl@0
|
69 |
|
sl@0
|
70 |
C3GPCompose* composer = doTestStepCreateComposerL();
|
sl@0
|
71 |
CleanupStack::PushL(composer);
|
sl@0
|
72 |
|
sl@0
|
73 |
doTestStepComposeOpenL(*composer);
|
sl@0
|
74 |
if (TestStepResult() == EPass)
|
sl@0
|
75 |
{
|
sl@0
|
76 |
// set it to EFail, if both calls below does not leave, then it will be reset
|
sl@0
|
77 |
// back to EPass
|
sl@0
|
78 |
SetTestStepResult(EFail);
|
sl@0
|
79 |
doTestStepComposeWriteVideoAudioL(*composer);
|
sl@0
|
80 |
doTestStepComposeSetUserDataL(*composer);
|
sl@0
|
81 |
SetTestStepResult(EPass);
|
sl@0
|
82 |
}
|
sl@0
|
83 |
|
sl@0
|
84 |
TInt err = composer->Complete();
|
sl@0
|
85 |
if (err != KErrNone)
|
sl@0
|
86 |
{
|
sl@0
|
87 |
SetTestStepResult(EFail);
|
sl@0
|
88 |
User::Leave(err);
|
sl@0
|
89 |
}
|
sl@0
|
90 |
CleanupStack::PopAndDestroy(composer);
|
sl@0
|
91 |
|
sl@0
|
92 |
return TestStepResult();
|
sl@0
|
93 |
}
|
sl@0
|
94 |
|
sl@0
|
95 |
C3GPCompose* C3GPLibComposeBase::doTestStepCreateComposerL()
|
sl@0
|
96 |
{
|
sl@0
|
97 |
return C3GPCompose::NewL();
|
sl@0
|
98 |
}
|
sl@0
|
99 |
|
sl@0
|
100 |
void C3GPLibComposeBase::doTestStepComposeWriteVideoAudioL(C3GPCompose& /* aComposer */)
|
sl@0
|
101 |
{
|
sl@0
|
102 |
}
|
sl@0
|
103 |
|
sl@0
|
104 |
void C3GPLibComposeBase::doTestStepComposeSetUserDataL(C3GPCompose& /* aComposer */)
|
sl@0
|
105 |
{
|
sl@0
|
106 |
}
|
sl@0
|
107 |
|
sl@0
|
108 |
// -----------------------------------------------------------------------------
|
sl@0
|
109 |
// C3GPLibComposeFilename
|
sl@0
|
110 |
// -----------------------------------------------------------------------------
|
sl@0
|
111 |
//
|
sl@0
|
112 |
C3GPLibComposeFilename::C3GPLibComposeFilename()
|
sl@0
|
113 |
{
|
sl@0
|
114 |
}
|
sl@0
|
115 |
|
sl@0
|
116 |
TVerdict C3GPLibComposeFilename::doTestStepPreambleL()
|
sl@0
|
117 |
{
|
sl@0
|
118 |
// ensure all basic setup is completed first
|
sl@0
|
119 |
C3GPLibComposeBase::doTestStepPreambleL();
|
sl@0
|
120 |
if (TestStepResult() == EPass)
|
sl@0
|
121 |
{
|
sl@0
|
122 |
TPtrC fileNamePtr;
|
sl@0
|
123 |
if (GetStringFromConfig(ConfigSection(), _L("filename"), fileNamePtr))
|
sl@0
|
124 |
{
|
sl@0
|
125 |
// save a copy of the filename specified for the test
|
sl@0
|
126 |
iFilename.CreateL(fileNamePtr);
|
sl@0
|
127 |
}
|
sl@0
|
128 |
else
|
sl@0
|
129 |
{
|
sl@0
|
130 |
// cannot find filename!
|
sl@0
|
131 |
ERR_PRINTF1(_L("Filename not specified. Test cannot proceed."));
|
sl@0
|
132 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
133 |
}
|
sl@0
|
134 |
}
|
sl@0
|
135 |
|
sl@0
|
136 |
return TestStepResult();
|
sl@0
|
137 |
}
|
sl@0
|
138 |
|
sl@0
|
139 |
TVerdict C3GPLibComposeFilename::doTestStepPostambleL()
|
sl@0
|
140 |
{
|
sl@0
|
141 |
iFilename.Close();
|
sl@0
|
142 |
|
sl@0
|
143 |
// clean up all composer test base setups
|
sl@0
|
144 |
C3GPLibComposeBase::doTestStepPostambleL();
|
sl@0
|
145 |
|
sl@0
|
146 |
return TestStepResult();
|
sl@0
|
147 |
}
|
sl@0
|
148 |
|
sl@0
|
149 |
void C3GPLibComposeFilename::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
150 |
{
|
sl@0
|
151 |
T3GPAudioPropertiesMpeg4Audio audio(100, KDummyData);
|
sl@0
|
152 |
T3GPVideoPropertiesAvc video(100, TSize(100, 100), KDummyData);
|
sl@0
|
153 |
|
sl@0
|
154 |
TInt err = aComposer.Open(E3GP3GP, &video, &audio, iFilename);
|
sl@0
|
155 |
if (err != KErrNone)
|
sl@0
|
156 |
{
|
sl@0
|
157 |
if (!ShouldRunOOMTest())
|
sl@0
|
158 |
{
|
sl@0
|
159 |
ERR_PRINTF2(_L("C3GPCompose::Open failed with error = %d"), err);
|
sl@0
|
160 |
}
|
sl@0
|
161 |
SetTestStepError(err);
|
sl@0
|
162 |
SetTestStepResult(EFail);
|
sl@0
|
163 |
}
|
sl@0
|
164 |
else
|
sl@0
|
165 |
{
|
sl@0
|
166 |
INFO_PRINTF1(_L("C3GPCompose::Open completes with no error"));
|
sl@0
|
167 |
SetTestStepResult(EPass);
|
sl@0
|
168 |
}
|
sl@0
|
169 |
}
|
sl@0
|
170 |
|
sl@0
|
171 |
// -----------------------------------------------------------------------------
|
sl@0
|
172 |
// C3GPLibComposeWithoutOpen
|
sl@0
|
173 |
// -----------------------------------------------------------------------------
|
sl@0
|
174 |
//
|
sl@0
|
175 |
C3GPLibComposeWithoutOpen::C3GPLibComposeWithoutOpen()
|
sl@0
|
176 |
{
|
sl@0
|
177 |
}
|
sl@0
|
178 |
|
sl@0
|
179 |
void C3GPLibComposeWithoutOpen::doTestStepComposeOpenL(C3GPCompose& /* aComposer */)
|
sl@0
|
180 |
{
|
sl@0
|
181 |
// This test needs the composer NOT initialised. Do nothing here
|
sl@0
|
182 |
}
|
sl@0
|
183 |
|
sl@0
|
184 |
void C3GPLibComposeWithoutOpen::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
185 |
{
|
sl@0
|
186 |
if (TestStepResult() != EPass)
|
sl@0
|
187 |
{
|
sl@0
|
188 |
return;
|
sl@0
|
189 |
}
|
sl@0
|
190 |
|
sl@0
|
191 |
TInt err = aComposer.WriteVideoFrame(KDummyData, 100, ETrue);
|
sl@0
|
192 |
if (err != KErrNotReady)
|
sl@0
|
193 |
{
|
sl@0
|
194 |
ERR_PRINTF2(_L("C3GPCompose::WriteVideoFrame failed with error = %d instead of KErrNotReady"), err);
|
sl@0
|
195 |
SetTestStepResult(EFail);
|
sl@0
|
196 |
}
|
sl@0
|
197 |
|
sl@0
|
198 |
if (TestStepResult() == EPass)
|
sl@0
|
199 |
{
|
sl@0
|
200 |
T3GPFrameDependencies dependencies;
|
sl@0
|
201 |
err = aComposer.WriteVideoFrame(KDummyData, 100, ETrue, dependencies);
|
sl@0
|
202 |
if (err != KErrNotReady)
|
sl@0
|
203 |
{
|
sl@0
|
204 |
ERR_PRINTF2(_L("C3GPCompose::WriteVideoFrame failed with error = %d instead of KErrNotReady"), err);
|
sl@0
|
205 |
SetTestStepResult(EFail);
|
sl@0
|
206 |
}
|
sl@0
|
207 |
}
|
sl@0
|
208 |
|
sl@0
|
209 |
if (TestStepResult() == EPass)
|
sl@0
|
210 |
{
|
sl@0
|
211 |
err = aComposer.WriteAudioFrames(KDummyData, 100);
|
sl@0
|
212 |
if (err != KErrNotReady)
|
sl@0
|
213 |
{
|
sl@0
|
214 |
ERR_PRINTF2(_L("C3GPCompose::WriteAudioFrames failed with error = %d instead of KErrNotReady"), err);
|
sl@0
|
215 |
SetTestStepResult(EFail);
|
sl@0
|
216 |
}
|
sl@0
|
217 |
}
|
sl@0
|
218 |
}
|
sl@0
|
219 |
|
sl@0
|
220 |
void C3GPLibComposeWithoutOpen::doTestStepComposeSetUserDataL(C3GPCompose& aComposer)
|
sl@0
|
221 |
{
|
sl@0
|
222 |
if (TestStepResult() != EPass)
|
sl@0
|
223 |
{
|
sl@0
|
224 |
return;
|
sl@0
|
225 |
}
|
sl@0
|
226 |
|
sl@0
|
227 |
TInt err = aComposer.SetUserData(E3GPUdtaMoov, KDummyData);
|
sl@0
|
228 |
if (err != KErrNotReady)
|
sl@0
|
229 |
{
|
sl@0
|
230 |
ERR_PRINTF2(_L("C3GPCompose::SetUserData failed with error = %d instead of KErrNotReady"), err);
|
sl@0
|
231 |
SetTestStepResult(EFail);
|
sl@0
|
232 |
}
|
sl@0
|
233 |
|
sl@0
|
234 |
if (TestStepResult() == EPass)
|
sl@0
|
235 |
{
|
sl@0
|
236 |
err = aComposer.SetUserData(E3GPUdtaVideoTrak, KDummyData);
|
sl@0
|
237 |
if (err != KErrNotReady)
|
sl@0
|
238 |
{
|
sl@0
|
239 |
ERR_PRINTF2(_L("C3GPCompose::SetUserData failed with error = %d instead of KErrNotReady"), err);
|
sl@0
|
240 |
SetTestStepResult(EFail);
|
sl@0
|
241 |
}
|
sl@0
|
242 |
}
|
sl@0
|
243 |
|
sl@0
|
244 |
if (TestStepResult() == EPass)
|
sl@0
|
245 |
{
|
sl@0
|
246 |
err = aComposer.SetUserData(E3GPUdtaAudioTrak, KDummyData);
|
sl@0
|
247 |
if (err != KErrNotReady)
|
sl@0
|
248 |
{
|
sl@0
|
249 |
ERR_PRINTF2(_L("C3GPCompose::SetUserData failed with error = %d instead of KErrNotReady"), err);
|
sl@0
|
250 |
SetTestStepResult(EFail);
|
sl@0
|
251 |
}
|
sl@0
|
252 |
}
|
sl@0
|
253 |
}
|
sl@0
|
254 |
|
sl@0
|
255 |
// -----------------------------------------------------------------------------
|
sl@0
|
256 |
// C3GPLibComposeFile
|
sl@0
|
257 |
// -----------------------------------------------------------------------------
|
sl@0
|
258 |
//
|
sl@0
|
259 |
C3GPLibComposeFile::C3GPLibComposeFile() :
|
sl@0
|
260 |
iInputFileFormat(E3GP3GP),
|
sl@0
|
261 |
iVideoType(E3GPNoVideo),
|
sl@0
|
262 |
iAudioType(E3GPNoAudio)
|
sl@0
|
263 |
{
|
sl@0
|
264 |
}
|
sl@0
|
265 |
|
sl@0
|
266 |
TVerdict C3GPLibComposeFile::doTestStepPreambleL()
|
sl@0
|
267 |
{
|
sl@0
|
268 |
// ensure the base class setup is completed first
|
sl@0
|
269 |
C3GPLibComposeBase::doTestStepPreambleL();
|
sl@0
|
270 |
if (TestStepResult() == EPass)
|
sl@0
|
271 |
{
|
sl@0
|
272 |
TInt temp;
|
sl@0
|
273 |
if (GetIntFromConfig(ConfigSection(), _L("inputFormat"), temp))
|
sl@0
|
274 |
{
|
sl@0
|
275 |
iInputFileFormat = (T3GPFileFormatType)temp;
|
sl@0
|
276 |
|
sl@0
|
277 |
if (GetIntFromConfig(ConfigSection(), _L("video"), temp))
|
sl@0
|
278 |
{
|
sl@0
|
279 |
iVideoType = (T3GPVideoType)temp;
|
sl@0
|
280 |
}
|
sl@0
|
281 |
|
sl@0
|
282 |
if (GetIntFromConfig(ConfigSection(), _L("audio"), temp))
|
sl@0
|
283 |
{
|
sl@0
|
284 |
iAudioType = (T3GPAudioType)temp;
|
sl@0
|
285 |
}
|
sl@0
|
286 |
|
sl@0
|
287 |
if (iVideoType == E3GPNoVideo && iAudioType == E3GPNoAudio)
|
sl@0
|
288 |
{
|
sl@0
|
289 |
// At least audio or video should be specified
|
sl@0
|
290 |
ERR_PRINTF1(_L("Specify at least video or audio"));
|
sl@0
|
291 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
292 |
}
|
sl@0
|
293 |
else
|
sl@0
|
294 |
{
|
sl@0
|
295 |
#ifdef __WINSCW__
|
sl@0
|
296 |
_LIT(KTestFolderName, "testFolderNameEmu");
|
sl@0
|
297 |
#else
|
sl@0
|
298 |
_LIT(KTestFolderName, "testFolderNameHw");
|
sl@0
|
299 |
#endif
|
sl@0
|
300 |
|
sl@0
|
301 |
TPtrC testFolderName;
|
sl@0
|
302 |
if (GetStringFromConfig(_L("general"), KTestFolderName, testFolderName))
|
sl@0
|
303 |
{
|
sl@0
|
304 |
TInt err = iFs.Connect();
|
sl@0
|
305 |
if (err == KErrNone)
|
sl@0
|
306 |
{
|
sl@0
|
307 |
iFs.MkDirAll(testFolderName);
|
sl@0
|
308 |
|
sl@0
|
309 |
TFileName fileName;
|
sl@0
|
310 |
// Create a temp file for the composer to write data into
|
sl@0
|
311 |
err = iFile.Temp(iFs, testFolderName, fileName, EFileShareExclusive);
|
sl@0
|
312 |
if (err == KErrNone)
|
sl@0
|
313 |
{
|
sl@0
|
314 |
iFileName.CreateL(fileName);
|
sl@0
|
315 |
}
|
sl@0
|
316 |
}
|
sl@0
|
317 |
|
sl@0
|
318 |
if (err != KErrNone)
|
sl@0
|
319 |
{
|
sl@0
|
320 |
ERR_PRINTF1(_L("Fail to create temp file for testing."));
|
sl@0
|
321 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
322 |
}
|
sl@0
|
323 |
}
|
sl@0
|
324 |
else
|
sl@0
|
325 |
{
|
sl@0
|
326 |
ERR_PRINTF1(_L("Fail to provide test directory."));
|
sl@0
|
327 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
328 |
}
|
sl@0
|
329 |
}
|
sl@0
|
330 |
}
|
sl@0
|
331 |
else
|
sl@0
|
332 |
{
|
sl@0
|
333 |
// file format has to be specified
|
sl@0
|
334 |
ERR_PRINTF1(_L("Specify file format of the file to be composed"));
|
sl@0
|
335 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
336 |
}
|
sl@0
|
337 |
}
|
sl@0
|
338 |
|
sl@0
|
339 |
return TestStepResult();
|
sl@0
|
340 |
}
|
sl@0
|
341 |
|
sl@0
|
342 |
TVerdict C3GPLibComposeFile::doTestStepPostambleL()
|
sl@0
|
343 |
{
|
sl@0
|
344 |
// clean up of temp file
|
sl@0
|
345 |
iFile.Close();
|
sl@0
|
346 |
iFs.Delete(iFileName);
|
sl@0
|
347 |
iFs.Close();
|
sl@0
|
348 |
|
sl@0
|
349 |
iFileName.Close();
|
sl@0
|
350 |
|
sl@0
|
351 |
// clean up all composer test base setups
|
sl@0
|
352 |
C3GPLibComposeBase::doTestStepPostambleL();
|
sl@0
|
353 |
|
sl@0
|
354 |
return TestStepResult();
|
sl@0
|
355 |
}
|
sl@0
|
356 |
|
sl@0
|
357 |
void C3GPLibComposeFile::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
358 |
{
|
sl@0
|
359 |
T3GPVideoPropertiesBase* video = SetupVideoPropertiesL();
|
sl@0
|
360 |
CleanupStack::PushL(video);
|
sl@0
|
361 |
|
sl@0
|
362 |
T3GPAudioPropertiesBase* audio = SetupAudioPropertiesL();
|
sl@0
|
363 |
CleanupStack::PushL(audio);
|
sl@0
|
364 |
|
sl@0
|
365 |
TInt err = aComposer.Open(iInputFileFormat, video, audio, iFile);
|
sl@0
|
366 |
if (err == KErrNone)
|
sl@0
|
367 |
{
|
sl@0
|
368 |
SetTestStepResult(EPass);
|
sl@0
|
369 |
}
|
sl@0
|
370 |
else
|
sl@0
|
371 |
{
|
sl@0
|
372 |
if (!ShouldRunOOMTest())
|
sl@0
|
373 |
{
|
sl@0
|
374 |
ERR_PRINTF2(_L("C3GPLibComposeFile::doTestStepComposeOpenL => C3GPComposer::Open returns = %d"), err);
|
sl@0
|
375 |
}
|
sl@0
|
376 |
SetTestStepError(err);
|
sl@0
|
377 |
SetTestStepResult(EInconclusive);
|
sl@0
|
378 |
}
|
sl@0
|
379 |
|
sl@0
|
380 |
CleanupStack::PopAndDestroy(2); // audio, video
|
sl@0
|
381 |
}
|
sl@0
|
382 |
|
sl@0
|
383 |
void C3GPLibComposeFile::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
384 |
{
|
sl@0
|
385 |
// add a dummy video frame. The content is of no importance for this test case,
|
sl@0
|
386 |
// only the file format is of interest
|
sl@0
|
387 |
TInt err = KErrNone;
|
sl@0
|
388 |
|
sl@0
|
389 |
if (iVideoType != E3GPNoVideo)
|
sl@0
|
390 |
{
|
sl@0
|
391 |
err = aComposer.WriteVideoFrame(KDummyData, 10, ETrue);
|
sl@0
|
392 |
if (err != KErrNone)
|
sl@0
|
393 |
{
|
sl@0
|
394 |
ERR_PRINTF2(_L("Fail to write video frame, err = %d"), err);
|
sl@0
|
395 |
}
|
sl@0
|
396 |
}
|
sl@0
|
397 |
|
sl@0
|
398 |
if (err == KErrNone && iAudioType != E3GPNoAudio)
|
sl@0
|
399 |
{
|
sl@0
|
400 |
// add a dummy audio frame. The content is of no importance for this test case,
|
sl@0
|
401 |
// only the file format is of interest
|
sl@0
|
402 |
err = aComposer.WriteAudioFrames(KDummyData, 10);
|
sl@0
|
403 |
if (err != KErrNone)
|
sl@0
|
404 |
{
|
sl@0
|
405 |
ERR_PRINTF2(_L("Fail to write audio frame, err = %d"), err);
|
sl@0
|
406 |
}
|
sl@0
|
407 |
}
|
sl@0
|
408 |
|
sl@0
|
409 |
if (err != KErrNone)
|
sl@0
|
410 |
{
|
sl@0
|
411 |
SetTestStepResult(EInconclusive);
|
sl@0
|
412 |
}
|
sl@0
|
413 |
}
|
sl@0
|
414 |
|
sl@0
|
415 |
T3GPVideoPropertiesBase* C3GPLibComposeFile::SetupVideoPropertiesL()
|
sl@0
|
416 |
{
|
sl@0
|
417 |
if (iVideoType == E3GPNoVideo)
|
sl@0
|
418 |
{
|
sl@0
|
419 |
return NULL;
|
sl@0
|
420 |
}
|
sl@0
|
421 |
|
sl@0
|
422 |
// create a dummy video property for setting the composer
|
sl@0
|
423 |
T3GPVideoPropertiesBase* video = NULL;
|
sl@0
|
424 |
switch(iVideoType)
|
sl@0
|
425 |
{
|
sl@0
|
426 |
case E3GPMpeg4Video:
|
sl@0
|
427 |
video = SetupMpeg4VideoL();
|
sl@0
|
428 |
break;
|
sl@0
|
429 |
|
sl@0
|
430 |
case E3GPAvcProfileBaseline:
|
sl@0
|
431 |
case E3GPAvcProfileMain:
|
sl@0
|
432 |
case E3GPAvcProfileExtended:
|
sl@0
|
433 |
case E3GPAvcProfileHigh:
|
sl@0
|
434 |
video = SetupAvcVideoL();
|
sl@0
|
435 |
break;
|
sl@0
|
436 |
|
sl@0
|
437 |
case E3GPH263Profile0:
|
sl@0
|
438 |
case E3GPH263Profile3:
|
sl@0
|
439 |
video = SetupH263VideoL();
|
sl@0
|
440 |
break;
|
sl@0
|
441 |
|
sl@0
|
442 |
default:
|
sl@0
|
443 |
User::Leave(KErrUnknown);
|
sl@0
|
444 |
}
|
sl@0
|
445 |
|
sl@0
|
446 |
return video;
|
sl@0
|
447 |
}
|
sl@0
|
448 |
|
sl@0
|
449 |
T3GPVideoPropertiesBase* C3GPLibComposeFile::SetupAvcVideoL()
|
sl@0
|
450 |
{
|
sl@0
|
451 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesAvc(1000, TSize(100, 100), KDummyData);
|
sl@0
|
452 |
return video;
|
sl@0
|
453 |
}
|
sl@0
|
454 |
|
sl@0
|
455 |
T3GPVideoPropertiesBase* C3GPLibComposeFile::SetupH263VideoL()
|
sl@0
|
456 |
{
|
sl@0
|
457 |
T3GPVideoPropertiesH263::TProfile profile = T3GPVideoPropertiesH263::EProfile0;
|
sl@0
|
458 |
if (iVideoType == E3GPH263Profile3)
|
sl@0
|
459 |
{
|
sl@0
|
460 |
profile = T3GPVideoPropertiesH263::EProfile3;
|
sl@0
|
461 |
}
|
sl@0
|
462 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesH263(1000, TSize(100, 100), 10, profile);
|
sl@0
|
463 |
return video;
|
sl@0
|
464 |
}
|
sl@0
|
465 |
|
sl@0
|
466 |
T3GPVideoPropertiesBase* C3GPLibComposeFile::SetupMpeg4VideoL()
|
sl@0
|
467 |
{
|
sl@0
|
468 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesMpeg4Video(1000, TSize(100, 100), 4000, 400, KDummyData);
|
sl@0
|
469 |
return video;
|
sl@0
|
470 |
}
|
sl@0
|
471 |
|
sl@0
|
472 |
T3GPAudioPropertiesBase* C3GPLibComposeFile::SetupAudioPropertiesL()
|
sl@0
|
473 |
{
|
sl@0
|
474 |
if (iAudioType == E3GPNoAudio)
|
sl@0
|
475 |
{
|
sl@0
|
476 |
return NULL;
|
sl@0
|
477 |
}
|
sl@0
|
478 |
|
sl@0
|
479 |
// create a dummy audio property for setting the composer
|
sl@0
|
480 |
T3GPAudioPropertiesBase* audio = NULL;
|
sl@0
|
481 |
switch(iAudioType)
|
sl@0
|
482 |
{
|
sl@0
|
483 |
case E3GPMpeg4Video:
|
sl@0
|
484 |
audio = SetupMpeg4AudioL();
|
sl@0
|
485 |
break;
|
sl@0
|
486 |
|
sl@0
|
487 |
case E3GPQcelp13K:
|
sl@0
|
488 |
audio = SetupQcelpAudioL();
|
sl@0
|
489 |
break;
|
sl@0
|
490 |
|
sl@0
|
491 |
case E3GPAmrNB:
|
sl@0
|
492 |
case E3GPAmrWB:
|
sl@0
|
493 |
audio = SetupAmrAudioL();
|
sl@0
|
494 |
break;
|
sl@0
|
495 |
|
sl@0
|
496 |
default:
|
sl@0
|
497 |
User::Leave(KErrUnknown);
|
sl@0
|
498 |
break;
|
sl@0
|
499 |
}
|
sl@0
|
500 |
|
sl@0
|
501 |
return audio;
|
sl@0
|
502 |
}
|
sl@0
|
503 |
|
sl@0
|
504 |
T3GPAudioPropertiesBase* C3GPLibComposeFile::SetupQcelpAudioL()
|
sl@0
|
505 |
{
|
sl@0
|
506 |
// for this test's purpose, just use the default QCELP sample entry storage mode
|
sl@0
|
507 |
T3GPAudioPropertiesBase* audio = new (ELeave) T3GPAudioPropertiesQcelp(1000, 10);
|
sl@0
|
508 |
return audio;
|
sl@0
|
509 |
}
|
sl@0
|
510 |
|
sl@0
|
511 |
T3GPAudioPropertiesBase* C3GPLibComposeFile::SetupAmrAudioL()
|
sl@0
|
512 |
{
|
sl@0
|
513 |
T3GPAudioPropertiesAmr::TSpeechCodec codec = T3GPAudioPropertiesAmr::EAmrWB;
|
sl@0
|
514 |
if (iAudioType == E3GPAmrNB)
|
sl@0
|
515 |
{
|
sl@0
|
516 |
codec = T3GPAudioPropertiesAmr::EAmrNB;
|
sl@0
|
517 |
}
|
sl@0
|
518 |
T3GPAudioPropertiesBase* audio = new (ELeave) T3GPAudioPropertiesAmr(1000, 10, 150, codec);
|
sl@0
|
519 |
return audio;
|
sl@0
|
520 |
}
|
sl@0
|
521 |
|
sl@0
|
522 |
T3GPAudioPropertiesBase* C3GPLibComposeFile::SetupMpeg4AudioL()
|
sl@0
|
523 |
{
|
sl@0
|
524 |
T3GPAudioPropertiesBase* audio = new (ELeave)T3GPAudioPropertiesMpeg4Audio(1000, KDummyData);
|
sl@0
|
525 |
return audio;
|
sl@0
|
526 |
}
|
sl@0
|
527 |
|
sl@0
|
528 |
// -----------------------------------------------------------------------------
|
sl@0
|
529 |
// C3GPLibComposeFileWithFileFormatCheck
|
sl@0
|
530 |
// -----------------------------------------------------------------------------
|
sl@0
|
531 |
//
|
sl@0
|
532 |
C3GPLibComposeFileWithFileFormatCheck::C3GPLibComposeFileWithFileFormatCheck() :
|
sl@0
|
533 |
iOutputFileFormat(E3GP3GP)
|
sl@0
|
534 |
{
|
sl@0
|
535 |
}
|
sl@0
|
536 |
|
sl@0
|
537 |
TVerdict C3GPLibComposeFileWithFileFormatCheck::doTestStepPreambleL()
|
sl@0
|
538 |
{
|
sl@0
|
539 |
// ensure base class setup is completed first
|
sl@0
|
540 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
541 |
|
sl@0
|
542 |
if (TestStepResult() == EPass)
|
sl@0
|
543 |
{
|
sl@0
|
544 |
TInt temp;
|
sl@0
|
545 |
if (!GetIntFromConfig(ConfigSection(), _L("outputFormat"), temp))
|
sl@0
|
546 |
{
|
sl@0
|
547 |
ERR_PRINTF1(_L("outputFormat not specified"));
|
sl@0
|
548 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
549 |
}
|
sl@0
|
550 |
else
|
sl@0
|
551 |
{
|
sl@0
|
552 |
iOutputFileFormat = (T3GPFileFormatType)temp;
|
sl@0
|
553 |
}
|
sl@0
|
554 |
}
|
sl@0
|
555 |
|
sl@0
|
556 |
return TestStepResult();
|
sl@0
|
557 |
}
|
sl@0
|
558 |
|
sl@0
|
559 |
TVerdict C3GPLibComposeFileWithFileFormatCheck::doTestStepL()
|
sl@0
|
560 |
{
|
sl@0
|
561 |
if (TestStepResult() != EPass)
|
sl@0
|
562 |
{
|
sl@0
|
563 |
return TestStepResult();
|
sl@0
|
564 |
}
|
sl@0
|
565 |
|
sl@0
|
566 |
// this triggers:
|
sl@0
|
567 |
// 1. Create a composer
|
sl@0
|
568 |
// 2. Open the composer - C3GPLibComposeFileFormatCheck::doTestStepComposeOpenL
|
sl@0
|
569 |
// 3. Write Video & Audio Data - C3GPLibComposeFileFormatCheck::doTestStepComposeWriteVideoAudioL
|
sl@0
|
570 |
// 4. Write User Data - C3GPLibComposeFileFormatCheck::doTestStepComposeSetUserDataL
|
sl@0
|
571 |
// 5. Complete the composer
|
sl@0
|
572 |
TVerdict verdict = C3GPLibComposeFile::doTestStepL();
|
sl@0
|
573 |
if (verdict == EPass)
|
sl@0
|
574 |
{
|
sl@0
|
575 |
// once the file is composed, it can be verified if the file composed is the same as the
|
sl@0
|
576 |
// expected file format
|
sl@0
|
577 |
verdict = VerifyFileFormatL(iFile);
|
sl@0
|
578 |
}
|
sl@0
|
579 |
else
|
sl@0
|
580 |
{
|
sl@0
|
581 |
INFO_PRINTF1(_L("<C3GPLibComposeFileWithFileFormatCheck> C3GPLibComposeFile::doTestStepL returns failed result"));
|
sl@0
|
582 |
}
|
sl@0
|
583 |
SetTestStepResult(verdict);
|
sl@0
|
584 |
|
sl@0
|
585 |
if (!ShouldRunOOMTest())
|
sl@0
|
586 |
{
|
sl@0
|
587 |
INFO_PRINTF2(_L("C3GPLibComposeFile::doTestStepL returns %d"), TestStepResult());
|
sl@0
|
588 |
}
|
sl@0
|
589 |
return TestStepResult();
|
sl@0
|
590 |
}
|
sl@0
|
591 |
|
sl@0
|
592 |
TVerdict C3GPLibComposeFileWithFileFormatCheck::VerifyFileFormatL(const RFile& aFile)
|
sl@0
|
593 |
{
|
sl@0
|
594 |
// Seek to the beginning of the file
|
sl@0
|
595 |
TInt pos = 0;
|
sl@0
|
596 |
User::LeaveIfError(aFile.Seek(ESeekStart, pos));
|
sl@0
|
597 |
|
sl@0
|
598 |
TVerdict verdict = EFail;
|
sl@0
|
599 |
TBuf8<4> atom;
|
sl@0
|
600 |
|
sl@0
|
601 |
while(ETrue)
|
sl@0
|
602 |
{
|
sl@0
|
603 |
// read the file content and search for the 'ftyp' atom to check
|
sl@0
|
604 |
// the 32bit value of brand attribute immediately following the 'ftyp' type.
|
sl@0
|
605 |
User::LeaveIfError(aFile.Read(atom));
|
sl@0
|
606 |
if (atom.Length() < atom.MaxLength())
|
sl@0
|
607 |
{
|
sl@0
|
608 |
break;
|
sl@0
|
609 |
}
|
sl@0
|
610 |
|
sl@0
|
611 |
// read 4 bytes at a time, if 'ftyp' is found
|
sl@0
|
612 |
if (Mem::Compare((&KFtypAtom)->Ptr(), (&KFtypAtom)->Length(), atom.Ptr(), atom.Length()) == 0)
|
sl@0
|
613 |
{
|
sl@0
|
614 |
// read 4 more bytes, and it should contain the brand value
|
sl@0
|
615 |
User::LeaveIfError(aFile.Read(atom));
|
sl@0
|
616 |
if (atom.Length() < atom.MaxLength())
|
sl@0
|
617 |
{
|
sl@0
|
618 |
// cannot read brand value, test failed.
|
sl@0
|
619 |
ERR_PRINTF1(_L("Failed to read enough data for comparison."));
|
sl@0
|
620 |
break;
|
sl@0
|
621 |
}
|
sl@0
|
622 |
|
sl@0
|
623 |
switch(iOutputFileFormat)
|
sl@0
|
624 |
{
|
sl@0
|
625 |
case E3GP3G2:
|
sl@0
|
626 |
{
|
sl@0
|
627 |
// check if file type is 3G2
|
sl@0
|
628 |
if (!ShouldRunOOMTest())
|
sl@0
|
629 |
{
|
sl@0
|
630 |
INFO_PRINTF1(_L("Check 3GP2 file format."));
|
sl@0
|
631 |
}
|
sl@0
|
632 |
if (Mem::Compare((&K3g2Brand)->Ptr(), (&K3g2Brand)->Length(), atom.Ptr(), atom.Length()) == 0)
|
sl@0
|
633 |
{
|
sl@0
|
634 |
verdict = EPass;
|
sl@0
|
635 |
break;
|
sl@0
|
636 |
}
|
sl@0
|
637 |
}
|
sl@0
|
638 |
break;
|
sl@0
|
639 |
|
sl@0
|
640 |
case E3GPMP4:
|
sl@0
|
641 |
{
|
sl@0
|
642 |
if (!ShouldRunOOMTest())
|
sl@0
|
643 |
{
|
sl@0
|
644 |
INFO_PRINTF1(_L("Check MP4 file format."));
|
sl@0
|
645 |
}
|
sl@0
|
646 |
// check if file type is MP4
|
sl@0
|
647 |
if (Mem::Compare((&KMp4Brand)->Ptr(), (&KMp4Brand)->Length(), atom.Ptr(), atom.Length()) == 0)
|
sl@0
|
648 |
{
|
sl@0
|
649 |
verdict = EPass;
|
sl@0
|
650 |
}
|
sl@0
|
651 |
}
|
sl@0
|
652 |
break;
|
sl@0
|
653 |
|
sl@0
|
654 |
case E3GP3GP:
|
sl@0
|
655 |
{
|
sl@0
|
656 |
if (!ShouldRunOOMTest())
|
sl@0
|
657 |
{
|
sl@0
|
658 |
INFO_PRINTF1(_L("Check 3GP file format."));
|
sl@0
|
659 |
}
|
sl@0
|
660 |
// check if file type is 3GP
|
sl@0
|
661 |
// Both 3gp4 & 3gp6 are valid brands, thus checking ONLY "3gp" instead of the full atom size
|
sl@0
|
662 |
if (Mem::Compare((&K3gpBrand)->Ptr(), (&K3gpBrand)->Length(), atom.Ptr(), (&K3gpBrand)->Length()) == 0)
|
sl@0
|
663 |
{
|
sl@0
|
664 |
verdict = EPass;
|
sl@0
|
665 |
}
|
sl@0
|
666 |
}
|
sl@0
|
667 |
break;
|
sl@0
|
668 |
|
sl@0
|
669 |
default:
|
sl@0
|
670 |
INFO_PRINTF1(_L("Unknown format expected."));
|
sl@0
|
671 |
verdict = EInconclusive;
|
sl@0
|
672 |
break;
|
sl@0
|
673 |
}
|
sl@0
|
674 |
|
sl@0
|
675 |
// ftyp is found, regardless of the result, finish reading the file
|
sl@0
|
676 |
break;
|
sl@0
|
677 |
}
|
sl@0
|
678 |
}
|
sl@0
|
679 |
|
sl@0
|
680 |
return verdict;
|
sl@0
|
681 |
}
|
sl@0
|
682 |
|
sl@0
|
683 |
// -----------------------------------------------------------------------------
|
sl@0
|
684 |
// C3GPLibComposeFrameDependency
|
sl@0
|
685 |
// -----------------------------------------------------------------------------
|
sl@0
|
686 |
//
|
sl@0
|
687 |
C3GPLibComposeFrameDependency::C3GPLibComposeFrameDependency()
|
sl@0
|
688 |
{
|
sl@0
|
689 |
}
|
sl@0
|
690 |
|
sl@0
|
691 |
void C3GPLibComposeFrameDependency::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
692 |
{
|
sl@0
|
693 |
TInt err = KErrNone;
|
sl@0
|
694 |
T3GPFrameDependencies dep;
|
sl@0
|
695 |
|
sl@0
|
696 |
for (TInt i = 0; i <= (TInt)E3GPDependencyNone; i++)
|
sl@0
|
697 |
{
|
sl@0
|
698 |
for (TInt j = 0; j <= (TInt)E3GPDependencyNone; j++)
|
sl@0
|
699 |
{
|
sl@0
|
700 |
for (TInt k = 0; k <= (TInt)E3GPRedundancyNone; k++)
|
sl@0
|
701 |
{
|
sl@0
|
702 |
dep.iDependsOn = (T3GPVideoFrameDependency)i;
|
sl@0
|
703 |
dep.iIsDependedOn = (T3GPVideoFrameDependency)j;
|
sl@0
|
704 |
dep.iHasRedundancy = (T3GPVideoFrameRedundancy)k;
|
sl@0
|
705 |
|
sl@0
|
706 |
// add a dummy video frame. The content is of no importance for this test case,
|
sl@0
|
707 |
// only the different dependency/redundancy is the focus of this test
|
sl@0
|
708 |
err = aComposer.WriteVideoFrame(KDummyData, 100, ETrue, dep);
|
sl@0
|
709 |
if (err != KErrNone)
|
sl@0
|
710 |
{
|
sl@0
|
711 |
ERR_PRINTF2(_L("C3GPCompose::WriteVideoFrame (with frame dependency) failed with error = %d"), err);
|
sl@0
|
712 |
SetTestStepResult(EFail);
|
sl@0
|
713 |
break;
|
sl@0
|
714 |
}
|
sl@0
|
715 |
}
|
sl@0
|
716 |
}
|
sl@0
|
717 |
}
|
sl@0
|
718 |
}
|
sl@0
|
719 |
|
sl@0
|
720 |
// -----------------------------------------------------------------------------
|
sl@0
|
721 |
// C3GPLibComposeVideoProperties
|
sl@0
|
722 |
// -----------------------------------------------------------------------------
|
sl@0
|
723 |
//
|
sl@0
|
724 |
C3GPLibComposeVideoProperties::C3GPLibComposeVideoProperties()
|
sl@0
|
725 |
{
|
sl@0
|
726 |
}
|
sl@0
|
727 |
|
sl@0
|
728 |
TVerdict C3GPLibComposeVideoProperties::doTestStepPreambleL()
|
sl@0
|
729 |
{
|
sl@0
|
730 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
731 |
if (TestStepResult() != EPass)
|
sl@0
|
732 |
{
|
sl@0
|
733 |
return TestStepResult();
|
sl@0
|
734 |
}
|
sl@0
|
735 |
|
sl@0
|
736 |
TInt temp;
|
sl@0
|
737 |
TBool result = ETrue;
|
sl@0
|
738 |
result = GetIntFromConfig(ConfigSection(), _L("width"), temp);
|
sl@0
|
739 |
if (result)
|
sl@0
|
740 |
{
|
sl@0
|
741 |
iSize.iWidth = temp;
|
sl@0
|
742 |
result = GetIntFromConfig(ConfigSection(), _L("height"), temp);
|
sl@0
|
743 |
if (result)
|
sl@0
|
744 |
{
|
sl@0
|
745 |
iSize.iHeight = temp;
|
sl@0
|
746 |
result = GetIntFromConfig(ConfigSection(), _L("timescale"), temp);
|
sl@0
|
747 |
if (result)
|
sl@0
|
748 |
{
|
sl@0
|
749 |
iTimescale = temp;
|
sl@0
|
750 |
}
|
sl@0
|
751 |
}
|
sl@0
|
752 |
}
|
sl@0
|
753 |
|
sl@0
|
754 |
if (result &&
|
sl@0
|
755 |
(iVideoType == E3GPMpeg4Video ||
|
sl@0
|
756 |
iVideoType == E3GPAvcProfileBaseline ||
|
sl@0
|
757 |
iVideoType == E3GPAvcProfileMain ||
|
sl@0
|
758 |
iVideoType == E3GPAvcProfileExtended ||
|
sl@0
|
759 |
iVideoType == E3GPAvcProfileHigh )
|
sl@0
|
760 |
)
|
sl@0
|
761 |
{
|
sl@0
|
762 |
TPtrC decoder;
|
sl@0
|
763 |
result = GetStringFromConfig(ConfigSection(), _L("decoderSpecInfo"), decoder);
|
sl@0
|
764 |
if (result)
|
sl@0
|
765 |
{
|
sl@0
|
766 |
iDecoderSpecInfo.CreateL(decoder.Length());
|
sl@0
|
767 |
iDecoderSpecInfo.Copy(decoder);
|
sl@0
|
768 |
}
|
sl@0
|
769 |
}
|
sl@0
|
770 |
|
sl@0
|
771 |
if (result && (iVideoType == E3GPMpeg4Video))
|
sl@0
|
772 |
{
|
sl@0
|
773 |
result = GetIntFromConfig(ConfigSection(), _L("avgBR"), temp);
|
sl@0
|
774 |
if (result)
|
sl@0
|
775 |
{
|
sl@0
|
776 |
iAvgBitRate = temp;
|
sl@0
|
777 |
result = GetIntFromConfig(ConfigSection(), _L("maxBR"), temp);
|
sl@0
|
778 |
if (result)
|
sl@0
|
779 |
{
|
sl@0
|
780 |
iMaxBitRate = temp;
|
sl@0
|
781 |
}
|
sl@0
|
782 |
}
|
sl@0
|
783 |
}
|
sl@0
|
784 |
|
sl@0
|
785 |
if (result && (iVideoType == E3GPH263Profile0 || iVideoType == E3GPH263Profile3))
|
sl@0
|
786 |
{
|
sl@0
|
787 |
result = GetIntFromConfig(ConfigSection(), _L("level"), temp);
|
sl@0
|
788 |
if (result)
|
sl@0
|
789 |
{
|
sl@0
|
790 |
iVideoLevel = temp;
|
sl@0
|
791 |
}
|
sl@0
|
792 |
}
|
sl@0
|
793 |
|
sl@0
|
794 |
if (!result)
|
sl@0
|
795 |
{
|
sl@0
|
796 |
ERR_PRINTF1(_L("Cannot retrieve necessary video properties to complete this test."));
|
sl@0
|
797 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
798 |
}
|
sl@0
|
799 |
|
sl@0
|
800 |
return TestStepResult();
|
sl@0
|
801 |
}
|
sl@0
|
802 |
|
sl@0
|
803 |
TVerdict C3GPLibComposeVideoProperties::doTestStepPostambleL()
|
sl@0
|
804 |
{
|
sl@0
|
805 |
iDecoderSpecInfo.Close();
|
sl@0
|
806 |
|
sl@0
|
807 |
// clean up base class setups
|
sl@0
|
808 |
C3GPLibComposeFile::doTestStepPostambleL();
|
sl@0
|
809 |
|
sl@0
|
810 |
return TestStepResult();
|
sl@0
|
811 |
}
|
sl@0
|
812 |
|
sl@0
|
813 |
T3GPVideoPropertiesBase* C3GPLibComposeVideoProperties::SetupAvcVideoL()
|
sl@0
|
814 |
{
|
sl@0
|
815 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesAvc(iTimescale, iSize, iDecoderSpecInfo);
|
sl@0
|
816 |
return video;
|
sl@0
|
817 |
}
|
sl@0
|
818 |
|
sl@0
|
819 |
T3GPVideoPropertiesBase* C3GPLibComposeVideoProperties::SetupH263VideoL()
|
sl@0
|
820 |
{
|
sl@0
|
821 |
T3GPVideoPropertiesH263::TProfile profile = T3GPVideoPropertiesH263::EProfile0;
|
sl@0
|
822 |
if (iVideoType == E3GPH263Profile3)
|
sl@0
|
823 |
{
|
sl@0
|
824 |
profile = T3GPVideoPropertiesH263::EProfile3;
|
sl@0
|
825 |
}
|
sl@0
|
826 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesH263(iTimescale, iSize, iVideoLevel, profile);
|
sl@0
|
827 |
return video;
|
sl@0
|
828 |
}
|
sl@0
|
829 |
|
sl@0
|
830 |
T3GPVideoPropertiesBase* C3GPLibComposeVideoProperties::SetupMpeg4VideoL()
|
sl@0
|
831 |
{
|
sl@0
|
832 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesMpeg4Video(iTimescale,
|
sl@0
|
833 |
iSize,
|
sl@0
|
834 |
iMaxBitRate,
|
sl@0
|
835 |
iAvgBitRate,
|
sl@0
|
836 |
iDecoderSpecInfo);
|
sl@0
|
837 |
return video;
|
sl@0
|
838 |
}
|
sl@0
|
839 |
|
sl@0
|
840 |
// -----------------------------------------------------------------------------
|
sl@0
|
841 |
// C3GPLibComposeWithSpecificBufferSize
|
sl@0
|
842 |
// -----------------------------------------------------------------------------
|
sl@0
|
843 |
//
|
sl@0
|
844 |
C3GPLibComposeWithSpecificBufferSize::C3GPLibComposeWithSpecificBufferSize()
|
sl@0
|
845 |
{
|
sl@0
|
846 |
}
|
sl@0
|
847 |
|
sl@0
|
848 |
TVerdict C3GPLibComposeWithSpecificBufferSize::doTestStepPreambleL()
|
sl@0
|
849 |
{
|
sl@0
|
850 |
TVerdict verdict = C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
851 |
if (verdict != EPass)
|
sl@0
|
852 |
{
|
sl@0
|
853 |
return verdict;
|
sl@0
|
854 |
}
|
sl@0
|
855 |
|
sl@0
|
856 |
TInt temp;
|
sl@0
|
857 |
if (GetIntFromConfig(ConfigSection(), _L("bufferSize"), temp))
|
sl@0
|
858 |
{
|
sl@0
|
859 |
iBufferSize = temp;
|
sl@0
|
860 |
if (GetIntFromConfig(ConfigSection(), _L("bufferCount"), temp))
|
sl@0
|
861 |
{
|
sl@0
|
862 |
iBufferMaxCount = temp;
|
sl@0
|
863 |
}
|
sl@0
|
864 |
else
|
sl@0
|
865 |
{
|
sl@0
|
866 |
ERR_PRINTF1(_L("C3GPLibComposeWithSpecificBufferSize cannot read Buffer Max Count"));
|
sl@0
|
867 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
868 |
}
|
sl@0
|
869 |
}
|
sl@0
|
870 |
else
|
sl@0
|
871 |
{
|
sl@0
|
872 |
ERR_PRINTF1(_L("C3GPLibComposeWithSpecificBufferSize cannot read Buffer Size"));
|
sl@0
|
873 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
874 |
}
|
sl@0
|
875 |
|
sl@0
|
876 |
return TestStepResult();
|
sl@0
|
877 |
}
|
sl@0
|
878 |
|
sl@0
|
879 |
C3GPCompose* C3GPLibComposeWithSpecificBufferSize::doTestStepCreateComposerL()
|
sl@0
|
880 |
{
|
sl@0
|
881 |
return C3GPCompose::NewL(iBufferSize, iBufferMaxCount);
|
sl@0
|
882 |
}
|
sl@0
|
883 |
|
sl@0
|
884 |
// -----------------------------------------------------------------------------
|
sl@0
|
885 |
// C3GPLibComposeUserData
|
sl@0
|
886 |
// -----------------------------------------------------------------------------
|
sl@0
|
887 |
//
|
sl@0
|
888 |
C3GPLibComposeUserData::C3GPLibComposeUserData() :
|
sl@0
|
889 |
iUdtaLocation(-1)
|
sl@0
|
890 |
{
|
sl@0
|
891 |
}
|
sl@0
|
892 |
|
sl@0
|
893 |
TVerdict C3GPLibComposeUserData::doTestStepPreambleL()
|
sl@0
|
894 |
{
|
sl@0
|
895 |
// ensure all basic setup is completed first
|
sl@0
|
896 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
897 |
if (TestStepResult() == EPass)
|
sl@0
|
898 |
{
|
sl@0
|
899 |
GetBoolFromConfig(ConfigSection(), _L("udtaMoov"), iUdtaMoov);
|
sl@0
|
900 |
GetBoolFromConfig(ConfigSection(), _L("udtaVideo"), iUdtaVideo);
|
sl@0
|
901 |
GetBoolFromConfig(ConfigSection(), _L("udtaAudio"), iUdtaAudio);
|
sl@0
|
902 |
GetIntFromConfig(ConfigSection(), _L("udtaLocation"), iUdtaLocation);
|
sl@0
|
903 |
|
sl@0
|
904 |
if (!iUdtaMoov && !iUdtaVideo && !iUdtaAudio && iUdtaLocation == -1)
|
sl@0
|
905 |
{
|
sl@0
|
906 |
ERR_PRINTF1(_L("No user data location is specified. Test cannot proceed."));
|
sl@0
|
907 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
908 |
}
|
sl@0
|
909 |
else
|
sl@0
|
910 |
{
|
sl@0
|
911 |
TPtrC userDataPtr;
|
sl@0
|
912 |
if (GetStringFromConfig(ConfigSection(), _L("userData"), userDataPtr))
|
sl@0
|
913 |
{
|
sl@0
|
914 |
iUserData.CreateL(userDataPtr.Length());
|
sl@0
|
915 |
iUserData.Copy(userDataPtr);
|
sl@0
|
916 |
}
|
sl@0
|
917 |
else
|
sl@0
|
918 |
{
|
sl@0
|
919 |
// user data not specified, use dummy data
|
sl@0
|
920 |
iUserData.CreateL(KDummyData);
|
sl@0
|
921 |
}
|
sl@0
|
922 |
}
|
sl@0
|
923 |
}
|
sl@0
|
924 |
|
sl@0
|
925 |
return TestStepResult();
|
sl@0
|
926 |
}
|
sl@0
|
927 |
|
sl@0
|
928 |
TVerdict C3GPLibComposeUserData::doTestStepPostambleL()
|
sl@0
|
929 |
{
|
sl@0
|
930 |
iUserData.Close();
|
sl@0
|
931 |
|
sl@0
|
932 |
// clean up base class setups
|
sl@0
|
933 |
C3GPLibComposeFile::doTestStepPostambleL();
|
sl@0
|
934 |
|
sl@0
|
935 |
return TestStepResult();
|
sl@0
|
936 |
}
|
sl@0
|
937 |
|
sl@0
|
938 |
void C3GPLibComposeUserData::doTestStepComposeSetUserDataL(C3GPCompose& aComposer)
|
sl@0
|
939 |
{
|
sl@0
|
940 |
TInt err = KErrNone;
|
sl@0
|
941 |
if (iUdtaVideo)
|
sl@0
|
942 |
{
|
sl@0
|
943 |
err = aComposer.SetUserData(E3GPUdtaVideoTrak, iUserData);
|
sl@0
|
944 |
if (err != KErrNone)
|
sl@0
|
945 |
{
|
sl@0
|
946 |
ERR_PRINTF2(_L("C3GPComposer::SetUserData(E3GPUdtaVideoTrak) fails with %d"), err);
|
sl@0
|
947 |
SetTestStepError(err);
|
sl@0
|
948 |
}
|
sl@0
|
949 |
}
|
sl@0
|
950 |
if (iUdtaAudio)
|
sl@0
|
951 |
{
|
sl@0
|
952 |
err = aComposer.SetUserData(E3GPUdtaAudioTrak, iUserData);
|
sl@0
|
953 |
if (err != KErrNone)
|
sl@0
|
954 |
{
|
sl@0
|
955 |
ERR_PRINTF2(_L("C3GPComposer::SetUserData(E3GPUdtaAudioTrak) fails with %d"), err);
|
sl@0
|
956 |
SetTestStepError(err);
|
sl@0
|
957 |
}
|
sl@0
|
958 |
}
|
sl@0
|
959 |
if (iUdtaMoov)
|
sl@0
|
960 |
{
|
sl@0
|
961 |
err = aComposer.SetUserData(E3GPUdtaMoov, iUserData);
|
sl@0
|
962 |
if (err != KErrNone)
|
sl@0
|
963 |
{
|
sl@0
|
964 |
ERR_PRINTF2(_L("C3GPComposer::SetUserData(E3GPUdtaMoov) fails with %d"), err);
|
sl@0
|
965 |
SetTestStepError(err);
|
sl@0
|
966 |
}
|
sl@0
|
967 |
}
|
sl@0
|
968 |
|
sl@0
|
969 |
if (iUdtaLocation != -1)
|
sl@0
|
970 |
{
|
sl@0
|
971 |
// if a specific user data location has been specified, try it!
|
sl@0
|
972 |
err = aComposer.SetUserData((T3GPUdtaLocation)iUdtaLocation, iUserData);
|
sl@0
|
973 |
if (err != KErrNone)
|
sl@0
|
974 |
{
|
sl@0
|
975 |
ERR_PRINTF3(_L("C3GPComposer::SetUserData(%d) fails with %d"), iUdtaLocation, err);
|
sl@0
|
976 |
SetTestStepError(err);
|
sl@0
|
977 |
}
|
sl@0
|
978 |
}
|
sl@0
|
979 |
}
|
sl@0
|
980 |
|
sl@0
|
981 |
// -----------------------------------------------------------------------------
|
sl@0
|
982 |
// C3GPLibComposeWithFlag
|
sl@0
|
983 |
// -----------------------------------------------------------------------------
|
sl@0
|
984 |
//
|
sl@0
|
985 |
C3GPLibComposeWithFlag::C3GPLibComposeWithFlag()
|
sl@0
|
986 |
{
|
sl@0
|
987 |
}
|
sl@0
|
988 |
|
sl@0
|
989 |
TVerdict C3GPLibComposeWithFlag::doTestStepPreambleL()
|
sl@0
|
990 |
{
|
sl@0
|
991 |
// ensure the base class setup is completed first
|
sl@0
|
992 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
993 |
if (TestStepResult() == EPass)
|
sl@0
|
994 |
{
|
sl@0
|
995 |
if (!GetIntFromConfig(ConfigSection(), _L("flag"), iComposeFlag))
|
sl@0
|
996 |
{
|
sl@0
|
997 |
ERR_PRINTF1(_L("C3GPLibComposeWithFlag::doTestStepPreambleL cannot retrieve any composer flags."));
|
sl@0
|
998 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
999 |
}
|
sl@0
|
1000 |
}
|
sl@0
|
1001 |
return TestStepResult();
|
sl@0
|
1002 |
}
|
sl@0
|
1003 |
|
sl@0
|
1004 |
void C3GPLibComposeWithFlag::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1005 |
{
|
sl@0
|
1006 |
T3GPVideoPropertiesBase* video = SetupVideoPropertiesL();
|
sl@0
|
1007 |
CleanupStack::PushL(video);
|
sl@0
|
1008 |
|
sl@0
|
1009 |
T3GPAudioPropertiesBase* audio = SetupAudioPropertiesL();
|
sl@0
|
1010 |
CleanupStack::PushL(audio);
|
sl@0
|
1011 |
|
sl@0
|
1012 |
TInt err = aComposer.Open(iInputFileFormat, video, audio, iFile, iComposeFlag);
|
sl@0
|
1013 |
if (err == KErrNone)
|
sl@0
|
1014 |
{
|
sl@0
|
1015 |
SetTestStepResult(EPass);
|
sl@0
|
1016 |
}
|
sl@0
|
1017 |
else
|
sl@0
|
1018 |
{
|
sl@0
|
1019 |
ERR_PRINTF2(_L("C3GPLibComposeFile::doTestStepComposeOpenL => C3GPComposer::Open returns = %d"), err);
|
sl@0
|
1020 |
SetTestStepResult(EInconclusive);
|
sl@0
|
1021 |
}
|
sl@0
|
1022 |
|
sl@0
|
1023 |
CleanupStack::PopAndDestroy(2); // audio, video
|
sl@0
|
1024 |
}
|
sl@0
|
1025 |
|
sl@0
|
1026 |
// -----------------------------------------------------------------------------
|
sl@0
|
1027 |
// C3GPLibComposeAudioProperties
|
sl@0
|
1028 |
// -----------------------------------------------------------------------------
|
sl@0
|
1029 |
//
|
sl@0
|
1030 |
C3GPLibComposeAudioProperties::C3GPLibComposeAudioProperties()
|
sl@0
|
1031 |
{
|
sl@0
|
1032 |
}
|
sl@0
|
1033 |
|
sl@0
|
1034 |
TVerdict C3GPLibComposeAudioProperties::doTestStepPreambleL()
|
sl@0
|
1035 |
{
|
sl@0
|
1036 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
1037 |
if (TestStepResult() != EPass)
|
sl@0
|
1038 |
{
|
sl@0
|
1039 |
return TestStepResult();
|
sl@0
|
1040 |
}
|
sl@0
|
1041 |
|
sl@0
|
1042 |
TInt temp;
|
sl@0
|
1043 |
TBool result = ETrue;
|
sl@0
|
1044 |
result = GetIntFromConfig(ConfigSection(), _L("timescale"), temp);
|
sl@0
|
1045 |
if (result)
|
sl@0
|
1046 |
{
|
sl@0
|
1047 |
iTimescale = temp;
|
sl@0
|
1048 |
}
|
sl@0
|
1049 |
|
sl@0
|
1050 |
if (result && (iAudioType == E3GPQcelp13K))
|
sl@0
|
1051 |
{
|
sl@0
|
1052 |
result = GetIntFromConfig(ConfigSection(), _L("storage"), temp);
|
sl@0
|
1053 |
if (result)
|
sl@0
|
1054 |
{
|
sl@0
|
1055 |
iQCelpMode = (T3GPQcelpStorageMode) temp;
|
sl@0
|
1056 |
if (iQCelpMode == E3GPMP4AudioDescriptionBox)
|
sl@0
|
1057 |
{
|
sl@0
|
1058 |
TPtrC decoder;
|
sl@0
|
1059 |
result = GetStringFromConfig(ConfigSection(), _L("decoderSpecInfo"), decoder);
|
sl@0
|
1060 |
if (result)
|
sl@0
|
1061 |
{
|
sl@0
|
1062 |
iDecoderSpecInfo.CreateL(decoder.Length());
|
sl@0
|
1063 |
iDecoderSpecInfo.Copy(decoder);
|
sl@0
|
1064 |
}
|
sl@0
|
1065 |
}
|
sl@0
|
1066 |
}
|
sl@0
|
1067 |
|
sl@0
|
1068 |
if (result)
|
sl@0
|
1069 |
{
|
sl@0
|
1070 |
result = GetIntFromConfig(ConfigSection(), _L("fps"), iFps);
|
sl@0
|
1071 |
}
|
sl@0
|
1072 |
}
|
sl@0
|
1073 |
|
sl@0
|
1074 |
if (result && (iAudioType == E3GPMpeg4Audio))
|
sl@0
|
1075 |
{
|
sl@0
|
1076 |
TPtrC decoder;
|
sl@0
|
1077 |
result = GetStringFromConfig(ConfigSection(), _L("decoderSpecInfo"), decoder);
|
sl@0
|
1078 |
if (result)
|
sl@0
|
1079 |
{
|
sl@0
|
1080 |
iDecoderSpecInfo.CreateL(decoder.Length());
|
sl@0
|
1081 |
iDecoderSpecInfo.Copy(decoder);
|
sl@0
|
1082 |
}
|
sl@0
|
1083 |
}
|
sl@0
|
1084 |
|
sl@0
|
1085 |
if (result && (iAudioType == E3GPAmrNB || iAudioType == E3GPAmrWB))
|
sl@0
|
1086 |
{
|
sl@0
|
1087 |
result = GetIntFromConfig(ConfigSection(), _L("modeSet"), iModeSet);
|
sl@0
|
1088 |
if (result)
|
sl@0
|
1089 |
{
|
sl@0
|
1090 |
result = GetIntFromConfig(ConfigSection(), _L("fps"), iFps);
|
sl@0
|
1091 |
}
|
sl@0
|
1092 |
}
|
sl@0
|
1093 |
|
sl@0
|
1094 |
if (!result)
|
sl@0
|
1095 |
{
|
sl@0
|
1096 |
//
|
sl@0
|
1097 |
ERR_PRINTF1(_L("Cannot retrieve necessary a properties to complete this test."));
|
sl@0
|
1098 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1099 |
}
|
sl@0
|
1100 |
|
sl@0
|
1101 |
return TestStepResult();
|
sl@0
|
1102 |
}
|
sl@0
|
1103 |
|
sl@0
|
1104 |
TVerdict C3GPLibComposeAudioProperties::doTestStepPostambleL()
|
sl@0
|
1105 |
{
|
sl@0
|
1106 |
iDecoderSpecInfo.Close();
|
sl@0
|
1107 |
|
sl@0
|
1108 |
// clean up base class setups
|
sl@0
|
1109 |
C3GPLibComposeFile::doTestStepPostambleL();
|
sl@0
|
1110 |
|
sl@0
|
1111 |
return TestStepResult();
|
sl@0
|
1112 |
}
|
sl@0
|
1113 |
|
sl@0
|
1114 |
T3GPAudioPropertiesBase* C3GPLibComposeAudioProperties::SetupQcelpAudioL()
|
sl@0
|
1115 |
{
|
sl@0
|
1116 |
T3GPAudioPropertiesBase* audio = NULL;
|
sl@0
|
1117 |
|
sl@0
|
1118 |
if (iQCelpMode == E3GPQcelpSampleEntryBox)
|
sl@0
|
1119 |
{
|
sl@0
|
1120 |
audio = new (ELeave) T3GPAudioPropertiesQcelp(iTimescale, iFps);
|
sl@0
|
1121 |
}
|
sl@0
|
1122 |
else if (iQCelpMode == E3GPMP4AudioDescriptionBox)
|
sl@0
|
1123 |
{
|
sl@0
|
1124 |
audio = new (ELeave) T3GPAudioPropertiesQcelp(iTimescale, iFps, iDecoderSpecInfo);
|
sl@0
|
1125 |
}
|
sl@0
|
1126 |
else
|
sl@0
|
1127 |
{
|
sl@0
|
1128 |
User::Leave(KErrNotFound);
|
sl@0
|
1129 |
}
|
sl@0
|
1130 |
|
sl@0
|
1131 |
return audio;
|
sl@0
|
1132 |
}
|
sl@0
|
1133 |
|
sl@0
|
1134 |
T3GPAudioPropertiesBase* C3GPLibComposeAudioProperties::SetupAmrAudioL()
|
sl@0
|
1135 |
{
|
sl@0
|
1136 |
T3GPAudioPropertiesAmr::TSpeechCodec codec = T3GPAudioPropertiesAmr::EAmrWB;
|
sl@0
|
1137 |
if (iAudioType == E3GPAmrNB)
|
sl@0
|
1138 |
{
|
sl@0
|
1139 |
codec = T3GPAudioPropertiesAmr::EAmrNB;
|
sl@0
|
1140 |
}
|
sl@0
|
1141 |
T3GPAudioPropertiesBase* audio = new (ELeave) T3GPAudioPropertiesAmr(iTimescale, iFps, iModeSet, codec);
|
sl@0
|
1142 |
return audio;
|
sl@0
|
1143 |
}
|
sl@0
|
1144 |
|
sl@0
|
1145 |
T3GPAudioPropertiesBase* C3GPLibComposeAudioProperties::SetupMpeg4AudioL()
|
sl@0
|
1146 |
{
|
sl@0
|
1147 |
T3GPAudioPropertiesBase* audio = new (ELeave)T3GPAudioPropertiesMpeg4Audio(iTimescale, iDecoderSpecInfo);
|
sl@0
|
1148 |
return audio;
|
sl@0
|
1149 |
}
|
sl@0
|
1150 |
|
sl@0
|
1151 |
// -----------------------------------------------------------------------------
|
sl@0
|
1152 |
// C3GPLibComposeWithNoAudioVideo
|
sl@0
|
1153 |
// -----------------------------------------------------------------------------
|
sl@0
|
1154 |
//
|
sl@0
|
1155 |
C3GPLibComposeWithNoAudioVideo::C3GPLibComposeWithNoAudioVideo()
|
sl@0
|
1156 |
{
|
sl@0
|
1157 |
}
|
sl@0
|
1158 |
|
sl@0
|
1159 |
TVerdict C3GPLibComposeWithNoAudioVideo::doTestStepPreambleL()
|
sl@0
|
1160 |
{
|
sl@0
|
1161 |
// ensure the base class setup is completed first
|
sl@0
|
1162 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
1163 |
if (TestStepResult() == EPass)
|
sl@0
|
1164 |
{
|
sl@0
|
1165 |
// reset the video / audio type both of No Video & No Audio
|
sl@0
|
1166 |
iVideoType = E3GPNoVideo;
|
sl@0
|
1167 |
iAudioType = E3GPNoAudio;
|
sl@0
|
1168 |
}
|
sl@0
|
1169 |
|
sl@0
|
1170 |
return TestStepResult();
|
sl@0
|
1171 |
}
|
sl@0
|
1172 |
|
sl@0
|
1173 |
// -----------------------------------------------------------------------------
|
sl@0
|
1174 |
// C3GPLibComposeAudioFrames
|
sl@0
|
1175 |
// -----------------------------------------------------------------------------
|
sl@0
|
1176 |
//
|
sl@0
|
1177 |
C3GPLibComposeAudioFrames::C3GPLibComposeAudioFrames()
|
sl@0
|
1178 |
{
|
sl@0
|
1179 |
}
|
sl@0
|
1180 |
|
sl@0
|
1181 |
TVerdict C3GPLibComposeAudioFrames::doTestStepPreambleL()
|
sl@0
|
1182 |
{
|
sl@0
|
1183 |
// ensure all basic setup is completed first
|
sl@0
|
1184 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
1185 |
if (TestStepResult() == EPass)
|
sl@0
|
1186 |
{
|
sl@0
|
1187 |
if (GetIntFromConfig(ConfigSection(), _L("duration"), iDuration))
|
sl@0
|
1188 |
{
|
sl@0
|
1189 |
TPtrC audioFramePtr;
|
sl@0
|
1190 |
if (GetStringFromConfig(ConfigSection(), _L("audioFrame"), audioFramePtr))
|
sl@0
|
1191 |
{
|
sl@0
|
1192 |
iAudioFrames.CreateL(audioFramePtr.Length());
|
sl@0
|
1193 |
iAudioFrames.Copy(audioFramePtr);
|
sl@0
|
1194 |
}
|
sl@0
|
1195 |
else
|
sl@0
|
1196 |
{
|
sl@0
|
1197 |
// cannot find expected error!
|
sl@0
|
1198 |
ERR_PRINTF1(_L("audioFrame not specified. Test cannot proceed."));
|
sl@0
|
1199 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1200 |
}
|
sl@0
|
1201 |
}
|
sl@0
|
1202 |
else
|
sl@0
|
1203 |
{
|
sl@0
|
1204 |
// cannot find expected error!
|
sl@0
|
1205 |
ERR_PRINTF1(_L("duration not specified. Test cannot proceed."));
|
sl@0
|
1206 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1207 |
}
|
sl@0
|
1208 |
}
|
sl@0
|
1209 |
|
sl@0
|
1210 |
return TestStepResult();
|
sl@0
|
1211 |
}
|
sl@0
|
1212 |
|
sl@0
|
1213 |
TVerdict C3GPLibComposeAudioFrames::doTestStepPostambleL()
|
sl@0
|
1214 |
{
|
sl@0
|
1215 |
// cleanup
|
sl@0
|
1216 |
iAudioFrames.Close();
|
sl@0
|
1217 |
|
sl@0
|
1218 |
// ensure all base cleanup is done
|
sl@0
|
1219 |
C3GPLibComposeFile::doTestStepPostambleL();
|
sl@0
|
1220 |
|
sl@0
|
1221 |
return TestStepResult();
|
sl@0
|
1222 |
}
|
sl@0
|
1223 |
|
sl@0
|
1224 |
void C3GPLibComposeAudioFrames::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
1225 |
{
|
sl@0
|
1226 |
// add the audio frame
|
sl@0
|
1227 |
TInt err = aComposer.WriteAudioFrames(iAudioFrames, iDuration);
|
sl@0
|
1228 |
if (err != KErrNone)
|
sl@0
|
1229 |
{
|
sl@0
|
1230 |
if (!ShouldRunOOMTest())
|
sl@0
|
1231 |
{
|
sl@0
|
1232 |
INFO_PRINTF2(_L("C3GPCompose::WriteAudioFrames returns %d"), err);
|
sl@0
|
1233 |
}
|
sl@0
|
1234 |
SetTestStepError(err);
|
sl@0
|
1235 |
}
|
sl@0
|
1236 |
}
|
sl@0
|
1237 |
|
sl@0
|
1238 |
// -----------------------------------------------------------------------------
|
sl@0
|
1239 |
// C3GPLibComposeVideoFrame
|
sl@0
|
1240 |
// -----------------------------------------------------------------------------
|
sl@0
|
1241 |
//
|
sl@0
|
1242 |
C3GPLibComposeVideoFrame::C3GPLibComposeVideoFrame()
|
sl@0
|
1243 |
{
|
sl@0
|
1244 |
}
|
sl@0
|
1245 |
|
sl@0
|
1246 |
TVerdict C3GPLibComposeVideoFrame::doTestStepPreambleL()
|
sl@0
|
1247 |
{
|
sl@0
|
1248 |
// ensure all basic setup is completed first
|
sl@0
|
1249 |
C3GPLibComposeFile::doTestStepPreambleL();
|
sl@0
|
1250 |
if (TestStepResult() == EPass)
|
sl@0
|
1251 |
{
|
sl@0
|
1252 |
if (GetBoolFromConfig(ConfigSection(), _L("keyFrame"), iKeyFrame))
|
sl@0
|
1253 |
{
|
sl@0
|
1254 |
if (GetIntFromConfig(ConfigSection(), _L("duration"), iDuration))
|
sl@0
|
1255 |
{
|
sl@0
|
1256 |
TPtrC framePtr;
|
sl@0
|
1257 |
if (GetStringFromConfig(ConfigSection(), _L("videoFrame"), framePtr))
|
sl@0
|
1258 |
{
|
sl@0
|
1259 |
iVideoFrame.CreateL(framePtr.Length());
|
sl@0
|
1260 |
iVideoFrame.Copy(framePtr);
|
sl@0
|
1261 |
|
sl@0
|
1262 |
TInt dependsOn;
|
sl@0
|
1263 |
TInt isDependedOn;
|
sl@0
|
1264 |
TInt hasRedundancy;
|
sl@0
|
1265 |
if (GetIntFromConfig(ConfigSection(), _L("dependsOn"), dependsOn) &&
|
sl@0
|
1266 |
GetIntFromConfig(ConfigSection(), _L("isDependedOn"), isDependedOn) &&
|
sl@0
|
1267 |
GetIntFromConfig(ConfigSection(), _L("hasRedundancy"), hasRedundancy))
|
sl@0
|
1268 |
{
|
sl@0
|
1269 |
iDependencies = new (ELeave) T3GPFrameDependencies();
|
sl@0
|
1270 |
iDependencies->iDependsOn = (T3GPVideoFrameDependency) dependsOn;
|
sl@0
|
1271 |
iDependencies->iIsDependedOn = (T3GPVideoFrameDependency) isDependedOn;
|
sl@0
|
1272 |
iDependencies->iHasRedundancy = (T3GPVideoFrameRedundancy) hasRedundancy;
|
sl@0
|
1273 |
}
|
sl@0
|
1274 |
}
|
sl@0
|
1275 |
else
|
sl@0
|
1276 |
{
|
sl@0
|
1277 |
// cannot find expected error!
|
sl@0
|
1278 |
ERR_PRINTF1(_L("videoFrame not specified. Test cannot proceed."));
|
sl@0
|
1279 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1280 |
}
|
sl@0
|
1281 |
}
|
sl@0
|
1282 |
else
|
sl@0
|
1283 |
{
|
sl@0
|
1284 |
// cannot find expected error!
|
sl@0
|
1285 |
ERR_PRINTF1(_L("duration not specified. Test cannot proceed."));
|
sl@0
|
1286 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1287 |
}
|
sl@0
|
1288 |
}
|
sl@0
|
1289 |
else
|
sl@0
|
1290 |
{
|
sl@0
|
1291 |
// cannot find expected error!
|
sl@0
|
1292 |
ERR_PRINTF1(_L("keyFrame not specified. Test cannot proceed."));
|
sl@0
|
1293 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1294 |
}
|
sl@0
|
1295 |
}
|
sl@0
|
1296 |
|
sl@0
|
1297 |
return TestStepResult();
|
sl@0
|
1298 |
}
|
sl@0
|
1299 |
|
sl@0
|
1300 |
TVerdict C3GPLibComposeVideoFrame::doTestStepPostambleL()
|
sl@0
|
1301 |
{
|
sl@0
|
1302 |
// cleanup
|
sl@0
|
1303 |
iVideoFrame.Close();
|
sl@0
|
1304 |
delete iDependencies;
|
sl@0
|
1305 |
|
sl@0
|
1306 |
// ensure all base cleanup is done
|
sl@0
|
1307 |
C3GPLibComposeFile::doTestStepPostambleL();
|
sl@0
|
1308 |
|
sl@0
|
1309 |
return TestStepResult();
|
sl@0
|
1310 |
}
|
sl@0
|
1311 |
|
sl@0
|
1312 |
void C3GPLibComposeVideoFrame::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
1313 |
{
|
sl@0
|
1314 |
// add the video frame
|
sl@0
|
1315 |
TInt err = KErrNone;
|
sl@0
|
1316 |
if (iDependencies)
|
sl@0
|
1317 |
{
|
sl@0
|
1318 |
err = aComposer.WriteVideoFrame(iVideoFrame, iDuration, iKeyFrame, *iDependencies);
|
sl@0
|
1319 |
}
|
sl@0
|
1320 |
else
|
sl@0
|
1321 |
{
|
sl@0
|
1322 |
err = aComposer.WriteVideoFrame(iVideoFrame, iDuration, iKeyFrame);
|
sl@0
|
1323 |
}
|
sl@0
|
1324 |
|
sl@0
|
1325 |
if (err != KErrNone)
|
sl@0
|
1326 |
{
|
sl@0
|
1327 |
INFO_PRINTF2(_L("C3GPCompose::WriteVideoFrame returns %d"), err);
|
sl@0
|
1328 |
SetTestStepError(err);
|
sl@0
|
1329 |
}
|
sl@0
|
1330 |
}
|
sl@0
|
1331 |
|
sl@0
|
1332 |
// -----------------------------------------------------------------------------
|
sl@0
|
1333 |
// C3GPLibComposeOpenAgain
|
sl@0
|
1334 |
// -----------------------------------------------------------------------------
|
sl@0
|
1335 |
//
|
sl@0
|
1336 |
C3GPLibComposeOpenAgain::C3GPLibComposeOpenAgain()
|
sl@0
|
1337 |
{
|
sl@0
|
1338 |
}
|
sl@0
|
1339 |
|
sl@0
|
1340 |
void C3GPLibComposeOpenAgain::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1341 |
{
|
sl@0
|
1342 |
C3GPLibComposeFile::doTestStepComposeOpenL(aComposer);
|
sl@0
|
1343 |
if (TestStepResult() == EPass)
|
sl@0
|
1344 |
{
|
sl@0
|
1345 |
// ensure the composer is opened, then try open it again!
|
sl@0
|
1346 |
T3GPVideoPropertiesBase* video = SetupVideoPropertiesL();
|
sl@0
|
1347 |
CleanupStack::PushL(video);
|
sl@0
|
1348 |
|
sl@0
|
1349 |
T3GPAudioPropertiesBase* audio = SetupAudioPropertiesL();
|
sl@0
|
1350 |
CleanupStack::PushL(audio);
|
sl@0
|
1351 |
|
sl@0
|
1352 |
// retrieve the current location of the temp file created when
|
sl@0
|
1353 |
// opening the composer the first time in C3GPLibComposeFile::doTestStepComposeOpenL
|
sl@0
|
1354 |
RBuf folderName;
|
sl@0
|
1355 |
folderName.CreateL(KMaxFileName);
|
sl@0
|
1356 |
CleanupClosePushL(folderName);
|
sl@0
|
1357 |
User::LeaveIfError(iFile.FullName(folderName));
|
sl@0
|
1358 |
|
sl@0
|
1359 |
TParsePtrC folderParse(folderName);
|
sl@0
|
1360 |
TPtrC folder = folderParse.DriveAndPath();
|
sl@0
|
1361 |
|
sl@0
|
1362 |
// create another file temp file within the same folder
|
sl@0
|
1363 |
RFile file;
|
sl@0
|
1364 |
TFileName fileName;
|
sl@0
|
1365 |
User::LeaveIfError(file.Temp(iFs, folder, fileName, EFileWrite));
|
sl@0
|
1366 |
|
sl@0
|
1367 |
TInt err = aComposer.Open(iInputFileFormat, video, audio, file);
|
sl@0
|
1368 |
TInt err2 = aComposer.Open(iInputFileFormat, video, audio, fileName);
|
sl@0
|
1369 |
if (err != KErrNone && err == err2)
|
sl@0
|
1370 |
{
|
sl@0
|
1371 |
SetTestStepError(err);
|
sl@0
|
1372 |
}
|
sl@0
|
1373 |
else
|
sl@0
|
1374 |
{
|
sl@0
|
1375 |
INFO_PRINTF1(_L("C3GPLibComposeOpenAgain C3GPCompose::Open returns inconsistent error."));
|
sl@0
|
1376 |
}
|
sl@0
|
1377 |
|
sl@0
|
1378 |
// clean up
|
sl@0
|
1379 |
file.Close();
|
sl@0
|
1380 |
iFs.Delete(fileName);
|
sl@0
|
1381 |
|
sl@0
|
1382 |
CleanupStack::PopAndDestroy(3); // audio, video, folderName
|
sl@0
|
1383 |
}
|
sl@0
|
1384 |
}
|
sl@0
|
1385 |
|
sl@0
|
1386 |
// -----------------------------------------------------------------------------
|
sl@0
|
1387 |
// C3GPLibComposeOpenReadOnlyFile
|
sl@0
|
1388 |
// -----------------------------------------------------------------------------
|
sl@0
|
1389 |
//
|
sl@0
|
1390 |
C3GPLibComposeOpenReadOnlyFile::C3GPLibComposeOpenReadOnlyFile()
|
sl@0
|
1391 |
{
|
sl@0
|
1392 |
}
|
sl@0
|
1393 |
|
sl@0
|
1394 |
void C3GPLibComposeOpenReadOnlyFile::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1395 |
{
|
sl@0
|
1396 |
RBuf fileName;
|
sl@0
|
1397 |
fileName.CreateL(KMaxFilename);
|
sl@0
|
1398 |
CleanupClosePushL(fileName);
|
sl@0
|
1399 |
|
sl@0
|
1400 |
// change the file to be opened to be a READ-ONLY file
|
sl@0
|
1401 |
User::LeaveIfError(iFile.FullName(fileName));
|
sl@0
|
1402 |
iFile.Close();
|
sl@0
|
1403 |
|
sl@0
|
1404 |
User::LeaveIfError(iFile.Open(iFs, fileName, EFileShareReadersOnly));
|
sl@0
|
1405 |
CleanupStack::PopAndDestroy(&fileName);
|
sl@0
|
1406 |
|
sl@0
|
1407 |
C3GPLibComposeWithFlag::doTestStepComposeOpenL(aComposer);
|
sl@0
|
1408 |
}
|
sl@0
|
1409 |
|
sl@0
|
1410 |
TVerdict C3GPLibComposeOpenReadOnlyFile::doTestStepL()
|
sl@0
|
1411 |
{
|
sl@0
|
1412 |
TVerdict verdict(EFail);
|
sl@0
|
1413 |
|
sl@0
|
1414 |
TRAP_IGNORE(verdict = C3GPLibComposeWithFlag::doTestStepL());
|
sl@0
|
1415 |
|
sl@0
|
1416 |
return verdict;
|
sl@0
|
1417 |
}
|
sl@0
|
1418 |
|
sl@0
|
1419 |
// -----------------------------------------------------------------------------
|
sl@0
|
1420 |
// C3GPLibComposeOpenedFile
|
sl@0
|
1421 |
// -----------------------------------------------------------------------------
|
sl@0
|
1422 |
//
|
sl@0
|
1423 |
C3GPLibComposeOpenedFile::C3GPLibComposeOpenedFile()
|
sl@0
|
1424 |
{
|
sl@0
|
1425 |
}
|
sl@0
|
1426 |
|
sl@0
|
1427 |
void C3GPLibComposeOpenedFile::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1428 |
{
|
sl@0
|
1429 |
RBuf fileName;
|
sl@0
|
1430 |
fileName.CreateL(KMaxFilename);
|
sl@0
|
1431 |
CleanupClosePushL(fileName);
|
sl@0
|
1432 |
|
sl@0
|
1433 |
// change the file to be opened to be a READ-ONLY file
|
sl@0
|
1434 |
User::LeaveIfError(iFile.FullName(fileName));
|
sl@0
|
1435 |
iFile.Close();
|
sl@0
|
1436 |
|
sl@0
|
1437 |
User::LeaveIfError(iFile.Open(iFs, fileName, EFileShareAny));
|
sl@0
|
1438 |
|
sl@0
|
1439 |
T3GPVideoPropertiesBase* video = SetupVideoPropertiesL();
|
sl@0
|
1440 |
CleanupStack::PushL(video);
|
sl@0
|
1441 |
|
sl@0
|
1442 |
T3GPAudioPropertiesBase* audio = SetupAudioPropertiesL();
|
sl@0
|
1443 |
CleanupStack::PushL(audio);
|
sl@0
|
1444 |
|
sl@0
|
1445 |
TInt err1 = aComposer.Open(iInputFileFormat, video, audio, fileName);
|
sl@0
|
1446 |
if (err1 != KErrNone)
|
sl@0
|
1447 |
{
|
sl@0
|
1448 |
if (!ShouldRunOOMTest())
|
sl@0
|
1449 |
{
|
sl@0
|
1450 |
ERR_PRINTF2(_L("C3GPLibComposeOpenedFile::doTestStepComposeOpenL => C3GPComposer::Open returns = %d"), err1);
|
sl@0
|
1451 |
}
|
sl@0
|
1452 |
|
sl@0
|
1453 |
iFile.Close();
|
sl@0
|
1454 |
User::LeaveIfError(iFile.Open(iFs, fileName, EFileShareReadersOrWriters));
|
sl@0
|
1455 |
TInt err2 = aComposer.Open(iInputFileFormat, video, audio, fileName);
|
sl@0
|
1456 |
|
sl@0
|
1457 |
if (err1 == err2)
|
sl@0
|
1458 |
{
|
sl@0
|
1459 |
SetTestStepError(err1);
|
sl@0
|
1460 |
}
|
sl@0
|
1461 |
}
|
sl@0
|
1462 |
|
sl@0
|
1463 |
CleanupStack::PopAndDestroy(3); // audio, video, fileName
|
sl@0
|
1464 |
}
|
sl@0
|
1465 |
|
sl@0
|
1466 |
// -----------------------------------------------------------------------------
|
sl@0
|
1467 |
// C3GPLibComposeMultiComposeOnSameFile
|
sl@0
|
1468 |
// -----------------------------------------------------------------------------
|
sl@0
|
1469 |
//
|
sl@0
|
1470 |
C3GPLibComposeMultiComposeOnSameFile::C3GPLibComposeMultiComposeOnSameFile()
|
sl@0
|
1471 |
{
|
sl@0
|
1472 |
}
|
sl@0
|
1473 |
|
sl@0
|
1474 |
void C3GPLibComposeMultiComposeOnSameFile::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1475 |
{
|
sl@0
|
1476 |
C3GPLibComposeFilename::doTestStepComposeOpenL(aComposer);
|
sl@0
|
1477 |
if (TestStepError() == KErrNone && TestStepResult() == EPass)
|
sl@0
|
1478 |
{
|
sl@0
|
1479 |
T3GPAudioPropertiesMpeg4Audio audio(100, KDummyData);
|
sl@0
|
1480 |
T3GPVideoPropertiesAvc video(100, TSize(100, 100), KDummyData);
|
sl@0
|
1481 |
C3GPCompose* composer2 = C3GPCompose::NewL();
|
sl@0
|
1482 |
|
sl@0
|
1483 |
TInt err = composer2->Open(E3GP3GP, &video, &audio, iFilename);
|
sl@0
|
1484 |
if (err != KErrNone)
|
sl@0
|
1485 |
{
|
sl@0
|
1486 |
SetTestStepError(err);
|
sl@0
|
1487 |
}
|
sl@0
|
1488 |
|
sl@0
|
1489 |
// close the composer
|
sl@0
|
1490 |
composer2->Complete();
|
sl@0
|
1491 |
delete composer2;
|
sl@0
|
1492 |
}
|
sl@0
|
1493 |
}
|
sl@0
|
1494 |
|
sl@0
|
1495 |
// -----------------------------------------------------------------------------
|
sl@0
|
1496 |
// C3GPLibComposeMultiComposers
|
sl@0
|
1497 |
// -----------------------------------------------------------------------------
|
sl@0
|
1498 |
//
|
sl@0
|
1499 |
C3GPLibComposeMultiComposers::C3GPLibComposeMultiComposers()
|
sl@0
|
1500 |
{
|
sl@0
|
1501 |
}
|
sl@0
|
1502 |
|
sl@0
|
1503 |
void C3GPLibComposeMultiComposers::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1504 |
{
|
sl@0
|
1505 |
C3GPLibComposeFilename::doTestStepComposeOpenL(aComposer);
|
sl@0
|
1506 |
if (TestStepError() == KErrNone && TestStepResult() == EPass)
|
sl@0
|
1507 |
{
|
sl@0
|
1508 |
#ifdef __WINSCW__
|
sl@0
|
1509 |
_LIT(KTestFolderName, "testFolderNameEmu");
|
sl@0
|
1510 |
#else
|
sl@0
|
1511 |
_LIT(KTestFolderName, "testFolderNameHw");
|
sl@0
|
1512 |
#endif
|
sl@0
|
1513 |
|
sl@0
|
1514 |
TPtrC testFolderName;
|
sl@0
|
1515 |
if (!GetStringFromConfig(_L("general"), KTestFolderName, testFolderName))
|
sl@0
|
1516 |
{
|
sl@0
|
1517 |
User::Leave(KErrNotFound);
|
sl@0
|
1518 |
}
|
sl@0
|
1519 |
|
sl@0
|
1520 |
TFileName fileName;
|
sl@0
|
1521 |
RFs fs;
|
sl@0
|
1522 |
User::LeaveIfError(fs.Connect());
|
sl@0
|
1523 |
CleanupClosePushL(fs);
|
sl@0
|
1524 |
|
sl@0
|
1525 |
// Composer 2
|
sl@0
|
1526 |
T3GPAudioPropertiesMpeg4Audio audio1(100, KDummyData);
|
sl@0
|
1527 |
T3GPVideoPropertiesAvc video1(100, TSize(100, 100), KDummyData);
|
sl@0
|
1528 |
|
sl@0
|
1529 |
RFile file1;
|
sl@0
|
1530 |
CleanupClosePushL(file1);
|
sl@0
|
1531 |
User::LeaveIfError(file1.Temp(fs, testFolderName, fileName, EFileShareExclusive));
|
sl@0
|
1532 |
|
sl@0
|
1533 |
C3GPCompose* composer2 = C3GPCompose::NewL();
|
sl@0
|
1534 |
CleanupStack::PushL(composer2);
|
sl@0
|
1535 |
User::LeaveIfError(composer2->Open(E3GP3GP, &video1, &audio1, file1));
|
sl@0
|
1536 |
|
sl@0
|
1537 |
// composer 3
|
sl@0
|
1538 |
T3GPAudioPropertiesMpeg4Audio audio2(50, KDummyData);
|
sl@0
|
1539 |
T3GPVideoPropertiesAvc video2(50, TSize(20, 20), KDummyData);
|
sl@0
|
1540 |
|
sl@0
|
1541 |
RFile file2;
|
sl@0
|
1542 |
CleanupClosePushL(file2);
|
sl@0
|
1543 |
User::LeaveIfError(file2.Temp(fs, testFolderName, fileName, EFileShareExclusive));
|
sl@0
|
1544 |
|
sl@0
|
1545 |
C3GPCompose* composer3 = C3GPCompose::NewL();
|
sl@0
|
1546 |
CleanupStack::PushL(composer3);
|
sl@0
|
1547 |
User::LeaveIfError(composer3->Open(E3GP3GP, &video2, &audio2, file2));
|
sl@0
|
1548 |
|
sl@0
|
1549 |
// write some data into composer 1, then 2, then 3
|
sl@0
|
1550 |
User::LeaveIfError(aComposer.WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1551 |
User::LeaveIfError(composer2->WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1552 |
User::LeaveIfError(composer3->WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1553 |
|
sl@0
|
1554 |
// clean up for composer 3
|
sl@0
|
1555 |
User::LeaveIfError(composer3->Complete());
|
sl@0
|
1556 |
CleanupStack::PopAndDestroy(composer3);
|
sl@0
|
1557 |
CleanupStack::PopAndDestroy(&file2);
|
sl@0
|
1558 |
|
sl@0
|
1559 |
// Parse file2
|
sl@0
|
1560 |
C3GPParse* parser = C3GPParse::NewL();
|
sl@0
|
1561 |
CleanupStack::PushL(parser);
|
sl@0
|
1562 |
User::LeaveIfError(parser->Open(fileName));
|
sl@0
|
1563 |
|
sl@0
|
1564 |
// write some data into composer 1 & 2
|
sl@0
|
1565 |
User::LeaveIfError(aComposer.WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1566 |
User::LeaveIfError(composer2->WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1567 |
|
sl@0
|
1568 |
// close parser and delete the file
|
sl@0
|
1569 |
User::LeaveIfError(parser->Complete());
|
sl@0
|
1570 |
CleanupStack::PopAndDestroy(parser);
|
sl@0
|
1571 |
User::LeaveIfError(fs.Delete(fileName)); // delete the temp file created
|
sl@0
|
1572 |
|
sl@0
|
1573 |
// clean up for composer 2
|
sl@0
|
1574 |
User::LeaveIfError(composer2->Complete());
|
sl@0
|
1575 |
file1.FullName(fileName); // retrieve the full name of file1
|
sl@0
|
1576 |
CleanupStack::PopAndDestroy(composer2);
|
sl@0
|
1577 |
CleanupStack::PopAndDestroy(&file1);
|
sl@0
|
1578 |
User::LeaveIfError(fs.Delete(fileName)); // delete the temp file created
|
sl@0
|
1579 |
|
sl@0
|
1580 |
// cleanup
|
sl@0
|
1581 |
CleanupStack::PopAndDestroy(&fs);
|
sl@0
|
1582 |
|
sl@0
|
1583 |
// write some data into composer 1
|
sl@0
|
1584 |
User::LeaveIfError(aComposer.WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1585 |
}
|
sl@0
|
1586 |
}
|
sl@0
|
1587 |
|
sl@0
|
1588 |
// -----------------------------------------------------------------------------
|
sl@0
|
1589 |
// C3GPLibComposeCloseComposerWithoutComplete
|
sl@0
|
1590 |
// -----------------------------------------------------------------------------
|
sl@0
|
1591 |
//
|
sl@0
|
1592 |
C3GPLibComposeCloseComposerWithoutComplete::C3GPLibComposeCloseComposerWithoutComplete()
|
sl@0
|
1593 |
{
|
sl@0
|
1594 |
}
|
sl@0
|
1595 |
|
sl@0
|
1596 |
void C3GPLibComposeCloseComposerWithoutComplete::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1597 |
{
|
sl@0
|
1598 |
// close the composer, then delete the file
|
sl@0
|
1599 |
aComposer.Complete();
|
sl@0
|
1600 |
|
sl@0
|
1601 |
RFs fs;
|
sl@0
|
1602 |
User::LeaveIfError(fs.Connect());
|
sl@0
|
1603 |
CleanupClosePushL(fs);
|
sl@0
|
1604 |
|
sl@0
|
1605 |
// ignore any error
|
sl@0
|
1606 |
fs.Delete(iFilename);
|
sl@0
|
1607 |
|
sl@0
|
1608 |
// Reopens it
|
sl@0
|
1609 |
T3GPAudioPropertiesMpeg4Audio audio1(100, KDummyData);
|
sl@0
|
1610 |
T3GPVideoPropertiesAvc video1(100, TSize(100, 100), KDummyData);
|
sl@0
|
1611 |
|
sl@0
|
1612 |
C3GPCompose* composer = C3GPCompose::NewL();
|
sl@0
|
1613 |
CleanupStack::PushL(composer);
|
sl@0
|
1614 |
User::LeaveIfError(composer->Open(E3GP3GP, &video1, &audio1, iFilename));
|
sl@0
|
1615 |
|
sl@0
|
1616 |
// write some data into composer 1, then 2, then 3
|
sl@0
|
1617 |
User::LeaveIfError(composer->WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1618 |
|
sl@0
|
1619 |
// delete the composer before calling Complete
|
sl@0
|
1620 |
CleanupStack::PopAndDestroy(composer);
|
sl@0
|
1621 |
|
sl@0
|
1622 |
RFile file;
|
sl@0
|
1623 |
CleanupClosePushL(file);
|
sl@0
|
1624 |
User::LeaveIfError(file.Open(fs, iFilename, EFileRead));
|
sl@0
|
1625 |
|
sl@0
|
1626 |
TInt fileSize = 0;
|
sl@0
|
1627 |
User::LeaveIfError(file.Size(fileSize));
|
sl@0
|
1628 |
|
sl@0
|
1629 |
if (fileSize == 0)
|
sl@0
|
1630 |
{
|
sl@0
|
1631 |
SetTestStepResult(EFail);
|
sl@0
|
1632 |
}
|
sl@0
|
1633 |
|
sl@0
|
1634 |
CleanupStack::PopAndDestroy(2); // file, fs
|
sl@0
|
1635 |
|
sl@0
|
1636 |
// continue the test
|
sl@0
|
1637 |
C3GPLibComposeFilename::doTestStepComposeOpenL(aComposer);
|
sl@0
|
1638 |
}
|
sl@0
|
1639 |
|
sl@0
|
1640 |
// -----------------------------------------------------------------------------
|
sl@0
|
1641 |
// C3GPLibComposePanic
|
sl@0
|
1642 |
// -----------------------------------------------------------------------------
|
sl@0
|
1643 |
//
|
sl@0
|
1644 |
C3GPLibComposePanic::C3GPLibComposePanic()
|
sl@0
|
1645 |
{
|
sl@0
|
1646 |
}
|
sl@0
|
1647 |
|
sl@0
|
1648 |
TVerdict C3GPLibComposePanic::doTestStepPreambleL()
|
sl@0
|
1649 |
{
|
sl@0
|
1650 |
TVerdict verdict = C3GPLibComposeFilename::doTestStepPreambleL();
|
sl@0
|
1651 |
if (TestStepResult() == EPass)
|
sl@0
|
1652 |
{
|
sl@0
|
1653 |
if (!GetBoolFromConfig(ConfigSection(), _L("panic"), iPanic))
|
sl@0
|
1654 |
{
|
sl@0
|
1655 |
ERR_PRINTF1(_L("Test setting panic not specified. Test cannot proceed."));
|
sl@0
|
1656 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1657 |
}
|
sl@0
|
1658 |
else
|
sl@0
|
1659 |
{
|
sl@0
|
1660 |
TPtrC strPtr;
|
sl@0
|
1661 |
if (GetStringFromConfig(ConfigSection(), _L("dir"), strPtr))
|
sl@0
|
1662 |
{
|
sl@0
|
1663 |
// save a copy of the dir specified for the test
|
sl@0
|
1664 |
iDir.CreateL(strPtr);
|
sl@0
|
1665 |
}
|
sl@0
|
1666 |
else
|
sl@0
|
1667 |
{
|
sl@0
|
1668 |
// cannot find filename!
|
sl@0
|
1669 |
ERR_PRINTF1(_L("Dir not specified. Test cannot proceed."));
|
sl@0
|
1670 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1671 |
}
|
sl@0
|
1672 |
}
|
sl@0
|
1673 |
}
|
sl@0
|
1674 |
|
sl@0
|
1675 |
return TestStepResult();
|
sl@0
|
1676 |
}
|
sl@0
|
1677 |
|
sl@0
|
1678 |
void C3GPLibComposePanic::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1679 |
{
|
sl@0
|
1680 |
// close the composer, then delete the file
|
sl@0
|
1681 |
aComposer.Complete();
|
sl@0
|
1682 |
|
sl@0
|
1683 |
RFs fs;
|
sl@0
|
1684 |
User::LeaveIfError(fs.Connect());
|
sl@0
|
1685 |
CleanupClosePushL(fs);
|
sl@0
|
1686 |
|
sl@0
|
1687 |
// retrieve the number of items in the directory
|
sl@0
|
1688 |
CDir* dirList = NULL;
|
sl@0
|
1689 |
User::LeaveIfError(fs.GetDir(iDir, KEntryAttNormal, ESortNone, dirList));
|
sl@0
|
1690 |
TInt orgCount = dirList->Count();
|
sl@0
|
1691 |
delete dirList;
|
sl@0
|
1692 |
|
sl@0
|
1693 |
// Reopens it
|
sl@0
|
1694 |
T3GPAudioPropertiesMpeg4Audio audio1(100, KDummyData);
|
sl@0
|
1695 |
T3GPVideoPropertiesAvc video1(100, TSize(100, 100), KDummyData);
|
sl@0
|
1696 |
|
sl@0
|
1697 |
C3GPCompose* composer = C3GPCompose::NewL();
|
sl@0
|
1698 |
CleanupStack::PushL(composer);
|
sl@0
|
1699 |
User::LeaveIfError(composer->Open(E3GP3GP, &video1, &audio1, iFilename));
|
sl@0
|
1700 |
|
sl@0
|
1701 |
// write some data into composer 1, then 2, then 3
|
sl@0
|
1702 |
User::LeaveIfError(composer->WriteVideoFrame(KDummyData, 10, EFalse));
|
sl@0
|
1703 |
|
sl@0
|
1704 |
if (iPanic)
|
sl@0
|
1705 |
{
|
sl@0
|
1706 |
// force a panic so that the composed file and the temporary file is left in the
|
sl@0
|
1707 |
// directory
|
sl@0
|
1708 |
User::Panic(_L("Testing"), KErrArgument);
|
sl@0
|
1709 |
}
|
sl@0
|
1710 |
|
sl@0
|
1711 |
// delete the composer before calling Complete
|
sl@0
|
1712 |
composer->Complete();
|
sl@0
|
1713 |
CleanupStack::PopAndDestroy(composer);
|
sl@0
|
1714 |
|
sl@0
|
1715 |
User::LeaveIfError(fs.GetDir(iDir, KEntryAttNormal, ESortNone, dirList));
|
sl@0
|
1716 |
TInt newCount = dirList->Count();
|
sl@0
|
1717 |
delete dirList;
|
sl@0
|
1718 |
|
sl@0
|
1719 |
// When cleaned up properly, only the composed file should be left within the directory.
|
sl@0
|
1720 |
if (!(newCount == 1 && orgCount > 0))
|
sl@0
|
1721 |
{
|
sl@0
|
1722 |
SetTestStepResult(EFail);
|
sl@0
|
1723 |
}
|
sl@0
|
1724 |
|
sl@0
|
1725 |
CleanupStack::PopAndDestroy(); // fs
|
sl@0
|
1726 |
|
sl@0
|
1727 |
// continue the test
|
sl@0
|
1728 |
C3GPLibComposeFilename::doTestStepComposeOpenL(aComposer);
|
sl@0
|
1729 |
}
|
sl@0
|
1730 |
|
sl@0
|
1731 |
TVerdict C3GPLibComposePanic::doTestStepPostambleL()
|
sl@0
|
1732 |
{
|
sl@0
|
1733 |
iDir.Close();
|
sl@0
|
1734 |
return C3GPLibComposeFilename::doTestStepPostambleL();
|
sl@0
|
1735 |
}
|
sl@0
|
1736 |
|
sl@0
|
1737 |
// -----------------------------------------------------------------------------
|
sl@0
|
1738 |
// C3GPLibComposeLargeFile
|
sl@0
|
1739 |
// -----------------------------------------------------------------------------
|
sl@0
|
1740 |
//
|
sl@0
|
1741 |
C3GPLibComposeLargeFile::C3GPLibComposeLargeFile()
|
sl@0
|
1742 |
{
|
sl@0
|
1743 |
}
|
sl@0
|
1744 |
|
sl@0
|
1745 |
TVerdict C3GPLibComposeLargeFile::doTestStepPreambleL()
|
sl@0
|
1746 |
{
|
sl@0
|
1747 |
// ensure the base class setup is completed first
|
sl@0
|
1748 |
C3GPLibComposeBase::doTestStepPreambleL();
|
sl@0
|
1749 |
if (TestStepResult() == EPass)
|
sl@0
|
1750 |
{
|
sl@0
|
1751 |
TInt temp;
|
sl@0
|
1752 |
if (GetIntFromConfig(ConfigSection(), _L("inputFormat"), temp))
|
sl@0
|
1753 |
{
|
sl@0
|
1754 |
iInputFileFormat = (T3GPFileFormatType)temp;
|
sl@0
|
1755 |
|
sl@0
|
1756 |
if (GetIntFromConfig(ConfigSection(), _L("video"), temp))
|
sl@0
|
1757 |
{
|
sl@0
|
1758 |
iVideoType = (T3GPVideoType)temp;
|
sl@0
|
1759 |
}
|
sl@0
|
1760 |
|
sl@0
|
1761 |
if (GetIntFromConfig(ConfigSection(), _L("audio"), temp))
|
sl@0
|
1762 |
{
|
sl@0
|
1763 |
iAudioType = (T3GPAudioType)temp;
|
sl@0
|
1764 |
}
|
sl@0
|
1765 |
|
sl@0
|
1766 |
if (iVideoType == E3GPNoVideo && iAudioType == E3GPNoAudio)
|
sl@0
|
1767 |
{
|
sl@0
|
1768 |
// At least audio or video should be specified
|
sl@0
|
1769 |
ERR_PRINTF1(_L("Specify at least video or audio"));
|
sl@0
|
1770 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1771 |
}
|
sl@0
|
1772 |
else
|
sl@0
|
1773 |
{
|
sl@0
|
1774 |
#ifdef __WINSCW__
|
sl@0
|
1775 |
_LIT(KOutputDir, "filenameEmu");
|
sl@0
|
1776 |
#else
|
sl@0
|
1777 |
_LIT(KOutputDir, "filenameHw");
|
sl@0
|
1778 |
#endif
|
sl@0
|
1779 |
|
sl@0
|
1780 |
TPtrC fileNamePtr;
|
sl@0
|
1781 |
if (GetStringFromConfig(ConfigSection(), KOutputDir, fileNamePtr))
|
sl@0
|
1782 |
{
|
sl@0
|
1783 |
iFileName.CreateL(fileNamePtr);
|
sl@0
|
1784 |
User::LeaveIfError(iFs.Connect());
|
sl@0
|
1785 |
|
sl@0
|
1786 |
TInt err = iFs.MkDirAll(iFileName);
|
sl@0
|
1787 |
if (err != KErrNone && err != KErrAlreadyExists)
|
sl@0
|
1788 |
{
|
sl@0
|
1789 |
User::Leave(err);
|
sl@0
|
1790 |
}
|
sl@0
|
1791 |
|
sl@0
|
1792 |
err = iFile64.Create(iFs, iFileName, EFileShareAny|EFileStream|EFileWrite);
|
sl@0
|
1793 |
if (err == KErrAlreadyExists)
|
sl@0
|
1794 |
{
|
sl@0
|
1795 |
User::LeaveIfError(iFile64.Replace(iFs, iFileName, EFileShareAny|EFileStream|EFileWrite));
|
sl@0
|
1796 |
}
|
sl@0
|
1797 |
else
|
sl@0
|
1798 |
{
|
sl@0
|
1799 |
User::LeaveIfError(err);
|
sl@0
|
1800 |
}
|
sl@0
|
1801 |
}
|
sl@0
|
1802 |
else
|
sl@0
|
1803 |
{
|
sl@0
|
1804 |
// cannot find filename!
|
sl@0
|
1805 |
ERR_PRINTF1(_L("Filename not specified. Test cannot proceed."));
|
sl@0
|
1806 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1807 |
}
|
sl@0
|
1808 |
}
|
sl@0
|
1809 |
}
|
sl@0
|
1810 |
else
|
sl@0
|
1811 |
{
|
sl@0
|
1812 |
// file format has to be specified
|
sl@0
|
1813 |
ERR_PRINTF1(_L("Specify file format of the file to be composed"));
|
sl@0
|
1814 |
SetTestStepResult(ETestSuiteError);
|
sl@0
|
1815 |
}
|
sl@0
|
1816 |
|
sl@0
|
1817 |
if (!GetIntFromConfig(ConfigSection(), _L("flag"), iComposeFlag))
|
sl@0
|
1818 |
{
|
sl@0
|
1819 |
iComposeFlag = E3GPNoFlag;
|
sl@0
|
1820 |
}
|
sl@0
|
1821 |
}
|
sl@0
|
1822 |
|
sl@0
|
1823 |
return TestStepResult();
|
sl@0
|
1824 |
}
|
sl@0
|
1825 |
|
sl@0
|
1826 |
TVerdict C3GPLibComposeLargeFile::doTestStepPostambleL()
|
sl@0
|
1827 |
{
|
sl@0
|
1828 |
// clean up of temp file
|
sl@0
|
1829 |
iFile64.Close();
|
sl@0
|
1830 |
iFs.Delete(iFileName);
|
sl@0
|
1831 |
iFs.Close();
|
sl@0
|
1832 |
|
sl@0
|
1833 |
iFileName.Close();
|
sl@0
|
1834 |
|
sl@0
|
1835 |
// clean up all composer test base setups
|
sl@0
|
1836 |
C3GPLibComposeBase::doTestStepPostambleL();
|
sl@0
|
1837 |
|
sl@0
|
1838 |
return TestStepResult();
|
sl@0
|
1839 |
}
|
sl@0
|
1840 |
|
sl@0
|
1841 |
C3GPCompose* C3GPLibComposeLargeFile::doTestStepCreateComposerL()
|
sl@0
|
1842 |
{
|
sl@0
|
1843 |
return C3GPCompose::NewL(KLargeFileWriteBufferSize, KLargeFileWriteBufferMaxCount);
|
sl@0
|
1844 |
}
|
sl@0
|
1845 |
|
sl@0
|
1846 |
void C3GPLibComposeLargeFile::doTestStepComposeOpenL(C3GPCompose& aComposer)
|
sl@0
|
1847 |
{
|
sl@0
|
1848 |
T3GPVideoPropertiesBase* video = SetupVideoPropertiesL();
|
sl@0
|
1849 |
CleanupStack::PushL(video);
|
sl@0
|
1850 |
|
sl@0
|
1851 |
T3GPAudioPropertiesBase* audio = SetupAudioPropertiesL();
|
sl@0
|
1852 |
CleanupStack::PushL(audio);
|
sl@0
|
1853 |
|
sl@0
|
1854 |
TInt err = aComposer.Open(iInputFileFormat, video, audio, iFile64, iComposeFlag);
|
sl@0
|
1855 |
if (err == KErrNone)
|
sl@0
|
1856 |
{
|
sl@0
|
1857 |
SetTestStepResult(EPass);
|
sl@0
|
1858 |
}
|
sl@0
|
1859 |
else
|
sl@0
|
1860 |
{
|
sl@0
|
1861 |
if (!ShouldRunOOMTest())
|
sl@0
|
1862 |
{
|
sl@0
|
1863 |
ERR_PRINTF2(_L("C3GPLibComposeFile::doTestStepComposeOpenL => C3GPComposer::Open returns = %d"), err);
|
sl@0
|
1864 |
}
|
sl@0
|
1865 |
SetTestStepError(err);
|
sl@0
|
1866 |
SetTestStepResult(EInconclusive);
|
sl@0
|
1867 |
}
|
sl@0
|
1868 |
|
sl@0
|
1869 |
CleanupStack::PopAndDestroy(2); // audio, video
|
sl@0
|
1870 |
}
|
sl@0
|
1871 |
|
sl@0
|
1872 |
void C3GPLibComposeLargeFile::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
1873 |
{
|
sl@0
|
1874 |
RBuf8 videoBuf1;
|
sl@0
|
1875 |
CleanupClosePushL(videoBuf1);
|
sl@0
|
1876 |
TBool keyFrame1;
|
sl@0
|
1877 |
TUint videoTimestampMS = 0;
|
sl@0
|
1878 |
TUint videoTS1;
|
sl@0
|
1879 |
TUint frameSize = 0;
|
sl@0
|
1880 |
T3GPFrameDependencies aDependencies;
|
sl@0
|
1881 |
|
sl@0
|
1882 |
RFile fileName;
|
sl@0
|
1883 |
CleanupClosePushL(fileName);
|
sl@0
|
1884 |
User::LeaveIfError(fileName.Open(iFs, KLargeVideoFile(), EFileRead));
|
sl@0
|
1885 |
|
sl@0
|
1886 |
C3GPParse* parser = C3GPParse::NewL();
|
sl@0
|
1887 |
CleanupStack::PushL(parser);
|
sl@0
|
1888 |
User::LeaveIfError(parser->Open(fileName));
|
sl@0
|
1889 |
User::LeaveIfError(parser->GetVideoFrameSize(frameSize));
|
sl@0
|
1890 |
User::LeaveIfError(videoBuf1.Create((TInt)frameSize));
|
sl@0
|
1891 |
User::LeaveIfError(parser->ReadVideoFrame(videoBuf1, keyFrame1, videoTimestampMS, videoTS1));
|
sl@0
|
1892 |
|
sl@0
|
1893 |
TInt error = parser->GetVideoFrameDependencies(aDependencies);
|
sl@0
|
1894 |
if (error != KErrNone)
|
sl@0
|
1895 |
{
|
sl@0
|
1896 |
aDependencies.iDependsOn = E3GPDependencyUnknown;
|
sl@0
|
1897 |
aDependencies.iIsDependedOn = E3GPDependencyUnknown;
|
sl@0
|
1898 |
aDependencies.iHasRedundancy = E3GPRedundancyUnknown;
|
sl@0
|
1899 |
}
|
sl@0
|
1900 |
|
sl@0
|
1901 |
TInt err = KErrNone;
|
sl@0
|
1902 |
TInt64 size = 0;
|
sl@0
|
1903 |
TTime startTime;
|
sl@0
|
1904 |
TTime endTime;
|
sl@0
|
1905 |
startTime.UniversalTime();
|
sl@0
|
1906 |
|
sl@0
|
1907 |
// create a 3GB video file
|
sl@0
|
1908 |
TInt videoLength = videoBuf1.Length();
|
sl@0
|
1909 |
while (size + videoLength < K3GigaBytes)
|
sl@0
|
1910 |
{
|
sl@0
|
1911 |
err = aComposer.WriteVideoFrame(videoBuf1, 100, keyFrame1, aDependencies);
|
sl@0
|
1912 |
if (err != KErrNone)
|
sl@0
|
1913 |
{
|
sl@0
|
1914 |
ERR_PRINTF2(_L("Fail to write video frame, err = %d"), err);
|
sl@0
|
1915 |
break;
|
sl@0
|
1916 |
}
|
sl@0
|
1917 |
iFile64.Size(size);
|
sl@0
|
1918 |
}
|
sl@0
|
1919 |
|
sl@0
|
1920 |
endTime.UniversalTime();
|
sl@0
|
1921 |
TTimeIntervalMinutes composeTime;
|
sl@0
|
1922 |
endTime.MinutesFrom(startTime, composeTime);
|
sl@0
|
1923 |
INFO_PRINTF3(_L("Took %d minutes to compose a video file of size %d bytes"), composeTime.Int(), size);
|
sl@0
|
1924 |
|
sl@0
|
1925 |
if (err != KErrNone)
|
sl@0
|
1926 |
{
|
sl@0
|
1927 |
SetTestStepResult(EFail);
|
sl@0
|
1928 |
}
|
sl@0
|
1929 |
|
sl@0
|
1930 |
User::LeaveIfError(parser->Complete());
|
sl@0
|
1931 |
CleanupStack::PopAndDestroy(3, &videoBuf1);
|
sl@0
|
1932 |
}
|
sl@0
|
1933 |
|
sl@0
|
1934 |
// -----------------------------------------------------------------------------
|
sl@0
|
1935 |
// C3GPLibComposeLargeFileUserData
|
sl@0
|
1936 |
// -----------------------------------------------------------------------------
|
sl@0
|
1937 |
//
|
sl@0
|
1938 |
C3GPLibComposeLargeFileUserData::C3GPLibComposeLargeFileUserData()
|
sl@0
|
1939 |
{
|
sl@0
|
1940 |
}
|
sl@0
|
1941 |
|
sl@0
|
1942 |
void C3GPLibComposeLargeFileUserData::doTestStepComposeSetUserDataL(C3GPCompose& aComposer)
|
sl@0
|
1943 |
{
|
sl@0
|
1944 |
TInt bufferUdtaSize = 0;
|
sl@0
|
1945 |
TBuf8<256> bufferUdta;
|
sl@0
|
1946 |
TUint8* ptr = const_cast<TUint8*>(bufferUdta.Ptr());
|
sl@0
|
1947 |
TInt size = 0;
|
sl@0
|
1948 |
|
sl@0
|
1949 |
_LIT8(KTitle,"titl");
|
sl@0
|
1950 |
_LIT8(KData1,"This Udta titl test data 01!!<end>");
|
sl@0
|
1951 |
size = KTitle().Length() + KData1().Length() + 4;
|
sl@0
|
1952 |
WriteInt32(ptr, size);
|
sl@0
|
1953 |
ptr += 4;
|
sl@0
|
1954 |
Mem::Copy(ptr, KTitle().Ptr(), KTitle().Length());
|
sl@0
|
1955 |
ptr += KTitle().Length();
|
sl@0
|
1956 |
Mem::Copy(ptr, KData1().Ptr(), KData1().Length());
|
sl@0
|
1957 |
ptr += KData1().Length();
|
sl@0
|
1958 |
bufferUdtaSize += size;
|
sl@0
|
1959 |
|
sl@0
|
1960 |
_LIT8(KTitle1,"titl");
|
sl@0
|
1961 |
_LIT8(KData2,"This Udta titl test data 02!!blahblahblahbla<end>");
|
sl@0
|
1962 |
size = KTitle1().Length() + KData2().Length() + 4;
|
sl@0
|
1963 |
WriteInt32(ptr, size);
|
sl@0
|
1964 |
ptr += 4;
|
sl@0
|
1965 |
Mem::Copy(ptr, KTitle1().Ptr(), KTitle1().Length());
|
sl@0
|
1966 |
ptr += KTitle1().Length();
|
sl@0
|
1967 |
Mem::Copy(ptr, KData2().Ptr(), KData2().Length());
|
sl@0
|
1968 |
ptr += KData2().Length();
|
sl@0
|
1969 |
bufferUdtaSize += size;
|
sl@0
|
1970 |
|
sl@0
|
1971 |
_LIT8(KTitle2,"titl");
|
sl@0
|
1972 |
_LIT8(KData3,"This Udta titl test data 03!!Moreblahblahblahblahblahblahblahblahblah<end>");
|
sl@0
|
1973 |
size = KTitle2().Length() + KData3().Length() + 4;
|
sl@0
|
1974 |
WriteInt32(ptr, size);
|
sl@0
|
1975 |
ptr += 4;
|
sl@0
|
1976 |
Mem::Copy(ptr, KTitle2().Ptr(), KTitle2().Length());
|
sl@0
|
1977 |
ptr += KTitle2().Length();
|
sl@0
|
1978 |
Mem::Copy(ptr, KData3().Ptr(), KData3().Length());
|
sl@0
|
1979 |
ptr += KData3().Length();
|
sl@0
|
1980 |
bufferUdtaSize += size;
|
sl@0
|
1981 |
|
sl@0
|
1982 |
bufferUdta.SetLength(bufferUdtaSize);
|
sl@0
|
1983 |
TInt error = aComposer.SetUserData(E3GPUdtaVideoTrak, bufferUdta);
|
sl@0
|
1984 |
|
sl@0
|
1985 |
if (error != KErrNone)
|
sl@0
|
1986 |
{
|
sl@0
|
1987 |
ERR_PRINTF2(_L("C3GPComposer::SetUserData failed with %d"), error);
|
sl@0
|
1988 |
SetTestStepError(error);
|
sl@0
|
1989 |
}
|
sl@0
|
1990 |
}
|
sl@0
|
1991 |
|
sl@0
|
1992 |
void C3GPLibComposeLargeFileUserData::WriteInt32(TUint8* aPtr, TInt32 aData)
|
sl@0
|
1993 |
{
|
sl@0
|
1994 |
aPtr[0] = TUint8(aData>>24);
|
sl@0
|
1995 |
aPtr[1] = TUint8(aData>>16);
|
sl@0
|
1996 |
aPtr[2] = TUint8(aData>>8);
|
sl@0
|
1997 |
aPtr[3] = TUint8(aData);
|
sl@0
|
1998 |
}
|
sl@0
|
1999 |
|
sl@0
|
2000 |
// -----------------------------------------------------------------------------
|
sl@0
|
2001 |
// C3GPLibComposeLargeFile32bitAPI
|
sl@0
|
2002 |
// -----------------------------------------------------------------------------
|
sl@0
|
2003 |
//
|
sl@0
|
2004 |
C3GPLibComposeLargeFile32bitAPI::C3GPLibComposeLargeFile32bitAPI()
|
sl@0
|
2005 |
{
|
sl@0
|
2006 |
}
|
sl@0
|
2007 |
|
sl@0
|
2008 |
C3GPCompose* C3GPLibComposeLargeFile32bitAPI::doTestStepCreateComposerL()
|
sl@0
|
2009 |
{
|
sl@0
|
2010 |
return C3GPCompose::NewL(KLargeFileWriteBufferSize, KLargeFileWriteBufferMaxCount);
|
sl@0
|
2011 |
}
|
sl@0
|
2012 |
|
sl@0
|
2013 |
void C3GPLibComposeLargeFile32bitAPI::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
2014 |
{
|
sl@0
|
2015 |
RBuf8 videoBuf1;
|
sl@0
|
2016 |
CleanupClosePushL(videoBuf1);
|
sl@0
|
2017 |
TBool keyFrame1;
|
sl@0
|
2018 |
TUint videoTimestampMS = 0;
|
sl@0
|
2019 |
TUint videoTS1;
|
sl@0
|
2020 |
TUint frameSize = 0;
|
sl@0
|
2021 |
T3GPFrameDependencies aDependencies;
|
sl@0
|
2022 |
|
sl@0
|
2023 |
RFile fileName;
|
sl@0
|
2024 |
CleanupClosePushL(fileName);
|
sl@0
|
2025 |
User::LeaveIfError(fileName.Open(iFs, KLargeVideoFile(), EFileRead));
|
sl@0
|
2026 |
|
sl@0
|
2027 |
C3GPParse* parser = C3GPParse::NewL();
|
sl@0
|
2028 |
CleanupStack::PushL(parser);
|
sl@0
|
2029 |
User::LeaveIfError(parser->Open(fileName));
|
sl@0
|
2030 |
User::LeaveIfError(parser->GetVideoFrameSize(frameSize));
|
sl@0
|
2031 |
User::LeaveIfError(videoBuf1.Create((TInt)frameSize));
|
sl@0
|
2032 |
User::LeaveIfError(parser->ReadVideoFrame(videoBuf1, keyFrame1, videoTimestampMS, videoTS1));
|
sl@0
|
2033 |
|
sl@0
|
2034 |
TInt error = parser->GetVideoFrameDependencies(aDependencies);
|
sl@0
|
2035 |
if (error != KErrNone)
|
sl@0
|
2036 |
{
|
sl@0
|
2037 |
aDependencies.iDependsOn = E3GPDependencyUnknown;
|
sl@0
|
2038 |
aDependencies.iIsDependedOn = E3GPDependencyUnknown;
|
sl@0
|
2039 |
aDependencies.iHasRedundancy = E3GPRedundancyUnknown;
|
sl@0
|
2040 |
}
|
sl@0
|
2041 |
|
sl@0
|
2042 |
TInt err = KErrNone;
|
sl@0
|
2043 |
TInt size = 0;
|
sl@0
|
2044 |
TTime startTime;
|
sl@0
|
2045 |
TTime endTime;
|
sl@0
|
2046 |
startTime.UniversalTime();
|
sl@0
|
2047 |
|
sl@0
|
2048 |
// create a 3GB video file
|
sl@0
|
2049 |
TInt videoLength = videoBuf1.Length();
|
sl@0
|
2050 |
while (size + videoLength < K3GigaBytes)
|
sl@0
|
2051 |
{
|
sl@0
|
2052 |
err = aComposer.WriteVideoFrame(videoBuf1, 100, keyFrame1, aDependencies);
|
sl@0
|
2053 |
if (err != KErrNone)
|
sl@0
|
2054 |
{
|
sl@0
|
2055 |
ERR_PRINTF2(_L("Fail to write video frame, err = %d"), err);
|
sl@0
|
2056 |
break;
|
sl@0
|
2057 |
}
|
sl@0
|
2058 |
iFile.Size(size);
|
sl@0
|
2059 |
}
|
sl@0
|
2060 |
|
sl@0
|
2061 |
endTime.UniversalTime();
|
sl@0
|
2062 |
TTimeIntervalMinutes composeTime;
|
sl@0
|
2063 |
endTime.MinutesFrom(startTime, composeTime);
|
sl@0
|
2064 |
INFO_PRINTF3(_L("Took %d minutes to compose a video file of size %d bytes"), composeTime.Int(), size);
|
sl@0
|
2065 |
|
sl@0
|
2066 |
err = aComposer.Complete();
|
sl@0
|
2067 |
if (err != KErrNone)
|
sl@0
|
2068 |
{
|
sl@0
|
2069 |
SetTestStepError(err);
|
sl@0
|
2070 |
}
|
sl@0
|
2071 |
|
sl@0
|
2072 |
User::LeaveIfError(parser->Complete());
|
sl@0
|
2073 |
CleanupStack::PopAndDestroy(3, &videoBuf1);
|
sl@0
|
2074 |
}
|
sl@0
|
2075 |
|
sl@0
|
2076 |
// -----------------------------------------------------------------------------
|
sl@0
|
2077 |
// C3GPLibComposeLargeFileDiskFull
|
sl@0
|
2078 |
// -----------------------------------------------------------------------------
|
sl@0
|
2079 |
//
|
sl@0
|
2080 |
C3GPLibComposeLargeFileDiskFull::C3GPLibComposeLargeFileDiskFull()
|
sl@0
|
2081 |
{
|
sl@0
|
2082 |
}
|
sl@0
|
2083 |
|
sl@0
|
2084 |
void C3GPLibComposeLargeFileDiskFull::doTestStepComposeWriteVideoAudioL(C3GPCompose& aComposer)
|
sl@0
|
2085 |
{
|
sl@0
|
2086 |
RBuf8 videoBuf1;
|
sl@0
|
2087 |
CleanupClosePushL(videoBuf1);
|
sl@0
|
2088 |
TBool keyFrame1;
|
sl@0
|
2089 |
TUint videoTimestampMS = 0;
|
sl@0
|
2090 |
TUint videoTS1;
|
sl@0
|
2091 |
TUint frameSize = 0;
|
sl@0
|
2092 |
T3GPFrameDependencies aDependencies;
|
sl@0
|
2093 |
|
sl@0
|
2094 |
RFile fileName;
|
sl@0
|
2095 |
CleanupClosePushL(fileName);
|
sl@0
|
2096 |
User::LeaveIfError(fileName.Open(iFs, KLargeVideoFile(), EFileRead));
|
sl@0
|
2097 |
|
sl@0
|
2098 |
C3GPParse* parser = C3GPParse::NewL();
|
sl@0
|
2099 |
CleanupStack::PushL(parser);
|
sl@0
|
2100 |
User::LeaveIfError(parser->Open(fileName));
|
sl@0
|
2101 |
User::LeaveIfError(parser->GetVideoFrameSize(frameSize));
|
sl@0
|
2102 |
User::LeaveIfError(videoBuf1.Create((TInt)frameSize));
|
sl@0
|
2103 |
User::LeaveIfError(parser->ReadVideoFrame(videoBuf1, keyFrame1, videoTimestampMS, videoTS1));
|
sl@0
|
2104 |
|
sl@0
|
2105 |
TInt error = parser->GetVideoFrameDependencies(aDependencies);
|
sl@0
|
2106 |
if (error != KErrNone)
|
sl@0
|
2107 |
{
|
sl@0
|
2108 |
aDependencies.iDependsOn = E3GPDependencyUnknown;
|
sl@0
|
2109 |
aDependencies.iIsDependedOn = E3GPDependencyUnknown;
|
sl@0
|
2110 |
aDependencies.iHasRedundancy = E3GPRedundancyUnknown;
|
sl@0
|
2111 |
}
|
sl@0
|
2112 |
|
sl@0
|
2113 |
TInt err = KErrNone;
|
sl@0
|
2114 |
TInt64 size = 0;
|
sl@0
|
2115 |
TTime startTime;
|
sl@0
|
2116 |
TTime endTime;
|
sl@0
|
2117 |
startTime.UniversalTime();
|
sl@0
|
2118 |
|
sl@0
|
2119 |
// create a 3GB video file
|
sl@0
|
2120 |
TInt videoLength = videoBuf1.Length();
|
sl@0
|
2121 |
while (size + videoLength < K3GigaBytes)
|
sl@0
|
2122 |
{
|
sl@0
|
2123 |
err = aComposer.WriteVideoFrame(videoBuf1, 100, keyFrame1, aDependencies);
|
sl@0
|
2124 |
if (err != KErrNone)
|
sl@0
|
2125 |
{
|
sl@0
|
2126 |
ERR_PRINTF2(_L("Fail to write video frame, err = %d"), err);
|
sl@0
|
2127 |
break;
|
sl@0
|
2128 |
}
|
sl@0
|
2129 |
iFile64.Size(size);
|
sl@0
|
2130 |
}
|
sl@0
|
2131 |
|
sl@0
|
2132 |
endTime.UniversalTime();
|
sl@0
|
2133 |
TTimeIntervalMinutes composeTime;
|
sl@0
|
2134 |
endTime.MinutesFrom(startTime, composeTime);
|
sl@0
|
2135 |
INFO_PRINTF3(_L("Took %d minutes to compose a video file of size %d bytes"), composeTime.Int(), size);
|
sl@0
|
2136 |
|
sl@0
|
2137 |
if (err != KErrNone)
|
sl@0
|
2138 |
{
|
sl@0
|
2139 |
SetTestStepError(err);
|
sl@0
|
2140 |
}
|
sl@0
|
2141 |
|
sl@0
|
2142 |
User::LeaveIfError(parser->Complete());
|
sl@0
|
2143 |
CleanupStack::PopAndDestroy(3, &videoBuf1);
|
sl@0
|
2144 |
|
sl@0
|
2145 |
// ignore the error
|
sl@0
|
2146 |
aComposer.Complete();
|
sl@0
|
2147 |
}
|
sl@0
|
2148 |
|
sl@0
|
2149 |
// -----------------------------------------------------------------------------
|
sl@0
|
2150 |
// C3GPLibComposeFileWithAvcProfileCheck
|
sl@0
|
2151 |
// -----------------------------------------------------------------------------
|
sl@0
|
2152 |
//
|
sl@0
|
2153 |
|
sl@0
|
2154 |
const TInt KAvcDecoderConfigRecordLength = 7;
|
sl@0
|
2155 |
|
sl@0
|
2156 |
_LIT8(KAvcCTag, "avcC");
|
sl@0
|
2157 |
|
sl@0
|
2158 |
const TUint8 KAvcConfigVersion = 1;
|
sl@0
|
2159 |
|
sl@0
|
2160 |
const TUint8 KAvcProfileByteBaseline = 66;
|
sl@0
|
2161 |
const TUint8 KAvcProfileByteExtended = 77;
|
sl@0
|
2162 |
const TUint8 KAvcProfileByteMain = 88;
|
sl@0
|
2163 |
const TUint8 KAvcProfileByteHigh = 100;
|
sl@0
|
2164 |
|
sl@0
|
2165 |
C3GPLibComposeFileWithAvcProfileCheck::C3GPLibComposeFileWithAvcProfileCheck()
|
sl@0
|
2166 |
: iAvcDecoderConfigRecord( KAvcDecoderConfigRecordLength )
|
sl@0
|
2167 |
{
|
sl@0
|
2168 |
}
|
sl@0
|
2169 |
|
sl@0
|
2170 |
TVerdict C3GPLibComposeFileWithAvcProfileCheck::doTestStepL()
|
sl@0
|
2171 |
{
|
sl@0
|
2172 |
if (TestStepResult() != EPass)
|
sl@0
|
2173 |
{
|
sl@0
|
2174 |
return TestStepResult();
|
sl@0
|
2175 |
}
|
sl@0
|
2176 |
|
sl@0
|
2177 |
// this triggers:
|
sl@0
|
2178 |
// 1. Create a composer
|
sl@0
|
2179 |
// 2. Open the composer - C3GPLibComposeFileFormatCheck::doTestStepComposeOpenL
|
sl@0
|
2180 |
// 3. Write Video & Audio Data - C3GPLibComposeFileFormatCheck::doTestStepComposeWriteVideoAudioL
|
sl@0
|
2181 |
// 4. Write User Data - C3GPLibComposeFileFormatCheck::doTestStepComposeSetUserDataL
|
sl@0
|
2182 |
// 5. Complete the composer
|
sl@0
|
2183 |
TVerdict verdict = C3GPLibComposeFile::doTestStepL();
|
sl@0
|
2184 |
if (verdict == EPass)
|
sl@0
|
2185 |
{
|
sl@0
|
2186 |
// once the file is composed, it can be verified if the file composed has the same
|
sl@0
|
2187 |
// AVC profile.
|
sl@0
|
2188 |
verdict = VerifyAvcProfileL(iFile);
|
sl@0
|
2189 |
}
|
sl@0
|
2190 |
else
|
sl@0
|
2191 |
{
|
sl@0
|
2192 |
INFO_PRINTF1(_L("<C3GPLibComposeFileWithAvcProfileCheck> C3GPLibComposeFile::doTestStepL returns failed result"));
|
sl@0
|
2193 |
}
|
sl@0
|
2194 |
SetTestStepResult(verdict);
|
sl@0
|
2195 |
|
sl@0
|
2196 |
if (!ShouldRunOOMTest())
|
sl@0
|
2197 |
{
|
sl@0
|
2198 |
INFO_PRINTF2(_L("C3GPLibComposeFileWithAvcProfileCheck::doTestStepL returns %d"), TestStepResult());
|
sl@0
|
2199 |
}
|
sl@0
|
2200 |
return TestStepResult();
|
sl@0
|
2201 |
}
|
sl@0
|
2202 |
|
sl@0
|
2203 |
/*
|
sl@0
|
2204 |
* The aDecoderSpecificInfo argument is used by 3GPlib to populate the
|
sl@0
|
2205 |
* avcC box. As this contains details of the AVC profile which is being
|
sl@0
|
2206 |
* checked by this test we cannot use KDummyData as the other tests do.
|
sl@0
|
2207 |
*
|
sl@0
|
2208 |
*/
|
sl@0
|
2209 |
T3GPVideoPropertiesBase* C3GPLibComposeFileWithAvcProfileCheck::SetupAvcVideoL()
|
sl@0
|
2210 |
{
|
sl@0
|
2211 |
// See ISO 14496-15, chapter 5.2.4.1.1 for details of these...
|
sl@0
|
2212 |
// config version (always 1)
|
sl@0
|
2213 |
iAvcDecoderConfigRecord[0] = KAvcConfigVersion;
|
sl@0
|
2214 |
// constraint flags
|
sl@0
|
2215 |
iAvcDecoderConfigRecord[2] = 0; // dummy data
|
sl@0
|
2216 |
// level
|
sl@0
|
2217 |
iAvcDecoderConfigRecord[3] = 0; // dummy data
|
sl@0
|
2218 |
// reserved (6bits) + lengthSizeMinusOne (2bits)
|
sl@0
|
2219 |
iAvcDecoderConfigRecord[4] = 0xFC; // 111111 00
|
sl@0
|
2220 |
// reserved (3bits) + numOfSeqParamSets (5bits)
|
sl@0
|
2221 |
iAvcDecoderConfigRecord[5] = 0xE0; // 111 00000
|
sl@0
|
2222 |
// numOfPicParamSets
|
sl@0
|
2223 |
iAvcDecoderConfigRecord[6] = 0;
|
sl@0
|
2224 |
|
sl@0
|
2225 |
switch( iVideoType )
|
sl@0
|
2226 |
{
|
sl@0
|
2227 |
case E3GPAvcProfileBaseline:
|
sl@0
|
2228 |
iAvcDecoderConfigRecord[1] = KAvcProfileByteBaseline;
|
sl@0
|
2229 |
break;
|
sl@0
|
2230 |
|
sl@0
|
2231 |
case E3GPAvcProfileMain:
|
sl@0
|
2232 |
iAvcDecoderConfigRecord[1] = KAvcProfileByteMain;
|
sl@0
|
2233 |
break;
|
sl@0
|
2234 |
|
sl@0
|
2235 |
case E3GPAvcProfileExtended:
|
sl@0
|
2236 |
iAvcDecoderConfigRecord[1] = KAvcProfileByteExtended;
|
sl@0
|
2237 |
break;
|
sl@0
|
2238 |
|
sl@0
|
2239 |
case E3GPAvcProfileHigh:
|
sl@0
|
2240 |
iAvcDecoderConfigRecord[1] = KAvcProfileByteHigh;
|
sl@0
|
2241 |
break;
|
sl@0
|
2242 |
|
sl@0
|
2243 |
default:
|
sl@0
|
2244 |
User::Leave(KErrUnknown);
|
sl@0
|
2245 |
}
|
sl@0
|
2246 |
T3GPVideoPropertiesBase* video = new (ELeave) T3GPVideoPropertiesAvc(1000, TSize(100, 100), iAvcDecoderConfigRecord );
|
sl@0
|
2247 |
return video;
|
sl@0
|
2248 |
}
|
sl@0
|
2249 |
|
sl@0
|
2250 |
TVerdict C3GPLibComposeFileWithAvcProfileCheck::VerifyAvcProfileL(const RFile& aFile)
|
sl@0
|
2251 |
{
|
sl@0
|
2252 |
// Seek to the beginning of the file
|
sl@0
|
2253 |
TInt pos = 0;
|
sl@0
|
2254 |
User::LeaveIfError(aFile.Seek(ESeekStart, pos));
|
sl@0
|
2255 |
|
sl@0
|
2256 |
TVerdict verdict = EFail;
|
sl@0
|
2257 |
TBuf8<4> atom;
|
sl@0
|
2258 |
TBuf8<1> byte;
|
sl@0
|
2259 |
TInt rewind = -1 * ( atom.MaxLength() - 1 );
|
sl@0
|
2260 |
TInt tmp = rewind;
|
sl@0
|
2261 |
|
sl@0
|
2262 |
while(ETrue)
|
sl@0
|
2263 |
{
|
sl@0
|
2264 |
// Search for the 'avcC' atom to check the profile that follows it.
|
sl@0
|
2265 |
|
sl@0
|
2266 |
// Read in next 4 bytes
|
sl@0
|
2267 |
User::LeaveIfError(aFile.Read(atom));
|
sl@0
|
2268 |
if (atom.Length() < atom.MaxLength())
|
sl@0
|
2269 |
{
|
sl@0
|
2270 |
break;
|
sl@0
|
2271 |
}
|
sl@0
|
2272 |
|
sl@0
|
2273 |
// Check if 'avcC' was found
|
sl@0
|
2274 |
if (Mem::Compare((&KAvcCTag)->Ptr(), (&KAvcCTag)->Length(), atom.Ptr(), atom.Length()) == 0)
|
sl@0
|
2275 |
{
|
sl@0
|
2276 |
// read next byte, and it should contain config version (always 1)
|
sl@0
|
2277 |
User::LeaveIfError(aFile.Read(byte));
|
sl@0
|
2278 |
if( byte[0] != KAvcConfigVersion )
|
sl@0
|
2279 |
{
|
sl@0
|
2280 |
ERR_PRINTF2(_L("avcC atom config type not as expected! (%d instead of 1)"), byte[0] );
|
sl@0
|
2281 |
break;
|
sl@0
|
2282 |
}
|
sl@0
|
2283 |
|
sl@0
|
2284 |
// read next byte, and it should contain profile indication
|
sl@0
|
2285 |
User::LeaveIfError(aFile.Read(byte));
|
sl@0
|
2286 |
switch( iVideoType )
|
sl@0
|
2287 |
{
|
sl@0
|
2288 |
case E3GPAvcProfileBaseline:
|
sl@0
|
2289 |
if( byte[0] == KAvcProfileByteBaseline )
|
sl@0
|
2290 |
{
|
sl@0
|
2291 |
verdict = EPass;
|
sl@0
|
2292 |
}
|
sl@0
|
2293 |
else
|
sl@0
|
2294 |
{
|
sl@0
|
2295 |
ERR_PRINTF3(_L("avcC atom config type not as expected! (%d instead of %d)"), byte[0], KAvcProfileByteBaseline );
|
sl@0
|
2296 |
}
|
sl@0
|
2297 |
break;
|
sl@0
|
2298 |
|
sl@0
|
2299 |
|
sl@0
|
2300 |
case E3GPAvcProfileMain:
|
sl@0
|
2301 |
if( byte[0] == KAvcProfileByteMain )
|
sl@0
|
2302 |
{
|
sl@0
|
2303 |
verdict = EPass;
|
sl@0
|
2304 |
}
|
sl@0
|
2305 |
else
|
sl@0
|
2306 |
{
|
sl@0
|
2307 |
ERR_PRINTF3(_L("avcC atom config type not as expected! (%d instead of %d)"), byte[0], KAvcProfileByteMain );
|
sl@0
|
2308 |
}
|
sl@0
|
2309 |
break;
|
sl@0
|
2310 |
|
sl@0
|
2311 |
|
sl@0
|
2312 |
case E3GPAvcProfileExtended:
|
sl@0
|
2313 |
if( byte[0] == KAvcProfileByteExtended )
|
sl@0
|
2314 |
{
|
sl@0
|
2315 |
verdict = EPass;
|
sl@0
|
2316 |
}
|
sl@0
|
2317 |
else
|
sl@0
|
2318 |
{
|
sl@0
|
2319 |
ERR_PRINTF3(_L("avcC atom config type not as expected! (%d instead of %d)"), byte[0], KAvcProfileByteExtended );
|
sl@0
|
2320 |
}
|
sl@0
|
2321 |
break;
|
sl@0
|
2322 |
|
sl@0
|
2323 |
|
sl@0
|
2324 |
case E3GPAvcProfileHigh:
|
sl@0
|
2325 |
if( byte[0] == KAvcProfileByteHigh )
|
sl@0
|
2326 |
{
|
sl@0
|
2327 |
verdict = EPass;
|
sl@0
|
2328 |
}
|
sl@0
|
2329 |
else
|
sl@0
|
2330 |
{
|
sl@0
|
2331 |
ERR_PRINTF3(_L("avcC atom config type not as expected! (%d instead of %d)"), byte[0], KAvcProfileByteHigh );
|
sl@0
|
2332 |
}
|
sl@0
|
2333 |
break;
|
sl@0
|
2334 |
|
sl@0
|
2335 |
default:
|
sl@0
|
2336 |
ERR_PRINTF2(_L("avcC has unknown profile indication: %d"), byte[0] );
|
sl@0
|
2337 |
}
|
sl@0
|
2338 |
|
sl@0
|
2339 |
// 'avcC' was found, regardless of the result, finish reading the file
|
sl@0
|
2340 |
break;
|
sl@0
|
2341 |
}
|
sl@0
|
2342 |
else
|
sl@0
|
2343 |
{
|
sl@0
|
2344 |
// The 4 bytes read were not 'avcC'.
|
sl@0
|
2345 |
// Need to rewind by 3 bytes since we need to step through the file
|
sl@0
|
2346 |
// byte-by-byte...
|
sl@0
|
2347 |
tmp = rewind; // Avoid rewind value being changed by Seek() function
|
sl@0
|
2348 |
User::LeaveIfError( aFile.Seek( ESeekCurrent, tmp ) );
|
sl@0
|
2349 |
}
|
sl@0
|
2350 |
}
|
sl@0
|
2351 |
|
sl@0
|
2352 |
return verdict;
|
sl@0
|
2353 |
}
|
sl@0
|
2354 |
|