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 ...@@ -321,13 +321,13 @@ namespace VideoLAN.LibVLC
} }
[DllImport ("libvlc-control.dll", [DllImport ("libvlc-control.dll",
EntryPoint="libvlc_media_descriptor_new")] EntryPoint="libvlc_media_new")]
public static extern public static extern
DescriptorHandle Create (InstanceHandle inst, U8String mrl, DescriptorHandle Create (InstanceHandle inst, U8String mrl,
NativeException ex); NativeException ex);
[DllImport ("libvlc-control.dll", [DllImport ("libvlc-control.dll",
EntryPoint="libvlc_media_descriptor_release")] EntryPoint="libvlc_media_release")]
public static extern void Release (IntPtr ptr); public static extern void Release (IntPtr ptr);
protected override bool ReleaseHandle () protected override bool ReleaseHandle ()
......
...@@ -45,8 +45,8 @@ public class MediaDescriptor ...@@ -45,8 +45,8 @@ public class MediaDescriptor
{ {
libvlc_exception_t exception = new libvlc_exception_t(); libvlc_exception_t exception = new libvlc_exception_t();
libvlc = jvlc.getLibvlc(); libvlc = jvlc.getLibvlc();
instance = libvlc.libvlc_media_descriptor_new(jvlc.getInstance(), media, exception); instance = libvlc.libvlc_media_new(jvlc.getInstance(), media, exception);
eventManager = libvlc.libvlc_media_descriptor_event_manager(instance, exception); eventManager = libvlc.libvlc_media_event_manager(instance, exception);
} }
MediaDescriptor(JVLC jvlc, LibVlcMediaDescriptor instance) MediaDescriptor(JVLC jvlc, LibVlcMediaDescriptor instance)
...@@ -54,18 +54,18 @@ public class MediaDescriptor ...@@ -54,18 +54,18 @@ public class MediaDescriptor
libvlc_exception_t exception = new libvlc_exception_t(); libvlc_exception_t exception = new libvlc_exception_t();
libvlc = jvlc.getLibvlc(); libvlc = jvlc.getLibvlc();
this.instance = instance; 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) public void addOption(String option)
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public String getMrl()
{ {
return libvlc.libvlc_media_descriptor_get_mrl(instance); return libvlc.libvlc_media_get_mrl(instance);
} }
public MediaInstance getMediaInstance() public MediaInstance getMediaInstance()
...@@ -79,7 +79,7 @@ public class MediaDescriptor ...@@ -79,7 +79,7 @@ public class MediaDescriptor
@Override @Override
protected void finalize() throws Throwable protected void finalize() throws Throwable
{ {
libvlc.libvlc_media_descriptor_release(instance); libvlc.libvlc_media_release(instance);
super.finalize(); super.finalize();
} }
......
...@@ -56,15 +56,15 @@ public class MediaInstance ...@@ -56,15 +56,15 @@ public class MediaInstance
libvlc_exception_t exception = new libvlc_exception_t(); libvlc_exception_t exception = new libvlc_exception_t();
this.instance = instance; this.instance = instance;
libvlc = jvlc.getLibvlc(); 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) public MediaInstance(MediaDescriptor mediaDescriptor)
{ {
libvlc_exception_t exception = new libvlc_exception_t(); libvlc_exception_t exception = new libvlc_exception_t();
libvlc = mediaDescriptor.getLibvlc(); libvlc = mediaDescriptor.getLibvlc();
instance = libvlc.libvlc_media_instance_new_from_media_descriptor(mediaDescriptor.getInstance(), exception); instance = libvlc.libvlc_media_player_new_from_media(mediaDescriptor.getInstance(), exception);
eventManager = libvlc.libvlc_media_instance_event_manager(instance, exception); eventManager = libvlc.libvlc_media_player_event_manager(instance, exception);
this.mediaDescriptor = mediaDescriptor; this.mediaDescriptor = mediaDescriptor;
} }
...@@ -76,79 +76,79 @@ public class MediaInstance ...@@ -76,79 +76,79 @@ public class MediaInstance
public void play() public void play()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public void stop()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public void pause()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public long getLength()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public long getTime()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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) public void setTime(long time)
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public float getPosition()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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) public void setPosition(float position)
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public boolean willPlay()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public float getRate()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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) public void setRate(float rate)
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public boolean hasVideoOutput()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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() public float getFPS()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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) public void addListener(final MediaInstanceListener listener)
...@@ -180,7 +180,7 @@ public class MediaInstance ...@@ -180,7 +180,7 @@ public class MediaInstance
libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception); libvlc.libvlc_event_detach(eventManager, event.ordinal(), callback, null, exception);
} }
} }
libvlc.libvlc_media_instance_release(instance); libvlc.libvlc_media_player_release(instance);
super.finalize(); super.finalize();
} }
......
...@@ -74,7 +74,7 @@ public class MediaList ...@@ -74,7 +74,7 @@ public class MediaList
} }
items.add(descriptor.getMrl()); items.add(descriptor.getMrl());
libvlc_exception_t exception = new libvlc_exception_t(); 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 ...@@ -179,7 +179,7 @@ public class MediaList
libvlc_exception_t exception = new libvlc_exception_t(); libvlc_exception_t exception = new libvlc_exception_t();
jvlc jvlc
.getLibvlc() .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 ...@@ -163,7 +163,7 @@ public class MediaListPlayer
public void setMediaInstance(MediaInstance mediaInstance) public void setMediaInstance(MediaInstance mediaInstance)
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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 { ...@@ -119,7 +119,7 @@ public class Playlist {
public MediaInstance getMediaInstance() public MediaInstance getMediaInstance()
{ {
libvlc_exception_t exception = new libvlc_exception_t(); 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); return new MediaInstance(jvlc, mi);
} }
......
...@@ -30,7 +30,7 @@ import org.videolan.jvlc.internal.LibVlc; ...@@ -30,7 +30,7 @@ import org.videolan.jvlc.internal.LibVlc;
import org.videolan.jvlc.internal.LibVlcEventType; import org.videolan.jvlc.internal.LibVlcEventType;
import org.videolan.jvlc.internal.LibVlc.LibVlcCallback; import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
import org.videolan.jvlc.internal.LibVlc.libvlc_event_t; 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; import com.sun.jna.Pointer;
...@@ -70,9 +70,9 @@ public class MediaInstanceCallback implements LibVlcCallback ...@@ -70,9 +70,9 @@ public class MediaInstanceCallback implements LibVlcCallback
} }
else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceTimeChanged.ordinal()) else if (libvlc_event.type == LibVlcEventType.libvlc_MediaInstanceTimeChanged.ordinal())
{ {
libvlc_event.event_type_specific.setType(LibVlc.media_instance_time_changed.class); libvlc_event.event_type_specific.setType(LibVlc.media_player_time_changed.class);
LibVlc.media_instance_time_changed timeChanged = (media_instance_time_changed) libvlc_event.event_type_specific LibVlc.media_player_time_changed timeChanged = (media_player_time_changed) libvlc_event.event_type_specific
.readField("media_instance_time_changed"); .readField("media_player_time_changed");
listener.timeChanged(mediaInstance, timeChanged.new_time); listener.timeChanged(mediaInstance, timeChanged.new_time);
} }
else else
......
...@@ -62,37 +62,37 @@ public interface LibVlc extends Library ...@@ -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 Pointer meta_type;
} }
public class media_descriptor_subitem_added extends Structure public class media_subitem_added extends Structure
{ {
public LibVlcMediaDescriptor new_child; public LibVlcMediaDescriptor new_child;
} }
public class media_descriptor_duration_changed extends Structure public class media_duration_changed extends Structure
{ {
public NativeLong new_duration; public NativeLong new_duration;
} }
public class media_descriptor_preparsed_changed extends Structure public class media_preparsed_changed extends Structure
{ {
public int new_status; public int new_status;
} }
public class media_descriptor_freed extends Structure public class media_freed extends Structure
{ {
public LibVlcMediaDescriptor md; public LibVlcMediaDescriptor md;
} }
public class media_descriptor_state_changed extends Structure public class media_state_changed extends Structure
{ {
// @todo: check this one // @todo: check this one
...@@ -101,13 +101,13 @@ public interface LibVlc extends Library ...@@ -101,13 +101,13 @@ public interface LibVlc extends Library
/* media instance */ /* media instance */
public class media_instance_position_changed extends Structure public class media_player_position_changed extends Structure
{ {
public float new_position; public float new_position;
} }
public class media_instance_time_changed extends Structure public class media_player_time_changed extends Structure
{ {
// @todo: check this one // @todo: check this one
...@@ -195,14 +195,14 @@ public interface LibVlc extends Library ...@@ -195,14 +195,14 @@ public interface LibVlc extends Library
public class event_type_specific extends Union public class event_type_specific extends Union
{ {
public media_descriptor_meta_changed media_descriptor_meta_changed; public media_meta_changed media_meta_changed;
public media_descriptor_subitem_added media_descriptor_subitem_added; public media_subitem_added media_subitem_added;
public media_descriptor_duration_changed media_descriptor_duration_changed; public media_duration_changed media_duration_changed;
public media_descriptor_preparsed_changed media_descriptor_preparsed_changed; public media_preparsed_changed media_preparsed_changed;
public media_descriptor_freed media_descriptor_freed; public media_freed media_freed;
public media_descriptor_state_changed media_descriptor_state_changed; public media_state_changed media_state_changed;
public media_instance_position_changed media_instance_position_changed; public media_player_position_changed media_player_position_changed;
public media_instance_time_changed media_instance_time_changed; public media_player_time_changed media_player_time_changed;
public media_list_item_added media_list_item_added; public media_list_item_added media_list_item_added;
public media_list_will_add_item media_list_will_add_item; public media_list_will_add_item media_list_will_add_item;
public media_list_item_deleted media_list_item_deleted; public media_list_item_deleted media_list_item_deleted;
...@@ -337,66 +337,66 @@ public interface LibVlc extends Library ...@@ -337,66 +337,66 @@ public interface LibVlc extends Library
int libvlc_playlist_delete_item(LibVlcInstance instance, int itemIndex, libvlc_exception_t exception); 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 // 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); 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); 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); libvlc_exception_t exception);
// media instance // 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); 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); 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);