Java bindings: added log functions. Removed @Override for java 1.5 compatibility
authorCristian Maglie <megabug@autistici.org>
Sun, 6 Apr 2008 15:37:58 +0000 (17:37 +0200)
committerFilippo Carone <littlejohn@videolan.org>
Sun, 6 Apr 2008 15:39:36 +0000 (17:39 +0200)
Signed-off-by: Filippo Carone <littlejohn@videolan.org>
core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
core/src/main/java/org/videolan/jvlc/example/VLCExample.java
core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java

index 9801338..c9a9c59 100644 (file)
@@ -49,7 +49,6 @@ public class MediaInstanceCallback implements LibVlcCallback
     /**
      * {@inheritDoc}
      */
-    @Override
     public void callback(libvlc_event_t libvlc_event, Pointer userData)
     {
         if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal())
index c0597e9..53cac89 100644 (file)
@@ -36,31 +36,26 @@ public class VLCExample
         mediaInstance.addListener(new MediaInstanceListener()
         {
 
-            @Override
             public void endReached(MediaInstance mediaInstance)
             {
                 System.out.println("Media instance end reached. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
             }
 
-            @Override
             public void paused(MediaInstance mediaInstance)
             {
                 System.out.println("Media instance paused. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
             }
 
-            @Override
             public void played(MediaInstance mediaInstance)
             {
                 System.out.println("Media instance played. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
             }
 
-            @Override
             public void positionChanged(MediaInstance mediaInstance)
             {
                 // TODO Auto-generated method stub
             }
 
-            @Override
             public void timeChanged(MediaInstance mediaInstance, long newTime)
             {
                 System.out.println("new time: " + newTime);
index 421b9dc..9fd9f0e 100644 (file)
@@ -52,6 +52,22 @@ public interface LibVlc extends Library
         public String message;
     }
 
+    public static class libvlc_log_message_t extends Structure
+    {
+
+        public int sizeof_msg; /* sizeof() of message structure, must be filled in by user */
+
+        public int i_severity; /* 0=INFO, 1=ERR, 2=WARN, 3=DBG */
+
+        public String psz_type; /* module type */
+
+        public String psz_name; /* module name */
+
+        public String psz_header; /* optional header */
+
+        public String psz_message; /* message */
+    }
+
     public static class libvlc_event_t extends Structure
     {
 
@@ -254,6 +270,14 @@ public interface LibVlc extends Library
     {
     }
 
+    public class LibVlcLog extends PointerType
+    {
+    }
+
+    public class LibVlcLogIterator extends PointerType
+    {
+    }
+
     // exception handling
     void libvlc_exception_init(libvlc_exception_t exception);
 
@@ -521,4 +545,27 @@ public interface LibVlc extends Library
 
     void libvlc_toggle_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
+    // logging
+
+    int libvlc_get_log_verbosity(LibVlcInstance p_instance, libvlc_exception_t p_e);
+
+    void libvlc_set_log_verbosity(LibVlcInstance p_instance, int level, libvlc_exception_t p_e);
+
+    LibVlcLog libvlc_log_open(LibVlcInstance p_instance, libvlc_exception_t p_e);
+
+    void libvlc_log_close(LibVlcLog p_log, libvlc_exception_t p_e);
+
+    int libvlc_log_count(LibVlcLog p_log, libvlc_exception_t p_e);
+
+    void libvlc_log_clear(LibVlcLog p_log, libvlc_exception_t p_e);
+
+    LibVlcLogIterator libvlc_log_get_iterator(LibVlcLog p_log, libvlc_exception_t p_e);
+
+    void libvlc_log_iterator_free(LibVlcLogIterator p_iter, libvlc_exception_t p_e);
+
+    int libvlc_log_iterator_has_next(LibVlcLogIterator p_iter, libvlc_exception_t p_e);
+
+    libvlc_log_message_t libvlc_log_iterator_next(LibVlcLogIterator p_iter, libvlc_log_message_t p_buffer,
+        libvlc_exception_t p_e);
+
 }
index 8df2b59..5a163f5 100644 (file)
@@ -68,7 +68,6 @@ public class LibVlcImpl
         LibVlcCallback played = new LibVlcCallback()
         {
 
-            @Override
             public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
             {
                 System.out.println("Playing started.");
@@ -78,7 +77,6 @@ public class LibVlcImpl
         LibVlcCallback endReached = new LibVlcCallback()
         {
 
-            @Override
             public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
             {
                 synchronized (lock)