本文整理汇总了Java中uk.co.caprica.vlcj.runtime.RuntimeUtil类的典型用法代码示例。如果您正苦于以下问题:Java RuntimeUtil类的具体用法?Java RuntimeUtil怎么用?Java RuntimeUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RuntimeUtil类属于uk.co.caprica.vlcj.runtime包,在下文中一共展示了RuntimeUtil类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: VLCPlayer
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
VLCPlayer(ElphelVision parent) {
this.Parent = parent;
List<String> vlcArgs = new ArrayList<String>();
vlcArgs.add("--no-video-title-show");
vlcArgs.add("--rtsp-caching=50");
vlcArgs.add("--clock-jitter=0");
// This burns so many people on Windows that I decided to leave it in...
if (RuntimeUtil.isWindows()) {
vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
}
// fullScreenStrategy = new
// DefaultFullScreenStrategy(Parent.GetMainframe());
mediaPlayerFactory = new MediaPlayerFactory(vlcArgs.toArray(new String[vlcArgs.size()]));
mediaPlayer = mediaPlayerFactory.newEmbeddedMediaPlayer(fullScreenStrategy);
// mediaPlayer = mediaPlayerFactory.newMediaPlayer(null);
}
示例2: VLCPlayer
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
VLCPlayer(ElphelVision parent) {
this.Parent = parent;
List<String> vlcArgs = new ArrayList<String>();
vlcArgs.add("--no-video-title-show");
vlcArgs.add("--rtsp-caching=50");
vlcArgs.add("--clock-jitter=0");
// This burns so many people on Windows that I decided to leave it in...
if (RuntimeUtil.isWindows()) {
vlcArgs.add("--plugin-path=" + WindowsRuntimeUtil.getVlcInstallDir() + "\\plugins");
}
//fullScreenStrategy = new DefaultFullScreenStrategy(Parent.GetMainframe());
mediaPlayerFactory = new MediaPlayerFactory(vlcArgs.toArray(new String[vlcArgs.size()]));
mediaPlayer = mediaPlayerFactory.newMediaPlayer(fullScreenStrategy);
//mediaPlayer = mediaPlayerFactory.newMediaPlayer(null);
}
示例3: ensureVLCLib
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
/**
* Ensures that the vlcj Lib is properly loaded
*/
public synchronized static void ensureVLCLib(){
if(!vlcjLoaded && !vlcjLoadError)
{
String vlclibName = RuntimeUtil.getLibVlcLibraryName();
List<String> libPaths = VLCUtil.getVLCLibPaths();
logger.info("jni loading: " + vlclibName);
for (String libPath : libPaths) {
logger.debug("adding search path: " + libPath);
NativeLibrary.addSearchPath(vlclibName, libPath);
}
try{
Native.loadLibrary(vlclibName, LibVlc.class);
vlcjLoaded = true;
}catch(UnsatisfiedLinkError e){
vlcjLoadError = true;
logger.error(e);
}
}
}
示例4: initVideoImportEngine
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
@Override
public void initVideoImportEngine(Optional<String> pathToLibrary) {
if (pathToLibrary.isPresent()) {
log.debug("Path to library {}", pathToLibrary);
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), pathToLibrary.get());
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
log.debug("Library loaded");
}
}
示例5: main
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
public static void main(String[] args) {
// TODO code application logic here
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), NATIVE_LIBRARY_SEARCH_PATH);
System.out.println(LibVlc.INSTANCE.libvlc_get_version());
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
new JSTPlay();
}
});
}
示例6: create
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
public void create(String filepath) throws Error {
camera = new OrthographicCamera();
camera.setToOrtho(false, w, h);
camera.update();
LibXUtil.initialise();
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcpath);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
image = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration()
.createCompatibleImage((int) w, (int) h);
image.setAccelerationPriority(1.0f);
String[] args = null;
if ((System.getProperty("os.name").toLowerCase().indexOf("mac") >= 0)) {
String pluginpath = vlcpath.substring(0, vlcpath.lastIndexOf('/')) + "/plugins";
System.out.println(pluginpath);
uk.co.caprica.vlcj.binding.LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", pluginpath, 1);
args = new String[] { "--no-video-title-show", "--verbose=3", "--vout=macosx" };
} else {
args = new String[] { "--no-video-title-show", "--verbose=3" };
}
factory = new MediaPlayerFactory(args);
mediaPlayer = factory.newDirectMediaPlayer(new TestBufferFormatCallback(), new TestRenderCallback());
mediaPlayer.prepareMedia(filepath);
mediaPlayer.start();
mediaPlayer.pause();
System.out.println(LibVlc.INSTANCE.libvlc_get_version());
}
示例7: ScreenRecorder
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
public ScreenRecorder() {
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), System.getProperty("user.dir")+"/lib");
System.setProperty("VLC_PLUGIN_PATH", System.getProperty("user.dir")+"/lib/plugins");
mediaPlayerFactory = new MediaPlayerFactory(OPTIONS);
mediaPlayer = mediaPlayerFactory.newHeadlessMediaPlayer();
}
示例8: initPlayer
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
private void initPlayer() {
boolean found = new NativeDiscovery().discover();
if (!found) {
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), NATIVE_LIBRARY_SEARCH_PATH);
}
}
示例9: cargaLibreria
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
private void cargaLibreria() {
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), LIB_VLC);
Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
}
示例10: checkNativeLibrary
import uk.co.caprica.vlcj.runtime.RuntimeUtil; //导入依赖的package包/类
/**
* Check loading of the native library.
*
* @param showError if <code>true</code> will display
* a message to the user in a dialog if the library
* failed to load
*
* @return <code>true</code> if the library was
* loaded correctly. <code>false</code> otherwise.
*
*/
public static boolean checkNativeLibrary(boolean showError) {
if(!isLoaded) {
try {
String vlcLocationDefault = new String();
String vlcPluginPathDefault = null;
// attempt to load native libraries
if(OSInfo.isMacOs()) {
vlcLocationDefault = VLC_LOCATION_MAC;
vlcPluginPathDefault = VLC_PLUGIN_PATH_MAC;
} else if (OSInfo.isWindows()) {
vlcLocationDefault = VLC_LOCATION_WIN;
vlcPluginPathDefault = VLC_PLUGIN_PATH_WIN;
} else if (OSInfo.isNix()) {
// libvlc should be in /usr/lib and already included in LD_LIBRARY_PATH
// on most systems
}
final String vlcLocation = PrefHelper.get(VLC_LOCATION, vlcLocationDefault);
NativeLibrary.addSearchPath(RuntimeUtil.getLibVlcLibraryName(), vlcLocation);
final String vlcPluginPath = PrefHelper.get(VLC_PLUGIN_PATH, vlcPluginPathDefault);
if(vlcPluginPath != null && !OSInfo.isWindows()) {
LibC.INSTANCE.setenv("VLC_PLUGIN_PATH", vlcPluginPath, 1);
}
Object lib = Native.loadLibrary(RuntimeUtil.getLibVlcLibraryName(), LibVlc.class);
isLoaded = true;
// print info to logger
LOGGER.info("Using vlcj " + Info.getInstance().version());
LOGGER.info("Found libVLC " + LibVlcVersion.getVersion() + " at " + getLibraryPath(lib));
} catch (UnsatisfiedLinkError e) {
LOGGER.log(Level.SEVERE, e.getLocalizedMessage(), e);
if(showError)
ToastFactory.makeToast(e.getLocalizedMessage()).start();
}
}
return isLoaded;
}