|
1 /* |
|
2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Camcorder MMF API Test DLL |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 // INCLUDE FILES |
|
21 #include "camcTest_9.h" |
|
22 #include "camcTest.h" |
|
23 #include <bldvariant.hrh> |
|
24 |
|
25 |
|
26 // EXTERNAL DATA STRUCTURES |
|
27 |
|
28 // EXTERNAL FUNCTION PROTOTYPES |
|
29 |
|
30 // CONSTANTS |
|
31 |
|
32 // MACROS |
|
33 |
|
34 // LOCAL CONSTANTS AND MACROS |
|
35 |
|
36 // Allows a 10% margin for the filesize |
|
37 #define TC9_ALLOWED_MARGIN ( TC9_FILE_SIZE_LIMIT * 0.1 ) |
|
38 |
|
39 // MODULE DATA STRUCTURES |
|
40 |
|
41 // LOCAL FUNCTION PROTOTYPES |
|
42 |
|
43 // FORWARD DECLARATIONS |
|
44 |
|
45 CCamcTest_9::CCamcTest_9 () |
|
46 { |
|
47 } |
|
48 |
|
49 |
|
50 |
|
51 CCamcTest_9::~CCamcTest_9 () |
|
52 { |
|
53 delete iCamcTestClient; |
|
54 iCamcTestClient = NULL; |
|
55 } |
|
56 |
|
57 |
|
58 void CCamcTest_9::setUpL () |
|
59 { |
|
60 { |
|
61 iCamcTestClient = CCamcTestClient_9::NewL( ); |
|
62 } |
|
63 // Do nothing in the setUp to get Memory Failure functionality |
|
64 iWaitScheduler = new (ELeave) CActiveSchedulerWait; |
|
65 |
|
66 // Create a new Camera API implementation object, if supported |
|
67 TRAPD( err, iUiLevelCamera = CCamera::New2L( static_cast<MCameraObserver2&>(*this), 0 /*index*/, 0 /*Priority*/ ) ); |
|
68 if ( err ) |
|
69 { |
|
70 PRINT( ( _L( "CCamcTest_9::setUpL CCamera::New2L return code=%d" ), err ) ); |
|
71 // Create old Camera API implementation object. |
|
72 iUiLevelCamera = CCamera::NewL( static_cast<MCameraObserver&>(*this), 0 /*Index*/ ); |
|
73 } |
|
74 else |
|
75 { |
|
76 PRINT( ( _L( "CCamcTest_9::setUp() using new MCameraObserver2" )) ); |
|
77 } |
|
78 |
|
79 iUiLevelCameraHandle = iUiLevelCamera->Handle(); |
|
80 iUiLevelCamera->Reserve(); |
|
81 iWaitScheduler->Start(); |
|
82 } |
|
83 |
|
84 |
|
85 void CCamcTest_9::tearDown () |
|
86 { |
|
87 delete iCamcTestClient; |
|
88 iCamcTestClient = NULL; |
|
89 delete iWaitScheduler; |
|
90 delete iUiLevelCamera; |
|
91 REComSession::FinalClose(); |
|
92 } |
|
93 |
|
94 |
|
95 // |
|
96 // Own test functions. |
|
97 // |
|
98 |
|
99 // ////////////////////////////////////////////////////////////////// |
|
100 // Prepare tests |
|
101 // ////////////////////////////////////////////////////////////////// |
|
102 |
|
103 void CCamcTest_9::Prepare_007_L() |
|
104 { |
|
105 /////////////////////////////////////// |
|
106 // ID: CAMC_API.PREPARE_007 |
|
107 // Action : |
|
108 // Prepare when controller is open. |
|
109 // Call prepare, without setting anything (using all defaults) |
|
110 // Output : |
|
111 // OK |
|
112 /////////////////////////////////////// |
|
113 |
|
114 iCamcTestClient->Start_Active_ObjectL(K_Tc9_PrepareWhenControllerReadyWhitoutSetting, iUiLevelCameraHandle); |
|
115 } |
|
116 |
|
117 void CCamcTest_9::Prepare_008_L() |
|
118 { |
|
119 /////////////////////////////////////// |
|
120 // ID: CAMC_API.PREPARE_008 |
|
121 // Action : |
|
122 // Prepare when controller is open. Call prepare, setting |
|
123 // only VideoBitRate (using defaults for the other parameters) |
|
124 // Output : |
|
125 // OK |
|
126 /////////////////////////////////////// |
|
127 |
|
128 iCamcTestClient->Start_Active_ObjectL(K_Tc9_PrepareWhenControllerReadyOnlyVideoBitRateSetting, iUiLevelCameraHandle); |
|
129 } |
|
130 |
|
131 void CCamcTest_9::Prepare_009_L() |
|
132 { |
|
133 /////////////////////////////////////// |
|
134 // ID: CAMC_API.PREPARE_009 |
|
135 // Action : |
|
136 // Prepare when controller is open. Call prepare, setting |
|
137 // only VideoFrameSize (using defaults for the other parameters) |
|
138 // Output : |
|
139 // OK |
|
140 /////////////////////////////////////// |
|
141 |
|
142 iCamcTestClient->Start_Active_ObjectL(K_Tc9_PrepareWhenControllerReadyOnlyVideoFrameSizeSetting, iUiLevelCameraHandle); |
|
143 } |
|
144 |
|
145 void CCamcTest_9::RecordTimeAvailableL_005_L() |
|
146 { |
|
147 /////////////////////////////////////// |
|
148 // ID: CAMC_API.RECORDTIMEAVAILABLEL_005 |
|
149 // Action : |
|
150 // Asking RecordTimeAvailable() |
|
151 // Once Recording is ready |
|
152 // Output : |
|
153 // Value must be sensible |
|
154 /////////////////////////////////////// |
|
155 |
|
156 iCamcTestClient->Start_Active_ObjectL( K_Tc9_RecordTimeAvailWhenRecordingReady, iUiLevelCameraHandle ); |
|
157 } |
|
158 |
|
159 /**************************/ |
|
160 /* SET MAX CLIP SIZE */ |
|
161 /**************************/ |
|
162 |
|
163 void CCamcTest_9::SetMaxClipSizeL_008_L() |
|
164 { |
|
165 /////////////////////////////////////// |
|
166 // ID: CAMC_API.SETMAXCLIPSIZEL_008 |
|
167 // Action : |
|
168 // SetMaxClipSizeL when controller is open. Set size = 0 |
|
169 // Output : |
|
170 // Must record until disk full. |
|
171 /////////////////////////////////////// |
|
172 |
|
173 iCamcTestClient->Start_Active_ObjectL(K_Tc9_SetMaxClipSizeLWhenControllerReadySize0, iUiLevelCameraHandle); |
|
174 } |
|
175 |
|
176 void CCamcTest_9::SetMaxClipSizeL_009_L() |
|
177 { |
|
178 /////////////////////////////////////// |
|
179 // ID: CAMC_API.SETMAXCLIPSIZEL_009 |
|
180 // Action : |
|
181 // SetMaxClipSizeL when controller is open. Set size = KMMFNoMaxClipSize |
|
182 // Output : |
|
183 // Must record until disk full. |
|
184 /////////////////////////////////////// |
|
185 |
|
186 iCamcTestClient->Start_Active_ObjectL(K_Tc9_SetMaxClipSizeLWhenControllerReadyKMMFNoMaxClipSize, iUiLevelCameraHandle); |
|
187 } |
|
188 |
|
189 /**************************/ |
|
190 /* NEW FILE NAME */ |
|
191 /**************************/ |
|
192 |
|
193 void CCamcTest_9::NewFileName_001_L() |
|
194 { |
|
195 /////////////////////////////////////// |
|
196 // ID: CAMC_API.NEWFILENAME_001 |
|
197 // Action : |
|
198 // Set NewFileName when prepared, not recording |
|
199 // Output : |
|
200 // New video, which have new name. |
|
201 /////////////////////////////////////// |
|
202 TInt err; |
|
203 |
|
204 RFile file; |
|
205 RFs fsSession; |
|
206 fsSession.Connect(); |
|
207 |
|
208 TFileName fileName; |
|
209 AddDriveLetterToPath(_L("NewFileName.3gp"),fileName); |
|
210 err = fsSession.Delete( fileName ); |
|
211 |
|
212 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
213 { |
|
214 User::Leave(KErrGeneral); |
|
215 } |
|
216 |
|
217 iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenPreparedNotRecording, iUiLevelCameraHandle); |
|
218 |
|
219 err = file.Open(fsSession,fileName,EFileShareAny); |
|
220 file.Close(); |
|
221 fsSession.Close(); |
|
222 assertTIntsEqualL( KErrNone, err ); |
|
223 } |
|
224 |
|
225 void CCamcTest_9::NewFileName_002_L() |
|
226 { |
|
227 /////////////////////////////////////// |
|
228 // ID: CAMC_API.NEWFILENAME_002 |
|
229 // Action : |
|
230 // Set NewFileName when recorded ready |
|
231 // Output : |
|
232 // Record two videos, and the second one have new name. |
|
233 /////////////////////////////////////// |
|
234 |
|
235 RFile file; |
|
236 RFs fsSession; |
|
237 fsSession.Connect(); |
|
238 TInt err; |
|
239 TFileName fileName; |
|
240 AddDriveLetterToPath(_L("recordQCIF.3gp"),fileName); |
|
241 TFileName newfile; |
|
242 AddDriveLetterToPath(_L("NewFileName.3gp"),newfile); |
|
243 err = fsSession.Delete( fileName ); |
|
244 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
245 { |
|
246 User::Leave(KErrGeneral); |
|
247 } |
|
248 |
|
249 err = fsSession.Delete( newfile ); |
|
250 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
251 { |
|
252 User::Leave(KErrGeneral); |
|
253 } |
|
254 |
|
255 iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenRecordSecondTime, iUiLevelCameraHandle); |
|
256 |
|
257 |
|
258 err = file.Open(fsSession,fileName,EFileShareAny); |
|
259 assertTIntsEqualL( KErrNone, err ); |
|
260 err = file.Open(fsSession,newfile,EFileShareAny); |
|
261 assertTIntsEqualL( KErrNone, err ); |
|
262 |
|
263 file.Close(); |
|
264 fsSession.Close(); |
|
265 } |
|
266 |
|
267 void CCamcTest_9::NewFileName_003_L() |
|
268 { |
|
269 /////////////////////////////////////// |
|
270 // ID: CAMC_API.NEWFILENAME_003 |
|
271 // Action : |
|
272 // Set NewFileName when recording |
|
273 // Output : |
|
274 // Leave. |
|
275 /////////////////////////////////////// |
|
276 |
|
277 TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenRecording, iUiLevelCameraHandle)); |
|
278 assertTIntsEqualL( KErrNotReady, err ); |
|
279 } |
|
280 |
|
281 void CCamcTest_9::NewFileName_004_L() |
|
282 { |
|
283 /////////////////////////////////////// |
|
284 // ID: CAMC_API.NEWFILENAME_004 |
|
285 // Action : |
|
286 // Set NewFileName when paused |
|
287 // Output : |
|
288 // Leave. |
|
289 /////////////////////////////////////// |
|
290 |
|
291 TRAPD(err, iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenPaused, iUiLevelCameraHandle)); |
|
292 assertTIntsEqualL( KErrNotReady, err ); |
|
293 } |
|
294 |
|
295 void CCamcTest_9::NewFileName_005_L() |
|
296 { |
|
297 /////////////////////////////////////// |
|
298 // ID: CAMC_API.NEWFILENAME_005 |
|
299 // Action : |
|
300 // One video is recorded. It ends because of filesize reached. |
|
301 // A second video is recorded, changing the filename using custom |
|
302 // command, no OpenFile(). |
|
303 // Output : |
|
304 // FileSize of both video is ok. |
|
305 /////////////////////////////////////// |
|
306 |
|
307 RFile file; |
|
308 TInt filesize,err; |
|
309 RFs fsSession; |
|
310 fsSession.Connect(); |
|
311 TFileName fileName1, fileName2; |
|
312 |
|
313 TRAPD(leavingCode, |
|
314 { |
|
315 AddDriveLetterToPath(_L("recordQCIF.3gp"),fileName1); |
|
316 err = fsSession.Delete( fileName1 ); |
|
317 AddDriveLetterToPath(_L("NewFileName.3gp"),fileName2); |
|
318 err = fsSession.Delete( fileName2 ); |
|
319 |
|
320 // Start the test case |
|
321 iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenInternalStop, iUiLevelCameraHandle); |
|
322 |
|
323 // Check if size of files is according to previously set Size limit |
|
324 err = file.Open(fsSession,fileName1,EFileShareAny); |
|
325 assertTIntsEqualL( KErrNone, err ); |
|
326 err = file.Size(filesize); |
|
327 file.Close(); |
|
328 |
|
329 if ( ( filesize > TC9_FILE_SIZE_LIMIT + TC9_ALLOWED_MARGIN ) || |
|
330 (filesize < TC9_FILE_SIZE_LIMIT - TC9_ALLOWED_MARGIN ) ) |
|
331 { |
|
332 assertL(0); |
|
333 } |
|
334 |
|
335 err = file.Open(fsSession,fileName2,EFileShareAny); |
|
336 assertTIntsEqualL( KErrNone, err ); |
|
337 err = file.Size(filesize); |
|
338 file.Close(); |
|
339 |
|
340 if ( ( filesize > TC9_FILE_SIZE_LIMIT + TC9_ALLOWED_MARGIN ) || |
|
341 (filesize < TC9_FILE_SIZE_LIMIT - TC9_ALLOWED_MARGIN ) ) |
|
342 { |
|
343 assertL(0); |
|
344 } |
|
345 } ); //End of TRAPD |
|
346 |
|
347 fsSession.Close(); |
|
348 User::LeaveIfError(leavingCode); |
|
349 } |
|
350 |
|
351 void CCamcTest_9::NewFileName_006_L() |
|
352 { |
|
353 /////////////////////////////////////// |
|
354 // ID: CAMC_API.NEWFILENAME_006 |
|
355 // Action : |
|
356 // Custom command sent, prepare(), and record() |
|
357 // Output : |
|
358 // 2nd recorded file has the name |
|
359 // requested in the custom command. |
|
360 /////////////////////////////////////// |
|
361 |
|
362 RFile file; |
|
363 RFs fsSession; |
|
364 fsSession.Connect(); |
|
365 TInt err; |
|
366 TFileName fileName; |
|
367 AddDriveLetterToPath(_L("recordQCIF.3g2"),fileName); |
|
368 TFileName newfile; |
|
369 AddDriveLetterToPath(_L("NewFileName.3g2"),newfile); |
|
370 err = fsSession.Delete( fileName ); |
|
371 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
372 { |
|
373 User::Leave(KErrGeneral); |
|
374 } |
|
375 |
|
376 err = fsSession.Delete( newfile ); |
|
377 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
378 { |
|
379 User::Leave(KErrGeneral); |
|
380 } |
|
381 |
|
382 iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenRecordSecondTimeDiffFileFormat, iUiLevelCameraHandle); |
|
383 |
|
384 |
|
385 err = file.Open(fsSession,fileName,EFileShareAny); |
|
386 assertTIntsEqualL( KErrNone, err ); |
|
387 err = file.Open(fsSession,newfile,EFileShareAny); |
|
388 assertTIntsEqualL( KErrNone, err ); |
|
389 |
|
390 file.Close(); |
|
391 fsSession.Close(); |
|
392 } |
|
393 |
|
394 void CCamcTest_9::NewFileName_007_L() |
|
395 { |
|
396 /////////////////////////////////////// |
|
397 // ID: CAMC_API.NEWFILENAME_007 |
|
398 // Action : |
|
399 // Custom command sent, prepare(), and record() |
|
400 // Output : |
|
401 // 2nd recorded file has the name |
|
402 // requested in the custom command. |
|
403 /////////////////////////////////////// |
|
404 |
|
405 RFile file; |
|
406 RFs fsSession; |
|
407 fsSession.Connect(); |
|
408 TInt err; |
|
409 TFileName fileName; |
|
410 AddDriveLetterToPath(_L("recordQCIF.mp4"),fileName); |
|
411 TFileName newfile; |
|
412 AddDriveLetterToPath(_L("NewFileName.mp4"),newfile); |
|
413 err = fsSession.Delete( fileName ); |
|
414 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
415 { |
|
416 User::Leave(KErrGeneral); |
|
417 } |
|
418 |
|
419 err = fsSession.Delete( newfile ); |
|
420 if ( ( err != KErrNone ) && ( err != KErrNotFound ) ) |
|
421 { |
|
422 User::Leave(KErrGeneral); |
|
423 } |
|
424 |
|
425 iCamcTestClient->Start_Active_ObjectL(K_TC9_NewFileNameWhenRecordSecondTimeMPEG4FileFormat, iUiLevelCameraHandle); |
|
426 |
|
427 |
|
428 err = file.Open(fsSession,fileName,EFileShareAny); |
|
429 assertTIntsEqualL( KErrNone, err ); |
|
430 err = file.Open(fsSession,newfile,EFileShareAny); |
|
431 assertTIntsEqualL( KErrNone, err ); |
|
432 |
|
433 file.Close(); |
|
434 fsSession.Close(); |
|
435 } |
|
436 |
|
437 |
|
438 |
|
439 /*****************************/ |
|
440 /* OPEN FILE */ |
|
441 /*****************************/ |
|
442 |
|
443 void CCamcTest_9::OpenFileL_016_L() |
|
444 { |
|
445 |
|
446 /////////////////////////////////////// |
|
447 // ID: CAMC_API.OPENFILEL_016 |
|
448 // |
|
449 // Action :FileOpen with FileName "foo/filename.3gp", ie a folder |
|
450 // that doesn't exists. Then normal recording procedure. |
|
451 // |
|
452 // Output :Folder is created, video is correctly recorded. |
|
453 // (Existence of the video checked) |
|
454 /////////////////////////////////////// |
|
455 |
|
456 iCamcTestClient->Start_Active_ObjectL(K_Tc9_OpenFileInAFolderNonExistent, iUiLevelCameraHandle); |
|
457 |
|
458 RFile file; |
|
459 RFs fsSession; |
|
460 fsSession.Connect(); |
|
461 TInt err; |
|
462 TFileName fileName; |
|
463 AddDriveLetterToPath(_L("non-existent-folder\\recordQCIF.3gp"), fileName); |
|
464 err = file.Open(fsSession,fileName,EFileShareAny); |
|
465 assertTIntsEqualL( KErrNone, err ); |
|
466 |
|
467 file.Close(); |
|
468 fsSession.Close(); |
|
469 } |
|
470 |
|
471 // |
|
472 // An own static function to collect the test functions into one |
|
473 // suite of tests. The framework will run the tests and free the |
|
474 // memory allocated for the test suite. |
|
475 // |
|
476 |
|
477 |
|
478 // ////////////////////////////////////////////////////////////////// |
|
479 // Dummy Camera API callback functions |
|
480 // ////////////////////////////////////////////////////////////////// |
|
481 void CCamcTest_9::ReserveComplete(TInt /*aError*/) |
|
482 { |
|
483 RDebug::Print(_L("CCamcTest_9::ReserveComplete")); |
|
484 |
|
485 // UI level camera is being initialized |
|
486 if (iWaitScheduler->IsStarted()) |
|
487 { |
|
488 iUiLevelCamera->PowerOn(); |
|
489 return; |
|
490 } |
|
491 } |
|
492 |
|
493 void CCamcTest_9::PowerOnComplete(TInt /*aError*/) |
|
494 { |
|
495 RDebug::Print(_L("CCamcTest_9::PowerOnComplete")); |
|
496 |
|
497 // UI level camera is being initialized |
|
498 if (iWaitScheduler->IsStarted()) |
|
499 { |
|
500 iWaitScheduler->AsyncStop(); |
|
501 return; |
|
502 } |
|
503 } |
|
504 |
|
505 void CCamcTest_9::ViewFinderFrameReady(CFbsBitmap& /*aFrame*/) |
|
506 { |
|
507 } |
|
508 void CCamcTest_9::ImageReady(CFbsBitmap* /*aBitmap */,HBufC8* /*aData*/,TInt /*aError*/) |
|
509 { |
|
510 } |
|
511 void CCamcTest_9::FrameBufferReady(MFrameBuffer* /*aFrameBuffer*/,TInt /*aError*/ ) |
|
512 { |
|
513 } |
|
514 |
|
515 // ----------------------------------------------------------------------------- |
|
516 // CCamcTest_9::HandleEvent |
|
517 // MCameraObserver2 call-back handler |
|
518 // ----------------------------------------------------------------------------- |
|
519 // |
|
520 void CCamcTest_9::HandleEvent( const TECAMEvent& aEvent) |
|
521 { |
|
522 PRINT(( _L( "CCamcTest_9::HandleEvent() entering, type=%x, err=%d" ), aEvent.iEventType.iUid, aEvent.iErrorCode )); |
|
523 |
|
524 if ( aEvent.iEventType == KUidECamEventCameraNoLongerReserved ) |
|
525 { |
|
526 PRINT(( _L( "CCamcTest_9::HandleEvent() KUidECamEventCameraNoLongerReserved" ) )); |
|
527 } |
|
528 else if ( aEvent.iEventType == KUidECamEventPowerOnComplete ) |
|
529 { |
|
530 PRINT(( _L( "CCamcTest_9::HandleEvent() KUidECamEventPowerOnComplete" ) )); |
|
531 PowerOnComplete( aEvent.iErrorCode ); |
|
532 } |
|
533 else if ( aEvent.iEventType == KUidECamEventReserveComplete ) |
|
534 { |
|
535 PRINT(( _L( "CCamcTest_9::HandleEvent() KUidECamEventReserveComplete" ) )); |
|
536 ReserveComplete( aEvent.iErrorCode ); |
|
537 } |
|
538 |
|
539 PRINT(( _L( "CCamcTestClient_7::HandleEvent() returning" ) )); |
|
540 } |
|
541 |
|
542 // ----------------------------------------------------------------------------- |
|
543 // CCamcTest_9::ViewFinderReady |
|
544 // MCameraObserver2 call-back handler |
|
545 // ----------------------------------------------------------------------------- |
|
546 // |
|
547 void CCamcTest_9::ViewFinderReady( MCameraBuffer& aCameraBuffer, TInt aError) |
|
548 { |
|
549 PRINT(( _L( "CCamcTest_9::ViewFinderReady() NOT HANDLED err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() )); |
|
550 CFbsBitmap *buffer = NULL; |
|
551 if ( !aError ) |
|
552 { |
|
553 aCameraBuffer.Release(); |
|
554 } |
|
555 ViewFinderFrameReady( *buffer ); |
|
556 } |
|
557 |
|
558 // ----------------------------------------------------------------------------- |
|
559 // CCamcTest_9::ImageBufferReady |
|
560 // MCameraObserver2 call-back handler |
|
561 // ----------------------------------------------------------------------------- |
|
562 // |
|
563 void CCamcTest_9::ImageBufferReady( MCameraBuffer& aCameraBuffer, TInt aError) |
|
564 { |
|
565 PRINT(( _L( "CCamcTest_9::ImageBufferReady() BUFFER NOT HANDLED, err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() )); |
|
566 |
|
567 if ( !aError ) |
|
568 { |
|
569 aCameraBuffer.Release(); |
|
570 } |
|
571 ImageReady( NULL, NULL, aError ); |
|
572 } |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // CCamcTest_9::VideoBufferReady |
|
576 // MCameraObserver2 call-back handler |
|
577 // ----------------------------------------------------------------------------- |
|
578 // |
|
579 void CCamcTest_9::VideoBufferReady( MCameraBuffer& aCameraBuffer, TInt aError) |
|
580 { |
|
581 PRINT(( _L( "CCamcTest_9::VideoBufferReady() entering, err=%d, NumFrames=%d" ), aError, aCameraBuffer.NumFrames() )); |
|
582 MFrameBuffer* buffer = NULL; |
|
583 |
|
584 if ( !aError ) |
|
585 { |
|
586 aCameraBuffer.Release(); |
|
587 } |
|
588 // Call old Camera-API observer handler |
|
589 FrameBufferReady( buffer, aError ); |
|
590 |
|
591 PRINT(( _L( "CCamcTest_9::VideoBufferReady() returning" ))); |
|
592 } |
|
593 |
|
594 |
|
595 MTest* CCamcTest_9::suiteL () |
|
596 { |
|
597 // Always use NewL (Do not use NewLC) !!! |
|
598 CTestSuite *suite = CTestSuite::NewL(_L8("CCamcTest_9")); |
|
599 |
|
600 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.PREPARE_007"), &Prepare_007_L)); |
|
601 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.PREPARE_008"), &Prepare_008_L)); |
|
602 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.PREPARE_009"), &Prepare_009_L)); |
|
603 |
|
604 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.RECORDTIMEAVAILABLEL_005"), &RecordTimeAvailableL_005_L)); |
|
605 |
|
606 // SetMaxClipSizeL_008 and SetMaxClipSizeL_009, only to be tested on HW |
|
607 #if !( defined (__WINS__) || defined (__WINSCW__) ) |
|
608 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.SETMAXCLIPSIZEL_008"), &SetMaxClipSizeL_008_L)); |
|
609 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.SETMAXCLIPSIZEL_009"), &SetMaxClipSizeL_009_L)); |
|
610 #endif |
|
611 |
|
612 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_001"), &NewFileName_001_L)); |
|
613 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_002"), &NewFileName_002_L)); |
|
614 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_003"), &NewFileName_003_L)); |
|
615 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_004"), &NewFileName_004_L)); |
|
616 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_005"), &NewFileName_005_L)); |
|
617 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_006"), &NewFileName_006_L)); |
|
618 |
|
619 #ifdef MP4_FILE_FORMAT_SUPPORTED |
|
620 #if ((!defined __WINS__) || (!defined __WINSCW__)) // AAC supported only in HW |
|
621 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.NEWFILENAME_007"), &NewFileName_007_L)); |
|
622 #endif |
|
623 #endif |
|
624 |
|
625 suite->addTestL(CTestCaller<CCamcTest_9>::NewL(_L8("CAMC_API.OPENFILEL_016"), &OpenFileL_016_L)); |
|
626 |
|
627 return suite; |
|
628 } |
|
629 |