Commit bf1292e4 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

libvlc: rename libvlc_media_descriptor to libvlc_media and...

libvlc: rename libvlc_media_descriptor to libvlc_media and libvlc_media_instance to libvlc_media_player.
parent b87ff819
......@@ -321,13 +321,13 @@ namespace VideoLAN.LibVLC
}
[DllImport ("libvlc-control.dll",
EntryPoint="libvlc_media_descriptor_new")]
EntryPoint="libvlc_media_new")]
public static extern
DescriptorHandle Create (InstanceHandle inst, U8String mrl,
NativeException ex);
[DllImport ("libvlc-control.dll",
EntryPoint="libvlc_media_descriptor_release")]
EntryPoint="libvlc_media_release")]
public static extern void Release (IntPtr ptr);
protected override bool ReleaseHandle ()
......
......@@ -45,8 +45,8 @@ public class MediaDescriptor
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc = jvlc.getLibvlc();
instance = libvlc.libvlc_media_descriptor_new(jvlc.getInstance(), media, exception);
eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception);
instance = libvlc.libvlc_media_new(jvlc.getInstance(), media, exception);
eventManager = libvlc.libvlc_media_event_manager(instance, exception);
}
MediaDescriptor(JVLC jvlc, LibVlcMediaDescriptor instance)
......@@ -54,18 +54,18 @@ public class MediaDescriptor
libvlc_exception_t exception = new libvlc_exception_t();
libvlc = jvlc.getLibvlc();
this.instance = instance;
eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception);
eventManager = libvlc.libvlc_media_event_manager(instance, exception);
}
public void addOption(String option)
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_descriptor_add_option(instance, option, exception );
libvlc.libvlc_media_add_option(instance, option, exception );
}
public String getMrl()
{
return libvlc.libvlc_media_descriptor_get_mrl(instance);
return libvlc.libvlc_media_get_mrl(instance);
}
public MediaInstance getMediaInstance()
......@@ -79,7 +79,7 @@ public class MediaDescriptor
@Override
protected void finalize() throws Throwable
{
libvlc.libvlc_media_descriptor_release(instance);
libvlc.libvlc_media_release(instance);
super.finalize();
}
......
......@@ -56,15 +56,15 @@ public class MediaInstance
libvlc_exception_t exception = new libvlc_exception_t();
this.instance = instance;
libvlc = jvlc.getLibvlc();
eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception);
eventManager = libvlc.libvlc_media_player_event_manager(instance, exception);
}
public MediaInstance(MediaDescriptor mediaDescriptor)
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc = mediaDescriptor.getLibvlc();
instance = libvlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor.getInstance(), exception);
eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception);
instance = libvlc.libvlc_media_player_new_from_media(mediaDescriptor.getInstance(), exception);
eventManager = libvlc.libvlc_media_player_event_manager(instance, exception);
this.mediaDescriptor = mediaDescriptor;
}
......@@ -76,79 +76,79 @@ public class MediaInstance
public void play()
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_instance_play(instance, exception);
libvlc.libvlc_media_player_play(instance, exception);
}
public void stop()
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_instance_stop(instance, exception);
libvlc.libvlc_media_player_stop(instance, exception);
}
public void pause()
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_instance_pause(instance, exception);
libvlc.libvlc_media_player_pause(instance, exception);
}
public long getLength()
{
libvlc_exception_t exception = new libvlc_exception_t();
return libvlc.libvlc_media_instance_get_length(instance, exception);
return libvlc.libvlc_media_player_get_length(instance, exception);
}
public long getTime()
{
libvlc_exception_t exception = new libvlc_exception_t();
return libvlc.libvlc_media_instance_get_time(instance, exception);
return libvlc.libvlc_media_player_get_time(instance, exception);
}
public void setTime(long time)
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_instance_set_time(instance, time, exception);
libvlc.libvlc_media_player_set_time(instance, time, exception);
}
public float getPosition()
{
libvlc_exception_t exception = new libvlc_exception_t();
return libvlc.libvlc_media_instance_get_position(instance, exception);
return libvlc.libvlc_media_player_get_position(instance, exception);
}
public void setPosition(float position)
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_instance_set_position(instance, position, exception);
libvlc.libvlc_media_player_set_position(instance, position, exception);
}
public boolean willPlay()
{
libvlc_exception_t exception = new libvlc_exception_t();
return (libvlc.libvlc_media_instance_will_play(instance, exception) == 1);
return (libvlc.libvlc_media_player_will_play(instance, exception) == 1);
}
public float getRate()
{
libvlc_exception_t exception = new libvlc_exception_t();
return libvlc.libvlc_media_instance_get_rate(instance, exception);
return libvlc.libvlc_media_player_get_rate(instance, exception);
}
public void setRate(float rate)
{
libvlc_exception_t exception = new libvlc_exception_t();
libvlc.libvlc_media_instance_set_rate(instance, rate, exception);
libvlc.libvlc_media_player_set_rate(instance, rate, exception);
}
public boolean hasVideoOutput()
{
libvlc_exception_t exception = new libvlc_exception_t();
return (libvlc.libvlc_media_instance_has_vout(instance, exception) == 1);
return (libvlc.libvlc_media_player_has_vout(instance, exception) == 1);
}
public float getFPS()
{
libvlc_exception_t exception = new libvlc_exception_t();
return libvlc.libvlc_media_instance_get_fps(instance, exception);
return libvlc.libvlc_media_player_get_fps(instance, exception);
}
public void addListener(final MediaInstanceListener listener)
......@@ -180,7 +180,7 @@ public class MediaInstance
libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception);
}
}
libvlc.libvlc_media_instance_release(instance);
libvlc.libvlc_media_player_release(instance);
super.finalize();
}
......
......@@ -74,7 +74,7 @@ public class MediaList
}
items.add(descriptor.getMrl());
libvlc_exception_t exception = new libvlc_exception_t();
jvlc.getLibvlc().libvlc_media_list_add_media_descriptor(instance, descriptor.getInstance(), exception);
jvlc.getLibvlc().libvlc_media_list_add_media(instance, descriptor.getInstance(), exception);
}
/**
......@@ -179,7 +179,7 @@ public class MediaList
libvlc_exception_t exception = new libvlc_exception_t();
jvlc
.getLibvlc()
.libvlc_media_list_insert_media_descriptor(instance, descriptor.getInstance(), index, exception);
.libvlc_media_list_insert_media(instance, descriptor.getInstance(), index, exception);
}
/**
......
......@@ -163,7 +163,7 @@ public class MediaListPlayer
public void setMediaInstance(MediaInstance mediaInstance)
{
libvlc_exception_t exception = new libvlc_exception_t();
jvlc.getLibvlc().libvlc_media_list_player_set_media_instance(instance, mediaInstance.getInstance(), exception);
jvlc.getLibvlc().libvlc_media_list_player_set_media_player(instance, mediaInstance.getInstance(), exception);
}
/**
......
......@@ -119,7 +119,7 @@ public class Playlist {
public MediaInstance getMediaInstance()
{
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaInstance mi = libvlc.libvlc_playlist_get_media_instance(libvlcInstance, exception);
LibVlcMediaInstance mi = libvlc.libvlc_playlist_get_media_player(libvlcInstance, exception);
return new MediaInstance(jvlc, mi);
}
......
......@@ -30,7 +30,7 @@ import org.videolan.jvlc.internal.LibVlc;
import org.videolan.jvlc.internal.LibVlcEventType;
import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
import org.videolan.jvlc.internal.LibVlc.libvlc_event_t;
import org.videolan.jvlc.internal.LibVlc.media_instance_time_changed;
import org.videolan.jvlc.internal.LibVlc.media_player_time_changed;
import com.sun.jna.Pointer;
......@@ -70,9 +70,9 @@ public class MediaInstanceCallback implements LibVlcCallback
}
else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceTimeChanged.ordinal())
{
libvlc_event.event_type_specific.setType(LibVlc.media_instance_time_changed.class);
LibVlc.media_instance_time_changed timeChanged = (media_instance_time_changed) libvlc_event.event_type_specific
.readField("media_instance_time_changed");
libvlc_event.event_type_specific.setType(LibVlc.media_player_time_changed.class);
LibVlc.media_player_time_changed timeChanged = (media_player_time_changed) libvlc_event.event_type_specific
.readField("media_player_time_changed");
listener.timeChanged(mediaInstance, timeChanged.new_time);
}
else
......
......@@ -62,37 +62,37 @@ public interface LibVlc extends Library
}
public class media_descriptor_meta_changed extends Structure
public class media_meta_changed extends Structure
{
public Pointer meta_type;
}
public class media_descriptor_subitem_added extends Structure
public class media_subitem_added extends Structure
{
public LibVlcMediaDescriptor new_child;
}
public class media_descriptor_duration_changed extends Structure
public class media_duration_changed extends Structure
{
public NativeLong new_duration;
}
public class media_descriptor_preparsed_changed extends Structure
public class media_preparsed_changed extends Structure
{
public int new_status;
}
public class media_descriptor_freed extends Structure
public class media_freed extends Structure
{
public LibVlcMediaDescriptor md;
}
public class media_descriptor_state_changed extends Structure
public class media_state_changed extends Structure
{
// @todo: check this one
......@@ -101,13 +101,13 @@ public interface LibVlc extends Library
/* media instance */
public class media_instance_position_changed extends Structure
public class media_player_position_changed extends Structure
{
public float new_position;
}
public class media_instance_time_changed extends Structure
public class media_player_time_changed extends Structure
{
// @todo: check this one
......@@ -195,14 +195,14 @@ public interface LibVlc extends Library
public class event_type_specific extends Union
{
public media_descriptor_meta_changed media_descriptor_meta_changed;
public media_descriptor_subitem_added media_descriptor_subitem_added;
public media_descriptor_duration_changed media_descriptor_duration_changed;
public media_descriptor_preparsed_changed media_descriptor_preparsed_changed;
public media_descriptor_freed media_descriptor_freed;
public media_descriptor_state_changed media_descriptor_state_changed;
public media_instance_position_changed media_instance_position_changed;
public media_instance_time_changed media_instance_time_changed;
public media_meta_changed media_meta_changed;
public media_subitem_added media_subitem_added;
public media_duration_changed media_duration_changed;
public media_preparsed_changed media_preparsed_changed;
public media_freed media_freed;
public media_state_changed media_state_changed;
public media_player_position_changed media_player_position_changed;
public media_player_time_changed media_player_time_changed;
public media_list_item_added media_list_item_added;
public media_list_will_add_item media_list_will_add_item;
public media_list_item_deleted media_list_item_deleted;
......@@ -337,66 +337,66 @@ public interface LibVlc extends Library
int libvlc_playlist_delete_item(LibVlcInstance instance, int itemIndex, libvlc_exception_t exception);
LibVlcMediaInstance libvlc_playlist_get_media_instance(LibVlcInstance instance, libvlc_exception_t exception);
LibVlcMediaInstance libvlc_playlist_get_media_player(LibVlcInstance instance, libvlc_exception_t exception);
int libvlc_media_instance_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_player_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_instance_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_player_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
// media descriptor
LibVlcMediaDescriptor libvlc_media_descriptor_new(LibVlcInstance libvlc_instance, String mrl,
LibVlcMediaDescriptor libvlc_media_new(LibVlcInstance libvlc_instance, String mrl,
libvlc_exception_t exception);
void libvlc_media_descriptor_add_option(LibVlcMediaDescriptor media_descriptor, String option,
void libvlc_media_add_option(LibVlcMediaDescriptor media, String option,
libvlc_exception_t exception);
String libvlc_media_descriptor_get_mrl(LibVlcMediaDescriptor media_descriptor);
String libvlc_media_get_mrl(LibVlcMediaDescriptor media);
void libvlc_media_descriptor_release(LibVlcMediaDescriptor media_descriptor);
void libvlc_media_release(LibVlcMediaDescriptor media);
LibVlcEventManager libvlc_media_descriptor_event_manager(LibVlcMediaDescriptor media_descriptor,
LibVlcEventManager libvlc_media_event_manager(LibVlcMediaDescriptor media,
libvlc_exception_t exception);
// media instance
LibVlcMediaInstance libvlc_media_instance_new(LibVlcInstance instance, libvlc_exception_t exception);
LibVlcMediaInstance libvlc_media_player_new(LibVlcInstance instance, libvlc_exception_t exception);
LibVlcMediaInstance libvlc_media_instance_new_from_media_descriptor(LibVlcMediaDescriptor media_descriptor,
LibVlcMediaInstance libvlc_media_player_new_from_media(LibVlcMediaDescriptor media,
libvlc_exception_t exception);
void libvlc_media_instance_play(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
void libvlc_media_player_play(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_instance_pause(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
void libvlc_media_player_pause(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_instance_stop(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
void libvlc_media_player_stop(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_instance_set_drawable(LibVlcMediaInstance libvlc_media_instance, long drawable,
void libvlc_media_player_set_drawable(LibVlcMediaInstance libvlc_media_player, long drawable,
libvlc_exception_t exception);
long libvlc_media_instance_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
long libvlc_media_player_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
long libvlc_media_instance_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
long libvlc_media_player_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
void libvlc_media_instance_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
void libvlc_media_player_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
float libvlc_media_instance_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
float libvlc_media_player_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
void libvlc_media_instance_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
void libvlc_media_player_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
int libvlc_media_instance_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_player_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
void libvlc_media_instance_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
void libvlc_media_player_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
float libvlc_media_instance_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
float libvlc_media_player_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_instance_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
int libvlc_media_player_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
float libvlc_media_instance_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
float libvlc_media_player_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
void libvlc_media_instance_release(LibVlcMediaInstance instance);
void libvlc_media_player_release(LibVlcMediaInstance instance);
LibVlcEventManager libvlc_media_instance_event_manager(LibVlcMediaInstance media_instance,
LibVlcEventManager libvlc_media_player_event_manager(LibVlcMediaInstance media_player,
libvlc_exception_t exception);
// media list
......@@ -408,17 +408,17 @@ public interface LibVlc extends Library
void libvlc_media_list_add_file_content(LibVlcMediaList libvlc_media_list, String fileName,
libvlc_exception_t exception);
void libvlc_media_list_set_media_descriptor(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
void libvlc_media_list_set_media(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
LibVlcMediaDescriptor libvlc_media_list_media_descriptor(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media_list_media(LibVlcMediaList libvlc_media_list,
libvlc_exception_t exception);
void libvlc_media_list_add_media_descriptor(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
void libvlc_media_list_add_media(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
void libvlc_media_list_insert_media_descriptor(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media_descriptor, int position, libvlc_exception_t exception);
void libvlc_media_list_insert_media(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media, int position, libvlc_exception_t exception);
void libvlc_media_list_remove_index(LibVlcMediaList libvlc_media_list, int position, libvlc_exception_t exception);
......@@ -428,7 +428,7 @@ public interface LibVlc extends Library
libvlc_exception_t exception);
int libvlc_media_list_index_of_item(LibVlcMediaList libvlc_media_list,
LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
int libvlc_media_list_is_readonly(LibVlcMediaList libvlc_media_list);
......@@ -436,13 +436,13 @@ public interface LibVlc extends Library
// libvlc_media_list_player
LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_instance,
LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_player,
libvlc_exception_t exception);
void libvlc_media_list_player_release(LibVlcMediaListPlayer libvlc_media_list_player);
void libvlc_media_list_player_set_media_instance(LibVlcMediaListPlayer libvlc_media_list_player,
LibVlcMediaInstance libvlc_media_instance, libvlc_exception_t exception);
void libvlc_media_list_player_set_media_player(LibVlcMediaListPlayer libvlc_media_list_player,
LibVlcMediaInstance libvlc_media_player, libvlc_exception_t exception);
void libvlc_media_list_player_set_media_list(LibVlcMediaListPlayer libvlc_media_list_player,
LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
......@@ -459,7 +459,7 @@ public interface LibVlc extends Library
libvlc_exception_t exception);
void libvlc_media_list_player_play_item(LibVlcMediaListPlayer libvlc_media_list_player,
LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
void libvlc_media_list_player_stop(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
......
......@@ -59,11 +59,11 @@ public class LibVlcImpl
LibVlcInstance libvlc_instance_t = libVlc.libvlc_new(0, new String[] {"/usr/local/bin/vlc"}, exception);
LibVlcMediaDescriptor mediaDescriptor = libVlc
.libvlc_media_descriptor_new(libvlc_instance_t, "/home/carone/a.avi", exception);
.libvlc_media_new(libvlc_instance_t, "/home/carone/a.avi", exception);
LibVlcMediaInstance mediaInstance = libVlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor, exception);
LibVlcMediaInstance mediaInstance = libVlc.libvlc_media_player_new_from_media(mediaDescriptor, exception);
LibVlcEventManager mediaInstanceEventManager = libVlc.libvlc_media_instance_event_manager(mediaInstance, exception);
LibVlcEventManager mediaInstanceEventManager = libVlc.libvlc_media_player_event_manager(mediaInstance, exception);
LibVlcCallback played = new LibVlcCallback()
{
......@@ -120,6 +120,6 @@ public class LibVlcImpl
libVlc.libvlc_video_set_parent(libvlc_instance_t, drawable, exception);
libVlc.libvlc_media_instance_play(mediaInstance, exception);
libVlc.libvlc_media_player_play(mediaInstance, exception);
}
}
......@@ -64,7 +64,7 @@ public class LibVlcMediaInstanceTest
@Test
public void mediaInstanceNew()
{
LibVlcMediaInstance instance = libvlc.libvlc_media_instance_new(libvlcInstance, exception);
LibVlcMediaInstance instance = libvlc.libvlc_media_player_new(libvlcInstance, exception);
Assert.assertNotNull(instance);
Assert.assertEquals(0, exception.raised);
}
......@@ -72,67 +72,67 @@ public class LibVlcMediaInstanceTest
@Test
public void mediaInstancePlayBad()
{
LibVlcMediaInstance instance = libvlc.libvlc_media_instance_new(libvlcInstance, exception);
libvlc.libvlc_media_instance_play(instance, exception);
LibVlcMediaInstance instance = libvlc.libvlc_media_player_new(libvlcInstance, exception);
libvlc.libvlc_media_player_play(instance, exception);
Assert.assertEquals(1, exception.raised); // no associated media descriptor
}
@Test
public void mediaInstancePlay()
{
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_instance_new_from_media_descriptor(md, exception);
libvlc.libvlc_media_instance_play(mi, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_play(mi, exception);
Assert.assertEquals(0, exception.raised);
}
@Test
public void mediaInstancePauseBad()
{
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_instance_new_from_media_descriptor(md, exception);
libvlc.libvlc_media_instance_pause(mi, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_pause(mi, exception);
Assert.assertEquals(1, exception.raised);
}
@Test
public void mediaInstancePause()
{
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_instance_new_from_media_descriptor(md, exception);
libvlc.libvlc_media_instance_play(mi, exception);
libvlc.libvlc_media_instance_pause(mi, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_play(mi, exception);
libvlc.libvlc_media_player_pause(mi, exception);
Assert.assertEquals(0, exception.raised);
}
@Test
public void mediaInstanceSetPosition()
{
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_instance_new_from_media_descriptor(md, exception);
libvlc.libvlc_media_instance_play(mi, exception);
libvlc.libvlc_media_instance_set_position(mi, 0.5f, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_play(mi, exception);
libvlc.libvlc_media_player_set_position(mi, 0.5f, exception);
Assert.assertEquals(0, exception.raised);
float position = libvlc.libvlc_media_instance_get_position(mi, exception);
float position = libvlc.libvlc_media_player_get_position(mi, exception);
Assert.assertTrue("Position is: " + position, position >= 0.5f);
}
@Test
public void mediaInstanceStop()
{
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_instance_new_from_media_descriptor(md, exception);
libvlc.libvlc_media_instance_stop(mi, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_stop(mi, exception);
Assert.assertEquals(0, exception.raised);
}
@Test
public void mediaInstanceStop2()
{
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_instance_new_from_media_descriptor(md, exception);
libvlc.libvlc_media_instance_play(mi, exception);
libvlc.libvlc_media_instance_stop(mi, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_play(mi, exception);
libvlc.libvlc_media_player_stop(mi, exception);
Assert.assertEquals(0, exception.raised);
}
......
......@@ -61,7 +61,7 @@ public class MediaDescriptorTest
public void mediaDescriptorNew() throws Exception
{
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
Assert.assertNotNull(md);
Assert.assertEquals(0, exception.raised);
}
......@@ -70,8 +70,8 @@ public class MediaDescriptorTest
public void mediaDescriptorGetMrl()
{
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaDescriptor md = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
String mdMrl = libvlc.libvlc_media_descriptor_get_mrl(md);
LibVlcMediaDescriptor md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
String mdMrl = libvlc.libvlc_media_get_mrl(md);
Assert.assertEquals(mrl, mdMrl);
}
......
......@@ -87,8 +87,8 @@ public class MediaListPlayerTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, mediaDescriptor, exception);
LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception);
libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception);
Assert.assertEquals(0, exception.raised);
}
......@@ -121,8 +121,8 @@ public class MediaListPlayerTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, mediaDescriptor, exception);
LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception);
libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception);
libvlc.libvlc_media_list_player_play(mediaListPlayer, exception);
Assert.assertEquals("Exception message: " + exception.message + ".\n", 0, exception.raised);
......@@ -134,8 +134,8 @@ public class MediaListPlayerTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_descriptor_new(libvlcInstance, mrl, exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, mediaDescriptor, exception);
LibVlcMediaDescriptor mediaDescriptor = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
libvlc.libvlc_media_list_add_media(mediaList, mediaDescriptor, exception);
libvlc.libvlc_media_list_player_set_media_list(mediaListPlayer, mediaList, exception);
libvlc.libvlc_media_list_player_play_item_at_index(mediaListPlayer, 0, exception);
while (true)
......@@ -161,8 +161,8 @@ public class MediaListPlayerTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);