XineCanvas - Home Page
ABOUT
The XineCanvas aims to provide a Java AWT Component displaying videos through the xine library.
I started this project because I did not find any easy to use and fast video player for Java. JMF is outdated and complex to use. I don't know other solutions. Pointers are welcome.
NEWS
- 070930 - First binary release.
BUILDING
The building is in three phases:
- Compile the classes, in particular XineCanvas (javac xinecanvas/*.java);
- Generate the C header file xinecanvas_XineCanvas.h. The script build_header.sh do this. It is put in the XIneCanvasNative directory;
- Build the native library (Unix only at the moment). A build.sh script in the directory XineCanvasNative is provided.
USAGE
This package is for (Java) developers. The project provides essentially 3 classes/interfaces:
- XineCanvas - it is the core component, with native methods, providing the core methods to open/close and play/stop a movie. Other informations, such as the movie length and its play position, can be obtained. Using this class is quite delicate: misuse can cause invalid memory accesses and crash the whole JVM. So better use the XinePlayer.
- XinePlayer - An utility class, that contains a XineCanvas, providing a simpler usage of the player. It adds the support to handle a playlist and a listening interface to know when the playlist is finished.
- XinePlayerListener - A little interface to detect when a player finishes playing its playlist.
Simply create an instance of a XinePlayer and add it to your AWT/Swing stuff.
The two provided examples, TestCanvas and TestPlayer, clearly shows it.
When launching the JVM, the native library (libXineCanvasNative.so) must be in your classpath:
java -Djava.library.path=XineCanvasNative ....
The libxine.so must be in your system linking path (Generally /usr/lib) or specify it through the LD_LIBRARY_PATH environment variable.
In my system I use:
export LD_LIBRARY_PATH=/usr/local/lib
Downloads and Docs
- Downloads from the Sourceforge project page
- Java Docs also available on-line
To contact me, please look at the source project page.
TODO
- The canvas currently hangs the JVM when used in conjunction to complex interfaces. This might be caused by the following issue.
- The players needs a call to XInitThreads to work. The default XLoxk and XUnlock calls must be replaced. Can Xine work without X multithreading support? Help is welcome.
- Check multithreading support. Instantiating more players is desirable.
- Easier deploy to other platforms. Can xinelib be statically linked into a single, big, .so file? Help is welcome.
- Porting to other platforms.
Links