[Android] libvlc: don't choose android vout
Thomas Guillem
git at videolan.org
Mon Jun 22 15:43:10 CEST 2015
vlc-ports/android | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Jun 22 15:42:22 2015 +0200| [b61882d26e210e3c558dacbf3609fb3c90fd78ae] | committer: Thomas Guillem
libvlc: don't choose android vout
Let the default one: androidwindow, that works with direct rendering, software
rendering and android 2.1.
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=b61882d26e210e3c558dacbf3609fb3c90fd78ae
---
libvlc/src/org/videolan/libvlc/LibVLC.java | 14 +++----------
.../org/videolan/libvlc/util/HWDecoderUtil.java | 2 +-
.../vlc/gui/video/VideoPlayerActivity.java | 6 +++---
.../src/org/videolan/vlc/util/VLCOptions.java | 22 --------------------
4 files changed, 7 insertions(+), 37 deletions(-)
diff --git a/libvlc/src/org/videolan/libvlc/LibVLC.java b/libvlc/src/org/videolan/libvlc/LibVLC.java
index 7c438b7..a94c6e8 100644
--- a/libvlc/src/org/videolan/libvlc/LibVLC.java
+++ b/libvlc/src/org/videolan/libvlc/LibVLC.java
@@ -54,23 +54,21 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
* @param options
*/
public LibVLC(ArrayList<String> options) {
- boolean setAout = true, setVout = true, setChroma = true;
+ boolean setAout = true, setChroma = true;
// check if aout/vout options are already set
if (options != null) {
for (String option : options) {
if (option.startsWith("--aout="))
setAout = false;
- if (option.startsWith("--vout="))
- setVout = false;
if (option.startsWith("--androidsurface-chroma"))
setChroma = false;
- if (!setAout && !setVout && !setChroma)
+ if (!setAout && !setChroma)
break;
}
}
// set aout/vout options if they are not set
- if (setAout || setVout || setChroma) {
+ if (setAout || setChroma) {
if (options == null)
options = new ArrayList<String>();
if (setAout) {
@@ -80,12 +78,6 @@ public class LibVLC extends VLCObject<LibVLC.Event> {
else
options.add("--aout=android_audiotrack");
}
- if (setVout) {
- if (HWDecoderUtil.HAS_WINDOW_VOUT)
- options.add("--vout=androidwindow");
- else
- options.add("--vout=androidsurface");
- }
if (setChroma) {
options.add("--androidsurface-chroma");
options.add("RV32");
diff --git a/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java b/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java
index 1fe0655..d821cd7 100644
--- a/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java
+++ b/libvlc/src/org/videolan/libvlc/util/HWDecoderUtil.java
@@ -28,7 +28,7 @@ import java.util.HashMap;
*/
public class HWDecoderUtil {
- public static final boolean HAS_WINDOW_VOUT = AndroidUtil.isGingerbreadOrLater();
+ public static final boolean HAS_SUBTITLES_SURFACE = AndroidUtil.isGingerbreadOrLater();
public enum Decoder {
UNKNOWN, NONE, OMX, MEDIACODEC, ALL
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 dac3a45..8d70a36 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoPlayerActivity.java
@@ -453,7 +453,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
mSubtitlesSurfaceView.setZOrderMediaOverlay(true);
mSubtitlesSurfaceHolder.setFormat(PixelFormat.TRANSLUCENT);
- if (!HWDecoderUtil.HAS_WINDOW_VOUT) {
+ if (!HWDecoderUtil.HAS_SUBTITLES_SURFACE) {
mSubtitlesSurfaceView.setVisibility(View.GONE);
mSubtitleSurfaceReady = true;
}
@@ -1687,7 +1687,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
sw = mPresentation.getWindow().getDecorView().getWidth();
sh = mPresentation.getWindow().getDecorView().getHeight();
}
- if (LibVLC() != null && HWDecoderUtil.HAS_WINDOW_VOUT)
+ if (LibVLC() != null)
LibVLC().setWindowSize(sw, sh);
double dw = sw, dh = sh;
@@ -3079,7 +3079,7 @@ public class VideoPlayerActivity extends AppCompatActivity implements IVideoPlay
mSubtitlesSurfaceHolder.setFormat(PixelFormat.TRANSLUCENT);
mSubtitlesSurfaceHolder.addCallback(activity.mSubtitlesSurfaceCallback);
- if (!HWDecoderUtil.HAS_WINDOW_VOUT)
+ if (!HWDecoderUtil.HAS_SUBTITLES_SURFACE)
mSubtitlesSurfaceView.setVisibility(View.GONE);
Log.i(TAG, "Secondary display created");
}
diff --git a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
index eb08268..f98bb8b 100644
--- a/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
+++ b/vlc-android/src/org/videolan/vlc/util/VLCOptions.java
@@ -41,10 +41,6 @@ public class VLCOptions {
public static final int AOUT_AUDIOTRACK = 0;
public static final int AOUT_OPENSLES = 1;
- public static final int VOUT_ANDROID_SURFACE = 0;
- public static final int VOUT_OPEGLES2 = 1;
- public static final int VOUT_ANDROID_WINDOW = 2;
-
public static final int HW_ACCELERATION_AUTOMATIC = -1;
public static final int HW_ACCELERATION_DISABLED = 0;
public static final int HW_ACCELERATION_DECODING = 1;
@@ -80,13 +76,6 @@ public class VLCOptions {
}
aout = getAout(aout);
- int vout = -1;
- try {
- vout = Integer.parseInt(pref.getString("vout", "-1"));
- } catch (NumberFormatException nfe) {
- }
- vout = getVout(vout);
-
int deblocking = -1;
try {
deblocking = getDeblocking(Integer.parseInt(pref.getString("deblocking", "-1")));
@@ -114,7 +103,6 @@ public class VLCOptions {
if (networkCaching > 0)
options.add("--network-caching=" + networkCaching);
options.add(aout == AOUT_OPENSLES ? "--aout=opensles" : (aout == AOUT_AUDIOTRACK ? "--aout=android_audiotrack" : "--aout=dummy"));
- options.add(vout == VOUT_ANDROID_WINDOW ? "--vout=androidwindow" : (vout == VOUT_OPEGLES2 ? "--vout=gles2" : "--vout=androidsurface"));
options.add("--androidsurface-chroma");
options.add(chroma.indexOf(0) == 0 ? chroma : "RV32");
@@ -135,16 +123,6 @@ public class VLCOptions {
return aout == AOUT_OPENSLES ? AOUT_OPENSLES : AOUT_AUDIOTRACK;
}
- private static int getVout(int vout) {
- if (vout < 0 || vout > VOUT_ANDROID_WINDOW)
- vout = VOUT_ANDROID_SURFACE;
-
- if (vout == VOUT_ANDROID_SURFACE && HWDecoderUtil.HAS_WINDOW_VOUT)
- return VOUT_ANDROID_WINDOW;
- else
- return vout;
- }
-
private static int getDeblocking(int deblocking) {
int ret = deblocking;
if (deblocking < 0) {
More information about the Android
mailing list