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
......
......@@ -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);
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(mediaListPlayer, mediaDescriptor, exception);
Assert.assertEquals(0, exception.raised);
......@@ -201,8 +201,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(mediaListPlayer, mediaDescriptor, exception);
while (true)
......@@ -245,9 +245,9 @@ public class MediaListPlayerTest
{
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaListPlayer mediaListPlayer = libvlc.libvlc_media_list_player_new(libvlcInstance, exception);
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_list_player_set_media_instance(mediaListPlayer, 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_list_player_set_media_player(mediaListPlayer, mi, exception);
Assert.assertEquals(0, exception.raised);
}
......@@ -269,9 +269,9 @@ 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);
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_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);
Thread.sleep(150);
......@@ -285,8 +285,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(mediaListPlayer, mediaDescriptor, exception);
......
......@@ -71,11 +71,11 @@ public class MediaListTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(
LibVlcMediaDescriptor libvlc_media = libvlc.libvlc_media_new(
libvlcInstance,
mrl,
exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
Assert.assertEquals(0, exception.raised);
}
......@@ -85,16 +85,16 @@ public class MediaListTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(
LibVlcMediaDescriptor libvlc_media = libvlc.libvlc_media_new(
libvlcInstance,
mrl,
exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
int result = libvlc.libvlc_media_list_count(mediaList, exception);
Assert.assertEquals(1, result);
Assert.assertEquals(0, exception.raised);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
result = libvlc.libvlc_media_list_count(mediaList, exception);
Assert.assertEquals(2, result);
Assert.assertEquals(0, exception.raised);
......@@ -115,12 +115,12 @@ public class MediaListTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(
LibVlcMediaDescriptor libvlc_media = libvlc.libvlc_media_new(
libvlcInstance,
mrl,
exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
int index = libvlc.libvlc_media_list_index_of_item(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
int index = libvlc.libvlc_media_list_index_of_item(mediaList, libvlc_media, exception);
Assert.assertEquals(0, index);
Assert.assertEquals(0, exception.raised);
}
......@@ -131,11 +131,11 @@ public class MediaListTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(
LibVlcMediaDescriptor libvlc_media = libvlc.libvlc_media_new(
libvlcInstance,
mrl,
exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
libvlc.libvlc_media_list_remove_index(mediaList, 0, exception);
Assert.assertEquals(0, exception.raised);
}
......@@ -146,19 +146,19 @@ public class MediaListTest
libvlc_exception_t exception = new libvlc_exception_t();
LibVlcMediaList mediaList = libvlc.libvlc_media_list_new(libvlcInstance, exception);
String mrl = this.getClass().getResource("/raffa_voice.ogg").getPath();
LibVlcMediaDescriptor libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(
LibVlcMediaDescriptor libvlc_media = libvlc.libvlc_media_new(
libvlcInstance,
mrl,
exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
libvlc.libvlc_media_list_remove_index(mediaList, 0, exception);
Assert.assertEquals(0, exception.raised);
libvlc_media_descriptor = libvlc.libvlc_media_descriptor_new(
libvlc_media = libvlc.libvlc_media_new(
libvlcInstance,
mrl,
exception);
libvlc.libvlc_media_list_add_media_descriptor(mediaList, libvlc_media_descriptor, exception);
libvlc.libvlc_media_list_add_media(mediaList, libvlc_media, exception);
libvlc.libvlc_media_list_remove_index(mediaList, 0, exception);
}
......
......@@ -32,7 +32,7 @@ vlcMediaInstance_get_length( PyObject *self, PyObject *args )
libvlc_exception_t ex;
vlc_int64_t i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_get_length( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_get_length( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "L", i_ret );
}
......@@ -43,7 +43,7 @@ vlcMediaInstance_get_time( PyObject *self, PyObject *args )
libvlc_exception_t ex;
vlc_int64_t i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_get_time( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_get_time( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "L", i_ret );
}
......@@ -58,7 +58,7 @@ vlcMediaInstance_set_time( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_instance_set_time( LIBVLC_MEDIAINSTANCE->p_mi, i_time, &ex);
libvlc_media_player_set_time( LIBVLC_MEDIAINSTANCE->p_mi, i_time, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -70,7 +70,7 @@ vlcMediaInstance_get_position( PyObject *self, PyObject *args )
libvlc_exception_t ex;
float f_ret;
LIBVLC_TRY;
f_ret = libvlc_media_instance_get_position( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
f_ret = libvlc_media_player_get_position( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "f", f_ret );
}
......@@ -85,7 +85,7 @@ vlcMediaInstance_set_position( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_instance_set_position( LIBVLC_MEDIAINSTANCE->p_mi, f_pos, &ex);
libvlc_media_player_set_position( LIBVLC_MEDIAINSTANCE->p_mi, f_pos, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -97,7 +97,7 @@ vlcMediaInstance_will_play( PyObject *self, PyObject *args )
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_will_play( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_will_play( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -108,7 +108,7 @@ vlcMediaInstance_get_rate( PyObject *self, PyObject *args )
libvlc_exception_t ex;
float f_ret;
LIBVLC_TRY;
f_ret = libvlc_media_instance_get_rate( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
f_ret = libvlc_media_player_get_rate( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "f", f_ret );
}
......@@ -123,7 +123,7 @@ vlcMediaInstance_set_rate( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_instance_set_rate( LIBVLC_MEDIAINSTANCE->p_mi, f_rate, &ex);
libvlc_media_player_set_rate( LIBVLC_MEDIAINSTANCE->p_mi, f_rate, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -135,7 +135,7 @@ vlcMediaInstance_get_state( PyObject *self, PyObject *args )
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_get_state( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_get_state( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -146,7 +146,7 @@ vlcMediaInstance_has_vout( PyObject *self, PyObject *args )
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_has_vout( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_has_vout( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -157,7 +157,7 @@ vlcMediaInstance_get_fps( PyObject *self, PyObject *args )
libvlc_exception_t ex;
float f_ret;
LIBVLC_TRY;
f_ret = libvlc_media_instance_get_fps( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
f_ret = libvlc_media_player_get_fps( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "f", f_ret );
}
......@@ -197,7 +197,7 @@ vlcMediaInstance_get_chapter( PyObject *self, PyObject *args )
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_get_chapter( LIBVLC_MEDIAINSTANCE->p_mi, &ex );
i_ret = libvlc_media_player_get_chapter( LIBVLC_MEDIAINSTANCE->p_mi, &ex );
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -209,7 +209,7 @@ vlcMediaInstance_get_chapter_count( PyObject *self, PyObject *args )
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_get_chapter_count( LIBVLC_MEDIAINSTANCE->p_mi, &ex );
i_ret = libvlc_media_player_get_chapter_count( LIBVLC_MEDIAINSTANCE->p_mi, &ex );
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -224,7 +224,7 @@ vlcMediaInstance_set_chapter( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_instance_set_chapter( LIBVLC_MEDIAINSTANCE->p_mi, i_chapter, &ex );
libvlc_media_player_set_chapter( LIBVLC_MEDIAINSTANCE->p_mi, i_chapter, &ex );
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -382,7 +382,7 @@ vlcMediaInstance_is_seekable( PyObject *self, PyObject *args )
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_is_seekable( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_is_seekable( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -393,7 +393,7 @@ vlcMediaInstance_can_pause( PyObject *self, PyObject *args )
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_instance_can_pause( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
i_ret = libvlc_media_player_can_pause( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -404,7 +404,7 @@ vlcMediaInstance_play( PyObject *self, PyObject *args )
libvlc_exception_t ex;
LIBVLC_TRY;
libvlc_media_instance_play( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
libvlc_media_player_play( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -416,7 +416,7 @@ vlcMediaInstance_pause( PyObject *self, PyObject *args )
libvlc_exception_t ex;
LIBVLC_TRY;
libvlc_media_instance_pause( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
libvlc_media_player_pause( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -428,7 +428,7 @@ vlcMediaInstance_stop( PyObject *self, PyObject *args )
libvlc_exception_t ex;
LIBVLC_TRY;
libvlc_media_instance_stop( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
libvlc_media_player_stop( LIBVLC_MEDIAINSTANCE->p_mi, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -444,7 +444,7 @@ vlcMediaInstance_set_drawable( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_instance_set_drawable( LIBVLC_MEDIAINSTANCE->p_mi, (libvlc_drawable_t) i_drawable, &ex );
libvlc_media_player_set_drawable( LIBVLC_MEDIAINSTANCE->p_mi, (libvlc_drawable_t) i_drawable, &ex );
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
......@@ -452,7 +452,7 @@ vlcMediaInstance_set_drawable( PyObject *self, PyObject *args )
}
static PyObject *
vlcMediaInstance_set_media_descriptor( PyObject *self, PyObject *args )
vlcMediaInstance_set_media( PyObject *self, PyObject *args )
{
libvlc_exception_t ex;
PyObject* py_param = NULL;
......@@ -462,7 +462,7 @@ vlcMediaInstance_set_media_descriptor( PyObject *self, PyObject *args )
if( PyObject_TypeCheck( py_param, &vlcMediaDescriptor_Type ) == 1 )
{
LIBVLC_TRY;
libvlc_media_instance_set_media_descriptor( LIBVLC_MEDIAINSTANCE->p_mi, ((vlcMediaDescriptor*)py_param)->p_md, &ex );
libvlc_media_player_set_media( LIBVLC_MEDIAINSTANCE->p_mi, ((vlcMediaDescriptor*)py_param)->p_md, &ex );
LIBVLC_EXCEPT;
}
else
......@@ -475,14 +475,14 @@ vlcMediaInstance_set_media_descriptor( PyObject *self, PyObject *args )
}
static PyObject *
vlcMediaInstance_get_media_descriptor( PyObject *self, PyObject *args )
vlcMediaInstance_get_media( PyObject *self, PyObject *args )
{
libvlc_exception_t ex;
libvlc_media_descriptor_t *p_md;
libvlc_media_t *p_md;
vlcMediaDescriptor *p_ret;
LIBVLC_TRY;
p_md = libvlc_media_instance_get_media_descriptor( LIBVLC_MEDIAINSTANCE->p_mi, &ex );
p_md = libvlc_media_player_get_media( LIBVLC_MEDIAINSTANCE->p_mi, &ex );
LIBVLC_EXCEPT;
if( !p_md )
......@@ -596,10 +596,10 @@ static PyMethodDef vlcMediaInstance_methods[] =
{ "get_chapter_count", vlcMediaInstance_get_chapter_count, METH_VARARGS,
"get_chapter_count() -> int Get current chapter count" },
{ "set_mediadescriptor", vlcMediaInstance_set_media_descriptor, METH_VARARGS,
"set_mediadescriptor(vlc.MediaDescriptor) Set the media descriptor that will be used by the media_instance" },
{ "get_mediadescriptor", vlcMediaInstance_get_media_descriptor, METH_VARARGS,
"get_mediadescriptor() -> vlc.MediaDescriptor Get the media descriptor used by the media_instance (if any)." },
{ "set_mediadescriptor", vlcMediaInstance_set_media, METH_VARARGS,
"set_mediadescriptor(vlc.MediaDescriptor) Set the media descriptor that will be used by the media_player" },
{ "get_mediadescriptor", vlcMediaInstance_get_media, METH_VARARGS,
"get_mediadescriptor() -> vlc.MediaDescriptor Get the media descriptor used by the media_player (if any)." },
{ "get_spu", vlcMediaInstance_get_spu, METH_VARARGS,
"get_spu() -> int Get current video subtitle" },
......
......@@ -312,14 +312,14 @@ vlcInstance_playlist_delete_item( PyObject *self, PyObject *args )
}
static PyObject *
vlcInstance_playlist_get_media_instance( PyObject *self, PyObject *args )
vlcInstance_playlist_get_media_player( PyObject *self, PyObject *args )
{
libvlc_exception_t ex;
libvlc_media_instance_t *p_mi;
libvlc_media_player_t *p_mi;
vlcMediaInstance *p_ret;
LIBVLC_TRY;
p_mi = libvlc_playlist_get_media_instance( LIBVLC_INSTANCE->p_instance, &ex );
p_mi = libvlc_playlist_get_media_player( LIBVLC_INSTANCE->p_instance, &ex );
LIBVLC_EXCEPT;
p_ret = PyObject_New( vlcMediaInstance, &vlcMediaInstance_Type );
......@@ -730,10 +730,10 @@ vlcInstance_vlm_show_media( PyObject *self, PyObject *args )
}
static PyObject *
vlcInstance_media_descriptor_new( PyObject *self, PyObject *args )
vlcInstance_media_new( PyObject *self, PyObject *args )
{
libvlc_exception_t ex;
libvlc_media_descriptor_t *p_md;
libvlc_media_t *p_md;
char* psz_mrl = NULL;
vlcMediaDescriptor *p_ret;
......@@ -741,7 +741,7 @@ vlcInstance_media_descriptor_new( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
p_md = libvlc_media_descriptor_new( LIBVLC_INSTANCE->p_instance, psz_mrl, &ex );
p_md = libvlc_media_new( LIBVLC_INSTANCE->p_instance, psz_mrl, &ex );
LIBVLC_EXCEPT;
p_ret = PyObject_New( vlcMediaDescriptor, &vlcMediaDescriptor_Type );
......@@ -777,8 +777,8 @@ static PyMethodDef vlcInstance_methods[] =
"playlist_add(mrl=str, name=str, options=list) -> int Add a new item to the playlist. options is a list of strings."},
{ "playlist_delete_item", vlcInstance_playlist_delete_item, METH_VARARGS,
"playlist_delete_item(id=int) Delete the given item"},
{ "playlist_get_media_instance", vlcInstance_playlist_get_media_instance, METH_VARARGS,
"playlist_get_media_instance() -> object Return the current media instance"},
{ "playlist_get_media_player", vlcInstance_playlist_get_media_player, METH_VARARGS,
"playlist_get_media_player() -> object Return the current media instance"},
{ "video_set_parent", vlcInstance_video_set_parent, METH_VARARGS,
"video_set_parent(xid=int) Set the parent xid/HWND/CGrafPort"},
{ "video_get_parent", vlcInstance_video_get_parent, METH_VARARGS,
......@@ -800,8 +800,8 @@ static PyMethodDef vlcInstance_methods[] =
{ "audio_set_channel", vlcInstance_audio_set_channel, METH_VARARGS,
"audio_set_channel(int) Set current audio channel" },
{ "media_descriptor_new", vlcInstance_media_descriptor_new, METH_VARARGS,
"media_descriptor_new(str) -> object Create a media descriptor with the given mrl."},
{ "media_new", vlcInstance_media_new, METH_VARARGS,
"media_new(str) -> object Create a media descriptor with the given mrl."},
{ "vlm_add_broadcast", vlcInstance_vlm_add_broadcast, METH_VARARGS | METH_KEYWORDS,
"vlm_add_broadcast(name=str, input=str, output=str, options=list, enable=int, loop=int) Add a new broadcast" },
......
......@@ -29,7 +29,7 @@
static void
vlcMediaDescriptor_dealloc( PyObject *self )
{
libvlc_media_descriptor_release( LIBVLC_MEDIADESCRIPTOR->p_md );
libvlc_media_release( LIBVLC_MEDIADESCRIPTOR->p_md );
PyObject_DEL( self );
}
......@@ -43,7 +43,7 @@ vlcMediaDescriptor_add_option( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_descriptor_add_option( LIBVLC_MEDIADESCRIPTOR->p_md, psz_options, &ex);
libvlc_media_add_option( LIBVLC_MEDIADESCRIPTOR->p_md, psz_options, &ex);
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -57,7 +57,7 @@ vlcMediaDescriptor_get_mrl( PyObject *self, PyObject *args )
PyObject * o_ret;
LIBVLC_TRY;
psz_mrl = libvlc_media_descriptor_get_mrl( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
psz_mrl = libvlc_media_get_mrl( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
LIBVLC_EXCEPT;
o_ret = Py_BuildValue( "s", psz_mrl );
......@@ -72,7 +72,7 @@ vlcMediaDescriptor_get_state( PyObject *self, PyObject *args )
libvlc_state_t i_state;
LIBVLC_TRY;
i_state = libvlc_media_descriptor_get_state( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
i_state = libvlc_media_get_state( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
LIBVLC_EXCEPT;
/* FIXME: return the defined state constant */
return Py_BuildValue( "i", i_state );
......@@ -89,7 +89,7 @@ vlcMediaDescriptor_add_tag( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_descriptor_add_tag( LIBVLC_MEDIADESCRIPTOR->p_md, psz_key, ( libvlc_tag_t )psz_tag, &ex );
libvlc_media_add_tag( LIBVLC_MEDIADESCRIPTOR->p_md, psz_key, ( libvlc_tag_t )psz_tag, &ex );
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -106,7 +106,7 @@ vlcMediaDescriptor_remove_tag( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
libvlc_media_descriptor_remove_tag( LIBVLC_MEDIADESCRIPTOR->p_md, psz_key, ( libvlc_tag_t )psz_tag, &ex );
libvlc_media_remove_tag( LIBVLC_MEDIADESCRIPTOR->p_md, psz_key, ( libvlc_tag_t )psz_tag, &ex );
LIBVLC_EXCEPT;
Py_INCREF( Py_None );
return Py_None;
......@@ -123,7 +123,7 @@ vlcMediaDescriptor_tags_count_for_key( PyObject *self, PyObject *args )
return NULL;
LIBVLC_TRY;
i_ret=libvlc_media_descriptor_tags_count_for_key( LIBVLC_MEDIADESCRIPTOR->p_md, psz_tag, &ex );
i_ret=libvlc_media_tags_count_for_key( LIBVLC_MEDIADESCRIPTOR->p_md, psz_tag, &ex );
LIBVLC_EXCEPT;
return Py_BuildValue( "i", i_ret );
}
......@@ -134,20 +134,20 @@ vlcMediaDescriptor_get_duration( PyObject *self, PyObject *args )
libvlc_exception_t ex;
libvlc_time_t i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_descriptor_get_duration( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
i_ret = libvlc_media_get_duration( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "L", i_ret );
}
static PyObject *
vlcMediaDescriptor_media_instance_new( PyObject *self, PyObject *args )
vlcMediaDescriptor_media_player_new( PyObject *self, PyObject *args )
{
libvlc_exception_t ex;
libvlc_media_instance_t *p_mi;
libvlc_media_player_t *p_mi;
vlcMediaInstance *p_ret;
LIBVLC_TRY;
p_mi = libvlc_media_instance_new_from_media_descriptor( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
p_mi = libvlc_media_player_new_from_media( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
LIBVLC_EXCEPT;
p_ret = PyObject_New( vlcMediaInstance, &vlcMediaInstance_Type );
......@@ -162,7 +162,7 @@ vlcMediaDescriptor_is_preparsed( PyObject *self, PyObject *args )
libvlc_exception_t ex;
int i_ret;
LIBVLC_TRY;
i_ret = libvlc_media_descriptor_is_preparsed( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
i_ret = libvlc_media_is_preparsed( LIBVLC_MEDIADESCRIPTOR->p_md, &ex);
LIBVLC_EXCEPT;
return Py_BuildValue( "L", i_ret );
}
......@@ -197,7 +197,7 @@ vlcMediaDescriptor_get_meta( PyObject *self, PyObject *args )
}
LIBVLC_TRY;
psz_ret = libvlc_media_descriptor_get_meta( LIBVLC_MEDIADESCRIPTOR->p_md, i_index, &ex);
psz_ret = libvlc_media_get_meta( LIBVLC_MEDIADESCRIPTOR->p_md, i_index, &ex);
LIBVLC_EXCEPT;
o_ret = Py_BuildValue( "s", psz_ret );
......@@ -221,7 +221,7 @@ static PyMethodDef vlcMediaDescriptor_methods[] =
"tags_count_for_key(str) ." },
{ "get_duration", vlcMediaDescriptor_get_duration, METH_VARARGS,
"get_duration() -> int" },
{ "mediainstance_new", vlcMediaDescriptor_media_instance_new, METH_VARARGS,
{ "mediainstance_new", vlcMediaDescriptor_media_player_new, METH_VARARGS,
"mediainstance_new() -> vlc.MediaInstance Create a Media Instance object from a Media Descriptor" },
{ "is_preparsed", vlcMediaDescriptor_is_preparsed, METH_VARARGS,
"is_preparsed() -> int" },
......
......@@ -118,7 +118,7 @@ typedef struct
typedef struct
{
PyObject_HEAD
libvlc_media_instance_t* p_mi;
libvlc_media_player_t* p_mi;
} vlcMediaInstance;
/**********************************************************************
......@@ -127,7 +127,7 @@ typedef struct
typedef struct
{
PyObject_HEAD
libvlc_media_descriptor_t* p_md;
libvlc_media_t* p_md;
} vlcMediaDescriptor;
/* Forward declarations */
......
......@@ -197,7 +197,7 @@ VLC_DEPRECATED_API int libvlc_playlist_delete_item( libvlc_instance_t *, int,
* \param p_e an initialized exception pointern
* \return a media instance object
*/
VLC_DEPRECATED_API libvlc_media_instance_t * libvlc_playlist_get_media_instance(
VLC_DEPRECATED_API libvlc_media_player_t * libvlc_playlist_get_media_player(
libvlc_instance_t *, libvlc_exception_t * );
/** @}*/
......
This diff is collapsed.
......@@ -92,87 +92,87 @@ typedef struct libvlc_event_t
struct
{
libvlc_meta_t meta_type;
} media_descriptor_meta_changed;
} media_meta_changed;
struct
{
libvlc_media_descriptor_t * new_child;
} media_descriptor_subitem_added;
libvlc_media_t * new_child;
} media_subitem_added;
struct
{
vlc_int64_t new_duration;
} media_descriptor_duration_changed;
} media_duration_changed;
struct
{
int new_status;
} media_descriptor_preparsed_changed;
} media_preparsed_changed;
struct
{
libvlc_media_descriptor_t * md;
} media_descriptor_freed;
libvlc_media_t * md;
} media_freed;
struct
{
libvlc_state_t new_state;
} media_descriptor_state_changed;
} media_state_changed;
/* media instance */
struct
{
float new_position;
} media_instance_position_changed;
} media_player_position_changed;
struct
{
libvlc_time_t new_time;
} media_instance_time_changed;
} media_player_time_changed;
struct
{
libvlc_time_t new_seekable;
} media_instance_seekable_changed;
} media_player_seekable_changed;
struct
{
libvlc_time_t new_pausable;
} media_instance_pausable_changed;
} media_player_pausable_changed;
/* media list */
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_item_added;
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_will_add_item;
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_item_deleted;
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_will_delete_item;
/* media list view */
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_view_item_added;
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_view_will_add_item;
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_view_item_deleted;
struct
{
libvlc_media_descriptor_t * item;
libvlc_media_t * item;
int index;
} media_list_view_will_delete_item;
......
......@@ -61,21 +61,21 @@ VLC_DEPRECATED_API void
libvlc_exception_t * p_e );
VLC_PUBLIC_API void
libvlc_media_list_set_media_descriptor( libvlc_media_list_t *,
libvlc_media_descriptor_t *,
libvlc_media_list_set_media( libvlc_media_list_t *,
libvlc_media_t *,
libvlc_exception_t *);
VLC_PUBLIC_API libvlc_media_descriptor_t *
libvlc_media_list_media_descriptor( libvlc_media_list_t *,
VLC_PUBLIC_API libvlc_media_t *
libvlc_media_list_media( libvlc_media_list_t *,
libvlc_exception_t *);
VLC_PUBLIC_API void
libvlc_media_list_add_media_descriptor( libvlc_media_list_t *,
libvlc_media_descriptor_t *,
libvlc_media_list_add_media( libvlc_media_list_t *,
libvlc_media_t *,
libvlc_exception_t * );
VLC_PUBLIC_API void
libvlc_media_list_insert_media_descriptor( libvlc_media_list_t *,
libvlc_media_descriptor_t *,
libvlc_media_list_insert_media( libvlc_media_list_t *,
libvlc_media_t *,
int,
libvlc_exception_t * );
VLC_PUBLIC_API void
......@@ -86,12 +86,12 @@ VLC_PUBLIC_API int
libvlc_media_list_count( libvlc_media_list_t * p_mlist,
libvlc_exception_t * p_e );
VLC_PUBLIC_API libvlc_media_descriptor_t *
VLC_PUBLIC_API libvlc_media_t *
libvlc_media_list_item_at_index( libvlc_media_list_t *, int,
libvlc_exception_t * );
VLC_PUBLIC_API int
libvlc_media_list_index_of_item( libvlc_media_list_t *,
libvlc_media_descriptor_t *,
libvlc_media_t *,
libvlc_exception_t * );
/* This indicates if this media list is read-only from a user point of view */
......@@ -140,7 +140,7 @@ VLC_PUBLIC_API int
libvlc_media_list_view_count( libvlc_media_list_view_t * p_mlv,
libvlc_exception_t * p_e );
VLC_PUBLIC_API libvlc_media_descriptor_t *
VLC_PUBLIC_API libvlc_media_t *
libvlc_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
int index,
libvlc_exception_t * p_e );
......@@ -152,18 +152,18 @@ VLC_PUBLIC_API libvlc_media_list_view_t *
VLC_PUBLIC_API libvlc_media_list_view_t *
libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
libvlc_exception_t * p_e );
VLC_PUBLIC_API int
libvlc_media_list_view_index_of_item( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
libvlc_exception_t * p_e );
VLC_PUBLIC_API void
libvlc_media_list_view_insert_at_index( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
int index,
libvlc_exception_t * p_e );
......@@ -174,7 +174,7 @@ VLC_PUBLIC_API void
VLC_PUBLIC_API void
libvlc_media_list_view_add_item( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
libvlc_exception_t * p_e );
VLC_PUBLIC_API libvlc_media_list_t *
......@@ -199,9 +199,9 @@ VLC_PUBLIC_API void
libvlc_media_list_player_release( libvlc_media_list_player_t * p_mlp );
VLC_PUBLIC_API void
libvlc_media_list_player_set_media_instance(
libvlc_media_list_player_set_media_player(
libvlc_media_list_player_t * p_mlp,
libvlc_media_instance_t * p_mi,
libvlc_media_player_t * p_mi,
libvlc_exception_t * p_e );
VLC_PUBLIC_API void
......@@ -235,7 +235,7 @@ VLC_PUBLIC_API void
VLC_PUBLIC_API void
libvlc_media_list_player_play_item(
libvlc_media_list_player_t * p_mlp,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
libvlc_exception_t * p_e );
VLC_PUBLIC_API void
......
......@@ -66,7 +66,7 @@ typedef vlc_int64_t libvlc_time_t;
/*****************************************************************************
* Media Descriptor
*****************************************************************************/
/** \defgroup libvlc_media_descriptor libvlc_media_descriptor
/** \defgroup libvlc_media libvlc_media
* \ingroup libvlc
* LibVLC Media Descriptor handling
* @{
......@@ -74,7 +74,7 @@ typedef vlc_int64_t libvlc_time_t;
/* Meta Handling */
/** defgroup libvlc_meta libvlc_meta
* \ingroup libvlc_media_descriptor
* \ingroup libvlc_media
* LibVLC Media Meta
* @{
*/
......@@ -101,7 +101,7 @@ typedef enum libvlc_meta_t {
/**@} */
typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
typedef struct libvlc_media_t libvlc_media_t;
/**@} */
......@@ -109,13 +109,13 @@ typedef struct libvlc_media_descriptor_t libvlc_media_descriptor_t;
/*****************************************************************************
* Media Instance
*****************************************************************************/
/** \defgroup libvlc_media_instance libvlc_media_instance
/** \defgroup libvlc_media_player libvlc_media_player
* \ingroup libvlc
* LibVLC Media Instance handling
* @{
*/
typedef struct libvlc_media_instance_t libvlc_media_instance_t;
typedef struct libvlc_media_player_t libvlc_media_player_t;
typedef enum libvlc_state_t
{
......@@ -197,7 +197,7 @@ typedef struct libvlc_playlist_item_t
* Video
*****************************************************************************/
/** \defgroup libvlc_video libvlc_video
* \ingroup libvlc_media_instance
* \ingroup libvlc_media_player
* LibVLC Video handling
* @{
*/
......
......@@ -183,7 +183,7 @@ VLC_PUBLIC_API void libvlc_vlm_seek_media( libvlc_instance_t *, char *,
VLC_PUBLIC_API char* libvlc_vlm_show_media( libvlc_instance_t *, char *, libvlc_exception_t * );
#define LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( attr, returnType, getType, default)\
returnType libvlc_vlm_get_media_## attr( libvlc_instance_t *, \
returnType libvlc_vlm_get_media_instance_## attr( libvlc_instance_t *, \
char *, int , libvlc_exception_t * );
VLC_PUBLIC_API LIBVLC_VLM_GET_MEDIA_ATTRIBUTE( position, float, Float, -1);
......
......@@ -818,11 +818,11 @@ void VLCPlugin::setTime(int seconds)
setStartTime(_i_time);
if( isRunning() )
{
libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(_p_libvlc, NULL);
libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(_p_libvlc, NULL);
if( NULL != p_md )
{
libvlc_media_instance_set_time(p_md, _i_time, NULL);
libvlc_media_instance_release(p_md);
libvlc_media_player_set_time(p_md, _i_time, NULL);
libvlc_media_player_release(p_md);
}
}
}
......
This diff is collapsed.
......@@ -104,8 +104,8 @@ static inline VLCMediaState LibVLCStateToMediaState( libvlc_state_t state )
*/
static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
{
if( event->u.media_descriptor_meta_changed.meta_type == libvlc_meta_Publisher ||
event->u.media_descriptor_meta_changed.meta_type == libvlc_meta_NowPlaying )
if( event->u.media_meta_changed.meta_type == libvlc_meta_Publisher ||
event->u.media_meta_changed.meta_type == libvlc_meta_NowPlaying )
{
/* Skip those meta. We don't really care about them for now.
* And they occure a lot */
......@@ -114,7 +114,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
[[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(metaChanged:)
withArgumentAsObject:[VLCMedia metaTypeToString:event->u.media_descriptor_meta_changed.meta_type]];
withArgumentAsObject:[VLCMedia metaTypeToString:event->u.media_meta_changed.meta_type]];
[pool release];
}
......@@ -125,7 +125,7 @@ static void HandleMediaMetaChanged(const libvlc_event_t * event, void * self)
// [[VLCEventManager sharedManager] callOnMainThreadObject:self
// withMethod:@selector(setLength:)
// withArgumentAsObject:[VLCTime timeWithNumber:
// [NSNumber numberWithLongLong:event->u.media_descriptor_duration_changed.new_duration]]];
// [NSNumber numberWithLongLong:event->u.media_duration_changed.new_duration]]];
// [pool release];
//}
......@@ -136,7 +136,7 @@ static void HandleMediaStateChanged(const libvlc_event_t * event, void * self)
[[VLCEventManager sharedManager] callOnMainThreadObject:self
withMethod:@selector(setStateAsNumber:)
withArgumentAsObject:[NSNumber numberWithInt:
LibVLCStateToMediaState(event->u.media_descriptor_state_changed.new_state)]];
LibVLCStateToMediaState(event->u.media_state_changed.new_state)]];
[pool release];
}
......@@ -180,7 +180,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
libvlc_exception_t ex;
libvlc_exception_init(&ex);
p_md = libvlc_media_descriptor_new([VLCLibrary sharedInstance],
p_md = libvlc_media_new([VLCLibrary sharedInstance],
[aPath UTF8String],
&ex);
catch_exception(&ex);
......@@ -204,7 +204,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
libvlc_exception_t ex;
libvlc_exception_init(&ex);
p_md = libvlc_media_descriptor_new_as_node([VLCLibrary sharedInstance],
p_md = libvlc_media_new_as_node([VLCLibrary sharedInstance],
[aName UTF8String],
&ex);
catch_exception(&ex);
......@@ -230,7 +230,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
/* We must make sure we won't receive new event after an upcoming dealloc
* We also may receive a -retain in some event callback that may occcur
* Before libvlc_event_detach. So this can't happen in dealloc */
libvlc_event_manager_t * p_em = libvlc_media_descriptor_event_manager(p_md, NULL);
libvlc_event_manager_t * p_em = libvlc_media_event_manager(p_md, NULL);
libvlc_event_detach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, NULL);
// libvlc_event_detach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, NULL);
libvlc_event_detach(p_em, libvlc_MediaDescriptorStateChanged, HandleMediaStateChanged, self, NULL);
......@@ -251,7 +251,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
[subitems release];
[metaDictionary release];
libvlc_media_descriptor_release( p_md );
libvlc_media_release( p_md );
[super dealloc];
}
......@@ -278,7 +278,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
if (!length)
{
// Try figuring out what the length is
long long duration = libvlc_media_descriptor_get_duration( p_md, NULL );
long long duration = libvlc_media_get_duration( p_md, NULL );
if (duration > -1)
{
[self setLength:[VLCTime timeWithNumber:[NSNumber numberWithLongLong:duration]]];
......@@ -311,7 +311,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
- (BOOL)isPreparsed
{
return libvlc_media_descriptor_is_preparsed( p_md, NULL );
return libvlc_media_is_preparsed( p_md, NULL );
}
@synthesize url;
......@@ -338,7 +338,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_descriptor_retain( md );
libvlc_media_retain( md );
p_md = md;
metaDictionary = [[NSMutableDictionary alloc] initWithCapacity:3];
......@@ -354,11 +354,11 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
+ (id)mediaWithMedia:(VLCMedia *)media andLibVLCOptions:(NSDictionary *)options
{
libvlc_media_descriptor_t * p_md;
p_md = libvlc_media_descriptor_duplicate( [media libVLCMediaDescriptor] );
libvlc_media_t * p_md;
p_md = libvlc_media_duplicate( [media libVLCMediaDescriptor] );
for( NSString * key in [options allKeys] )
{
libvlc_media_descriptor_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String], NULL);
libvlc_media_add_option(p_md, [[NSString stringWithFormat:@"%@=#%@", key, [options objectForKey:key]] UTF8String], NULL);
}
return [VLCMedia mediaWithLibVLCMediaDescriptor:p_md];
}
......@@ -432,7 +432,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
artFetched = NO;
char * p_url = libvlc_media_descriptor_get_mrl( p_md, &ex );
char * p_url = libvlc_media_get_mrl( p_md, &ex );
catch_exception( &ex );
url = [[NSURL URLWithString:[NSString stringWithUTF8String:p_url]] retain];
......@@ -440,17 +440,17 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
url = [[NSURL fileURLWithPath:[NSString stringWithUTF8String:p_url]] retain];
free( p_url );
libvlc_media_descriptor_set_user_data( p_md, (void*)self, &ex );
libvlc_media_set_user_data( p_md, (void*)self, &ex );
catch_exception( &ex );
libvlc_event_manager_t * p_em = libvlc_media_descriptor_event_manager( p_md, &ex );
libvlc_event_manager_t * p_em = libvlc_media_event_manager( p_md, &ex );
libvlc_event_attach(p_em, libvlc_MediaDescriptorMetaChanged, HandleMediaMetaChanged, self, &ex);
// libvlc_event_attach(p_em, libvlc_MediaDescriptorDurationChanged, HandleMediaDurationChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaDescriptorStateChanged, HandleMediaStateChanged, self, &ex);
libvlc_event_attach(p_em, libvlc_MediaDescriptorSubItemAdded, HandleMediaSubItemAdded, self, &ex);
catch_exception( &ex );
libvlc_media_list_t * p_mlist = libvlc_media_descriptor_subitems( p_md, NULL );
libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL );
if (!p_mlist)
subitems = nil;
......@@ -460,7 +460,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
libvlc_media_list_release( p_mlist );
}
state = LibVLCStateToMediaState(libvlc_media_descriptor_get_state( p_md, NULL ));
state = LibVLCStateToMediaState(libvlc_media_get_state( p_md, NULL ));
/* Force VLCMetaInformationTitle, that will trigger preparsing
* And all the other meta will be added through the libvlc event system */
......@@ -469,7 +469,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
- (void)fetchMetaInformationFromLibVLCWithType:(NSString *)metaType
{
char * psz_value = libvlc_media_descriptor_get_meta( p_md, [VLCMedia stringToMetaType:metaType], NULL);
char * psz_value = libvlc_media_get_meta( p_md, [VLCMedia stringToMetaType:metaType], NULL);
NSString * newValue = psz_value ? [NSString stringWithUTF8String: psz_value] : nil;
NSString * oldValue = [metaDictionary valueForKey:metaType];
free(psz_value);
......@@ -530,7 +530,7 @@ static void HandleMediaSubItemAdded(const libvlc_event_t * event, void * self)
if( subitems )
return; /* Nothing to do */
libvlc_media_list_t * p_mlist = libvlc_media_descriptor_subitems( p_md, NULL );
libvlc_media_list_t * p_mlist = libvlc_media_subitems( p_md, NULL );
NSAssert( p_mlist, @"The mlist shouldn't be nil, we are receiving a subItemAdded");
......
......@@ -155,7 +155,7 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
// Add it to the libvlc's medialist
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
libvlc_media_list_insert_media_descriptor( p_mlist, [media libVLCMediaDescriptor], index, &p_e );
libvlc_media_list_insert_media( p_mlist, [media libVLCMediaDescriptor], index, &p_e );
catch_exception( &p_e );
}
......@@ -267,9 +267,9 @@ static void HandleMediaListItemDeleted( const libvlc_event_t * event, void * use
int i, count = libvlc_media_list_count( p_mlist, NULL );
for( i = 0; i < count; i++ )
{
libvlc_media_descriptor_t * p_md = libvlc_media_list_item_at_index( p_mlist, i, NULL );
libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_mlist, i, NULL );
[cachedMedia addObject:[VLCMedia mediaWithLibVLCMediaDescriptor:p_md]];
libvlc_media_descriptor_release(p_md);
libvlc_media_release(p_md);
}
[self initInternalMediaList];
libvlc_media_list_unlock(p_mlist);
......
......@@ -157,7 +157,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
{
libvlc_exception_t p_e;
libvlc_exception_init( &p_e );
libvlc_media_descriptor_t * p_md = libvlc_media_list_view_item_at_index( p_mlv, index, &p_e );
libvlc_media_t * p_md = libvlc_media_list_view_item_at_index( p_mlv, index, &p_e );
catch_exception( &p_e );
// Returns local object for media descriptor, searchs for user data first. If not found it creates a
......@@ -248,7 +248,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
int i, count = libvlc_media_list_view_count(p_mlv, NULL);
for( i = 0; i < count; i++ )
{
libvlc_media_descriptor_t * p_md = libvlc_media_list_view_item_at_index(p_mlv, i, NULL);
libvlc_media_t * p_md = libvlc_media_list_view_item_at_index(p_mlv, i, NULL);
libvlc_media_list_view_t * p_sub_mlv = libvlc_media_list_view_children_at_index(p_mlv, i, NULL);
VLCMediaListAspectNode * node = [[[VLCMediaListAspectNode alloc] init] autorelease];
[node setMedia:[VLCMedia mediaWithLibVLCMediaDescriptor: p_md]];
......@@ -256,7 +256,7 @@ static void HandleMediaListViewItemDeleted( const libvlc_event_t * event, void *
if( p_sub_mlv ) NSAssert(![node isLeaf], @"Not leaf");
[cachedNode addObject:node];
libvlc_media_descriptor_release(p_md);
libvlc_media_release(p_md);
if( p_sub_mlv ) libvlc_media_list_view_release(p_sub_mlv);
}
[self initInternalMediaListView];
......
This diff is collapsed.
......@@ -169,11 +169,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
case ID_fullscreen: /* deprecated */
if( argCount == 0 )
{
libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);
if( p_md )
{
libvlc_toggle_fullscreen(p_md, &ex);
libvlc_media_instance_release(p_md);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
......@@ -533,11 +533,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
case ID_get_length: /* deprecated */
if( argCount == 0 )
{
libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);
if( p_md )
{
vlc_int64_t val = libvlc_media_instance_get_length(p_md, &ex);
libvlc_media_instance_release(p_md);
vlc_int64_t val = libvlc_media_player_get_length(p_md, &ex);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
......@@ -565,11 +565,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
case ID_get_position: /* deprecated */
if( argCount == 0 )
{
libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);
if( p_md )
{
float val = libvlc_media_instance_get_position(p_md, &ex);
libvlc_media_instance_release(p_md);
float val = libvlc_media_player_get_position(p_md, &ex);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
......@@ -597,11 +597,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
case ID_get_time: /* deprecated */
if( argCount == 0 )
{
libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);
if( p_md )
{
vlc_int64_t val = libvlc_media_instance_get_time(p_md, &ex);
libvlc_media_instance_release(p_md);
vlc_int64_t val = libvlc_media_player_get_time(p_md, &ex);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
......@@ -631,7 +631,7 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
&& isNumberValue(args[0])
&& NPVARIANT_IS_BOOLEAN(args[1]) )
{
libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);
if( p_md )
{
vlc_int64_t pos = 0;
......@@ -643,10 +643,10 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
if( NPVARIANT_TO_BOOLEAN(args[1]) )
{
/* relative seek */
vlc_int64_t from = libvlc_media_instance_get_time(p_md, &ex);
vlc_int64_t from = libvlc_media_player_get_time(p_md, &ex);
if( libvlc_exception_raised(&ex) )
{
libvlc_media_instance_release(p_md);
libvlc_media_player_release(p_md);
NPN_SetException(this, libvlc_exception_get_message(&ex));
libvlc_exception_clear(&ex);
return INVOKERESULT_GENERIC_ERROR;
......@@ -654,8 +654,8 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
pos += from;
}
/* jump to time */
libvlc_media_instance_set_time(p_md, pos, &ex);
libvlc_media_instance_release(p_md);
libvlc_media_player_set_time(p_md, pos, &ex);
libvlc_media_player_release(p_md);
if( libvlc_exception_raised(&ex) )
{
NPN_SetException(this, libvlc_exception_get_message(&ex));
......
......@@ -549,7 +549,7 @@ void VlcPlugin::hideToolbar()
void VlcPlugin::redrawToolbar()
{
libvlc_media_instance_t *p_md = NULL;
libvlc_media_player_t *p_md = NULL;
libvlc_exception_t ex;
float f_position = 0.0;
int i_playing = 0;
......@@ -565,7 +565,7 @@ void VlcPlugin::redrawToolbar()
/* get media instance */
libvlc_exception_init( &ex );
p_md = libvlc_playlist_get_media_instance( getVLC(), &ex );
p_md = libvlc_playlist_get_media_player( getVLC(), &ex );
libvlc_exception_clear( &ex );
/* get isplaying */
......@@ -582,10 +582,10 @@ void VlcPlugin::redrawToolbar()
if( i_playing == 1 )
{
libvlc_exception_init( &ex );
f_position = libvlc_media_instance_get_position( p_md, &ex ) * 100;
f_position = libvlc_media_player_get_position( p_md, &ex ) * 100;
libvlc_exception_clear( &ex );
}
libvlc_media_instance_release( p_md );
libvlc_media_player_release( p_md );
gcv.foreground = BlackPixel( p_display, 0 );
gc = XCreateGC( p_display, control, GCForeground, &gcv );
......
......@@ -186,12 +186,12 @@ int16 NPP_HandleEvent( NPP instance, void * event )
{
if( libvlc_playlist_isplaying(p_vlc, NULL) )
{
libvlc_media_instance_t *p_md =
libvlc_playlist_get_media_instance(p_vlc, NULL);
libvlc_media_player_t *p_md =
libvlc_playlist_get_media_player(p_vlc, NULL);
if( p_md )
{
libvlc_toggle_fullscreen(p_md, NULL);
libvlc_media_instance_release(p_md);
libvlc_media_player_release(p_md);
}
}
}
......@@ -217,11 +217,11 @@ int16 NPP_HandleEvent( NPP instance, void * event )
{
if( libvlc_playlist_isplaying(p_vlc, NULL) )
{
libvlc_media_instance_t *p_md =
libvlc_playlist_get_media_instance(p_vlc, NULL);
libvlc_media_player_t *p_md =
libvlc_playlist_get_media_player(p_vlc, NULL);
if( p_md )
{
hasVout = libvlc_media_instance_has_vout(p_md,
hasVout = libvlc_media_player_has_vout(p_md,
NULL);
if( hasVout )
{
......@@ -233,7 +233,7 @@ int16 NPP_HandleEvent( NPP instance, void * event )
libvlc_video_redraw_rectangle(p_md, &area,
NULL);
}
libvlc_media_instance_release(p_md);
libvlc_media_player_release(p_md);
}
}
}
......@@ -542,13 +542,13 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
/* callback */
/*
libvlc_media_instance_t *p_md;
libvlc_media_player_t *p_md;
libvlc_exception_t ex;
libvlc_exception_init(& ex );
p_md = libvlc_playlist_get_media_instance( p_plugin->getVLC(), &ex );
p_md = libvlc_playlist_get_media_player( p_plugin->getVLC(), &ex );
libvlc_exception_init( &ex );
libvlc_event_attach( libvlc_media_instance_event_manager( p_md, &ex ),
libvlc_event_attach( libvlc_media_player_event_manager( p_md, &ex ),
libvlc_MediaInstancePositionChanged, Redraw, NULL, &ex );
*/
......@@ -845,8 +845,8 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
{
libvlc_exception_t ex;
libvlc_exception_init( &ex );
libvlc_media_instance_t *p_md =
libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);
libvlc_media_player_t *p_md =
libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);
libvlc_exception_clear( &ex );
/* jump in the movie */
......@@ -857,14 +857,14 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
{
vlc_int64_t f_length;
libvlc_exception_init( &ex );
f_length = libvlc_media_instance_get_length( p_md, &ex ) / 100;
f_length = libvlc_media_player_get_length( p_md, &ex ) / 100;
libvlc_exception_clear( &ex );
f_length = (float)f_length *
( ((float)i_xPos-4 ) / ( ((float)i_width-8)/100) );
libvlc_exception_init( &ex );
libvlc_media_instance_set_time( p_md, f_length, &ex );
libvlc_media_player_set_time( p_md, f_length, &ex );
libvlc_exception_clear( &ex );
}
}
......@@ -917,7 +917,7 @@ static void ControlHandler( Widget w, XtPointer closure, XEvent *event )
libvlc_exception_clear( &ex );
}
if( p_md ) libvlc_media_instance_release( p_md );
if( p_md ) libvlc_media_player_release( p_md );
}
Redraw( w, closure, event );
}
......
......@@ -371,8 +371,8 @@ SOURCES_libvlc_control = \
control/flat_media_list_view.c \
control/hierarchical_media_list_view.c \
control/hierarchical_node_media_list_view.c \
control/media_descriptor.c \
control/media_instance.c \
control/media.c \
control/media_player.c \
control/media_list.c \
control/media_list_path.h \
control/media_list_player.c \
......
......@@ -120,7 +120,7 @@ void libvlc_audio_set_volume( libvlc_instance_t *p_instance, int i_volume,
/*****************************************************************************
* libvlc_audio_get_track_count : Get the number of available audio tracks
*****************************************************************************/
int libvlc_audio_get_track_count( libvlc_media_instance_t *p_mi,
int libvlc_audio_get_track_count( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
......@@ -137,7 +137,7 @@ int libvlc_audio_get_track_count( libvlc_media_instance_t *p_mi,
/*****************************************************************************
* libvlc_audio_get_track : Get the current audio track
*****************************************************************************/
int libvlc_audio_get_track( libvlc_media_instance_t *p_mi,
int libvlc_audio_get_track( libvlc_media_player_t *p_mi,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
......@@ -176,7 +176,7 @@ int libvlc_audio_get_track( libvlc_media_instance_t *p_mi,
/*****************************************************************************
* libvlc_audio_set_track : Set the current audio track
*****************************************************************************/
void libvlc_audio_set_track( libvlc_media_instance_t *p_mi, int i_track,
void libvlc_audio_set_track( libvlc_media_player_t *p_mi, int i_track,
libvlc_exception_t *p_e )
{
input_thread_t *p_input_thread = libvlc_get_input_thread( p_mi, p_e );
......
......@@ -50,8 +50,8 @@ static void
ml_item_added( const libvlc_event_t * p_event, libvlc_media_list_view_t * p_mlv )
{
int index = vlc_array_count( &p_mlv->p_this_view_data->array );
libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_added.item;
libvlc_media_descriptor_retain( p_md );
libvlc_media_t * p_md = p_event->u.media_list_item_added.item;
libvlc_media_retain( p_md );
trace("appending item at index %d\n", index);
libvlc_media_list_view_will_add_item( p_mlv, p_md, index );
......@@ -65,14 +65,14 @@ ml_item_added( const libvlc_event_t * p_event, libvlc_media_list_view_t * p_mlv
static void
ml_item_removed( const libvlc_event_t * p_event, libvlc_media_list_view_t * p_mlv )
{
libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_deleted.item;
libvlc_media_t * p_md = p_event->u.media_list_item_deleted.item;
int i = vlc_array_index_of_item( &p_mlv->p_this_view_data->array, p_md );
if( i >= 0 )
{
libvlc_media_list_view_will_delete_item( p_mlv, p_md, i );
vlc_array_remove( &p_mlv->p_this_view_data->array, i );
libvlc_media_list_view_item_deleted( p_mlv, p_md, i );
libvlc_media_descriptor_release( p_md );
libvlc_media_release( p_md );
}
}
......@@ -92,15 +92,15 @@ flat_media_list_view_count( libvlc_media_list_view_t * p_mlv,
* flat_media_list_view_item_at_index (private)
* (called by flat_media_list_view_item_at_index)
**************************************************************************/
static libvlc_media_descriptor_t *
static libvlc_media_t *
flat_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
int index,
libvlc_exception_t * p_e )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
(void)p_e;
p_md = vlc_array_item_at_index( &p_mlv->p_this_view_data->array, index );
libvlc_media_descriptor_retain( p_md );
libvlc_media_retain( p_md );
return p_md;
}
......@@ -142,11 +142,11 @@ import_mlist_rec( libvlc_media_list_view_t * p_mlv,
count = libvlc_media_list_count( p_mlist, p_e );
for( i = 0; i < count; i++ )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
p_md = libvlc_media_list_item_at_index( p_mlist, i, p_e );
vlc_array_append( &p_mlv->p_this_view_data->array, p_md );
p_submlist = libvlc_media_descriptor_subitems( p_md, p_e );
p_submlist = libvlc_media_subitems( p_md, p_e );
if( p_submlist )
{
libvlc_media_list_lock( p_submlist );
......
......@@ -58,7 +58,7 @@ hierarch_media_list_view_count( libvlc_media_list_view_t * p_mlv,
* flat_media_list_view_item_at_index (private)
* (called by flat_media_list_view_item_at_index)
**************************************************************************/
static libvlc_media_descriptor_t *
static libvlc_media_t *
hierarch_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
int index,
libvlc_exception_t * p_e )
......@@ -75,13 +75,13 @@ hierarch_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
int index,
libvlc_exception_t * p_e )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
libvlc_media_list_view_t * p_ret;
p_md = libvlc_media_list_item_at_index( p_mlv->p_mlist, index, p_e );
if( !p_md ) return NULL;
p_submlist = libvlc_media_descriptor_subitems( p_md, p_e );
libvlc_media_descriptor_release( p_md );
p_submlist = libvlc_media_subitems( p_md, p_e );
libvlc_media_release( p_md );
if( !p_submlist ) return NULL;
p_ret = libvlc_media_list_hierarchical_view( p_submlist, p_e );
libvlc_media_list_release( p_submlist );
......@@ -95,7 +95,7 @@ hierarch_media_list_view_children_at_index( libvlc_media_list_view_t * p_mlv,
static void
media_list_item_added( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index = p_event->u.media_list_item_added.index;
p_md = p_event->u.media_list_item_added.item;
......@@ -104,7 +104,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * user_data )
static void
media_list_will_add_item( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index = p_event->u.media_list_will_add_item.index;
p_md = p_event->u.media_list_will_add_item.item;
......@@ -113,7 +113,7 @@ media_list_will_add_item( const libvlc_event_t * p_event, void * user_data )
static void
media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index = p_event->u.media_list_item_deleted.index;
p_md = p_event->u.media_list_item_deleted.item;
......@@ -122,7 +122,7 @@ media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
static void
media_list_will_delete_item( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index = p_event->u.media_list_will_delete_item.index;
p_md = p_event->u.media_list_will_delete_item.item;
......
......@@ -57,7 +57,7 @@ hierarch_node_media_list_view_count( libvlc_media_list_view_t * p_mlv,
{
/* FIXME: we may want to cache that */
int i, ret, count = libvlc_media_list_count( p_mlv->p_mlist, p_e );
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
ret = 0;
trace("\n");
......@@ -65,9 +65,9 @@ hierarch_node_media_list_view_count( libvlc_media_list_view_t * p_mlv,
{
p_md = libvlc_media_list_item_at_index( p_mlv->p_mlist, i, p_e );
if( !p_md ) continue;
p_submlist = libvlc_media_descriptor_subitems( p_md, p_e );
p_submlist = libvlc_media_subitems( p_md, p_e );
if( !p_submlist ) continue;
libvlc_media_descriptor_release( p_md );
libvlc_media_release( p_md );
libvlc_media_list_release( p_submlist );
ret++;
}
......@@ -78,13 +78,13 @@ hierarch_node_media_list_view_count( libvlc_media_list_view_t * p_mlv,
* flat_media_list_view_item_at_index (private)
* (called by flat_media_list_view_item_at_index)
**************************************************************************/
static libvlc_media_descriptor_t *
static libvlc_media_t *
hierarch_node_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
int index,
libvlc_exception_t * p_e )
{
/* FIXME: we may want to cache that */
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
trace("%d\n", index);
int i, current_index, count = libvlc_media_list_count( p_mlv->p_mlist, p_e );
......@@ -93,13 +93,13 @@ hierarch_node_media_list_view_item_at_index( libvlc_media_list_view_t * p_mlv,
{
p_md = libvlc_media_list_item_at_index( p_mlv->p_mlist, i, p_e );
if( !p_md ) continue;
p_submlist = libvlc_media_descriptor_subitems( p_md, p_e );
p_submlist = libvlc_media_subitems( p_md, p_e );
if( !p_submlist ) continue;
libvlc_media_list_release( p_submlist );
current_index++;
if( current_index == index )
return p_md;
libvlc_media_descriptor_release( p_md );
libvlc_media_release( p_md );
}
libvlc_exception_raise( p_e, "Index out of bound in Media List View" );
......@@ -115,13 +115,13 @@ hierarch_node_media_list_view_children_at_index( libvlc_media_list_view_t * p_ml
int index,
libvlc_exception_t * p_e )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_t * p_submlist;
libvlc_media_list_view_t * p_ret;
p_md = hierarch_node_media_list_view_item_at_index( p_mlv, index, p_e );
if( !p_md ) return NULL;
p_submlist = libvlc_media_descriptor_subitems( p_md, p_e );
libvlc_media_descriptor_release( p_md );
p_submlist = libvlc_media_subitems( p_md, p_e );
libvlc_media_release( p_md );
if( !p_submlist ) return NULL;
p_ret = libvlc_media_list_hierarchical_node_view( p_submlist, p_e );
libvlc_media_list_release( p_submlist );
......@@ -131,9 +131,9 @@ hierarch_node_media_list_view_children_at_index( libvlc_media_list_view_t * p_ml
/* Helper */
static int
index_of_item( libvlc_media_list_view_t * p_mlv, libvlc_media_descriptor_t * p_md )
index_of_item( libvlc_media_list_view_t * p_mlv, libvlc_media_t * p_md )
{
libvlc_media_descriptor_t * p_iter_md;
libvlc_media_t * p_iter_md;
libvlc_media_list_t * p_submlist;
int i, current_index, count = libvlc_media_list_count( p_mlv->p_mlist, NULL );
......@@ -142,10 +142,10 @@ index_of_item( libvlc_media_list_view_t * p_mlv, libvlc_media_descriptor_t * p_m
{
p_iter_md = libvlc_media_list_item_at_index( p_mlv->p_mlist, i, NULL );
if( !p_iter_md ) continue;
p_submlist = libvlc_media_descriptor_subitems( p_iter_md, NULL );
p_submlist = libvlc_media_subitems( p_iter_md, NULL );
if( !p_submlist ) continue;
libvlc_media_list_release( p_submlist );
libvlc_media_descriptor_release( p_iter_md );
libvlc_media_release( p_iter_md );
current_index++;
if( p_md == p_iter_md )
return current_index;
......@@ -154,11 +154,11 @@ index_of_item( libvlc_media_list_view_t * p_mlv, libvlc_media_descriptor_t * p_m
}
static vlc_bool_t
item_is_already_added( libvlc_media_descriptor_t * p_md )
item_is_already_added( libvlc_media_t * p_md )
{
libvlc_media_list_t * p_submlist;
p_submlist = libvlc_media_descriptor_subitems( p_md, NULL );
p_submlist = libvlc_media_subitems( p_md, NULL );
if( !p_submlist ) return VLC_FALSE;
int count = libvlc_media_list_count( p_submlist, NULL );
libvlc_media_list_release( p_submlist );
......@@ -172,7 +172,7 @@ item_is_already_added( libvlc_media_descriptor_t * p_md )
static void
items_subitems_added( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index;
p_md = p_event->p_obj;
......@@ -195,7 +195,7 @@ items_subitems_added( const libvlc_event_t * p_event, void * user_data )
static void
media_list_item_added( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index;
p_md = p_event->u.media_list_item_added.item;
......@@ -210,7 +210,7 @@ media_list_item_added( const libvlc_event_t * p_event, void * user_data )
static void
media_list_will_add_item( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index;
p_md = p_event->u.media_list_will_add_item.item;
......@@ -222,7 +222,7 @@ media_list_will_add_item( const libvlc_event_t * p_event, void * user_data )
static void
media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index;
p_md = p_event->u.media_list_item_deleted.item;
......@@ -236,7 +236,7 @@ media_list_item_deleted( const libvlc_event_t * p_event, void * user_data )
static void
media_list_will_delete_item( const libvlc_event_t * p_event, void * user_data )
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_list_view_t * p_mlv = user_data;
int index;
p_md = p_event->u.media_list_will_delete_item.item;
......
......@@ -77,7 +77,7 @@ struct libvlc_instance_t
struct libvlc_callback_entry_list_t *p_callback_list;
};
struct libvlc_media_descriptor_t
struct libvlc_media_t
{
libvlc_event_manager_t * p_event_manager;
int b_preparsed;
......@@ -96,7 +96,7 @@ struct libvlc_media_list_t
libvlc_instance_t * p_libvlc_instance;
int i_refcount;
vlc_mutex_t object_lock;
libvlc_media_descriptor_t * p_md; /* The media_descriptor from which the
libvlc_media_t * p_md; /* The media from which the
* mlist comes, if any. */
vlc_array_t items;
......@@ -115,7 +115,7 @@ typedef void (*libvlc_media_list_view_release_func_t)( libvlc_media_list_view_t
typedef int (*libvlc_media_list_view_count_func_t)( libvlc_media_list_view_t * p_mlv,
libvlc_exception_t * ) ;
typedef libvlc_media_descriptor_t *
typedef libvlc_media_t *
(*libvlc_media_list_view_item_at_index_func_t)(
libvlc_media_list_view_t * p_mlv,
int index,
......@@ -152,13 +152,13 @@ struct libvlc_media_list_view_t
void (*pf_ml_item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *);
};
struct libvlc_media_instance_t
struct libvlc_media_player_t
{
int i_refcount;
vlc_mutex_t object_lock;
input_thread_t * p_input_thread;
struct libvlc_instance_t * p_libvlc_instance; /* Parent instance */
libvlc_media_descriptor_t * p_md; /* current media descriptor */
libvlc_media_t * p_md; /* current media descriptor */
libvlc_event_manager_t * p_event_manager;
libvlc_drawable_t drawable;
......@@ -172,9 +172,9 @@ struct libvlc_media_list_player_t
int i_refcount;
vlc_mutex_t object_lock;
libvlc_media_list_path_t current_playing_item_path;
libvlc_media_descriptor_t * p_current_playing_item;
libvlc_media_t * p_current_playing_item;
libvlc_media_list_t * p_mlist;
libvlc_media_instance_t * p_mi;
libvlc_media_player_t * p_mi;
};
struct libvlc_media_library_t
......@@ -262,31 +262,31 @@ typedef struct libvlc_event_manager_t
* Other internal functions
***************************************************************************/
VLC_EXPORT (input_thread_t *, libvlc_get_input_thread,
( struct libvlc_media_instance_t *, libvlc_exception_t * ) );
( struct libvlc_media_player_t *, libvlc_exception_t * ) );
/* Media instance */
VLC_EXPORT (libvlc_media_instance_t *, libvlc_media_instance_new_from_input_thread,
VLC_EXPORT (libvlc_media_player_t *, libvlc_media_player_new_from_input_thread,
( struct libvlc_instance_t *, input_thread_t *, libvlc_exception_t * ) );
VLC_EXPORT (void, libvlc_media_instance_destroy,
( libvlc_media_instance_t * ) );
VLC_EXPORT (void, libvlc_media_player_destroy,
( libvlc_media_player_t * ) );
/* Media Descriptor */
VLC_EXPORT (libvlc_media_descriptor_t *, libvlc_media_descriptor_new_from_input_item,
VLC_EXPORT (libvlc_media_t *, libvlc_media_new_from_input_item,
( struct libvlc_instance_t *, input_item_t *, libvlc_exception_t * ) );
VLC_EXPORT (void, libvlc_media_descriptor_set_state,
( libvlc_media_descriptor_t *, libvlc_state_t, libvlc_exception_t * ) );
VLC_EXPORT (void, libvlc_media_set_state,
( libvlc_media_t *, libvlc_state_t, libvlc_exception_t * ) );
/* Media List */
VLC_EXPORT ( void, _libvlc_media_list_add_media_descriptor,
VLC_EXPORT ( void, _libvlc_media_list_add_media,
( libvlc_media_list_t * p_mlist,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
libvlc_exception_t * p_e ) );
VLC_EXPORT ( void, _libvlc_media_list_insert_media_descriptor,
VLC_EXPORT ( void, _libvlc_media_list_insert_media,
( libvlc_media_list_t * p_mlist,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
int index,
libvlc_exception_t * p_e ) );
......@@ -312,16 +312,16 @@ VLC_EXPORT ( void, libvlc_media_list_view_set_ml_notification_callback, (
void (*item_removed)(const libvlc_event_t *, libvlc_media_list_view_t *) ));
VLC_EXPORT ( void, libvlc_media_list_view_will_delete_item, ( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index ));
VLC_EXPORT ( void, libvlc_media_list_view_item_deleted, ( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index ));
VLC_EXPORT ( void, libvlc_media_list_view_will_add_item, ( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index ));
VLC_EXPORT ( void, libvlc_media_list_view_item_added, ( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index ));
/* Events */
......
......@@ -39,11 +39,11 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
{
input_item_t * p_item = p_event->u.services_discovery_item_added.p_new_item;
const char * psz_cat = p_event->u.services_discovery_item_added.psz_category;
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_discoverer_t * p_mdis = user_data;
libvlc_media_list_t * p_mlist = p_mdis->p_mlist;
p_md = libvlc_media_descriptor_new_from_input_item(
p_md = libvlc_media_new_from_input_item(
p_mdis->p_libvlc_instance,
p_item, NULL );
......@@ -56,9 +56,9 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
if( p_mlist == kVLCDictionaryNotFound )
{
libvlc_media_descriptor_t * p_catmd;
p_catmd = libvlc_media_descriptor_new_as_node( p_mdis->p_libvlc_instance, psz_cat, NULL );
p_mlist = libvlc_media_descriptor_subitems( p_catmd, NULL );
libvlc_media_t * p_catmd;
p_catmd = libvlc_media_new_as_node( p_mdis->p_libvlc_instance, psz_cat, NULL );
p_mlist = libvlc_media_subitems( p_catmd, NULL );
p_mlist->b_read_only = VLC_TRUE;
/* Insert the newly created mlist in our dictionary */
......@@ -66,17 +66,17 @@ static void services_discovery_item_added( const vlc_event_t * p_event,
/* Insert the md into the root list */
libvlc_media_list_lock( p_mdis->p_mlist );
_libvlc_media_list_add_media_descriptor( p_mdis->p_mlist, p_catmd, NULL );
_libvlc_media_list_add_media( p_mdis->p_mlist, p_catmd, NULL );
libvlc_media_list_unlock( p_mdis->p_mlist );
/* We don't release the mlist cause the dictionary
* doesn't retain the object. But we release the md. */
libvlc_media_descriptor_release( p_catmd );
libvlc_media_release( p_catmd );
}
}
libvlc_media_list_lock( p_mlist );
_libvlc_media_list_add_media_descriptor( p_mlist, p_md, NULL );
_libvlc_media_list_add_media( p_mlist, p_md, NULL );
libvlc_media_list_unlock( p_mlist );
}
......@@ -88,7 +88,7 @@ static void services_discovery_item_removed( const vlc_event_t * p_event,
void * user_data )
{
input_item_t * p_item = p_event->u.services_discovery_item_added.p_new_item;
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
libvlc_media_discoverer_t * p_mdis = user_data;
int i, count = libvlc_media_list_count( p_mdis->p_mlist, NULL );
......
/*****************************************************************************
* tree.c: libvlc tags tree functions
* Create a tree of the 'tags' of a media_list's media_descriptors.
* Create a tree of the 'tags' of a media_list's medias.
*****************************************************************************
* Copyright (C) 2007 the VideoLAN team
* $Id$
......
This diff is collapsed.
......@@ -97,19 +97,19 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_copy( libvlc_media
* get_path_rec (Media List Player Internal)
**************************************************************************/
static libvlc_media_list_path_t
get_path_rec( libvlc_media_list_path_t path, libvlc_media_list_t * p_current_mlist, libvlc_media_descriptor_t * p_searched_md )
get_path_rec( libvlc_media_list_path_t path, libvlc_media_list_t * p_current_mlist, libvlc_media_t * p_searched_md )
{
int i, count;
count = libvlc_media_list_count( p_current_mlist, NULL );
for( i = 0; i < count; i++ )
{
libvlc_media_descriptor_t * p_md = libvlc_media_list_item_at_index( p_current_mlist, i, NULL );
libvlc_media_t * p_md = libvlc_media_list_item_at_index( p_current_mlist, i, NULL );
if( p_md == p_searched_md )
return libvlc_media_list_path_copy_by_appending( path, i ); /* Found! */
libvlc_media_list_t * p_subitems = libvlc_media_descriptor_subitems( p_md, NULL );
libvlc_media_descriptor_release( p_md );
libvlc_media_list_t * p_subitems = libvlc_media_subitems( p_md, NULL );
libvlc_media_release( p_md );
if( p_subitems )
{
libvlc_media_list_path_t new_path = libvlc_media_list_path_copy_by_appending( path, i );
......@@ -128,7 +128,7 @@ get_path_rec( libvlc_media_list_path_t path, libvlc_media_list_t * p_current_mli
/**************************************************************************
* path_of_item (Media List Player Internal)
**************************************************************************/
static inline libvlc_media_list_path_t libvlc_media_list_path_of_item( libvlc_media_list_t * p_mlist, libvlc_media_descriptor_t * p_md )
static inline libvlc_media_list_path_t libvlc_media_list_path_of_item( libvlc_media_list_t * p_mlist, libvlc_media_t * p_md )
{
libvlc_media_list_path_t path = libvlc_media_list_path_empty();
libvlc_media_list_path_t ret;
......@@ -140,11 +140,11 @@ static inline libvlc_media_list_path_t libvlc_media_list_path_of_item( libvlc_me
/**************************************************************************
* item_at_path (Media List Player Internal)
**************************************************************************/
static libvlc_media_descriptor_t *
static libvlc_media_t *
libvlc_media_list_item_at_path( libvlc_media_list_t * p_mlist, libvlc_media_list_path_t path )
{
libvlc_media_list_t * p_current_mlist = p_mlist;
libvlc_media_descriptor_t * p_md = NULL;
libvlc_media_t * p_md = NULL;
int i;
for( i = 0; path[i] != -1; i++ )
{
......@@ -156,8 +156,8 @@ libvlc_media_list_item_at_path( libvlc_media_list_t * p_mlist, libvlc_media_list
if( path[i+1] == -1 )
return p_md;
p_current_mlist = libvlc_media_descriptor_subitems( p_md, NULL );
libvlc_media_descriptor_release( p_md );
p_current_mlist = libvlc_media_subitems( p_md, NULL );
libvlc_media_release( p_md );
if( !p_current_mlist )
return NULL;
......@@ -177,7 +177,7 @@ static libvlc_media_list_t *
libvlc_media_list_parentlist_at_path( libvlc_media_list_t * p_mlist, libvlc_media_list_path_t path )
{
libvlc_media_list_t * p_current_mlist = p_mlist;
libvlc_media_descriptor_t * p_md = NULL;
libvlc_media_t * p_md = NULL;
int i;
for( i = 0; path[i] != -1; i++ )
{
......@@ -189,8 +189,8 @@ libvlc_media_list_parentlist_at_path( libvlc_media_list_t * p_mlist, libvlc_medi
p_md = libvlc_media_list_item_at_index( p_current_mlist, path[i], NULL );
p_current_mlist = libvlc_media_descriptor_subitems( p_md, NULL );
libvlc_media_descriptor_release( p_md );
p_current_mlist = libvlc_media_subitems( p_md, NULL );
libvlc_media_release( p_md );
if( !p_current_mlist )
return NULL;
......@@ -210,12 +210,12 @@ static libvlc_media_list_t *
libvlc_media_list_sublist_at_path( libvlc_media_list_t * p_mlist, libvlc_media_list_path_t path )
{
libvlc_media_list_t * ret;
libvlc_media_descriptor_t * p_md = libvlc_media_list_item_at_path( p_mlist, path );
libvlc_media_t * p_md = libvlc_media_list_item_at_path( p_mlist, path );
if( !p_md )
return NULL;
ret = libvlc_media_descriptor_subitems( p_md, NULL );
libvlc_media_descriptor_release( p_md );
ret = libvlc_media_subitems( p_md, NULL );
libvlc_media_release( p_md );
return ret;
}
......
This diff is collapsed.
......@@ -47,17 +47,17 @@ media_list_subitem_added( const libvlc_event_t * p_event, void * p_user_data );
static void
install_md_listener( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md)
libvlc_media_t * p_md)
{
libvlc_media_list_t * p_mlist;
if((p_mlist = libvlc_media_descriptor_subitems( p_md, NULL )))
if((p_mlist = libvlc_media_subitems( p_md, NULL )))
{
libvlc_media_list_lock( p_mlist );
int i, count = libvlc_media_list_count( p_mlist, NULL );
for( i = 0; i < count; i++)
{
libvlc_event_t added_event;
libvlc_media_descriptor_t * p_submd;
libvlc_media_t * p_submd;
p_submd = libvlc_media_list_item_at_index( p_mlist, i, NULL );
/* Install our listeners */
......@@ -67,7 +67,7 @@ install_md_listener( libvlc_media_list_view_t * p_mlv,
added_event.u.media_list_item_added.item = p_submd;
added_event.u.media_list_item_added.index = 0;
if( p_mlv->pf_ml_item_added ) p_mlv->pf_ml_item_added( &added_event, p_mlv );
libvlc_media_descriptor_release( p_submd );
libvlc_media_release( p_submd );
}
libvlc_event_attach( p_mlist->p_event_manager,
libvlc_MediaListItemAdded,
......@@ -89,7 +89,7 @@ install_md_listener( libvlc_media_list_view_t * p_mlv,
static void
uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md)
libvlc_media_t * p_md)
{
libvlc_media_list_t * p_mlist;
libvlc_exception_t ignored_exception;
......@@ -99,7 +99,7 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
media_list_subitem_added, p_mlv, &ignored_exception );
if( libvlc_exception_raised( &ignored_exception ) )
libvlc_exception_clear( &ignored_exception ); /* We don't care if we encounter an exception */
if((p_mlist = libvlc_media_descriptor_subitems( p_md, NULL )))
if((p_mlist = libvlc_media_subitems( p_md, NULL )))
{
libvlc_media_list_lock( p_mlist );
libvlc_event_detach( p_mlist->p_event_manager,
......@@ -112,10 +112,10 @@ uninstall_md_listener( libvlc_media_list_view_t * p_mlv,
int i, count = libvlc_media_list_count( p_mlist, NULL );
for( i = 0; i < count; i++)
{
libvlc_media_descriptor_t * p_submd;
libvlc_media_t * p_submd;
p_submd = libvlc_media_list_item_at_index( p_mlist,i, NULL );
uninstall_md_listener( p_mlv, p_submd );
libvlc_media_descriptor_release( p_submd );
libvlc_media_release( p_submd );
}
libvlc_media_list_unlock( p_mlist );
libvlc_media_list_release( p_mlist );
......@@ -126,7 +126,7 @@ static void
media_list_item_added( const libvlc_event_t * p_event, void * p_user_data )
{
libvlc_media_list_view_t * p_mlv = p_user_data;
libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_added.item;
libvlc_media_t * p_md = p_event->u.media_list_item_added.item;
install_md_listener( p_mlv, p_md );
if( p_mlv->pf_ml_item_added ) p_mlv->pf_ml_item_added( p_event, p_mlv );
}
......@@ -135,7 +135,7 @@ static void
media_list_item_removed( const libvlc_event_t * p_event, void * p_user_data )
{
libvlc_media_list_view_t * p_mlv = p_user_data;
libvlc_media_descriptor_t * p_md = p_event->u.media_list_item_added.item;
libvlc_media_t * p_md = p_event->u.media_list_item_added.item;
uninstall_md_listener( p_mlv, p_md );
if( p_mlv->pf_ml_item_removed ) p_mlv->pf_ml_item_removed( p_event, p_mlv );
}
......@@ -146,10 +146,10 @@ media_list_subitem_added( const libvlc_event_t * p_event, void * p_user_data )
libvlc_media_list_t * p_mlist;
libvlc_event_t added_event;
libvlc_media_list_view_t * p_mlv = p_user_data;
libvlc_media_descriptor_t * p_submd = p_event->u.media_descriptor_subitem_added.new_child;
libvlc_media_descriptor_t * p_md = p_event->p_obj;
libvlc_media_t * p_submd = p_event->u.media_subitem_added.new_child;
libvlc_media_t * p_md = p_event->p_obj;
if((p_mlist = libvlc_media_descriptor_subitems( p_md, NULL )))
if((p_mlist = libvlc_media_subitems( p_md, NULL )))
{
/* We have a mlist to which we're going to listen to events
* thus, no need to wait for SubItemAdded events */
......@@ -199,10 +199,10 @@ libvlc_media_list_view_set_ml_notification_callback(
int i, count = libvlc_media_list_count( p_mlv->p_mlist, NULL );
for( i = 0; i < count; i++)
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
p_md = libvlc_media_list_item_at_index( p_mlv->p_mlist, i, NULL );
install_md_listener( p_mlv, p_md );
libvlc_media_descriptor_release( p_md );
libvlc_media_release( p_md );
}
}
......@@ -212,7 +212,7 @@ libvlc_media_list_view_set_ml_notification_callback(
void
libvlc_media_list_view_will_delete_item(
libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index )
{
libvlc_event_t event;
......@@ -232,7 +232,7 @@ libvlc_media_list_view_will_delete_item(
void
libvlc_media_list_view_item_deleted(
libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index )
{
libvlc_event_t event;
......@@ -252,7 +252,7 @@ libvlc_media_list_view_item_deleted(
void
libvlc_media_list_view_will_add_item(
libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index )
{
libvlc_event_t event;
......@@ -272,7 +272,7 @@ libvlc_media_list_view_will_add_item(
void
libvlc_media_list_view_item_added(
libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_item,
libvlc_media_t * p_item,
int index )
{
libvlc_event_t event;
......@@ -383,10 +383,10 @@ libvlc_media_list_view_release( libvlc_media_list_view_t * p_mlv )
int i, count = libvlc_media_list_count( p_mlv->p_mlist, NULL );
for( i = 0; i < count; i++)
{
libvlc_media_descriptor_t * p_md;
libvlc_media_t * p_md;
p_md = libvlc_media_list_item_at_index( p_mlv->p_mlist, i, NULL );
uninstall_md_listener( p_mlv, p_md );
libvlc_media_descriptor_release( p_md );
libvlc_media_release( p_md );
}
libvlc_media_list_unlock( p_mlv->p_mlist );
......@@ -431,14 +431,14 @@ libvlc_media_list_view_parent_media_list( libvlc_media_list_view_t * p_mlv,
**************************************************************************/
libvlc_media_list_view_t *
libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
libvlc_media_descriptor_t * p_md,
libvlc_media_t * p_md,
libvlc_exception_t * p_e)
{
(void)p_e;
libvlc_media_list_t * p_mlist;
libvlc_media_list_view_t * ret;
p_mlist = libvlc_media_descriptor_subitems(p_md, p_e);
p_mlist = libvlc_media_subitems(p_md, p_e);
if(!p_mlist) return NULL;
ret = p_mlv->pf_constructor( p_mlist, p_e );
......@@ -484,6 +484,6 @@ libvlc_media_list_view_children_for_item( libvlc_media_list_view_t * p_mlv,
MEDIA_LIST_VIEW_FUNCTION( count, int, 0 )
MEDIA_LIST_VIEW_FUNCTION( item_at_index, libvlc_media_descriptor_t *, NULL, int arg1 )
MEDIA_LIST_VIEW_FUNCTION( item_at_index, libvlc_media_t *, NULL, int arg1 )
MEDIA_LIST_VIEW_FUNCTION( children_at_index, libvlc_media_list_view_t *, NULL, int arg1 )
......@@ -288,17 +288,17 @@ mediacontrol_get_rate( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
libvlc_exception_t ex;
libvlc_media_instance_t* p_mi;
libvlc_media_player_t* p_mi;
int i_ret;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
p_mi = libvlc_playlist_get_media_instance( self->p_instance, &ex );
p_mi = libvlc_playlist_get_media_player( self->p_instance, &ex );
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
i_ret = libvlc_media_instance_get_rate( p_mi, &ex );
libvlc_media_instance_release( p_mi );
i_ret = libvlc_media_player_get_rate( p_mi, &ex );
libvlc_media_player_release( p_mi );
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
return i_ret / 10;
......@@ -310,16 +310,16 @@ mediacontrol_set_rate( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
libvlc_exception_t ex;
libvlc_media_instance_t* p_mi;
libvlc_media_player_t* p_mi;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
p_mi = libvlc_playlist_get_media_instance( self->p_instance, &ex );
p_mi = libvlc_playlist_get_media_player( self->p_instance, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_media_instance_set_rate( p_mi, rate * 10, &ex );
libvlc_media_instance_release( p_mi );
libvlc_media_player_set_rate( p_mi, rate * 10, &ex );
libvlc_media_player_release( p_mi );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
}
......@@ -328,17 +328,17 @@ mediacontrol_get_fullscreen( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
libvlc_exception_t ex;
libvlc_media_instance_t* p_mi;
libvlc_media_player_t* p_mi;
int i_ret;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
p_mi = libvlc_playlist_get_media_instance( self->p_instance, &ex );
p_mi = libvlc_playlist_get_media_player( self->p_instance, &ex );
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
i_ret = libvlc_get_fullscreen( p_mi, &ex );
libvlc_media_instance_release( p_mi );
libvlc_media_player_release( p_mi );
HANDLE_LIBVLC_EXCEPTION_ZERO( &ex );
return i_ret;
......@@ -350,15 +350,15 @@ mediacontrol_set_fullscreen( mediacontrol_Instance *self,
mediacontrol_Exception *exception )
{
libvlc_exception_t ex;
libvlc_media_instance_t* p_mi;
libvlc_media_player_t* p_mi;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
p_mi = libvlc_playlist_get_media_instance( self->p_instance, &ex );
p_mi = libvlc_playlist_get_media_player( self->p_instance, &ex );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
libvlc_set_fullscreen( p_mi, b_fullscreen, &ex );
libvlc_media_instance_release( p_mi );
libvlc_media_player_release( p_mi );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
}
......@@ -113,7 +113,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
mediacontrol_Position* retval = NULL;
libvlc_exception_t ex;
vlc_int64_t pos;
libvlc_media_instance_t * p_mi;
libvlc_media_player_t * p_mi;
mediacontrol_exception_init( exception );
libvlc_exception_init( &ex );
......@@ -122,19 +122,19 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
retval->origin = an_origin;
retval->key = a_key;
p_mi = libvlc_playlist_get_media_instance( self->p_instance, &ex);
p_mi = libvlc_playlist_get_media_player( self->p_instance, &ex);
HANDLE_LIBVLC_EXCEPTION_NULL( &ex );
if( an_origin != mediacontrol_AbsolutePosition )
{
libvlc_media_instance_release( p_mi );
libvlc_media_player_release( p_mi );
/* Relative or ModuloPosition make no sense */
RAISE_NULL( mediacontrol_PositionOriginNotSupported,
"Only absolute position is valid." );
}
/* We are asked for an AbsolutePosition. */
pos = libvlc_media_instance_get_time( p_mi, &ex );
pos = libvlc_media_player_get_time( p_mi, &ex );
if( a_key == mediacontrol_MediaTime )
{
......@@ -144,7 +144,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
{
if( ! self->p_playlist->p_input )
{
libvlc_media_instance_release( p_mi );
libvlc_media_player_release( p_mi );
RAISE_NULL( mediacontrol_InternalException,
"No input" );
}
......@@ -153,7 +153,7 @@ mediacontrol_get_media_position( mediacontrol_Instance *self,
a_key,
pos );
}
libvlc_media_instance_release( p_mi );
libvlc_media_player_release( p_mi );
return retval;
}
......@@ -163,19 +163,19 @@ mediacontrol_set_media_position( mediacontrol_Instance *self,
const mediacontrol_Position * a_position,
mediacontrol_Exception *exception )
{
libvlc_media_instance_t * p_mi;
libvlc_media_player_t * p_mi;
libvlc_exception_t ex;
vlc_int64_t i_pos;
libvlc_exception_init( &ex );
mediacontrol_exception_init( exception );
p_mi = libvlc_playlist_get_media_instance( self->p_instance, &ex);
p_mi = libvlc_playlist_get_media_player( self->p_instance, &ex);
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
i_pos = private_mediacontrol_position2microsecond( self->p_playlist->p_input, a_position );
libvlc_media_instance_set_time( p_mi, i_pos / 1000, &ex );
libvlc_media_instance_release( p_mi );
libvlc_media_player_set_time( p_mi, i_pos / 1000, &ex );
libvlc_media_player_release( p_mi );
HANDLE_LIBVLC_EXCEPTION_VOID( &ex );
}
......
......@@ -222,17 +222,17 @@ void libvlc_playlist_unlock( libvlc_instance_t *p_instance )
vlc_mutex_unlock( &PL->object_lock );
}
libvlc_media_instance_t * libvlc_playlist_get_media_instance(
libvlc_media_player_t * libvlc_playlist_get_media_player(
libvlc_instance_t *p_instance,
libvlc_exception_t *p_e )
{
libvlc_media_instance_t *p_mi;
libvlc_media_player_t *p_mi;
assert( PL );
vlc_mutex_lock( &PL->object_lock );
if( PL->p_input )
{
p_mi = libvlc_media_instance_new_from_input_thread(
p_mi = libvlc_media_player_new_from_input_thread(
p_instance, PL->p_input, p_e );
}
else
......
This diff is collapsed.
This diff is collapsed.
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