[Android] LibVLC: add MEDIA_PAUSED flag that set "start-paused"

Thomas Guillem git at videolan.org
Wed Mar 25 15:56:49 CET 2015


vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Mar 23 14:51:03 2015 +0100| [a2f60dbc51948e64177f2f3843ddf9cad88ef0f2] | committer: Thomas Guillem

LibVLC: add MEDIA_PAUSED flag that set "start-paused"

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

 libvlc/src/org/videolan/libvlc/LibVLC.java |   20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 01bed0b..d4240a5 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -57,6 +57,7 @@ public class LibVLC {
 
     public final static int MEDIA_NO_VIDEO   = 0x01;
     public final static int MEDIA_NO_HWACCEL = 0x02;
+    public final static int MEDIA_PAUSED = 0x4;
 
     private static final String DEFAULT_CODEC_LIST = "mediacodec,iomx,all";
     private static final boolean HAS_WINDOW_VOUT = LibVlcUtil.isGingerbreadOrLater();
@@ -266,6 +267,16 @@ public class LibVLC {
     }
 
     public String[] getMediaOptions(boolean noHardwareAcceleration, boolean noVideo) {
+        final int flag = (noHardwareAcceleration ? MEDIA_NO_HWACCEL : 0) |
+                         (noVideo ? MEDIA_NO_VIDEO : 0);
+        return getMediaOptions(flag);
+    }
+
+    public String[] getMediaOptions(int flags) {
+        boolean noHardwareAcceleration = (flags & MEDIA_NO_HWACCEL) != 0;
+        boolean noVideo = (flags & MEDIA_NO_VIDEO) != 0;
+        final boolean paused = (flags & MEDIA_PAUSED) != 0;
+
         if (this.devHardwareDecoder != DEV_HW_DECODER_AUTOMATIC)
             noHardwareAcceleration = noVideo = false;
         else if (!noHardwareAcceleration)
@@ -289,16 +300,11 @@ public class LibVLC {
         }
         if (noVideo)
             options.add(":no-video");
-
+        if (paused)
+            options.add(":start-paused");
         return options.toArray(new String[options.size()]);
     }
 
-    public String[] getMediaOptions(int flags) {
-        final boolean noHardwareAcceleration = (flags & MEDIA_NO_HWACCEL) != 0;
-        final boolean noVideo = (flags & MEDIA_NO_VIDEO) != 0;
-        return getMediaOptions(noHardwareAcceleration, noVideo); 
-    }
-
     public String getSubtitlesEncoding() {
         return subtitlesEncoding;
     }



More information about the Android mailing list