photosgallery/viewframework/tvout/src/glxhdmicontroller.cpp
branchRCL_3
changeset 11 71da52165949
parent 9 6b87b143d312
child 12 ce1c7ad1f18b
equal deleted inserted replaced
9:6b87b143d312 11:71da52165949
    23 #include "glxhdmicontainer.h"
    23 #include "glxhdmicontainer.h"
    24 #include "glxhdmisurfaceupdater.h"
    24 #include "glxhdmisurfaceupdater.h"
    25 
    25 
    26 
    26 
    27 #include "glxhdmicontroller.h"
    27 #include "glxhdmicontroller.h"
    28 
       
    29 // 720p image size
       
    30 const TInt KHdTvWidth = 1280;
       
    31 const TInt KHdTvHeight = 720;
       
    32 
    28 
    33 // -----------------------------------------------------------------------------
    29 // -----------------------------------------------------------------------------
    34 // NewLC
    30 // NewLC
    35 // -----------------------------------------------------------------------------
    31 // -----------------------------------------------------------------------------
    36 EXPORT_C CGlxHdmiController* CGlxHdmiController::NewL(const TDesC& aImageFile)
    32 EXPORT_C CGlxHdmiController* CGlxHdmiController::NewL(const TDesC& aImageFile)
    65 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile,
    61 EXPORT_C void CGlxHdmiController::SetImageL(const TDesC& aImageFile,
    66         TSize aImageDimensions, TInt aFrameCount, TBool aStore)
    62         TSize aImageDimensions, TInt aFrameCount, TBool aStore)
    67     {
    63     {
    68     TRACER("CGlxHdmiController::SetImageL()");
    64     TRACER("CGlxHdmiController::SetImageL()");
    69     if (aStore)
    65     if (aStore)
       
    66         {
       
    67         iImageSupported = ETrue;
    70         StoreImageInfoL(aImageFile, aImageDimensions, aFrameCount);
    68         StoreImageInfoL(aImageFile, aImageDimensions, aFrameCount);
    71 		
    69         }
    72     if (iGlxTvOut->IsHDMIConnected())
    70     if (iGlxTvOut->IsHDMIConnected())
    73         {
    71         {
    74         if(aImageDimensions.iHeight<=KHdTvHeight && 
       
    75                 aImageDimensions.iWidth<= KHdTvWidth && aFrameCount > 0)
       
    76             {
       
    77             GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 1");
       
    78             DestroySurfaceUpdater();
       
    79             if (!iHdmiContainer)
       
    80                 {
       
    81                 CreateHdmiContainerL(); 
       
    82                 }
       
    83             CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount);
       
    84             }
       
    85         else
       
    86             {
       
    87             GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2");
    72             GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 2");
    88             // do not close the surface , use the same surface instead.
    73             // do not close the surface , use the same surface instead.
    89             // Call a function to pass imagefile, imagedimension, framecount
    74             // Call a function to pass imagefile, imagedimension, framecount
    90             if (!iHdmiContainer)
    75             if (!iHdmiContainer)
    91                 {            
    76                 {            
    97                 // it satisfies the 720p condition                
    82                 // it satisfies the 720p condition                
    98                 CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount);
    83                 CreateSurfaceUpdaterL(aImageFile, aImageDimensions, aFrameCount);
    99                 }
    84                 }
   100             else
    85             else
   101                 {
    86                 {
   102                 GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3");
    87             GLX_LOG_INFO("CGlxHdmiController::SetImageL() - 3");
   103                 iSurfaceUpdater->UpdateNewImageL(aImageFile, aFrameCount);
    88             iSurfaceUpdater->UpdateNewImageL(aImageFile, aFrameCount,aImageDimensions);
   104                 }
       
   105             iHdmiContainer->DrawNow();
       
   106             }
    89             }
       
    90         iHdmiContainer->DrawNow();
   107         }
    91         }
   108     }
    92     }
   109 
    93 
   110 // -----------------------------------------------------------------------------
    94 // -----------------------------------------------------------------------------
   111 // IsVideo 
    95 // IsVideo 
   112 // -----------------------------------------------------------------------------
    96 // -----------------------------------------------------------------------------
   113 EXPORT_C void CGlxHdmiController::IsVideo()
    97 EXPORT_C void CGlxHdmiController::IsVideo()
   114     {
    98     {
   115     TRACER("CGlxHdmiController::IsVideo()");
    99     TRACER("CGlxHdmiController::IsVideo()");
       
   100     iImageSupported = EFalse;
   116     if (iGlxTvOut->IsHDMIConnected())
   101     if (iGlxTvOut->IsHDMIConnected())
   117         {
   102         {
   118         DestroySurfaceUpdater();
   103         DestroySurfaceUpdater();
   119         }
   104         }
   120     }
   105     }
   261 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType )
   246 void CGlxHdmiController::HandleTvStatusChangedL( TTvChangeType aChangeType )
   262     {
   247     {
   263     TRACER("CGlxHdmiController::HandleTvStatusChangedL()");
   248     TRACER("CGlxHdmiController::HandleTvStatusChangedL()");
   264     if ( aChangeType == ETvConnectionChanged )          
   249     if ( aChangeType == ETvConnectionChanged )          
   265         {
   250         {
   266         if ( iGlxTvOut->IsHDMIConnected() )
   251         if ( iGlxTvOut->IsHDMIConnected() && iImageSupported)
   267             {
   252             {
   268             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected");
   253             GLX_LOG_INFO("CGlxHdmiController::HandleTvStatusChangedL() - HDMI Connected");
   269             // Calling SetImageL() with appropriate parameters
   254             // Calling SetImageL() with appropriate parameters
   270             SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount, EFalse);
   255             SetImageL(iStoredImagePath->Des(), iImageDimensions, iFrameCount, EFalse);
   271             }
   256             }