Commit e8eb6132 authored by Cristian Maglie's avatar Cristian Maglie Committed by Filippo Carone

Java bindings: added log functions. Removed @Override for java 1.5 compatibility

Signed-off-by: default avatarFilippo Carone <littlejohn@videolan.org>
parent 8a5846af
...@@ -49,7 +49,6 @@ public class MediaInstanceCallback implements LibVlcCallback ...@@ -49,7 +49,6 @@ public class MediaInstanceCallback implements LibVlcCallback
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override
public void callback(libvlc_event_t libvlc_event, Pointer userData) public void callback(libvlc_event_t libvlc_event, Pointer userData)
{ {
if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal()) if (libvlc_event.type == LibVlcEventType.libvlc_MediaPlayerPlayed.ordinal())
......
...@@ -36,31 +36,26 @@ public class VLCExample ...@@ -36,31 +36,26 @@ public class VLCExample
mediaInstance.addListener(new MediaInstanceListener() mediaInstance.addListener(new MediaInstanceListener()
{ {
@Override
public void endReached(MediaInstance mediaInstance) public void endReached(MediaInstance mediaInstance)
{ {
System.out.println("Media instance end reached. MRL: " + mediaInstance.getMediaDescriptor().getMrl()); System.out.println("Media instance end reached. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
} }
@Override
public void paused(MediaInstance mediaInstance) public void paused(MediaInstance mediaInstance)
{ {
System.out.println("Media instance paused. MRL: " + mediaInstance.getMediaDescriptor().getMrl()); System.out.println("Media instance paused. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
} }
@Override
public void played(MediaInstance mediaInstance) public void played(MediaInstance mediaInstance)
{ {
System.out.println("Media instance played. MRL: " + mediaInstance.getMediaDescriptor().getMrl()); System.out.println("Media instance played. MRL: " + mediaInstance.getMediaDescriptor().getMrl());
} }
@Override
public void positionChanged(MediaInstance mediaInstance) public void positionChanged(MediaInstance mediaInstance)
{ {
// TODO Auto-generated method stub // TODO Auto-generated method stub
} }
@Override
public void timeChanged(MediaInstance mediaInstance, long newTime) public void timeChanged(MediaInstance mediaInstance, long newTime)
{ {
System.out.println("new time: " + newTime); System.out.println("new time: " + newTime);
......
...@@ -52,6 +52,22 @@ public interface LibVlc extends Library ...@@ -52,6 +52,22 @@ public interface LibVlc extends Library
public String message; 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 public static class libvlc_event_t extends Structure
{ {
...@@ -254,6 +270,14 @@ public interface LibVlc extends Library ...@@ -254,6 +270,14 @@ public interface LibVlc extends Library
{ {
} }
public class LibVlcLog extends PointerType
{
}
public class LibVlcLogIterator extends PointerType
{
}
// exception handling // exception handling
void libvlc_exception_init(libvlc_exception_t exception); void libvlc_exception_init(libvlc_exception_t exception);
...@@ -521,4 +545,27 @@ public interface LibVlc extends Library ...@@ -521,4 +545,27 @@ public interface LibVlc extends Library
void libvlc_toggle_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception); 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);
} }
...@@ -68,7 +68,6 @@ public class LibVlcImpl ...@@ -68,7 +68,6 @@ public class LibVlcImpl
LibVlcCallback played = new LibVlcCallback() LibVlcCallback played = new LibVlcCallback()
{ {
@Override
public void callback(libvlc_event_t libvlc_event_t, Pointer pointer) public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
{ {
System.out.println("Playing started."); System.out.println("Playing started.");
...@@ -78,7 +77,6 @@ public class LibVlcImpl ...@@ -78,7 +77,6 @@ public class LibVlcImpl
LibVlcCallback endReached = new LibVlcCallback() LibVlcCallback endReached = new LibVlcCallback()
{ {
@Override
public void callback(libvlc_event_t libvlc_event_t, Pointer pointer) public void callback(libvlc_event_t libvlc_event_t, Pointer pointer)
{ {
synchronized (lock) synchronized (lock)
......
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