[Android] libvlc/Media: add noVideo and noHWAccel flags

Thomas Guillem git at videolan.org
Wed Dec 31 18:03:48 CET 2014


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Dec 31 12:35:47 2014 +0100| [02ce18e5c92116266bb6578afe4ac00d6add2fad] | committer: Thomas Guillem

libvlc/Media: add noVideo and noHWAccel flags

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

 libvlc/src/org/videolan/libvlc/LibVLC.java |   11 +++++++++++
 libvlc/src/org/videolan/libvlc/Media.java  |   14 ++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 237a252..13c6d25 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -352,6 +352,17 @@ public class LibVLC {
         return options.toArray(new String[options.size()]);
     }
 
+    public String[] getMediaOptions(Media media) {
+        boolean noHardwareAcceleration = false;
+        boolean noVideo = false;
+        if (media != null) {
+            final int flags = media.getFlags();
+            noHardwareAcceleration = (flags & Media.FLAG_NO_HWACCEL) != 0;
+            noVideo = (flags & Media.FLAG_NO_VIDEO) != 0;
+        }
+        return getMediaOptions(noHardwareAcceleration, noVideo); 
+    }
+
     public String getSubtitlesEncoding() {
         return subtitlesEncoding;
     }
diff --git a/libvlc/src/org/videolan/libvlc/Media.java b/libvlc/src/org/videolan/libvlc/Media.java
index f0dab6e..2db08db 100644
--- a/libvlc/src/org/videolan/libvlc/Media.java
+++ b/libvlc/src/org/videolan/libvlc/Media.java
@@ -62,6 +62,9 @@ public class Media {
     public final static int TYPE_AUDIO = 1;
     public final static int TYPE_GROUP = 2;
 
+    public final static int FLAG_NO_VIDEO   = 0x01;
+    public final static int FLAG_NO_HWACCEL = 0x02;
+
     /** Metadata from libvlc_media */
     protected String mTitle;
     private String mArtist;
@@ -117,6 +120,7 @@ public class Media {
     private int mHeight = 0;
     private Bitmap mPicture;
     private boolean mIsPictureParsed;
+    private int mFlags = 0;
 
     /**
      * Create a new Media
@@ -393,4 +397,14 @@ public class Media {
     public String getArtworkURL() {
         return mArtworkURL;
     }
+
+    public void addFlags(int flags) {
+        mFlags |= flags;
+    }
+    public void setFlags(int flags) {
+        mFlags = flags;
+    }
+    public int getFlags() {
+        return mFlags;
+    }
 }



More information about the Android mailing list