[vlc-devel] JVLC issue

Diego Sanchez Gallo dsgallo at larc.usp.br
Thu Feb 14 16:14:48 CET 2008


Hi guys,

I'm trying to use the java bindings, to play a file inside a GUI, but when
the playback starts, a "jvlc hardware yuv directx output" opens with the
video.
I need the video embeded in my application, inside a JPanel... Please, any
help would be greatly appreciated!!! ;-)

That is my code:

************************************************

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JPanel;

import org.videolan.jvlc.JVLC;
import org.videolan.jvlc.JVLCCanvas;
import org.videolan.jvlc.VLCException;

public class JVLCTest extends JFrame {

    private static final long serialVersionUID = 1L;

    public JVLC jvlc;

    public JVLCTest() {
        initComponents();
    }

    private void initComponents() {
        getContentPane().setLayout(new BoxLayout(getContentPane(),
BoxLayout.PAGE_AXIS));

        JPanel panel = new JPanel();
        panel.setLayout(new BoxLayout(panel, BoxLayout.PAGE_AXIS));
        JVLCCanvas canvas = new JVLCCanvas(new String[] {}, 688, 464);
        jvlc = canvas.getJVLC();
        panel.add(canvas);
        getContentPane().add(panel);
        pack();
    }

    public void play() {
        try {
            jvlc.playlist.add("E:\\MediaContent\\FG-dvd_mpeg2_comp.avi",
"Video");
            jvlc.playlist.play();
            while (!jvlc.isInputPlaying());
            System.out.println("playing");
        } catch (VLCException e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        JVLCTest test = new JVLCTest();
        test.setSize(800, 600);
        test.setVisible(true);
        test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        test.play();
    }
}

************************************************

I was trying to use the JVLCPanel directly also, but I'm getting
EXCEPTION_ACCESS_VIOLATION from the JVM when doing that, apparently because
the JVLCPanel tries to instanciate the JVLC passing no arguments, and I only
could make it work instanciating the JVLC passing as argument an empty
String array.

Any ideas? Thanks!
Diego

ps. I know that is not a bug to have the content playing in the overlay
window, but I need it embeded... I tried passing as argument the
--no-overlay option but get an EXCEPTION_ACCESS_VIOLATION from the JVM (from
the JNDI call)
ps2. I had everything working fine with the jvlc 0.86, but since this
version doesn't have the get/setTime and get/setPosition functionalities,
and I need them, I have to upgrade to the newest version...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080214/a09a1a96/attachment.html>
-------------- next part --------------
_______________________________________________
vlc-devel mailing list
To unsubscribe or modify your subscription options:
http://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list