If I'm posting this in the wrong spot I'm sorry, and please feel free to move it. I'm a bit new to this whole thing, probably not qualified enough to be attempting what I'm doing... But I've got the newest .jar file for jvlc downloaded, and I'm trying to get some of the sample code players to run for me but I'm having some problems. My friend says that the .jar file needs to be updated for windows because it's broken atm.
Here's the files I've got.
Complile.bat
Code: Select all
javac -classpath jvlc.jar; *.java
pause
Code: Select all
java -cp jvlc.jar; VlcClient
Pause
Code: Select all
import java.awt.Canvas;
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import javax.swing.JPanel;
import org.videolan.jvlc.JVLC;
import org.videolan.jvlc.Playlist;
import org.videolan.jvlc.VLCException;
class VLCPlayerFrame extends Frame
{
private Playlist playlist;
public Canvas jvcanvas;
public VLCPlayerFrame()
{
initComponents();
}
private void initComponents()
{
java.awt.GridBagConstraints gridBagConstraints;
fullScreenButton = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
setButton = new javax.swing.JButton();
pauseButton = new javax.swing.JButton();
stopButton = new javax.swing.JButton();
jvcc = new JPanel();
jvcanvas = new java.awt.Canvas();
jvcanvas.setSize(200, 200);
jvcc.add(jvcanvas);
jvlc = new JVLC();
playlist = new Playlist(jvlc);
setLayout(new java.awt.GridBagLayout());
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridwidth = java.awt.GridBagConstraints.CENTER;
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 0;
add(jvcc, gridBagConstraints);
fullScreenButton.setText("FullScreen");
fullScreenButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
fullScreenButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(fullScreenButton, gridBagConstraints);
jTextField1.setText("file://a.avi");
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 0;
gridBagConstraints.gridy = 1;
gridBagConstraints.gridwidth = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
add(jTextField1, gridBagConstraints);
setButton.setText("Set item");
setButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
setButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 1;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(setButton, gridBagConstraints);
pauseButton.setText("Play/Pause");
pauseButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
pauseButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 1;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(pauseButton, gridBagConstraints);
stopButton.setText("Stop");
stopButton.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt)
{
stopButtonActionPerformed(evt);
}
});
gridBagConstraints = new java.awt.GridBagConstraints();
gridBagConstraints.gridx = 2;
gridBagConstraints.gridy = 2;
gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
add(stopButton, gridBagConstraints);
pack();
}
private void stopButtonActionPerformed(java.awt.event.ActionEvent evt)
{
try
{
playlist.stop();
}
catch (Exception e)
{
e.printStackTrace();
}
}
private void pauseButtonActionPerformed(java.awt.event.ActionEvent evt)
{
try
{
playlist.togglePause();
}
catch (Exception e)
{
e.printStackTrace();
}
}
private void setButtonActionPerformed(java.awt.event.ActionEvent evt)
{
try
{
jvlc.setVideoOutput(jvcanvas);
playlist.add(jTextField1.getText(), "a.avi");
playlist.play();
}
catch (VLCException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
private void fullScreenButtonActionPerformed(java.awt.event.ActionEvent evt)
{
// jvlc.fullScreen();
}
private javax.swing.JButton setButton;
private javax.swing.JButton pauseButton;
private javax.swing.JButton stopButton;
private javax.swing.JButton fullScreenButton;
private javax.swing.JTextField jTextField1;
private JPanel jvcc;
public JVLC jvlc;
// MediaControlInstance mci;
}
public class VlcClient
{
public static void main(String[] args)
{
Frame f = new VLCPlayerFrame();
f.setBounds(0, 0, 500, 500);
f.addWindowListener(new WindowAdapter()
{
@Override
public void windowClosing(WindowEvent ev)
{
System.exit(0);
}
});
f.setVisible(true);
}
}
Code: Select all
G:\Documents and Settings\Cameron\Desktop\CHMP>java -cp jvlc.jar; VlcClient
Exception in thread "main" java.lang.UnsatisfiedLinkError: Unable to load librar
y 'libvlc': The specified module could not be found.
at com.sun.jna.NativeLibrary.loadLibrary(NativeLibrary.java:114)
at com.sun.jna.NativeLibrary.getInstance(NativeLibrary.java:157)
at com.sun.jna.Library$Handler.<init>(Library.java:123)
at com.sun.jna.Native.loadLibrary(Native.java:260)
at com.sun.jna.Native.loadLibrary(Native.java:246)
at org.videolan.jvlc.internal.LibVlc.<clinit>(LibVlc.java:41)
at org.videolan.jvlc.JVLC.<init>(JVLC.java:45)
at VLCPlayerFrame.initComponents(VlcClient.java:41)
at VLCPlayerFrame.<init>(VlcClient.java:22)
at VlcClient.main(VlcClient.java:192)
Edit: Okay so I was talking to another guy and he said I needed to add libvlc.dll file to the directory. So I did, and out comes this shibby.
Code: Select all
G:\Documents and Settings\Cameron\Desktop\CHMP>java -cp jvlc.jar; VlcClient
#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62e5428a, pid=1676, tid=2852
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C [libvlc.dll+0x9428a]
#
# An error report file with more information is saved as hs_err_pid1676.log
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
Code: Select all
#
# An unexpected error has been detected by Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x62e5428a, pid=1676, tid=2852
#
# Java VM: Java HotSpot(TM) Client VM (1.6.0_03-b05 mixed mode, sharing)
# Problematic frame:
# C [libvlc.dll+0x9428a]
#
# If you would like to submit a bug report, please visit:
# http://java.sun.com/webapps/bugreport/crash.jsp
#
--------------- T H R E A D ---------------
Current thread (0x002a6400): JavaThread "main" [_thread_in_native, id=2852]
siginfo: ExceptionCode=0xc0000005, reading address 0x010a01d3
Registers:
EAX=0x03252a78, EBX=0x00000003, ECX=0x00000003, EDX=0x00000003
ESP=0x0090eeac, EBP=0x0090f034, ESI=0x010a01d3, EDI=0x62f49960
EIP=0x62e5428a, EFLAGS=0x00210206
Top of Stack: (sp=0x0090eeac)
0x0090eeac: 62f49963 02dc0178 03254e08 03254de0
0x0090eebc: 00000002 02dc0178 00000008 03254e10
0x0090eecc: 00000000 000a0008 0000000d 02dc0178
0x0090eedc: 03254dd0 0090eef0 02dc0178 7c910098
0x0090eeec: 03254df8 0090ef00 00000000 7c910098
0x0090eefc: 03250fc0 0090efcc 7c910021 02dc0718
0x0090ef0c: 7c91003d 00000002 03250fc8 03250fb0
0x0090ef1c: 006f0072 00720067 006d0061 00460020
Instructions: (pc=0x62e5428a)
0x62e5427a: b9 03 00 00 00 8b 45 0c bf 60 99 f4 62 8b 34 90
0x62e5428a: f3 a6 0f 85 1c 04 00 00 8b 15 48 54 02 63 8b 0d
Stack: [0x008c0000,0x00910000), sp=0x0090eeac, free space=315k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C [libvlc.dll+0x9428a]
C [libvlc.dll+0x95ad3]
C [libvlc.dll+0x72222]
C [libvlc.dll+0xe72e]
C [libvlc.dll+0x8e501]
C [jna59262.tmp+0x9377]
C [jna59262.tmp+0x8f49]
C [jna59262.tmp+0x2131]
C [jna59262.tmp+0x26c0]
j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+607
j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
j com.sun.jna.Native$2.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+21
j $Proxy0.libvlc_new(I[Ljava/lang/String;Lorg/videolan/jvlc/internal/LibVlc$libvlc_exception_t;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+27
j org.videolan.jvlc.JVLC.createInstance([Ljava/lang/String;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+16
j org.videolan.jvlc.JVLC.<init>()V+19
j VLCPlayerFrame.initComponents()V+107
j VLCPlayerFrame.<init>()V+5
j VlcClient.main([Ljava/lang/String;)V+4
v ~StubRoutines::call_stub
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
j com.sun.jna.Function.invokePointer(I[Ljava/lang/Object;)Lcom/sun/jna/Pointer;+0
j com.sun.jna.Function.invoke([Ljava/lang/Object;Ljava/lang/Class;)Ljava/lang/Object;+607
j com.sun.jna.Function.invoke(Ljava/lang/Class;[Ljava/lang/Object;Ljava/util/Map;)Ljava/lang/Object;+194
j com.sun.jna.Library$Handler.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+344
j com.sun.jna.Native$2.invoke(Ljava/lang/Object;Ljava/lang/reflect/Method;[Ljava/lang/Object;)Ljava/lang/Object;+21
j $Proxy0.libvlc_new(I[Ljava/lang/String;Lorg/videolan/jvlc/internal/LibVlc$libvlc_exception_t;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+27
j org.videolan.jvlc.JVLC.createInstance([Ljava/lang/String;)Lorg/videolan/jvlc/internal/LibVlc$LibVlcInstance;+16
j org.videolan.jvlc.JVLC.<init>()V+19
j VLCPlayerFrame.initComponents()V+107
j VLCPlayerFrame.<init>()V+5
j VlcClient.main([Ljava/lang/String;)V+4
v ~StubRoutines::call_stub
--------------- P R O C E S S ---------------
Java Threads: ( => current thread )
0x02b0e800 JavaThread "AWT-Windows" daemon [_thread_in_native, id=3864]
0x02b0d400 JavaThread "AWT-Shutdown" [_thread_blocked, id=1812]
0x02b0b000 JavaThread "Java2D Disposer" daemon [_thread_blocked, id=3440]
0x02a6cc00 JavaThread "Low Memory Detector" daemon [_thread_blocked, id=444]
0x02a69c00 JavaThread "CompilerThread0" daemon [_thread_blocked, id=2252]
0x02a66c00 JavaThread "Attach Listener" daemon [_thread_blocked, id=460]
0x02a66000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=3744]
0x02a61800 JavaThread "Finalizer" daemon [_thread_blocked, id=3568]
0x02a5d400 JavaThread "Reference Handler" daemon [_thread_blocked, id=3672]
=>0x002a6400 JavaThread "main" [_thread_in_native, id=2852]
Other Threads:
0x02a5c000 VMThread [id=3076]
0x02a6e400 WatcherThread [id=2768]
VM state:not at safepoint (normal execution)
VM Mutex/Monitor currently owned by a thread: None
Heap
def new generation total 960K, used 639K [0x22970000, 0x22a70000, 0x22e50000)
eden space 896K, 64% used [0x22970000, 0x229ffeb0, 0x22a50000)
from space 64K, 100% used [0x22a60000, 0x22a70000, 0x22a70000)
to space 64K, 0% used [0x22a50000, 0x22a50000, 0x22a60000)
tenured generation total 4096K, used 634K [0x22e50000, 0x23250000, 0x26970000)
the space 4096K, 15% used [0x22e50000, 0x22eee8e0, 0x22eeea00, 0x23250000)
compacting perm gen total 12288K, used 541K [0x26970000, 0x27570000, 0x2a970000)
the space 12288K, 4% used [0x26970000, 0x269f7620, 0x269f7800, 0x27570000)
ro space 8192K, 62% used [0x2a970000, 0x2ae714a8, 0x2ae71600, 0x2b170000)
rw space 12288K, 52% used [0x2b170000, 0x2b7b7278, 0x2b7b7400, 0x2bd70000)
Dynamic libraries:
0x00400000 - 0x00423000 G:\Program Files\Java\jre1.6.0_03\bin\java.exe
0x7c900000 - 0x7c9af000 G:\WINDOWS\system32\ntdll.dll
0x7c800000 - 0x7c8f6000 G:\WINDOWS\system32\kernel32.dll
0x77dd0000 - 0x77e6b000 G:\WINDOWS\system32\ADVAPI32.dll
0x77e70000 - 0x77f02000 G:\WINDOWS\system32\RPCRT4.dll
0x77fe0000 - 0x77ff1000 G:\WINDOWS\system32\Secur32.dll
0x7c340000 - 0x7c396000 G:\Program Files\Java\jre1.6.0_03\bin\msvcr71.dll
0x6d7c0000 - 0x6da0a000 G:\Program Files\Java\jre1.6.0_03\bin\client\jvm.dll
0x7e410000 - 0x7e4a1000 G:\WINDOWS\system32\USER32.dll
0x77f10000 - 0x77f59000 G:\WINDOWS\system32\GDI32.dll
0x76b40000 - 0x76b6d000 G:\WINDOWS\system32\WINMM.dll
0x76390000 - 0x763ad000 G:\WINDOWS\system32\IMM32.DLL
0x629c0000 - 0x629c9000 G:\WINDOWS\system32\LPK.DLL
0x74d90000 - 0x74dfb000 G:\WINDOWS\system32\USP10.dll
0x6d310000 - 0x6d318000 G:\Program Files\Java\jre1.6.0_03\bin\hpi.dll
0x76bf0000 - 0x76bfb000 G:\WINDOWS\system32\PSAPI.DLL
0x6d770000 - 0x6d77c000 G:\Program Files\Java\jre1.6.0_03\bin\verify.dll
0x6d3b0000 - 0x6d3cf000 G:\Program Files\Java\jre1.6.0_03\bin\java.dll
0x6d7b0000 - 0x6d7bf000 G:\Program Files\Java\jre1.6.0_03\bin\zip.dll
0x6d000000 - 0x6d1c3000 G:\Program Files\Java\jre1.6.0_03\bin\awt.dll
0x73000000 - 0x73026000 G:\WINDOWS\system32\WINSPOOL.DRV
0x77c10000 - 0x77c68000 G:\WINDOWS\system32\msvcrt.dll
0x774e0000 - 0x7761d000 G:\WINDOWS\system32\ole32.dll
0x5ad70000 - 0x5ada8000 G:\WINDOWS\system32\uxtheme.dll
0x73760000 - 0x737ab000 G:\WINDOWS\system32\ddraw.dll
0x73bc0000 - 0x73bc6000 G:\WINDOWS\system32\DCIMAN32.dll
0x6d2b0000 - 0x6d303000 G:\Program Files\Java\jre1.6.0_03\bin\fontmanager.dll
0x10000000 - 0x1000d000 G:\Program Files\FlashGet\fgmgr.dll
0x763b0000 - 0x763f9000 G:\WINDOWS\system32\comdlg32.dll
0x5d090000 - 0x5d12a000 G:\WINDOWS\system32\COMCTL32.dll
0x7c9c0000 - 0x7d1d7000 G:\WINDOWS\system32\SHELL32.dll
0x77f60000 - 0x77fd6000 G:\WINDOWS\system32\SHLWAPI.dll
0x77c00000 - 0x77c08000 G:\WINDOWS\system32\VERSION.dll
0x771b0000 - 0x7725a000 G:\WINDOWS\system32\WININET.dll
0x77a80000 - 0x77b15000 G:\WINDOWS\system32\CRYPT32.dll
0x77b20000 - 0x77b32000 G:\WINDOWS\system32\MSASN1.dll
0x77120000 - 0x771ab000 G:\WINDOWS\system32\OLEAUT32.dll
0x773d0000 - 0x774d3000 G:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.5512_x-ww_35d4ce83\comctl32.dll
0x74720000 - 0x7476c000 G:\WINDOWS\system32\MSCTF.dll
0x77b40000 - 0x77b62000 G:\WINDOWS\system32\apphelp.dll
0x755c0000 - 0x755ee000 G:\WINDOWS\system32\msctfime.ime
0x031d0000 - 0x031e9000 G:\Documents and Settings\Cameron\Local Settings\Temp\jna59262.tmp
0x62dc0000 - 0x63072000 G:\Documents and Settings\Cameron\Desktop\CHMP\libvlc.dll
0x71ab0000 - 0x71ac7000 G:\WINDOWS\system32\WS2_32.DLL
0x71aa0000 - 0x71aa8000 G:\WINDOWS\system32\WS2HELP.dll
VM Arguments:
java_command: VlcClient
Launcher Type: SUN_STANDARD
Environment Variables:
JAVA_HOME=G:\Program Files\Java\jdk1.6.0_03
CLASSPATH=.;.;G:\PROGRA~1\JMF21~1.1E\lib\sound.jar;G:\PROGRA~1\JMF21~1.1E\lib\jmf.jar;G:\PROGRA~1\JMF21~1.1E\lib;G:\WINDOWS\java\classes;.
PATH=PATH=PATH=PATH=G:\WINDOWS\System32;C:\Ant\bin;G:\Program Files\Java\jre1.6.0_03\bin;G:\C++\Bin;G:\Program Files\WinRAR;G:\WINDOWS\System32\Wbem;G:\WINDOWS\system32;G:\Program Files\QuickTime\QTSystem\;F:\Program Files\Java\jdk1.6.0_07\bin;C:\Ant\bin;G:\Program Files\Java\jre1.6.0_03\bin;G:\C++\Bin;G:\Program Files\WinRAR;G:\WINDOWS\System32\Wbem;G:\WINDOWS\system32;G:\Program Files\QuickTime\QTSystem\;F:\Program Files\Java\jdk1.6.0_07\bin;C:\Ant\bin;G:\Program Files\Java\jre1.6.0_03\bin;G:\C++\Bin;G:\Program Files\WinRAR;G:\WINDOWS\System32\Wbem;G:\WINDOWS\system32;G:\Program Files\QuickTime\QTSystem\;F:\Program Files\Java\jdk1.6.0_07\bin;G:\Program Files\MKVtoolnix
USERNAME=Cameron
OS=Windows_NT
PROCESSOR_IDENTIFIER=x86 Family 6 Model 15 Stepping 6, GenuineIntel
--------------- S Y S T E M ---------------
OS: Windows XP Build 2600 Service Pack 3
CPU:total 2 (2 cores per cpu, 1 threads per core) family 6 model 15 stepping 6, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3
Memory: 4k page, physical 2095532k(1352032k free), swap 4033264k(3421472k free)
vm_info: Java HotSpot(TM) Client VM (1.6.0_03-b05) for windows-x86, built on Sep 24 2007 22:24:33 by "java_re" with unknown MS VC++:1310