380 |
380 |
381 CX_DEBUG_EXIT_FUNCTION(); |
381 CX_DEBUG_EXIT_FUNCTION(); |
382 return err; |
382 return err; |
383 } |
383 } |
384 |
384 |
385 /** |
385 /*! |
386 * Command to start image capture now. |
386 * Command to start image capture now. |
|
387 * @sa handleCameraEvent |
387 */ |
388 */ |
388 void CxeStillCaptureControlSymbian::capture() |
389 void CxeStillCaptureControlSymbian::capture() |
389 { |
390 { |
390 CX_DEBUG_ENTER_FUNCTION(); |
391 CX_DEBUG_ENTER_FUNCTION(); |
391 CX_ASSERT_ALWAYS(mCameraDevice.camera()); |
392 CX_ASSERT_ALWAYS(mCameraDevice.camera()); |
392 |
393 |
393 // Start the image capture as fast as possible to minimize lag. |
394 // Start the image capture as fast as possible to minimize lag. |
394 // Check e.g. space available *after* this. |
395 // Check e.g. space available *after* this. |
|
396 // Capture sound will be played when we receive "image capture event" from ECAM. |
395 mCameraDevice.camera()->CaptureImage(); |
397 mCameraDevice.camera()->CaptureImage(); |
396 |
398 |
397 if (imagesLeft() > 0) { |
399 if (imagesLeft() > 0) { |
398 mCaptureSoundPlayer->play(); |
|
399 setState(Capturing); |
400 setState(Capturing); |
400 |
401 |
401 //! @todo: NOTE: This call may not stay here. It can move depending on the implementation for burst capture. |
402 //! @todo: NOTE: This call may not stay here. It can move depending on the implementation for burst capture. |
402 if (mMode == BurstCapture) { |
403 if (mMode == BurstCapture) { |
403 // Start a new filename sequence |
404 // Start a new filename sequence |
469 OstTrace0( camerax_performance, DUP1_CXESTILLCAPTURECONTROLSYMBIAN_HANDLESNAPSHOTEVENT, "msg: e_CX_HANDLE_SNAPSHOT 0" ); |
470 OstTrace0( camerax_performance, DUP1_CXESTILLCAPTURECONTROLSYMBIAN_HANDLESNAPSHOTEVENT, "msg: e_CX_HANDLE_SNAPSHOT 0" ); |
470 } |
471 } |
471 |
472 |
472 CX_DEBUG_EXIT_FUNCTION(); |
473 CX_DEBUG_EXIT_FUNCTION(); |
473 } |
474 } |
|
475 |
|
476 /*! |
|
477 * Handle ECAM events. |
|
478 * Needed only for capture sound synchronization. |
|
479 * @param eventUid ECAM event id. |
|
480 * @param error Error code. KErrNone if operation has been successful. |
|
481 */ |
|
482 void CxeStillCaptureControlSymbian::handleCameraEvent(int eventUid, int error) |
|
483 { |
|
484 if (eventUid == KUidECamEventImageCaptureEventUidValue && error == KErrNone) { |
|
485 CX_DEBUG(("CxeStillCaptureControlSymbian::handleCameraEvent - image capture event")); |
|
486 if (state() == CxeStillCaptureControl::Capturing) { |
|
487 mCaptureSoundPlayer->play(); |
|
488 } |
|
489 } |
|
490 } |
|
491 |
474 |
492 |
475 /** |
493 /** |
476 * handleImageData: Image data received from ECam |
494 * handleImageData: Image data received from ECam |
477 */ |
495 */ |
478 void CxeStillCaptureControlSymbian::handleImageData(MCameraBuffer* cameraBuffer, int error) |
496 void CxeStillCaptureControlSymbian::handleImageData(MCameraBuffer* cameraBuffer, int error) |