[Android] Add intent extra to disable hardware decoding

Geoffrey Métais git at videolan.org
Thu Nov 26 16:31:32 CET 2015


vlc-ports/android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Nov 26 16:30:56 2015 +0100| [b8842674629825179fadf689df0ef15d212eedea] | committer: Geoffrey Métais

Add intent extra to disable hardware decoding

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

 vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java |    3 ++-
 1 file changed, 2 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 9f76966..12f3db4 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -146,6 +146,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
     public final static String PLAY_EXTRA_ITEM_TITLE = "title";
     public final static String PLAY_EXTRA_FROM_START = "from_start";
     public final static String PLAY_EXTRA_OPENED_POSITION = "opened_position";
+    public final static String PLAY_DISABLE_HARDWARE = "disable_hardware";
 
     public final static String ACTION_RESULT = Strings.buildPkgString("player.result");
     public final static String EXTRA_POSITION = "extra_position";
@@ -2771,7 +2772,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVLCVout.C
                 final MediaWrapper mw = new MediaWrapper(mUri);
                 if (wasPaused)
                     mw.addFlags(MediaWrapper.MEDIA_PAUSED);
-                if (mHardwareAccelerationError)
+                if (mHardwareAccelerationError || intent.hasExtra(PLAY_DISABLE_HARDWARE))
                     mw.addFlags(MediaWrapper.MEDIA_NO_HWACCEL);
                 mw.removeFlags(MediaWrapper.MEDIA_FORCE_AUDIO);
                 mw.addFlags(MediaWrapper.MEDIA_VIDEO);



More information about the Android mailing list