[Android] LibVLC: allow to force hw accel on unknow devices

Tommy Tran ducprosoft at yahoo.com
Wed Mar 22 18:48:37 CET 2017


Thomas,
Will this address the GPU issue we talked earlier? I sent you 2 sample files over a week ago. I got a bounce back email saying it needed moderator approval and then nothing after that so I'm not sure if you received those sample files.
-Tommy
 

    On Wednesday, March 22, 2017 9:38 AM, Thomas Guillem <git at videolan.org> wrote:
 

 vlc-android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Mar 22 17:36:38 2017 +0100| [8082f750420a6ea735f9e9c325c9ba0dfd54c541] | committer: Thomas Guillem

LibVLC: allow to force hw accel on unknow devices

Mainly for 4.2.x devices when the user asked for it.

> https://code.videolan.org/videolan/vlc-android/commit/8082f750420a6ea735f9e9c325c9ba0dfd54c541
---

 libvlc/src/org/videolan/libvlc/Media.java | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index 5a48be5..358a8f4 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -735,12 +735,15 @@ public class Media extends VLCObject<Media.Event> {
      * @param force force hw acceleration even for unknown devices
      */
    public void setHWDecoderEnabled(boolean enabled, boolean force) {
-        final HWDecoderUtil.Decoder decoder = enabled ?
+        HWDecoderUtil.Decoder decoder = enabled ?
                HWDecoderUtil.getDecoderFromDevice() :
                HWDecoderUtil.Decoder.NONE;
 
-        if (decoder == HWDecoderUtil.Decoder.NONE ||
-                (decoder == HWDecoderUtil.Decoder.UNKNOWN && !force)) {
+        /* Unknown device but the user asked for hardware acceleration */
+        if (decoder == HWDecoderUtil.Decoder.UNKNOWN && force)
+            decoder = HWDecoderUtil.Decoder.ALL;
+
+        if (decoder == HWDecoderUtil.Decoder.NONE || decoder == HWDecoderUtil.Decoder.UNKNOWN) {
            addOption(":codec=all");
            return;
        }

_______________________________________________
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/20170322/a54a08b7/attachment-0001.html>


More information about the Android mailing list