hi all !
I fixed my probleme : i upgrade to vlc 1.0.2 and i could now call the libvlc_audio_output_list_get() function !
But now my new probleme is how to use a libvlc_audio_output_t object in my java program.
I m using JNA in my own vlc binding, i know how to call native functions like "play", "pause", ... which not return anything but i don't exactly understand how JNA brings me back native's return object.
My java code :
Code: Select all
public class libvlc_audio_output_t extends PointerType
{
public String psz_name;
public String psz_description;
public libvlc_audio_output_t p_next;
}
Code: Select all
public interface LibVlc extends Library
{
...
libvlc_audio_output_t libvlc_audio_output_list_get(LibVlcInstance instance, libvlc_exception_t exception);
}
Code: Select all
public class MediaPlayer {
private List<MediaPlayerEventListener> eventListenerList = new ArrayList<MediaPlayerEventListener>();
private final LibVlc libvlc = LibVlc.SYNC_INSTANCE;
private final ExecutorService listenersService = Executors.newSingleThreadExecutor();
private final String[] args;
private LibVlcInstance instance;
private LibVlcMediaInstance mediaPlayerInstance;
private LibVlcEventManager mediaPlayerEventManager;
private LibVlcCallback callback;
private Canvas videoSurface;
....
public void libvlcAudioOutputListGet()// it s a void type at this time for my tests
{
if(mediaPlayerInstance == null)
{
throw new IllegalStateException("No media player instance");
}
libvlc_exception_t exception = new libvlc_exception_t();
System.out.println(libvlc.libvlc_audio_output_list_get(instance, exception).psz_name);//here i would like to have the name of the first audio output device
checkException(exception);
}
I read the JNA mappings "rules" in order to create my libvlc_audio_output_t class but i'm not sure to have understood exactly how it works ...
thanks for any help