Commit 5a4f0db0 authored by Thomas Guillem's avatar Thomas Guillem
Browse files

libvlc: move Media flags to LibVLC

parent 339013f2
......@@ -56,6 +56,9 @@ public class LibVLC {
public static final int INPUT_NAV_LEFT = 3;
public static final int INPUT_NAV_RIGHT = 4;
public final static int MEDIA_NO_VIDEO = 0x01;
public final static int MEDIA_NO_HWACCEL = 0x02;
private static final String DEFAULT_CODEC_LIST = "mediacodec,iomx,all";
private static final boolean HAS_WINDOW_VOUT = LibVlcUtil.isGingerbreadOrLater();
......@@ -340,14 +343,9 @@ 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;
}
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);
}
......
......@@ -73,9 +73,6 @@ public class Media implements Parcelable {
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;
......
......@@ -49,7 +49,7 @@ public class MediaListPlayer {
return;
final Media media = mMediaList.getMedia(position);
String[] options = mLibVLC.getMediaOptions(media);
String[] options = mLibVLC.getMediaOptions(media != null ? media.getFlags() : 0);
mPlayerIndex = position;
mLibVLC.playMRL(mrl, options);
}
......
......@@ -1224,7 +1224,7 @@ public class AudioService extends Service {
media = new Media(mLibVLC, location);
}
if (noVideo)
media.addFlags(Media.FLAG_NO_VIDEO);
media.addFlags(LibVLC.MEDIA_NO_VIDEO);
mediaList.add(media);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment