[Android] Benchmark: force fit_screen when playing video

Duncan McNamara git at videolan.org
Thu May 11 17:06:00 CEST 2017


vlc-android | branch: master | Duncan McNamara <dcn.mcnamara at gmail.com> | Thu May 11 17:03:42 2017 +0200| [4829665f098a54d3ddca6022b481059100d431b8] | committer: Geoffrey Métais

Benchmark: force fit_screen when playing video

To compare screenshots, it is better to have
an image with no top and bottom black borders.

Signed-off-by: Geoffrey Métais <geoffrey.metais at gmail.com>

> https://code.videolan.org/videolan/vlc-android/commit/4829665f098a54d3ddca6022b481059100d431b8
---

 .../src/org/videolan/vlc/gui/video/VideoPlayerActivity.java       | 8 +++++++-
 .../src/org/videolan/vlc/gui/video/benchmark/BenchActivity.java   | 1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

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 dcb5aed..fab2e97 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -348,6 +348,8 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
 
     DisplayMetrics mScreen = new DisplayMetrics();
 
+    protected boolean mIsBenchmark = false;
+
     private static LibVLC LibVLC() {
         return VLCInstance.get();
     }
@@ -488,7 +490,11 @@ 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);
+        }
         mMedialibrary = VLCApplication.getMLInstance();
     }
 
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 72cf34b..791c99c 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
@@ -124,6 +124,7 @@ public class BenchActivity extends ShallowVideoPlayer {
         if (!intent.hasExtra("disable_hardware")) {
             mIsHardware = true;
         }
+        mIsBenchmark = true;
 
         super.onCreate(savedInstanceState);
 



More information about the Android mailing list