tvout/src/glxhdmicontroller.cpp
changeset 24 99ad1390cd33
parent 23 74c9f037fd5d
equal deleted inserted replaced
23:74c9f037fd5d 24:99ad1390cd33
    57 
    57 
    58 // -----------------------------------------------------------------------------
    58 // -----------------------------------------------------------------------------
    59 // Setting an Image Path 
    59 // Setting an Image Path 
    60 // -----------------------------------------------------------------------------
    60 // -----------------------------------------------------------------------------
    61 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile,
    61 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile,
    62         TSize aImageDimensions, TInt aFrameCount, TBool aStore)
    62                                              TBool aStore)
    63     {
    63     {
    64     TRACER("CGlxHdmiController::SetImageL()");
    64     TRACER("CGlxHdmiController::SetImageL()");
    65     GLX_LOG_INFO2("CGlxHdmiController::SetImageL() - imagedimension width=%d, height=%d",aImageDimensions.iWidth,aImageDimensions.iHeight);
       
    66     if (aStore)
    65     if (aStore)
    67         {
    66         {
    68         iIsImageSupported = ETrue;
    67         iIsImageSupported = ETrue;
    69         StoreImageInfoL(aImageFile, aImageDimensions, aFrameCount);
    68         StoreImageInfoL(aImageFile);
    70         }
    69         }
    71     if (iGlxTvOut->IsHDMIConnected())
    70     if (iGlxTvOut->IsHDMIConnected())
    72         {
    71         {
    73 		iIsPostingMode = ETrue;
    72 		iIsPostingMode = ETrue;
    74         GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2");
    73             GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2");
    75         // do not close the surface , use the same surface instead.
    74             // do not close the surface , use the same surface instead.
    76         // Call a function to pass imagefile, imagedimension, framecount
    75             // Call a function to pass imagefile
    77         if (!iHdmiContainer)
    76             if (!iHdmiContainer)
    78             {
    77                 {            
    79             CreateHdmiContainerL(); 
    78                 CreateHdmiContainerL(); 
    80             }            
    79                 }            
    81         if (!iSurfaceUpdater)
    80             if (!iSurfaceUpdater)
    82             {
    81                 {
    83             // This case would come when surface updater is not created at the first instance and also
    82                 // This case would come when surface updater is not created at the first instance and also
    84             // it satisfies the 720p condition                
    83                 // it satisfies the 720p condition                
    85             CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount);
    84                 CreateSurfaceUpdaterL(aImageFile);
    86             }
    85                 }
    87         else
    86             else
    88             {
    87                 {
    89             GLX_LOG_INFO1("CGlxHdmiController::SetImageL() FrameCount =%d",aFrameCount);
    88             GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3");
    90             iSurfaceUpdater->UpdateNewImageL(aImageFile, aFrameCount,aImageDimensions);
    89             iSurfaceUpdater->UpdateNewImageL(aImageFile);
    91             }
    90             }
    92         iHdmiContainer->DrawNow();
    91         iHdmiContainer->DrawNow();
    93         }
    92         }
    94     }
    93     }
    95 
    94 
    96 // -----------------------------------------------------------------------------
    95 // -----------------------------------------------------------------------------
    97 // IsVideo 
    96 // IsVideo 
    98 // -----------------------------------------------------------------------------
    97 // -----------------------------------------------------------------------------
    99 EXPORT_C void CGlxHdmiController::IsVideo()
    98 EXPORT_C void CGlxHdmiController::ItemNotSupported()
   100     {
    99     {
   101     TRACER("CGlxHdmiController::IsVideo()");
   100     TRACER("CGlxHdmiController::IsVideo()");
   102     iIsImageSupported = EFalse;
   101     iIsImageSupported = EFalse;
   103     if (iGlxTvOut->IsHDMIConnected())
   102     if (iGlxTvOut->IsHDMIConnected())
   104         {
   103         {
   108 
   107 
   109 
   108 
   110 // -----------------------------------------------------------------------------
   109 // -----------------------------------------------------------------------------
   111 // ActivateZoom 
   110 // ActivateZoom 
   112 // -----------------------------------------------------------------------------
   111 // -----------------------------------------------------------------------------
   113 EXPORT_C void CGlxHdmiController::ActivateZoom()
   112 EXPORT_C void CGlxHdmiController::ActivateZoom(TBool aAutoZoomOut)
   114     {
   113     {
   115     TRACER("CGlxHdmiController::ActivateZoom()");
   114     TRACER("CGlxHdmiController::ActivateZoom()");
   116     if (iGlxTvOut->IsHDMIConnected())
   115     if (iGlxTvOut->IsHDMIConnected())
   117         {
   116         {
   118         iSurfaceUpdater->ActivateZoom();
   117         iSurfaceUpdater->ActivateZoom(aAutoZoomOut);
   119         }
   118         }
   120     }
   119     }
   121 
   120 
   122 // -----------------------------------------------------------------------------
   121 // -----------------------------------------------------------------------------
   123 // DeactivateZoom 
   122 // DeactivateZoom 
   135 // ShiftToCloningMode 
   134 // ShiftToCloningMode 
   136 // -----------------------------------------------------------------------------
   135 // -----------------------------------------------------------------------------
   137 EXPORT_C void CGlxHdmiController::ShiftToCloningMode()
   136 EXPORT_C void CGlxHdmiController::ShiftToCloningMode()
   138     {
   137     {
   139     TRACER("CGlxHdmiController::ShiftToCloningMode()");
   138     TRACER("CGlxHdmiController::ShiftToCloningMode()");
       
   139     iIsPostingMode = EFalse;
   140     if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater)
   140     if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater)
   141         {
   141         {
   142         iSurfaceUpdater->ShiftToCloningMode();
   142         iSurfaceUpdater->ShiftToCloningMode();
   143 		iIsPostingMode = EFalse;
       
   144         }
   143         }
   145     }
   144     }
   146 
   145 
   147 // -----------------------------------------------------------------------------
   146 // -----------------------------------------------------------------------------
   148 // ShiftToPostingMode 
   147 // ShiftToPostingMode 
   149 // -----------------------------------------------------------------------------
   148 // -----------------------------------------------------------------------------
   150 EXPORT_C void CGlxHdmiController::ShiftToPostingMode()
   149 EXPORT_C void CGlxHdmiController::ShiftToPostingMode()
   151     {
   150     {
   152     TRACER("CGlxHdmiController::ShiftToPostingMode()");
   151     TRACER("CGlxHdmiController::ShiftToPostingMode()");
       
   152     iIsPostingMode = ETrue;
   153     if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater)
   153     if (iGlxTvOut->IsHDMIConnected() && iSurfaceUpdater)
   154         {
   154         {
   155         iSurfaceUpdater->ShiftToPostingMode();
   155         iSurfaceUpdater->ShiftToPostingMode();
   156 		iIsPostingMode = ETrue;
       
   157         }
   156         }
   158     }
   157     }
   159 
   158 
   160 // -----------------------------------------------------------------------------
   159 // -----------------------------------------------------------------------------
   161 // Constructor
   160 // Constructor
   215     }
   214     }
   216 
   215 
   217 // -----------------------------------------------------------------------------
   216 // -----------------------------------------------------------------------------
   218 // CreateSurfaceUpdaterL 
   217 // CreateSurfaceUpdaterL 
   219 // -----------------------------------------------------------------------------
   218 // -----------------------------------------------------------------------------
   220 void CGlxHdmiController::CreateSurfaceUpdaterL(const TDesC& aImageFile, 
   219 void CGlxHdmiController::CreateSurfaceUpdaterL(const TDesC& aImageFile)
   221         TSize aImageDimensions, TInt aFrameCount)
       
   222     {
   220     {
   223     TRACER("CGlxHdmiController::CreateSurfaceUpdater()");
   221     TRACER("CGlxHdmiController::CreateSurfaceUpdater()");
   224     RWindow* window = iHdmiContainer->GetWindow();
   222     RWindow* window = iHdmiContainer->GetWindow();
   225     iSurfaceUpdater = CGlxHdmiSurfaceUpdater::NewL(window, aImageFile, aImageDimensions, 
   223     iSurfaceUpdater = CGlxHdmiSurfaceUpdater::NewL(window, aImageFile, 
   226             aFrameCount, iHdmiContainer);
   224                                                     iHdmiContainer);
   227     iHdmiContainer->DrawNow();
   225     iHdmiContainer->DrawNow();
   228     }
   226     }
   229 
   227 
   230 // -----------------------------------------------------------------------------
   228 // -----------------------------------------------------------------------------
   231 // StoreImageInfoL 
   229 // StoreImageInfoL 
   232 // -----------------------------------------------------------------------------
   230 // -----------------------------------------------------------------------------
   233 void CGlxHdmiController::StoreImageInfoL(const TDesC& aImageFile,
   231 void CGlxHdmiController::StoreImageInfoL(const TDesC& aImageFile)
   234         TSize aImageDimensions, TInt aFrameCount)
       
   235     {
   232     {
   236     TRACER("CGlxHdmiController::StoreImageInfoL()");
   233     TRACER("CGlxHdmiController::StoreImageInfoL()");
   237     if(iStoredImagePath)
   234     if(iStoredImagePath)
   238         {
   235         {
   239         delete iStoredImagePath;
   236         delete iStoredImagePath;
   240         iStoredImagePath = NULL;
   237         iStoredImagePath = NULL;
   241         }
   238         }
   242     iStoredImagePath = aImageFile.AllocL();
   239     iStoredImagePath = aImageFile.AllocL();
   243     iImageDimensions = aImageDimensions;
       
   244     iFrameCount = aFrameCount;
       
   245     GLX_LOG_INFO1("CGlxHdmiController::StoreImageInfoL() FrameCount =%d",iFrameCount);
       
   246     }
   240     }
   247 
   241 
   248 // -----------------------------------------------------------------------------
   242 // -----------------------------------------------------------------------------
   249 // HandleTvStatusChangedL 
   243 // HandleTvStatusChangedL 
   250 // -----------------------------------------------------------------------------
   244 // -----------------------------------------------------------------------------
   255         {
   249         {
   256         if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iIsPostingMode)
   250         if ( iGlxTvOut->IsHDMIConnected() && iIsImageSupported && iIsPostingMode)
   257             {
   251             {
   258             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected");
   252             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected");
   259             // Calling SetImageL() with appropriate parameters
   253             // Calling SetImageL() with appropriate parameters
   260             SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount, EFalse);
   254             SetImageL(iStoredImagePath->Des(), EFalse);
   261             }
   255             }
   262         else
   256         else
   263             {
   257             {
   264             // if it gets disconnected, destroy the surface 
   258             // if it gets disconnected, destroy the surface 
   265             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected");
   259             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Not Connected");
   266             DestroySurfaceUpdater();
   260             DestroySurfaceUpdater();
   267             }
   261             }
   268         }
   262         }
   269     }
   263     }
   270 
   264 
       
   265 // -----------------------------------------------------------------------------
       
   266 // HandleTvStatusChangedL 
       
   267 // -----------------------------------------------------------------------------
       
   268 EXPORT_C TBool CGlxHdmiController::IsHDMIConnected()
       
   269     {
       
   270     TRACER("CGlxHdmiController::IsHDMIConnected()");
       
   271     return iGlxTvOut->IsHDMIConnected(); 
       
   272     }
       
   273