Commit 0a53ef61 authored by Filippo Carone's avatar Filippo Carone

jvlc: fix the native type for drawable

parent 61888921
......@@ -41,7 +41,7 @@ public interface LibVlc extends Library
LibVlc INSTANCE = (LibVlc) Native.loadLibrary("vlc", LibVlc.class);
LibVlc SYNC_INSTANCE = (LibVlc) Native.synchronizedLibrary(INSTANCE);
public static class libvlc_exception_t extends Structure
{
......@@ -414,7 +414,7 @@ public interface LibVlc extends Library
void libvlc_media_player_stop(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_player_set_drawable(LibVlcMediaInstance libvlc_media_player, long drawable,
void libvlc_media_player_set_drawable(LibVlcMediaInstance libvlc_media_player, int drawable,
libvlc_exception_t exception);
long libvlc_media_player_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
......
......@@ -48,7 +48,7 @@ public class LibVlcImpl
public static void main(String[] args) throws InterruptedException
{
LibVlc libVlc = LibVlc.INSTANCE;
LibVlc libVlc = LibVlc.SYNC_INSTANCE;
libvlc_exception_t exception = new libvlc_exception_t();
libVlc.libvlc_exception_init(exception);
......@@ -117,10 +117,9 @@ public class LibVlcImpl
frame.getContentPane().add(panel);
frame.pack();
long drawable = com.sun.jna.Native.getComponentID(canvas);
int drawable = (int) com.sun.jna.Native.getComponentID(canvas);
libVlc.libvlc_video_set_parent(libvlc_instance_t, drawable, exception);
libVlc.libvlc_media_player_play(mediaPlayer, exception);
libVlc.libvlc_media_player_set_drawable(mediaPlayer, drawable, exception);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment