[Android] Toast to warn hardware acceleration has failed

Geoffrey Métais git at videolan.org
Mon Nov 2 17:12:32 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Nov  2 17:01:30 2015 +0100| [2b4cf23457111de941d51ce176d183ca31c4f8a1] | committer: Geoffrey Métais

Toast to warn hardware acceleration has failed

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=2b4cf23457111de941d51ce176d183ca31c4f8a1
---

 vlc-android/res/values-fr/strings.xml                      |    1 +
 vlc-android/res/values/strings.xml                         |    1 +
 .../org/videolan/vlc/gui/video/VideoPlayerActivity.java    |   12 +++++-------
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/vlc-android/res/values-fr/strings.xml b/vlc-android/res/values-fr/strings.xml
index 16f9346..fa0d1e2 100644
--- a/vlc-android/res/values-fr/strings.xml
+++ b/vlc-android/res/values-fr/strings.xml
@@ -312,4 +312,5 @@
     <!--Widget-->
     <string name="widget_name_w">Widget VLC blanc</string>
     <string name="widget_name_b">Widget VLC noir</string>
+    <string name="hardware_acceleration_error">Erreur d\'accélération matérielle, basculement en décodage logiciel</string>
 </resources>
diff --git a/vlc-android/res/values/strings.xml b/vlc-android/res/values/strings.xml
index eb6e02f..d2ef565 100644
--- a/vlc-android/res/values/strings.xml
+++ b/vlc-android/res/values/strings.xml
@@ -364,6 +364,7 @@
     <string name="allow_settings_access_description">VLC needs you to grant this permission to set up this song as your ringtone.</string>
     <string name="permission_ask_again">Grant permission</string>
     <string name="exit_app">Close VLC</string>
+    <string name="hardware_acceleration_error">hardware acceleration error, switching to software decoding</string>
 
     <string-array name="hardware_acceleration_list">
         <item>@string/automatic</item>
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 7706a4d..75bd32e 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -20,7 +20,6 @@
 
 package org.videolan.vlc.gui.video;
 
-import android.Manifest;
 import android.annotation.TargetApi;
 import android.app.KeyguardManager;
 import android.app.Presentation;
@@ -51,9 +50,7 @@ import android.provider.MediaStore;
 import android.provider.OpenableColumns;
 import android.provider.Settings;
 import android.provider.Settings.SettingNotFoundException;
-import android.support.v4.app.ActivityCompat;
 import android.support.v4.app.FragmentManager;
-import android.support.v4.content.ContextCompat;
 import android.support.v4.view.GestureDetectorCompat;
 import android.support.v4.view.MenuItemCompat;
 import android.support.v7.app.ActionBar;
@@ -106,11 +103,11 @@ import org.videolan.vlc.MediaWrapper;
 import org.videolan.vlc.PlaybackService;
 import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
-import org.videolan.vlc.gui.browser.FilePickerActivity;
-import org.videolan.vlc.gui.PlaybackServiceActivity;
 import org.videolan.vlc.gui.MainActivity;
-import org.videolan.vlc.gui.preferences.PreferencesActivity;
+import org.videolan.vlc.gui.PlaybackServiceActivity;
+import org.videolan.vlc.gui.browser.FilePickerActivity;
 import org.videolan.vlc.gui.dialogs.AdvOptionsDialog;
+import org.videolan.vlc.gui.preferences.PreferencesActivity;
 import org.videolan.vlc.interfaces.IDelayController;
 import org.videolan.vlc.util.AndroidDevices;
 import org.videolan.vlc.util.Strings;
@@ -1550,11 +1547,12 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
         mHardwareAccelerationError = true;
         if (mSwitchingView)
             return;
+        Toast.makeText(this, R.string.hardware_acceleration_error, Toast.LENGTH_LONG).show();
         mService.removeCallback(this);
         mService.stop();
         if(!isFinishing())
             loadMedia();
-    }
+        }
 
     private void handleVout(int voutCount) {
         final IVLCVout vlcVout = mService.getVLCVout();



More information about the Android mailing list