jvlc: fix the native type for drawable
authorFilippo Carone <littlejohn@videolan.org>
Sat, 19 Jul 2008 21:48:55 +0000 (23:48 +0200)
committerFilippo Carone <littlejohn@videolan.org>
Sat, 19 Jul 2008 21:49:07 +0000 (23:49 +0200)
core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java

index 4a6438f..e4add27 100644 (file)
@@ -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);
index 93506e6..bdbc921 100644 (file)
@@ -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);
     }
 }