[Android] [PATCH] Benchmark: now receive screenshot directory location from intent
Geoffrey Métais
geoffrey.metais at gmail.com
Wed May 31 20:12:08 CEST 2017
Looks good to me.
Le mer. 31 mai 2017 à 18:42, Duncan McNamara <dcn.mcnamara at gmail.com> a
écrit :
> ---
> .../org/videolan/vlc/gui/video/benchmark/BenchActivity.java | 13
> +++++++++++--
> 1 file changed, 11 insertions(+), 2 deletions(-)
>
> 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 791c99c..d4e2c33 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
> @@ -68,6 +68,7 @@ public class BenchActivity extends ShallowVideoPlayer {
> private static final String PLAYBACK =
> "org.videolan.vlc.gui.video.benchmark.ACTION_PLAYBACK";
>
> private static final String TIMESTAMPS =
> "org.videolan.vlc.gui.video.benchmark.TIMESTAMPS";
> + private static final String INTENT_SCREENSHOT_DIR = "SCREENSHOT_DIR";
> private static final String TAG = "VLCBenchmark";
> private static final int REQUEST_SCREENSHOT = 666;
>
> @@ -101,6 +102,8 @@ public class BenchActivity extends ShallowVideoPlayer {
> /* set to true when Vout event is received
> * used to check if hardware decoder works */
> private boolean mHasVout = false;
> + /* screenshot directory location */
> + private String screenshotDir;
>
> @Override
> protected void loadMedia() {
> @@ -126,6 +129,11 @@ public class BenchActivity extends ShallowVideoPlayer
> {
> }
> mIsBenchmark = true;
>
> + if (!intent.hasExtra(INTENT_SCREENSHOT_DIR)) {
> + errorFinish("Failed to get screenshot directory location");
> + }
> + screenshotDir = intent.getStringExtra(INTENT_SCREENSHOT_DIR);
> +
> super.onCreate(savedInstanceState);
>
> /* Determining the benchmark mode */
> @@ -422,11 +430,12 @@ public class BenchActivity extends
> ShallowVideoPlayer {
> if (bitmap != null) {
> bitmap.copyPixelsFromBuffer(buffer);
>
> - File folder = new
> File(Environment.getExternalStorageDirectory() + File.separator +
> "screenshotFolder");
> + String folderStr = screenshotDir;
> + File folder = new File(folderStr);
>
> if (!folder.exists()) {
> if (!folder.mkdir()) {
> - errorFinish("Failed to create
> screenshotFolder");
> + errorFinish("Failed to create
> screenshot directory");
> }
> }
>
> --
> 2.7.5
>
> _______________________________________________
> Android mailing list
> Android at videolan.org
> https://mailman.videolan.org/listinfo/android
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/android/attachments/20170531/00479c61/attachment-0001.html>
More information about the Android
mailing list