videoplayback/videoplaybackview/viewsrc/videoplaybackdisplayhandler.cpp
changeset 67 72c709219fcd
parent 66 adb51f74b890
--- a/videoplayback/videoplaybackview/viewsrc/videoplaybackdisplayhandler.cpp	Tue Oct 05 09:26:49 2010 +0300
+++ b/videoplayback/videoplaybackview/viewsrc/videoplaybackdisplayhandler.cpp	Fri Oct 15 16:29:10 2010 +0300
@@ -15,7 +15,7 @@
 *
 */
 
-// Version : %version:  31 %
+// Version : %version:  32 %
 
 #include <sysutil.h>
 #include <s32file.h>
@@ -125,6 +125,10 @@
     TReal32 height = (TReal32) aDisplayRect.Height();
     iDisplayAspectRatio = (width > height)? (width / height) : (height / width);
 
+    MPX_DEBUG(
+            _L("CVideoPlaybackDisplayHandler::CreateDisplayWindowL() display width=%d, height=%d, ratio=%f"),
+            aDisplayRect.Width(), aDisplayRect.Height(), iDisplayAspectRatio);
+
     if ( ! iVideoContainer )
     {
         iVideoContainer = new ( ELeave ) CVideoContainer();
@@ -244,16 +248,21 @@
 
         TReal32 videoAspectRatio = (TReal32)iFileDetails->mVideoWidth /
                                    (TReal32)iFileDetails->mVideoHeight;
+
+        MPX_DEBUG(
+                _L("CVideoPlaybackDisplayHandler::CalculateAspectRatioL() display width=%d, height=%d, ratio=%f"),
+                        iFileDetails->mVideoWidth, iFileDetails->mVideoHeight, videoAspectRatio);
+
         //
         //  If the pixel aspect ratio is valid, use it to modify the videoAspectRatio
         //
         if ( iAspectRatio.iDenominator )
         {
-            MPX_DEBUG(_L("VideoPlaybackDisplayHandler::CalculateAspectRatioL() iAspectRatio = (%d,%d)"),
-                iAspectRatio.iNumerator, iAspectRatio.iDenominator );
-
             TReal32 par = (TReal32)iAspectRatio.iNumerator / (TReal32)iAspectRatio.iDenominator;
             videoAspectRatio *= par;
+
+            MPX_DEBUG(_L("VideoPlaybackDisplayHandler::CalculateAspectRatioL() Num=%d, Den=%d, ratio =%f"),
+                iAspectRatio.iNumerator, iAspectRatio.iDenominator, videoAspectRatio );
        }
 
         TInt cnt = iAspectRatioArray.Count();
@@ -276,12 +285,12 @@
         //  if can't find out match aspect ratio in dat file,
         //  choose the scaling type through the rule
         //      aspectRatioDiff =  videoAspectRatio - iDisplayAspectRatio
-        //      aspectRatioDiff >= - 0.00001 and <= 0.00001    ==> natural
+        //      aspectRatioDiff >= - 0.01 and <= 0.01          ==> natural
         //      aspectRatioDiff > 0.1                          ==> zoom
         //      aspectRatioDiff < - 0.3                        ==> natural
         //      aspectRatioDiff >= - 0.3 and <= 0.1            ==> stretch
         //
-        //               -0.3      -0.00001       0.00001         0.1
+        //               -0.3        -0.01         0.01           0.1
         //     ------------------------------------------------------------
         //         Natural |   Stretch  |   Natural  |   Stretch   |  Zoom
         //
@@ -290,7 +299,7 @@
         {
             TReal32 aspectRatioDiff = videoAspectRatio - iDisplayAspectRatio;
 
-            MPX_DEBUG(_L("VideoPlaybackDisplayHandler::CalculateAspectRatioL() videoAspectRatio = d,iDisplayAspectRatio = %d)"),
+            MPX_DEBUG(_L("VideoPlaybackDisplayHandler::CalculateAspectRatioL() videoAR=%f, displayAR=%f)"),
                     videoAspectRatio, iDisplayAspectRatio );
 
             if ( IsAspectRatioEqual( videoAspectRatio, iDisplayAspectRatio )  )
@@ -777,7 +786,7 @@
     TBool valuesEqual = EFalse;
     TReal32 arDiff = aRatio1 - aRatio2;
 
-    if ( arDiff < 0.00001 && arDiff > -0.00001 )
+    if ( arDiff < 0.01 && arDiff > -0.01 )
     {
         valuesEqual = ETrue;
     }