camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp
changeset 1 f5ec9446e5bf
parent 0 1ddebce53859
child 7 dbec5787fa68
--- a/camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp	Thu Jan 07 16:18:56 2010 +0200
+++ b/camerauis/cameraapp/generic/src/cameracontroller/camcameracontroller.cpp	Mon Jan 18 20:06:55 2010 +0200
@@ -1534,7 +1534,7 @@
 #endif // CAMERAAPP_CAE_FOR_VIDEO
 
     PRINT1( _L("Camera <> OrientationOverride custom i/f pointer:%d"), iCustomInterfaceUIOrientationOverride );
-    iCustomInterfaceUIOrientationOverride->SetOrientationModeL( aOrientation );
+    TRAP_IGNORE(iCustomInterfaceUIOrientationOverride->SetOrientationModeL( aOrientation ));
     
   PRINT( _L("Camera <= CCamCameraController::SetOrientationModeL") );
   }
@@ -2416,6 +2416,13 @@
         orientation( MCameraOrientation::EOrientation0 );
       iSettingProvider.ProvideCameraSettingL( aSettingId, &orientation );
 
+      if ( iInfo.iCurrentCamera != KPrimaryCameraIndex && 
+           orientation == MCameraOrientation::EOrientation90 )
+        {
+        PRINT( _L("Camera <> Rotate portrait secondary camera image 270 degrees") );
+        orientation = MCameraOrientation::EOrientation270;
+        }
+
       PRINT1( _L("Camera <> setting camera orientation to [0x%02x]"), orientation );
       iCustomInterfaceOrientation->SetOrientationL( orientation );
       break;
@@ -2528,6 +2535,15 @@
 
     CAMERAAPP_PERF_CONTROLLER_START( ECamRequestReserve );
     iCamera->Reserve();
+    // If UIOrientationOverrideAPI is used, ui construction is completed while
+    // waiting for Reserve to complete, event sent here to continue ui construction
+    CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
+    if ( appUi->AppController().UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )    
+      {
+      NotifyObservers( KErrNone, 
+                       ECamCameraEventReserveRequested,
+                       ECamCameraEventClassBasicControl );
+      }
     }
   // -------------------------------------------------------
   // Power on
@@ -2539,14 +2555,6 @@
     CAMERAAPP_PERF_CONTROLLER_START( ECamRequestPowerOn );
 
     iCamera->PowerOn(); 
-    CCamAppUi* appUi = static_cast<CCamAppUi*>( CEikonEnv::Static()->AppUi() );
-    if ( appUi->AppController().UiConfigManagerPtr()->IsUIOrientationOverrideSupported() )    
-      {
-      NotifyObservers( KErrNone, 
-                       ECamCameraEventPowerOnRequested,
-                       ECamCameraEventClassBasicControl );
-      }
-    
     }
   // -------------------------------------------------------
   // Unknown