1 /* |
1 /* |
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
854 PRINT( _L("Camera => CCamCameraController::McaeoVideoPrepareComplete") ); |
854 PRINT( _L("Camera => CCamCameraController::McaeoVideoPrepareComplete") ); |
855 #ifdef CAMERAAPP_CAE_ERR_SIMULATION |
855 #ifdef CAMERAAPP_CAE_ERR_SIMULATION |
856 HandleVideoEvent( ECamCameraEventVideoInit, aError ); |
856 HandleVideoEvent( ECamCameraEventVideoInit, aError ); |
857 // DelayCallback( ECamCameraEventVideoInit, aError, 500000 ); |
857 // DelayCallback( ECamCameraEventVideoInit, aError, 500000 ); |
858 #else |
858 #else |
|
859 if( aError && |
|
860 ( iIveCancel || ( !iIveSequenceActive && iIveRecoveryOngoing ) ) ) |
|
861 // Return if error and recovering process has been started, |
|
862 // but this video prepare complete is not part of recovery |
|
863 // i.e. iIveSequenceActive is not active yet. |
|
864 { |
|
865 PRINT1( _L("Camera => CCamCameraController::McaeoVideoPrepareComplete - Ignore err %d"), aError ); |
|
866 return; |
|
867 } |
859 HandleVideoEvent( ECamCameraEventVideoInit, aError ); |
868 HandleVideoEvent( ECamCameraEventVideoInit, aError ); |
860 #endif // CAMERAAPP_CAE_ERR_SIMULATION |
869 #endif // CAMERAAPP_CAE_ERR_SIMULATION |
861 |
870 |
862 PRINT( _L("Camera <= CCamCameraController::McaeoVideoPrepareComplete") ); |
871 PRINT( _L("Camera <= CCamCameraController::McaeoVideoPrepareComplete") ); |
863 } |
872 } |
3894 CCamCameraController::EndSequence( TInt aStatus ) |
3903 CCamCameraController::EndSequence( TInt aStatus ) |
3895 { |
3904 { |
3896 PRINT1( _L("Camera => CCamCameraController::EndSequence, status:%d"), aStatus ); |
3905 PRINT1( _L("Camera => CCamCameraController::EndSequence, status:%d"), aStatus ); |
3897 |
3906 |
3898 iIveRecoveryOngoing = EFalse; |
3907 iIveRecoveryOngoing = EFalse; |
|
3908 iIveSequenceActive = EFalse; |
3899 #ifdef CAMERAAPP_CAE_FIX |
3909 #ifdef CAMERAAPP_CAE_FIX |
3900 if( ECamModeChangeInactive != iModeChange ) |
3910 if( ECamModeChangeInactive != iModeChange ) |
3901 { |
3911 { |
3902 PRINT( _L("Camera <> mode change not cleared, PANIC!!") ); |
3912 PRINT( _L("Camera <> mode change not cleared, PANIC!!") ); |
3903 Panic( ECamCameraControllerUnrecovableError ); |
3913 Panic( ECamCameraControllerUnrecovableError ); |
4096 PRINT1( _L("Camera => CCamCameraController::HandleReserveGainEvent, status:%d"), aStatus ); |
4106 PRINT1( _L("Camera => CCamCameraController::HandleReserveGainEvent, status:%d"), aStatus ); |
4097 if( iIdle && iIdle->IsActive() ) |
4107 if( iIdle && iIdle->IsActive() ) |
4098 { |
4108 { |
4099 PRINT( _L("Camera => CCamCameraController::HandleReserveGainEvent - return, recovery in progress")); |
4109 PRINT( _L("Camera => CCamCameraController::HandleReserveGainEvent - return, recovery in progress")); |
4100 return; |
4110 return; |
|
4111 } |
|
4112 if( iIveRecoveryOngoing && !iIveSequenceActive ) |
|
4113 { |
|
4114 PRINT( _L("Camera => CCamCameraController::HandleReserveGainEvent - first recovering sequence command executed")); |
|
4115 iIveSequenceActive = ETrue; |
4101 } |
4116 } |
4102 // We should be blocking new request at the moment. |
4117 // We should be blocking new request at the moment. |
4103 __ASSERT_DEBUG( iInfo.iBusy, Panic( ECamCameraControllerCorrupt ) ); |
4118 __ASSERT_DEBUG( iInfo.iBusy, Panic( ECamCameraControllerCorrupt ) ); |
4104 CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestReserve ); |
4119 CAMERAAPP_PERF_CONTROLLER_STOP( ECamRequestReserve ); |
4105 |
4120 |
6604 KErrNone ) ); |
6619 KErrNone ) ); |
6605 } |
6620 } |
6606 else |
6621 else |
6607 { |
6622 { |
6608 PRINT( _L("Camera <> CCamCameraController::DoIveRecovery - Start recovering from beginning") ) |
6623 PRINT( _L("Camera <> CCamCameraController::DoIveRecovery - Start recovering from beginning") ) |
|
6624 iIveSequenceActive = EFalse; |
6609 if( IsFlagOn( iInfo.iBusy, ECamBusySequence|ECamBusySetting ) ) |
6625 if( IsFlagOn( iInfo.iBusy, ECamBusySequence|ECamBusySetting ) ) |
6610 { |
6626 { |
6611 if( iActive && |
6627 if( iActive && |
6612 iActive->IsActive() ) |
6628 iActive->IsActive() ) |
6613 { |
6629 { |
6614 iActive->Cancel(); |
6630 iActive->Cancel(); |
6615 } |
6631 } |
6616 EndSequence( KErrNone ); |
6632 iIveCancel = ETrue; |
|
6633 EndSequence( KErrNone ); // Clears iIveRecoveryOngoing and iIveSequenceActive |
6617 } |
6634 } |
6618 NotifyObservers( KErrNone, ECamCameraEventIveRecover, |
6635 NotifyObservers( KErrNone, ECamCameraEventIveRecover, |
6619 ECamCameraEventClassBasicControl ); |
6636 ECamCameraEventClassBasicControl ); |
6620 } |
6637 } |
6621 iIveRecoveryCount--; |
6638 iIveRecoveryCount--; |
6622 iIveRecoveryOngoing = ETrue; |
6639 iIveRecoveryOngoing = ETrue; |
|
6640 iIveCancel = EFalse; |
6623 } |
6641 } |
6624 PRINT1( _L("Camera <= CCamCameraController::DoIveRecovery iIveRecoveryCount%d"),iIveRecoveryCount ) |
6642 PRINT1( _L("Camera <= CCamCameraController::DoIveRecovery iIveRecoveryCount%d"),iIveRecoveryCount ) |
6625 } |
6643 } |
6626 |
6644 |
6627 // --------------------------------------------------------------------------- |
6645 // --------------------------------------------------------------------------- |
6628 // CCamCameraController::IsWaitingIveResources |
6646 // CCamCameraController::IsWaitingIveResources |
6629 // --------------------------------------------------------------------------- |
6647 // --------------------------------------------------------------------------- |
6630 // |
6648 // |
6631 TBool CCamCameraController::IsWaitingIveResources() |
6649 TBool CCamCameraController::IsWaitingIveResources() |
6632 { |
6650 { |
6633 return iIdle && iIdle->IsActive(); |
6651 // ETrue if recovery is started, but not completed. |
|
6652 // iIveRecoveryOngoing is set to false when last recovery command is executed |
|
6653 return (iIdle && iIdle->IsActive()) || |
|
6654 iIveCancel || iIveRecoveryOngoing || iIveSequenceActive; |
6634 } |
6655 } |
6635 |
6656 |
6636 |
6657 |
6637 // --------------------------------------------------------------------------- |
6658 // --------------------------------------------------------------------------- |
6638 // CCamCameraController::SetFaceTrackingL |
6659 // CCamCameraController::SetFaceTrackingL |