Commit 8b832c45 authored by Filippo Carone's avatar Filippo Carone

jvlc: LibVlcMediaInstance renamed to LibVlcMediaPlayer

parent 0c90be80
......@@ -34,14 +34,14 @@ import org.videolan.jvlc.event.MediaPlayerListener;
import org.videolan.jvlc.internal.LibVlc;
import org.videolan.jvlc.internal.LibVlcEventType;
import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
public class MediaPlayer
{
private final LibVlcMediaInstance instance;
private final LibVlcMediaPlayer instance;
private final LibVlc libvlc;
......@@ -51,7 +51,7 @@ public class MediaPlayer
private MediaDescriptor mediaDescriptor;
MediaPlayer(JVLC jvlc, LibVlcMediaInstance instance)
MediaPlayer(JVLC jvlc, LibVlcMediaPlayer instance)
{
libvlc_exception_t exception = new libvlc_exception_t();
this.instance = instance;
......@@ -188,7 +188,7 @@ public class MediaPlayer
* Returns the instance.
* @return the instance
*/
LibVlcMediaInstance getInstance()
LibVlcMediaPlayer getInstance()
{
return instance;
}
......
......@@ -31,7 +31,7 @@ package org.videolan.jvlc;
import org.videolan.jvlc.internal.LibVlc;
import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
/**
......@@ -119,7 +119,7 @@ public class Playlist {
public MediaPlayer getMediaInstance()
{
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaInstance mi = libvlc.libvlc_playlist_get_media_player(libvlcInstance, exception);
LibVlcMediaPlayer mi = libvlc.libvlc_playlist_get_media_player(libvlcInstance, exception);
return new MediaPlayer(jvlc, mi);
}
......
......@@ -265,7 +265,7 @@ public interface LibVlc extends Library
{
}
public class LibVlcMediaInstance extends PointerType
public class LibVlcMediaPlayer extends PointerType
{
}
......@@ -319,36 +319,36 @@ public interface LibVlc extends Library
void libvlc_video_set_parent(LibVlcInstance libvlc_instance, long drawable, libvlc_exception_t exception);
void libvlc_toggle_fullscreen(LibVlcMediaInstance libvlc_instance);
void libvlc_toggle_fullscreen(LibVlcMediaPlayer libvlc_instance);
void libvlc_set_fullscreen(LibVlcMediaInstance instance, int fullscreen, libvlc_exception_t exception);
void libvlc_set_fullscreen(LibVlcMediaPlayer instance, int fullscreen, libvlc_exception_t exception);
int libvlc_get_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_get_fullscreen(LibVlcMediaPlayer instance, libvlc_exception_t exception);
int libvlc_video_get_height(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_video_get_height(LibVlcMediaPlayer instance, libvlc_exception_t exception);
int libvlc_video_get_width(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_video_get_width(LibVlcMediaPlayer instance, libvlc_exception_t exception);
String libvlc_video_get_aspect_ration(LibVlcMediaInstance instance, libvlc_exception_t exception);
String libvlc_video_get_aspect_ration(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_video_set_aspect_ration(LibVlcMediaInstance instance, String ratio, libvlc_exception_t exception);
void libvlc_video_set_aspect_ration(LibVlcMediaPlayer instance, String ratio, libvlc_exception_t exception);
int libvlc_video_get_spu(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_video_get_spu(LibVlcMediaPlayer instance, libvlc_exception_t exception);
int libvlc_video_set_spu(LibVlcMediaInstance instance, int spu, libvlc_exception_t exception);
int libvlc_video_set_spu(LibVlcMediaPlayer instance, int spu, libvlc_exception_t exception);
String libvlc_video_get_crop_geometry(LibVlcMediaInstance instance, libvlc_exception_t exception);
String libvlc_video_get_crop_geometry(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_video_set_crop_geometry(LibVlcMediaInstance instance, String geometry, libvlc_exception_t exception);
void libvlc_video_set_crop_geometry(LibVlcMediaPlayer instance, String geometry, libvlc_exception_t exception);
void libvlc_video_take_snapshot(LibVlcMediaInstance instance, String filename, int width, int height,
void libvlc_video_take_snapshot(LibVlcMediaPlayer instance, String filename, int width, int height,
libvlc_exception_t exception);
void libvlc_video_destroy(LibVlcMediaInstance instance, libvlc_exception_t exception);
void libvlc_video_destroy(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_video_resize(LibVlcMediaInstance instance, int width, int height, libvlc_exception_t exception);
void libvlc_video_resize(LibVlcMediaPlayer instance, int width, int height, libvlc_exception_t exception);
void libvlc_video_reparent(LibVlcMediaInstance instance, long drawable, libvlc_exception_t exception);
void libvlc_video_reparent(LibVlcMediaPlayer instance, long drawable, libvlc_exception_t exception);
void libvlc_video_set_size(LibVlcInstance instance, int width, int height, libvlc_exception_t exception);
......@@ -364,11 +364,11 @@ public interface LibVlc extends Library
int libvlc_audio_set_volume(LibVlcInstance instance, int volume, libvlc_exception_t exception);
int libvlc_audio_get_track_count(LibVlcMediaInstance mediaInstance, libvlc_exception_t exception);
int libvlc_audio_get_track_count(LibVlcMediaPlayer mediaInstance, libvlc_exception_t exception);
int libvlc_audio_get_track(LibVlcMediaInstance mediaInstance, libvlc_exception_t exception);
int libvlc_audio_get_track(LibVlcMediaPlayer mediaInstance, libvlc_exception_t exception);
void libvlc_audio_set_track(LibVlcMediaInstance mediaInstance, int channel, libvlc_exception_t exception);
void libvlc_audio_set_track(LibVlcMediaPlayer mediaInstance, int channel, libvlc_exception_t exception);
int libvlc_audio_get_channel(LibVlcInstance instance, libvlc_exception_t exception);
......@@ -399,11 +399,11 @@ public interface LibVlc extends Library
int libvlc_playlist_delete_item(LibVlcInstance instance, int itemIndex, libvlc_exception_t exception);
LibVlcMediaInstance libvlc_playlist_get_media_player(LibVlcInstance instance, libvlc_exception_t exception);
LibVlcMediaPlayer libvlc_playlist_get_media_player(LibVlcInstance instance, libvlc_exception_t exception);
int libvlc_media_player_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_player_is_seekable(LibVlcMediaPlayer instance, libvlc_exception_t exception);
int libvlc_media_player_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_player_can_pause(LibVlcMediaPlayer instance, libvlc_exception_t exception);
// media descriptor
......@@ -431,42 +431,42 @@ public interface LibVlc extends Library
// media player
LibVlcMediaInstance libvlc_media_player_new(LibVlcInstance instance, libvlc_exception_t exception);
LibVlcMediaPlayer libvlc_media_player_new(LibVlcInstance instance, libvlc_exception_t exception);
LibVlcMediaInstance libvlc_media_player_new_from_media(LibVlcMedia media, libvlc_exception_t exception);
LibVlcMediaPlayer libvlc_media_player_new_from_media(LibVlcMedia media, libvlc_exception_t exception);
void libvlc_media_player_play(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_player_play(LibVlcMediaPlayer media_player, libvlc_exception_t exception);
void libvlc_media_player_pause(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_player_pause(LibVlcMediaPlayer media_player, libvlc_exception_t exception);
void libvlc_media_player_stop(LibVlcMediaInstance media_player, libvlc_exception_t exception);
void libvlc_media_player_stop(LibVlcMediaPlayer media_player, libvlc_exception_t exception);
void libvlc_media_player_set_drawable(LibVlcMediaInstance libvlc_media_player, int drawable,
void libvlc_media_player_set_drawable(LibVlcMediaPlayer libvlc_media_player, int drawable,
libvlc_exception_t exception);
long libvlc_media_player_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
long libvlc_media_player_get_length(LibVlcMediaPlayer instance, libvlc_exception_t exception);
long libvlc_media_player_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
long libvlc_media_player_get_time(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_media_player_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
void libvlc_media_player_set_time(LibVlcMediaPlayer instance, long time, libvlc_exception_t exception);
float libvlc_media_player_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
float libvlc_media_player_get_position(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_media_player_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
void libvlc_media_player_set_position(LibVlcMediaPlayer instance, float position, libvlc_exception_t exception);
int libvlc_media_player_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
int libvlc_media_player_will_play(LibVlcMediaPlayer instance, libvlc_exception_t exception);
void libvlc_media_player_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
void libvlc_media_player_set_rate(LibVlcMediaPlayer instance, float rate, libvlc_exception_t exception);
float libvlc_media_player_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
float libvlc_media_player_get_rate(LibVlcMediaPlayer instance, libvlc_exception_t exception);
int libvlc_media_player_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
int libvlc_media_player_has_vout(LibVlcMediaPlayer instance2, libvlc_exception_t exception);
float libvlc_media_player_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
float libvlc_media_player_get_fps(LibVlcMediaPlayer instance2, libvlc_exception_t exception);
void libvlc_media_player_release(LibVlcMediaInstance instance);
void libvlc_media_player_release(LibVlcMediaPlayer instance);
LibVlcEventManager libvlc_media_player_event_manager(LibVlcMediaInstance media_player, libvlc_exception_t exception);
LibVlcEventManager libvlc_media_player_event_manager(LibVlcMediaPlayer media_player, libvlc_exception_t exception);
// media list
......@@ -509,7 +509,7 @@ public interface LibVlc extends Library
void libvlc_media_list_player_release(LibVlcMediaListPlayer libvlc_media_list_player);
void libvlc_media_list_player_set_media_player(LibVlcMediaListPlayer libvlc_media_list_player,
LibVlcMediaInstance libvlc_media_player, libvlc_exception_t exception);
LibVlcMediaPlayer 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);
......@@ -583,7 +583,7 @@ public interface LibVlc extends Library
void libvlc_event_detach(LibVlcEventManager event_manager, int event_type, LibVlcCallback callback,
Pointer userData, libvlc_exception_t excecption);
void libvlc_toggle_fullscreen(LibVlcMediaInstance instance, libvlc_exception_t exception);
void libvlc_toggle_fullscreen(LibVlcMediaPlayer instance, libvlc_exception_t exception);
// logging
......
......@@ -34,7 +34,7 @@ import org.videolan.jvlc.internal.LibVlc.LibVlcCallback;
import org.videolan.jvlc.internal.LibVlc.LibVlcEventManager;
import org.videolan.jvlc.internal.LibVlc.LibVlcInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMedia;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
import org.videolan.jvlc.internal.LibVlc.libvlc_event_t;
import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
......@@ -62,9 +62,9 @@ public class LibVlcImpl
LibVlcInstance libvlc_instance_t = libVlc.libvlc_new(0, new String[] {"/usr/local/bin/vlc"}, exception);
LibVlcMedia mediaDescriptor = libVlc
.libvlc_media_new(libvlc_instance_t, "/home/carone/a.avi", exception);
.libvlc_media_new(libvlc_instance_t, "/home/carone/apps/a.avi", exception);
LibVlcMediaInstance mediaPlayer = libVlc.libvlc_media_player_new_from_media(mediaDescriptor, exception);
LibVlcMediaPlayer mediaPlayer = libVlc.libvlc_media_player_new_from_media(mediaDescriptor, exception);
LibVlcEventManager mediaInstanceEventManager = libVlc.libvlc_media_player_event_manager(mediaPlayer, exception);
......
......@@ -28,7 +28,7 @@ package org.videolan.jvlc.internal;
import org.junit.Assert;
import org.junit.Test;
import org.videolan.jvlc.internal.LibVlc.LibVlcMedia;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
......@@ -36,7 +36,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
@Test
public void mediaInstanceNew()
{
LibVlcMediaInstance instance = libvlc.libvlc_media_player_new(libvlcInstance, exception);
LibVlcMediaPlayer instance = libvlc.libvlc_media_player_new(libvlcInstance, exception);
Assert.assertNotNull(instance);
Assert.assertEquals(0, exception.raised);
}
......@@ -44,7 +44,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
@Test
public void mediaInstancePlayBad()
{
LibVlcMediaInstance instance = libvlc.libvlc_media_player_new(libvlcInstance, exception);
LibVlcMediaPlayer instance = libvlc.libvlc_media_player_new(libvlcInstance, exception);
libvlc.libvlc_media_player_play(instance, exception);
Assert.assertEquals(1, exception.raised); // no associated media descriptor
}
......@@ -53,7 +53,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
public void mediaInstancePlay()
{
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_play(mi, exception);
Assert.assertEquals(0, exception.raised);
}
......@@ -62,7 +62,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
public void mediaInstancePauseBad()
{
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_pause(mi, exception);
Assert.assertEquals(1, exception.raised);
}
......@@ -71,7 +71,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
public void mediaInstancePause()
{
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer 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);
......@@ -81,7 +81,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
public void mediaInstanceSetPosition()
{
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer 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);
......@@ -93,7 +93,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
public void mediaInstanceStop()
{
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_stop(mi, exception);
Assert.assertEquals(0, exception.raised);
}
......@@ -102,7 +102,7 @@ public class LibVlcMediaPlayerTest extends AbstractVLCInternalTest
public void mediaInstanceStop2() throws Exception
{
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_player_play(mi, exception);
Thread.sleep(100);
libvlc.libvlc_media_player_stop(mi, exception);
......
......@@ -30,7 +30,7 @@ import junit.framework.Assert;
import org.junit.After;
import org.junit.Test;
import org.videolan.jvlc.internal.LibVlc.LibVlcMedia;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaInstance;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaPlayer;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaList;
import org.videolan.jvlc.internal.LibVlc.LibVlcMediaListPlayer;
import org.videolan.jvlc.internal.LibVlc.libvlc_exception_t;
......@@ -230,7 +230,7 @@ public class MediaListPlayerTest extends AbstractVLCInternalTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
LibVlcMedia md = libvlc.libvlc_media_new(libvlcInstance, mrl, exception);
LibVlcMediaInstance mi = libvlc.libvlc_media_player_new_from_media(md, exception);
LibVlcMediaPlayer mi = libvlc.libvlc_media_player_new_from_media(md, exception);
libvlc.libvlc_media_list_player_set_media_player(mediaListPlayer, mi, exception);
Assert.assertEquals(0, exception.raised);
}
......
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