本文整理汇总了Java中org.videolan.libvlc.Media.addOption方法的典型用法代码示例。如果您正苦于以下问题:Java Media.addOption方法的具体用法?Java Media.addOption怎么用?Java Media.addOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.videolan.libvlc.Media
的用法示例。
在下文中一共展示了Media.addOption方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: browse
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
* Browse to the specified media.
*
* @param media Can be a media returned by MediaBrowser.
* @param flags see {@link Flag}
*/
@MainThread
public void browse(Media media, int flags) {
/* media can be associated with a medialist,
* so increment ref count in order to don't clean it with the medialist
*/
media.retain();
media.addOption(IGNORE_LIST_OPTION + mIgnoreList);
if ((flags & Flag.NoSlavesAutodetect) != 0)
media.addOption(":no-sub-autodetect-file");
if ((flags & Flag.ShowHiddenFiles) != 0)
media.addOption(":show-hiddenfiles");
int mediaFlags = Media.Parse.ParseNetwork;
if ((flags & Flag.Interact) != 0)
mediaFlags |= Media.Parse.DoInteract;
reset();
mBrowserMediaList = media.subItems();
mBrowserMediaList.setEventListener(mBrowserMediaListEventListener, mHandler);
media.parseAsync(mediaFlags, 0);
mMedia = media;
}
示例2: setMediaOptions
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static void setMediaOptions(Media media, Context context, int flags) {
boolean noHardwareAcceleration = (flags & MEDIA_NO_HWACCEL) != 0;
boolean noVideo = (flags & MEDIA_VIDEO) == 0;
final boolean paused = (flags & MEDIA_PAUSED) != 0;
int hardwareAcceleration = HW_ACCELERATION_DISABLED;
if (!noHardwareAcceleration) {
try {
hardwareAcceleration = PrefUtils.get(context, Prefs.HW_ACCELERATION, HW_ACCELERATION_AUTOMATIC);
} catch (NumberFormatException ignored) {}
}
if (hardwareAcceleration == HW_ACCELERATION_DISABLED)
media.setHWDecoderEnabled(false, false);
else if (hardwareAcceleration == HW_ACCELERATION_FULL || hardwareAcceleration == HW_ACCELERATION_DECODING) {
media.setHWDecoderEnabled(true, true);
if (hardwareAcceleration == HW_ACCELERATION_DECODING) {
media.addOption(":no-mediacodec-dr");
media.addOption(":no-omxil-dr");
}
} /* else automatic: use default options */
if (noVideo)
media.addOption(":no-video");
if (paused)
media.addOption(":start-paused");
}
示例3: browse
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
* Browse to the specified media.
*
* @param media Can be a media returned by MediaBrowser.
* @param flags see {@link MediaBrowser.Flag}
*/
@MainThread
public void browse(Media media, int flags) {
/* media can be associated with a medialist,
* so increment ref count in order to don't clean it with the medialist
*/
media.retain();
media.addOption(IGNORE_LIST_OPTION + mIgnoreList);
if ((flags & Flag.NoSlavesAutodetect) != 0)
media.addOption(":no-sub-autodetect-file");
int mediaFlags = Media.Parse.ParseNetwork;
if ((flags & Flag.Interact) != 0)
mediaFlags |= Media.Parse.DoInteract;
reset();
mBrowserMediaList = media.subItems();
mBrowserMediaList.setEventListener(mBrowserMediaListEventListener);
media.parseAsync(mediaFlags, 0);
mMedia = media;
}
示例4: getThumbnail
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static byte[] getThumbnail(Media media, int i_width, int i_height) {
media.addOption(":no-audio");
media.addOption(":no-spu");
media.addOption(":no-osd");
media.addOption(":input-fast-seek");
return nativeGetThumbnail(media, i_width, i_height);
}
示例5: setMedia
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
private void setMedia(Media media) {
//delay = network buffer + file buffer
//media.addOption(":network-caching=" + Constants.BUFFER);
//media.addOption(":file-caching=" + Constants.BUFFER);
media.addOption(":fullscreen");
media.setHWDecoderEnabled(true, false);
player = new MediaPlayer(vlcInstance);
player.setMedia(media);
player.setEventListener(this);
IVLCVout vlcOut = player.getVLCVout();
//set correct class for render depend of constructor called
if (surfaceView != null) {
vlcOut.setVideoView(surfaceView);
width = surfaceView.getWidth();
height = surfaceView.getHeight();
} else if (textureView != null) {
vlcOut.setVideoView(textureView);
width = textureView.getWidth();
height = textureView.getHeight();
} else if (surfaceTexture != null) {
vlcOut.setVideoSurface(surfaceTexture);
} else if (surface != null) {
vlcOut.setVideoSurface(surface, surfaceHolder);
} else {
throw new RuntimeException("You cant set a null render object");
}
if (width != 0 && height != 0) vlcOut.setWindowSize(width, height);
vlcOut.attachViews();
player.setVideoTrackEnabled(true);
player.play();
}
示例6: browse
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
/**
* Browse to the specified media.
*
* @param media Can be a media returned by MediaBrowser.
*/
public synchronized void browse(Media media) {
/* media can be associated with a medialist,
* so increment ref count in order to don't clean it with the medialist
*/
media.retain();
media.addOption(IGNORE_LIST_OPTION+mIgnoreList);
reset();
mBrowserMediaList = media.subItems();
mBrowserMediaList.setEventListener(mBrowserMediaListEventListener);
media.parseAsync(Media.Parse.ParseNetwork);
mMedia = media;
}
示例7: setMediaOptions
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static void setMediaOptions(Media media, Context context, int flags) {
boolean noHardwareAcceleration = (flags & MediaWrapper.MEDIA_NO_HWACCEL) != 0;
boolean noVideo = (flags & MediaWrapper.MEDIA_VIDEO) == 0;
final boolean paused = (flags & MediaWrapper.MEDIA_PAUSED) != 0;
int hardwareAcceleration = HW_ACCELERATION_DISABLED;
if (!noHardwareAcceleration) {
try {
final SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(context);
hardwareAcceleration = Integer.parseInt(pref.getString("hardware_acceleration", "-1"));
} catch (NumberFormatException ignored) {}
}
if (hardwareAcceleration == HW_ACCELERATION_DISABLED)
media.setHWDecoderEnabled(false, false);
else if (hardwareAcceleration == HW_ACCELERATION_FULL || hardwareAcceleration == HW_ACCELERATION_DECODING) {
media.setHWDecoderEnabled(true, true);
if (hardwareAcceleration == HW_ACCELERATION_DECODING) {
media.addOption(":no-mediacodec-dr");
media.addOption(":no-omxil-dr");
}
} /* else automatic: use default options */
if (noVideo)
media.addOption(":no-video");
if (paused)
media.addOption(":start-paused");
}
示例8: getThumbnail
import org.videolan.libvlc.Media; //导入方法依赖的package包/类
public static byte[] getThumbnail(Media media, int i_width, int i_height) {
media.addOption(":no-audio");
media.addOption(":no-spu");
media.addOption(":no-osd");
return nativeGetThumbnail(media, i_width, i_height);
}