[Android] [PATCH 2/2] Benchmark: force fit_screen when playing video

Duncan McNamara dcn.mcnamara at gmail.com
Thu May 11 16:25:38 CEST 2017


To compare screenshots, it is better to have
an image with no top and bottom black borders
---
 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java      | 9 ++++++++-
 .../src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java  | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
index 8406ccf..2b8c973 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -347,6 +347,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
     DisplayMetrics mScreen = new DisplayMetrics();
 
+    protected boolean mIsBenchmark = false;
+
     private static LibVLC LibVLC() {
         return VLCInstance.get();
     }
@@ -487,7 +489,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         getWindowManager().getDefaultDisplay().getMetrics(mScreen);
         mSurfaceYDisplayRange = Math.min(mScreen.widthPixels, mScreen.heightPixels);
         mSurfaceXDisplayRange = Math.max(mScreen.widthPixels, mScreen.heightPixels);
-        mCurrentSize = mSettings.getInt(PreferencesActivity.VIDEO_RATIO, SURFACE_BEST_FIT);
+        if (mIsBenchmark) {
+            mCurrentSize = SURFACE_FIT_SCREEN;
+        } else {
+            mCurrentSize = mSettings.getInt(PreferencesActivity.VIDEO_RATIO, SURFACE_BEST_FIT);
+        }
+
     }
 
     @Override
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java b/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
index fddfc18..3be602a 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java
@@ -127,7 +127,7 @@ public class BenchActivity extends ShallowVideoPlayer {
         if (!intent.hasExtra("disable_hardware")) {
             mIsHardware = true;
         }
-
+        mIsBenchmark = true;
         super.onCreate(savedInstanceState);
 
         /* Determining the benchmark mode */
-- 
2.7.4



More information about the Android mailing list