camerauis/cameraapp/generic/src/CamVideoPreCaptureView.cpp
branchRCL_3
changeset 31 8f559c47d7fd
parent 27 53c8aa5d97a3
child 35 e32fcfe0045f
equal deleted inserted replaced
27:53c8aa5d97a3 31:8f559c47d7fd
    55 #include "CamLocalViewIds.h"
    55 #include "CamLocalViewIds.h"
    56 #include "OstTraceDefinitions.h"
    56 #include "OstTraceDefinitions.h"
    57 #ifdef OST_TRACE_COMPILER_IN_USE
    57 #ifdef OST_TRACE_COMPILER_IN_USE
    58 #include "CamVideoPreCaptureViewTraces.h"
    58 #include "CamVideoPreCaptureViewTraces.h"
    59 #endif
    59 #endif
    60 
    60 #include "CamTimer.h"
    61 
    61 
       
    62 const TInt KHdmiTimeout = 1000000; // 1 sec
    62 
    63 
    63 
    64 
    64 // ========================= MEMBER FUNCTIONS ================================
    65 // ========================= MEMBER FUNCTIONS ================================
    65 // ---------------------------------------------------------------------------
    66 // ---------------------------------------------------------------------------
    66 // CCamVideoPreCaptureView::NewLC
    67 // CCamVideoPreCaptureView::NewLC
    82 // 
    83 // 
    83 // ---------------------------------------------------------------------------
    84 // ---------------------------------------------------------------------------
    84 //
    85 //
    85 CCamVideoPreCaptureView::~CCamVideoPreCaptureView()
    86 CCamVideoPreCaptureView::~CCamVideoPreCaptureView()
    86     {
    87     {
       
    88     if( iHdmiTimer )
       
    89         {
       
    90         delete iHdmiTimer;
       
    91         iHdmiTimer = NULL;
       
    92         }
    87     }
    93     }
    88     
    94     
    89 // ---------------------------------------------------------------------------
    95 // ---------------------------------------------------------------------------
    90 // CCamVideoPreCaptureView::Id
    96 // CCamVideoPreCaptureView::Id
    91 // Returns UID of view
    97 // Returns UID of view
   146         	}
   152         	}
   147         else if ( aCommand == ECamMSKCmdAppRecord )
   153         else if ( aCommand == ECamMSKCmdAppRecord )
   148              // if the Camera in the Portrait mode
   154              // if the Camera in the Portrait mode
   149              // MSK event is handled like a capture key
   155              // MSK event is handled like a capture key
   150             {
   156             {
   151             if ( iController.IsViewFinding() && appUi->CheckMemoryL() )
   157             if( iController.IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) &&
       
   158                     iController.IsHdmiCableConnected() )
       
   159                 {
       
   160                 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording );
       
   161                 }
       
   162             else if ( iController.IsViewFinding() && appUi->CheckMemoryL() )
   152                 {
   163                 {
   153                 iController.StartVideoRecordingL();
   164                 iController.StartVideoRecordingL();
   154                 // fixed toolbar is used only with touch devices
   165                 // fixed toolbar is used only with touch devices
   155                 if ( iController.IsTouchScreenSupported() )
   166                 if ( iController.IsTouchScreenSupported() )
   156                     {
   167                     {
   166     	}
   177     	}
   167     case ECamCmdRecord:
   178     case ECamCmdRecord:
   168         {
   179         {
   169         	TInt callType( EPSCTsyCallTypeUninitialized );
   180         	TInt callType( EPSCTsyCallTypeUninitialized );
   170             RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType );
   181             RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType );
   171             if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() )
   182             if( iController.IsHdmiCableConnected() )
       
   183                 {
       
   184                 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording );
       
   185                 }
       
   186             else if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() )
   172             {
   187             {
   173             SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
   188             SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
   174             appUi->SetLensCoverExit( EFalse );
   189             appUi->SetLensCoverExit( EFalse );
   175             iController.StartVideoRecordingL();
   190             iController.StartVideoRecordingL();
   176             // fixed toolbar is used only with touch devices
   191             // fixed toolbar is used only with touch devices
   573 
   588 
   574       if ( EFalse == static_cast<CCamAppUi*>( AppUi() )->ShowPostCaptureView() )          
   589       if ( EFalse == static_cast<CCamAppUi*>( AppUi() )->ShowPostCaptureView() )          
   575           {
   590           {
   576           // Vf was stopped when stopping video recording, need to restart here
   591           // Vf was stopped when stopping video recording, need to restart here
   577           // if postcapture is off.
   592           // if postcapture is off.
   578           StartViewFinder();  
   593           StartViewFinder();
       
   594           if( iHdmiTimer->IsActive() )
       
   595               iHdmiTimer->Cancel();
       
   596           iHdmiTimer->StartTimer();
   579           } 
   597           } 
   580       break;
   598       break;
   581       }
   599       }
   582     // -----------------------------------------------------
   600     // -----------------------------------------------------
   583     case ECamEventEngineStateChanged:
   601     case ECamEventEngineStateChanged:
   617 // Symbian OS 2nd phase constructor
   635 // Symbian OS 2nd phase constructor
   618 // ---------------------------------------------------------------------------
   636 // ---------------------------------------------------------------------------
   619 //
   637 //
   620 void CCamVideoPreCaptureView::ConstructL()
   638 void CCamVideoPreCaptureView::ConstructL()
   621     {
   639     {
   622     BaseConstructL( ROID(R_CAM_VIDEO_PRE_CAPTURE_VIEW_ID));
   640     BaseConstructL( ROID(R_CAM_VIDEO_PRE_CAPTURE_VIEW_ID) );
   623     if(iController.UiConfigManagerPtr()->IsXenonFlashSupported())
   641     if(iController.UiConfigManagerPtr()->IsXenonFlashSupported())
   624         {
   642         {
   625         CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR);
   643         CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR);
   626         UpdateToolbarIconsL();
       
   627         }
   644         }
   628     else
   645     else
   629         {
   646         {
   630         CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT);
   647         CreateAndSetToolbarL(R_CAM_VIDEO_PRECAPTURE_TOOLBAR_VIDEOLIGHT);
   631         }
   648         }
   632     CCamPreCaptureViewBase::ConstructL();
   649     CCamPreCaptureViewBase::ConstructL();
       
   650     iHdmiTimer = CCamTimer::NewL( KHdmiTimeout, TCallBack(HdmiTimerCallback, this));
   633     }
   651     }
   634 
   652 
   635 // ---------------------------------------------------------------------------
   653 // ---------------------------------------------------------------------------
   636 // CCamVideoPreCaptureView::UpdateCbaL
   654 // CCamVideoPreCaptureView::UpdateCbaL
   637 // Update softkeys to reflect current state
   655 // Update softkeys to reflect current state
  1312     		// If optical joystic is not available, we will start the 
  1330     		// If optical joystic is not available, we will start the 
  1313     		// recording here. Otherwise it is handled
  1331     		// recording here. Otherwise it is handled
  1314     		// in CCamVideoPreCaptureContainer
  1332     		// in CCamVideoPreCaptureContainer
  1315         	TInt callType( EPSCTsyCallTypeUninitialized );
  1333         	TInt callType( EPSCTsyCallTypeUninitialized );
  1316             RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType );
  1334             RProperty::Get( KPSUidCtsyCallInformation, KCTsyCallType, callType );
  1317             if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() )
  1335             if( iController.IntegerSettingValue( ECamSettingItemStopRecordingInHdmiMode) &&
       
  1336                     iController.IsHdmiCableConnected() )
       
  1337                 {
       
  1338                 appUi->HandleHdmiEventL( ECamHdmiCableConnectedBeforeRecording );
       
  1339                 }
       
  1340             else if ( callType != EPSCTsyCallTypeH324Multimedia && iController.IsViewFinding() && appUi->CheckMemoryL() )
  1318             {
  1341             {
  1319                 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
  1342                 SetSoftKeysL( R_CAM_SOFTKEYS_BLANK );
  1320                 iController.StartVideoRecordingL();
  1343                 iController.StartVideoRecordingL();
  1321                 startedCapture = ETrue;
  1344                 startedCapture = ETrue;
  1322                 // fixed toolbar is used only with touch devices
  1345                 // fixed toolbar is used only with touch devices
  1641          default:
  1664          default:
  1642              break;
  1665              break;
  1643          }
  1666          }
  1644      }
  1667      }
  1645 
  1668 
       
  1669  // ---------------------------------------------------------------------------
       
  1670  // CCamVideoPostCaptureView::HdmiTimerCallback
       
  1671  // ---------------------------------------------------------------------------
       
  1672  //
       
  1673  TInt CCamVideoPreCaptureView::HdmiTimerCallback( TAny* aSelf )
       
  1674      {
       
  1675      CCamVideoPreCaptureView* self = static_cast<CCamVideoPreCaptureView*>(aSelf);
       
  1676      TInt err(0);
       
  1677      if( self )
       
  1678          {
       
  1679          TRAP(err, self->DoHdmiTimerCallbackL() );
       
  1680          }
       
  1681      PRINT1( _L("Camera <> CCamVideoPreCaptureView::HdmiTimerCallback err=%d"), err);
       
  1682      return err;
       
  1683      }
       
  1684 
       
  1685  // ---------------------------------------------------------------------------
       
  1686  // CCamVideoPostCaptureView::DoHdmlTimerCallbackL
       
  1687  // ---------------------------------------------------------------------------
       
  1688  //
       
  1689  void CCamVideoPreCaptureView::DoHdmiTimerCallbackL()
       
  1690      {
       
  1691      iController.HandlePostHdmiConnectDuringRecordingEventL();
       
  1692      }
       
  1693 
  1646 
  1694 
  1647 //  End of File  
  1695 //  End of File