libvlc: rename libvlc_media_descriptor to libvlc_media and libvlc_media_instance...
authorPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 30 Mar 2008 01:59:32 +0000 (03:59 +0200)
committerPierre d'Herbemont <pdherbemont@videolan.org>
Sun, 30 Mar 2008 02:02:57 +0000 (04:02 +0200)
54 files changed:
bindings/cil/src/libvlc.cs
bindings/java/core/src/main/java/org/videolan/jvlc/MediaDescriptor.java
bindings/java/core/src/main/java/org/videolan/jvlc/MediaInstance.java
bindings/java/core/src/main/java/org/videolan/jvlc/MediaList.java
bindings/java/core/src/main/java/org/videolan/jvlc/MediaListPlayer.java
bindings/java/core/src/main/java/org/videolan/jvlc/Playlist.java
bindings/java/core/src/main/java/org/videolan/jvlc/event/MediaInstanceCallback.java
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlc.java
bindings/java/core/src/main/java/org/videolan/jvlc/internal/LibVlcImpl.java
bindings/java/core/src/test/java/org/videolan/jvlc/internal/LibVlcMediaInstanceTest.java
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaDescriptorTest.java
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListPlayerTest.java
bindings/java/core/src/test/java/org/videolan/jvlc/internal/MediaListTest.java
bindings/python/vlc_input.c
bindings/python/vlc_instance.c
bindings/python/vlc_mediadescriptor.c
bindings/python/vlcglue.h
include/vlc/deprecated.h
include/vlc/libvlc.h
include/vlc/libvlc_events.h
include/vlc/libvlc_media_list.h
include/vlc/libvlc_structures.h
include/vlc/libvlc_vlm.h
projects/activex/plugin.cpp
projects/activex/vlccontrol2.cpp
projects/macosx/framework/Sources/VLCMedia.m
projects/macosx/framework/Sources/VLCMediaList.m
projects/macosx/framework/Sources/VLCMediaListAspect.m
projects/macosx/framework/Sources/VLCMediaPlayer.m
projects/mozilla/control/npolibvlc.cpp
projects/mozilla/control/npovlc.cpp
projects/mozilla/vlcplugin.cpp
projects/mozilla/vlcshell.cpp
src/Makefile.am
src/control/audio.c
src/control/flat_media_list_view.c
src/control/hierarchical_media_list_view.c
src/control/hierarchical_node_media_list_view.c
src/control/libvlc_internal.h
src/control/media.c [new file with mode: 0644]
src/control/media_descriptor.c [deleted file]
src/control/media_discoverer.c
src/control/media_instance.c [deleted file]
src/control/media_library.c
src/control/media_list.c
src/control/media_list_path.h
src/control/media_list_player.c
src/control/media_list_view.c
src/control/media_player.c [new file with mode: 0644]
src/control/mediacontrol_audio_video.c
src/control/mediacontrol_core.c
src/control/playlist.c
src/control/testapi.c
src/control/video.c

index 662ba66..afb6281 100644 (file)
@@ -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 ()
index 961d8d9..7e863d3 100644 (file)
@@ -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();
     }
 
index d2ceee9..a802366 100644 (file)
@@ -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();
     }
 
index 49c1b72..e6fe0eb 100644 (file)
@@ -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);
     }
 
     /**
index 091e0f1..565de72 100644 (file)
@@ -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);        
     }
 
     /**
index 140dc36..2fc7367 100644 (file)
@@ -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);
         
     }
index c5f5329..ab1aa0e 100644 (file)
@@ -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
index b8d2015..a6a7761 100644 (file)
@@ -62,37 +62,37 @@ public interface LibVlc extends Library
 
     }
 
-    public class media_descriptor_meta_changed extends Structure
+    public class media_meta_changed extends Structure
     {
 
         public Pointer meta_type;
     }
 
-    public class media_descriptor_subitem_added extends Structure
+    public class media_subitem_added extends Structure
     {
 
         public LibVlcMediaDescriptor new_child;
     }
 
-    public class media_descriptor_duration_changed extends Structure
+    public class media_duration_changed extends Structure
     {
 
         public NativeLong new_duration;
     }
 
-    public class media_descriptor_preparsed_changed extends Structure
+    public class media_preparsed_changed extends Structure
     {
 
         public int new_status;
     }
 
-    public class media_descriptor_freed extends Structure
+    public class media_freed extends Structure
     {
 
         public LibVlcMediaDescriptor md;
     }
 
-    public class media_descriptor_state_changed extends Structure
+    public class media_state_changed extends Structure
     {
 
         // @todo: check this one
@@ -101,13 +101,13 @@ public interface LibVlc extends Library
 
     /* media instance */
 
-    public class media_instance_position_changed extends Structure
+    public class media_player_position_changed extends Structure
     {
 
         public float new_position;
     }
 
-    public class media_instance_time_changed extends Structure
+    public class media_player_time_changed extends Structure
     {
 
         // @todo: check this one
@@ -195,14 +195,14 @@ public interface LibVlc extends Library
 
     public class event_type_specific extends Union
     {
-        public media_descriptor_meta_changed media_descriptor_meta_changed;
-        public media_descriptor_subitem_added media_descriptor_subitem_added;
-        public media_descriptor_duration_changed media_descriptor_duration_changed;
-        public media_descriptor_preparsed_changed media_descriptor_preparsed_changed;
-        public media_descriptor_freed media_descriptor_freed;
-        public media_descriptor_state_changed media_descriptor_state_changed;
-        public media_instance_position_changed media_instance_position_changed;
-        public media_instance_time_changed media_instance_time_changed;
+        public media_meta_changed media_meta_changed;
+        public media_subitem_added media_subitem_added;
+        public media_duration_changed media_duration_changed;
+        public media_preparsed_changed media_preparsed_changed;
+        public media_freed media_freed;
+        public media_state_changed media_state_changed;
+        public media_player_position_changed media_player_position_changed;
+        public media_player_time_changed media_player_time_changed;
         public media_list_item_added media_list_item_added;
         public media_list_will_add_item media_list_will_add_item;
         public media_list_item_deleted media_list_item_deleted;
@@ -337,66 +337,66 @@ public interface LibVlc extends Library
 
     int libvlc_playlist_delete_item(LibVlcInstance instance, int itemIndex, libvlc_exception_t exception);
 
-    LibVlcMediaInstance libvlc_playlist_get_media_instance(LibVlcInstance instance, libvlc_exception_t exception);
+    LibVlcMediaInstance libvlc_playlist_get_media_player(LibVlcInstance instance, libvlc_exception_t exception);
 
-    int libvlc_media_instance_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    int libvlc_media_player_is_seekable(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
-    int libvlc_media_instance_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    int libvlc_media_player_can_pause(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
     // media descriptor
 
-    LibVlcMediaDescriptor libvlc_media_descriptor_new(LibVlcInstance libvlc_instance, String mrl,
+    LibVlcMediaDescriptor libvlc_media_new(LibVlcInstance libvlc_instance, String mrl,
         libvlc_exception_t exception);
 
-    void libvlc_media_descriptor_add_option(LibVlcMediaDescriptor media_descriptor, String option,
+    void libvlc_media_add_option(LibVlcMediaDescriptor media, String option,
         libvlc_exception_t exception);
 
-    String libvlc_media_descriptor_get_mrl(LibVlcMediaDescriptor media_descriptor);
+    String libvlc_media_get_mrl(LibVlcMediaDescriptor media);
 
-    void libvlc_media_descriptor_release(LibVlcMediaDescriptor media_descriptor);
+    void libvlc_media_release(LibVlcMediaDescriptor media);
 
-    LibVlcEventManager libvlc_media_descriptor_event_manager(LibVlcMediaDescriptor media_descriptor,
+    LibVlcEventManager libvlc_media_event_manager(LibVlcMediaDescriptor media,
         libvlc_exception_t exception);
 
     // media instance
 
-    LibVlcMediaInstance libvlc_media_instance_new(LibVlcInstance instance, libvlc_exception_t exception);
+    LibVlcMediaInstance libvlc_media_player_new(LibVlcInstance instance, libvlc_exception_t exception);
 
-    LibVlcMediaInstance libvlc_media_instance_new_from_media_descriptor(LibVlcMediaDescriptor media_descriptor,
+    LibVlcMediaInstance libvlc_media_player_new_from_media(LibVlcMediaDescriptor media,
         libvlc_exception_t exception);
 
-    void libvlc_media_instance_play(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
+    void libvlc_media_player_play(LibVlcMediaInstance media_player, libvlc_exception_t exception);
 
-    void libvlc_media_instance_pause(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
+    void libvlc_media_player_pause(LibVlcMediaInstance media_player, libvlc_exception_t exception);
 
-    void libvlc_media_instance_stop(LibVlcMediaInstance media_instance, libvlc_exception_t exception);
+    void libvlc_media_player_stop(LibVlcMediaInstance media_player, libvlc_exception_t exception);
 
-    void libvlc_media_instance_set_drawable(LibVlcMediaInstance libvlc_media_instance, long drawable,
+    void libvlc_media_player_set_drawable(LibVlcMediaInstance libvlc_media_player, long drawable,
         libvlc_exception_t exception);
 
-    long libvlc_media_instance_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    long libvlc_media_player_get_length(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
-    long libvlc_media_instance_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    long libvlc_media_player_get_time(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
-    void libvlc_media_instance_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
+    void libvlc_media_player_set_time(LibVlcMediaInstance instance, long time, libvlc_exception_t exception);
 
-    float libvlc_media_instance_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    float libvlc_media_player_get_position(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
-    void libvlc_media_instance_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
+    void libvlc_media_player_set_position(LibVlcMediaInstance instance, float position, libvlc_exception_t exception);
 
-    int libvlc_media_instance_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    int libvlc_media_player_will_play(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
-    void libvlc_media_instance_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
+    void libvlc_media_player_set_rate(LibVlcMediaInstance instance, float rate, libvlc_exception_t exception);
 
-    float libvlc_media_instance_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
+    float libvlc_media_player_get_rate(LibVlcMediaInstance instance, libvlc_exception_t exception);
 
-    int libvlc_media_instance_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
+    int libvlc_media_player_has_vout(LibVlcMediaInstance instance2, libvlc_exception_t exception);
 
-    float libvlc_media_instance_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
+    float libvlc_media_player_get_fps(LibVlcMediaInstance instance2, libvlc_exception_t exception);
 
-    void libvlc_media_instance_release(LibVlcMediaInstance instance);
+    void libvlc_media_player_release(LibVlcMediaInstance instance);
 
-    LibVlcEventManager libvlc_media_instance_event_manager(LibVlcMediaInstance media_instance,
+    LibVlcEventManager libvlc_media_player_event_manager(LibVlcMediaInstance media_player,
         libvlc_exception_t exception);
 
     // media list
@@ -408,17 +408,17 @@ public interface LibVlc extends Library
     void libvlc_media_list_add_file_content(LibVlcMediaList libvlc_media_list, String fileName,
         libvlc_exception_t exception);
 
-    void libvlc_media_list_set_media_descriptor(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+    void libvlc_media_list_set_media(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
 
-    LibVlcMediaDescriptor libvlc_media_list_media_descriptor(LibVlcMediaList libvlc_media_list,
+    LibVlcMediaDescriptor libvlc_media_list_media(LibVlcMediaList libvlc_media_list,
         libvlc_exception_t exception);
 
-    void libvlc_media_list_add_media_descriptor(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+    void libvlc_media_list_add_media(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
 
-    void libvlc_media_list_insert_media_descriptor(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, int position, libvlc_exception_t exception);
+    void libvlc_media_list_insert_media(LibVlcMediaList libvlc_media_list,
+        LibVlcMediaDescriptor libvlc_media, int position, libvlc_exception_t exception);
 
     void libvlc_media_list_remove_index(LibVlcMediaList libvlc_media_list, int position, libvlc_exception_t exception);
 
@@ -428,7 +428,7 @@ public interface LibVlc extends Library
         libvlc_exception_t exception);
 
     int libvlc_media_list_index_of_item(LibVlcMediaList libvlc_media_list,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+        LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
 
     int libvlc_media_list_is_readonly(LibVlcMediaList libvlc_media_list);
 
@@ -436,13 +436,13 @@ public interface LibVlc extends Library
 
     // libvlc_media_list_player
 
-    LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_instance,
+    LibVlcMediaListPlayer libvlc_media_list_player_new(LibVlcInstance libvlc_media_player,
         libvlc_exception_t exception);
 
     void libvlc_media_list_player_release(LibVlcMediaListPlayer libvlc_media_list_player);
 
-    void libvlc_media_list_player_set_media_instance(LibVlcMediaListPlayer libvlc_media_list_player,
-        LibVlcMediaInstance libvlc_media_instance, libvlc_exception_t exception);
+    void libvlc_media_list_player_set_media_player(LibVlcMediaListPlayer libvlc_media_list_player,
+        LibVlcMediaInstance libvlc_media_player, libvlc_exception_t exception);
 
     void libvlc_media_list_player_set_media_list(LibVlcMediaListPlayer libvlc_media_list_player,
         LibVlcMediaList libvlc_media_list, libvlc_exception_t exception);
@@ -459,7 +459,7 @@ public interface LibVlc extends Library
         libvlc_exception_t exception);
 
     void libvlc_media_list_player_play_item(LibVlcMediaListPlayer libvlc_media_list_player,
-        LibVlcMediaDescriptor libvlc_media_descriptor, libvlc_exception_t exception);
+        LibVlcMediaDescriptor libvlc_media, libvlc_exception_t exception);
 
     void libvlc_media_list_player_stop(LibVlcMediaListPlayer libvlc_media_list_player, libvlc_exception_t exception);
 
index 39dbf0d..ae97655 100644 (file)
@@ -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);
     }
 }
index d808a67..3b97110 100644 (file)
@@ -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);
     }
     
index f2ce166..daee861 100644 (file)
@@ -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);
     }
 
index 0deb832..4061e6e 100644 (file)
@@ -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);
 
index ebf5e36..b40acea 100644 (file)
@@ -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);
     }   
     
index 92a2fad..3961f63 100644 (file)
@@ -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" },
index a9228dd..4037550 100644 (file)
@@ -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" },
index b6f6ef8..955042a 100644 (file)
@@ -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" },
index dacaaae..54f2ca2 100644 (file)
@@ -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 */
index 40a38c1..c5288d3 100644 (file)
@@ -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 * );
 
 /** @}*/
index a626df0..a240281 100644 (file)
@@ -150,7 +150,7 @@ VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
 /*****************************************************************************
  * Media descriptor
  *****************************************************************************/
-/** \defgroup libvlc_media_descriptor libvlc_media_descriptor
+/** \defgroup libvlc_media libvlc_media
  * \ingroup libvlc
  * LibVLC Media Descriptor
  * @{
@@ -164,7 +164,7 @@ VLC_PUBLIC_API void libvlc_retain( libvlc_instance_t * );
  * \param p_e an initialized exception pointer
  * \return the newly created media descriptor
  */
-VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
+VLC_PUBLIC_API libvlc_media_t * libvlc_media_new(
                                    libvlc_instance_t *p_instance,
                                    const char * psz_mrl,
                                    libvlc_exception_t *p_e );
@@ -177,7 +177,7 @@ VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new(
  * \param p_e an initialized exception pointer
  * \return the new empty media descriptor
  */
-VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
+VLC_PUBLIC_API libvlc_media_t * libvlc_media_new_as_node(
                                    libvlc_instance_t *p_instance,
                                    const char * psz_name,
                                    libvlc_exception_t *p_e );
@@ -185,8 +185,8 @@ VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
 /**
  * Add an option to the media descriptor.
  *
- * This option will be used to determine how the media_instance will
- * read the media_descriptor. This allows to use VLC's advanced
+ * This option will be used to determine how the media_player will
+ * read the media. This allows to use VLC's advanced
  * reading/streaming options on a per-media basis.
  *
  * The options are detailed in vlc --long-help, for instance "--sout-all"
@@ -195,21 +195,21 @@ VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
  * \param psz_mrl the MRL to read
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_descriptor_add_option(
-                                   libvlc_media_descriptor_t * p_md,
+VLC_PUBLIC_API void libvlc_media_add_option(
+                                   libvlc_media_t * p_md,
                                    const char * ppsz_options,
                                    libvlc_exception_t * p_e );
 
-VLC_PUBLIC_API void libvlc_media_descriptor_retain(
-                                   libvlc_media_descriptor_t *p_meta_desc );
+VLC_PUBLIC_API void libvlc_media_retain(
+                                   libvlc_media_t *p_meta_desc );
 
-VLC_PUBLIC_API void libvlc_media_descriptor_release(
-                                   libvlc_media_descriptor_t *p_meta_desc );
+VLC_PUBLIC_API void libvlc_media_release(
+                                   libvlc_media_t *p_meta_desc );
 
-VLC_PUBLIC_API char * libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
+VLC_PUBLIC_API char * libvlc_media_get_mrl( libvlc_media_t * p_md,
                                                        libvlc_exception_t * p_e );
 
-VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_duplicate( libvlc_media_descriptor_t * );
+VLC_PUBLIC_API libvlc_media_t * libvlc_media_duplicate( libvlc_media_t * );
 
 /**
  * Read the meta of the media descriptor.
@@ -219,37 +219,37 @@ VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_descriptor_duplicate( li
  * \param p_e an initialized exception pointer
  * \return the media descriptor's meta
  */
-VLC_PUBLIC_API char * libvlc_media_descriptor_get_meta(
-                                   libvlc_media_descriptor_t *p_meta_desc,
+VLC_PUBLIC_API char * libvlc_media_get_meta(
+                                   libvlc_media_t *p_meta_desc,
                                    libvlc_meta_t e_meta,
                                    libvlc_exception_t *p_e );
 
-VLC_PUBLIC_API libvlc_state_t libvlc_media_descriptor_get_state(
-                                   libvlc_media_descriptor_t *p_meta_desc,
+VLC_PUBLIC_API libvlc_state_t libvlc_media_get_state(
+                                   libvlc_media_t *p_meta_desc,
                                    libvlc_exception_t *p_e );
 
 VLC_PUBLIC_API libvlc_media_list_t *
-    libvlc_media_descriptor_subitems( libvlc_media_descriptor_t *p_md,
+    libvlc_media_subitems( libvlc_media_t *p_md,
                                       libvlc_exception_t *p_e );
 
 VLC_PUBLIC_API libvlc_event_manager_t *
-    libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
+    libvlc_media_event_manager( libvlc_media_t * p_md,
                                            libvlc_exception_t * p_e );
 
 VLC_PUBLIC_API libvlc_time_t
-   libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
+   libvlc_media_get_duration( libvlc_media_t * p_md,
                                          libvlc_exception_t * p_e );
 
 VLC_PUBLIC_API int
-   libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
+   libvlc_media_is_preparsed( libvlc_media_t * p_md,
                                          libvlc_exception_t * p_e );
 
 VLC_PUBLIC_API void
-    libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
+    libvlc_media_set_user_data( libvlc_media_t * p_md,
                                            void * p_new_user_data,
                                            libvlc_exception_t * p_e);
 VLC_PUBLIC_API void *
-    libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
+    libvlc_media_get_user_data( libvlc_media_t * p_md,
                                            libvlc_exception_t * p_e);
 
 /** @}*/
@@ -257,7 +257,7 @@ VLC_PUBLIC_API void *
 /*****************************************************************************
  * Media Instance
  *****************************************************************************/
-/** \defgroup libvlc_media_instance libvlc_media_instance
+/** \defgroup libvlc_media_player libvlc_media_player
  * \ingroup libvlc
  * LibVLC Media Instance, object that let you play a media descriptor
  * in a libvlc_drawable_t
@@ -271,7 +271,7 @@ VLC_PUBLIC_API void *
  *        should be created.
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new( libvlc_instance_t *, libvlc_exception_t * );
 
 /**
  * Create a Media Instance object from a Media Descriptor
@@ -280,17 +280,17 @@ VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new( libvlc_insta
  *        destroyed.
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API libvlc_media_instance_t * libvlc_media_instance_new_from_media_descriptor( libvlc_media_descriptor_t *, libvlc_exception_t * );
+VLC_PUBLIC_API libvlc_media_player_t * libvlc_media_player_new_from_media( libvlc_media_t *, libvlc_exception_t * );
 
 /**
- * Release a media_instance after use
+ * Release a media_player after use
  *
  * \param p_mi the Media Instance to free
  */
-VLC_PUBLIC_API void libvlc_media_instance_release( libvlc_media_instance_t * );
-VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
+VLC_PUBLIC_API void libvlc_media_player_release( libvlc_media_player_t * );
+VLC_PUBLIC_API void libvlc_media_player_retain( libvlc_media_player_t * );
 
-/** Set the media descriptor that will be used by the media_instance. If any,
+/** Set the media descriptor that will be used by the media_player. If any,
  * previous md will be released.
  *
  * \param p_mi the Media Instance
@@ -298,17 +298,17 @@ VLC_PUBLIC_API void libvlc_media_instance_retain( libvlc_media_instance_t * );
  *        destroyed.
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_instance_set_media_descriptor( libvlc_media_instance_t *, libvlc_media_descriptor_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_media_player_set_media( libvlc_media_player_t *, libvlc_media_t *, libvlc_exception_t * );
 
 /**
- * Get the media descriptor used by the media_instance
+ * Get the media descriptor used by the media_player
  *
  * \param p_mi the Media Instance
  * \param p_e an initialized exception pointer
  * \return the media descriptor associated with p_mi, or NULL if no
  *         media descriptor is associated
  */
-VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descriptor( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API libvlc_media_t * libvlc_media_player_get_media( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Get the Event Manager from which the media instance send event.
@@ -317,7 +317,7 @@ VLC_PUBLIC_API libvlc_media_descriptor_t * libvlc_media_instance_get_media_descr
  * \param p_e an initialized exception pointer
  * \return the event manager associated with p_mi
  */
-VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_player_event_manager ( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Play 
@@ -325,7 +325,7 @@ VLC_PUBLIC_API libvlc_event_manager_t * libvlc_media_instance_event_manager ( li
  * \param p_mi the Media Instance
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_media_player_play ( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Pause 
@@ -333,7 +333,7 @@ VLC_PUBLIC_API void libvlc_media_instance_play ( libvlc_media_instance_t *, libv
  * \param p_mi the Media Instance
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_media_player_pause ( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Stop 
@@ -341,7 +341,7 @@ VLC_PUBLIC_API void libvlc_media_instance_pause ( libvlc_media_instance_t *, lib
  * \param p_mi the Media Instance
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_media_player_stop ( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Set the drawable where the media instance should render its video output
@@ -351,7 +351,7 @@ VLC_PUBLIC_API void libvlc_media_instance_stop ( libvlc_media_instance_t *, libv
  *        should render its video
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_media_player_set_drawable ( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
 
 /**
  * Get the drawable where the media instance should render its video output
@@ -362,22 +362,22 @@ VLC_PUBLIC_API void libvlc_media_instance_set_drawable ( libvlc_media_instance_t
  *         should render its video
  */
 VLC_PUBLIC_API libvlc_drawable_t
-                    libvlc_media_instance_get_drawable ( libvlc_media_instance_t *, libvlc_exception_t * );
+                    libvlc_media_player_get_drawable ( libvlc_media_player_t *, libvlc_exception_t * );
 
 /** \bug This might go away ... to be replaced by a broader system */
-VLC_PUBLIC_API libvlc_time_t  libvlc_media_instance_get_length     ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API libvlc_time_t  libvlc_media_instance_get_time       ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API void           libvlc_media_instance_set_time       ( libvlc_media_instance_t *, libvlc_time_t, libvlc_exception_t *);
-VLC_PUBLIC_API float          libvlc_media_instance_get_position   ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API void           libvlc_media_instance_set_position   ( libvlc_media_instance_t *, float, libvlc_exception_t *);
-VLC_PUBLIC_API void           libvlc_media_instance_set_chapter    ( libvlc_media_instance_t *, int, libvlc_exception_t *);
-VLC_PUBLIC_API int            libvlc_media_instance_get_chapter    (libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API int            libvlc_media_instance_get_chapter_count( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API int            libvlc_media_instance_will_play      ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API float          libvlc_media_instance_get_rate       ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API void           libvlc_media_instance_set_rate       ( libvlc_media_instance_t *, float, libvlc_exception_t *);
-VLC_PUBLIC_API libvlc_state_t libvlc_media_instance_get_state   ( libvlc_media_instance_t *, libvlc_exception_t *);
-VLC_PUBLIC_API float          libvlc_media_instance_get_fps( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_length     ( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API libvlc_time_t  libvlc_media_player_get_time       ( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API void           libvlc_media_player_set_time       ( libvlc_media_player_t *, libvlc_time_t, libvlc_exception_t *);
+VLC_PUBLIC_API float          libvlc_media_player_get_position   ( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API void           libvlc_media_player_set_position   ( libvlc_media_player_t *, float, libvlc_exception_t *);
+VLC_PUBLIC_API void           libvlc_media_player_set_chapter    ( libvlc_media_player_t *, int, libvlc_exception_t *);
+VLC_PUBLIC_API int            libvlc_media_player_get_chapter    (libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int            libvlc_media_player_get_chapter_count( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int            libvlc_media_player_will_play      ( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API float          libvlc_media_player_get_rate       ( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API void           libvlc_media_player_set_rate       ( libvlc_media_player_t *, float, libvlc_exception_t *);
+VLC_PUBLIC_API libvlc_state_t libvlc_media_player_get_state   ( libvlc_media_player_t *, libvlc_exception_t *);
+VLC_PUBLIC_API float          libvlc_media_player_get_fps( libvlc_media_player_t *, libvlc_exception_t *);
 
 /**
  * Does this media instance have a video output?
@@ -385,7 +385,7 @@ VLC_PUBLIC_API float          libvlc_media_instance_get_fps( libvlc_media_instan
  * \param p_md the media instance
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API int  libvlc_media_instance_has_vout( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int  libvlc_media_player_has_vout( libvlc_media_player_t *, libvlc_exception_t *);
 
 /**
  * Is this media instance seekable?
@@ -393,7 +393,7 @@ VLC_PUBLIC_API int  libvlc_media_instance_has_vout( libvlc_media_instance_t *, l
  * \param p_input the input
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API int libvlc_media_instance_is_seekable( libvlc_media_instance_t *p_mi, libvlc_exception_t *p_e );
+VLC_PUBLIC_API int libvlc_media_player_is_seekable( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
 
 /**
  * Can this media instance be paused?
@@ -401,10 +401,10 @@ VLC_PUBLIC_API int libvlc_media_instance_is_seekable( libvlc_media_instance_t *p
  * \param p_input the input
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API int libvlc_media_instance_can_pause( libvlc_media_instance_t *p_mi, libvlc_exception_t *p_e );
+VLC_PUBLIC_API int libvlc_media_player_can_pause( libvlc_media_player_t *p_mi, libvlc_exception_t *p_e );
 
 /** \defgroup libvlc_video libvlc_video
- * \ingroup libvlc_media_instance
+ * \ingroup libvlc_media_player
  * LibVLC Video handling
  * @{
  */
@@ -415,7 +415,7 @@ VLC_PUBLIC_API int libvlc_media_instance_can_pause( libvlc_media_instance_t *p_m
  * \param p_input the input
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Enable or disable fullscreen on a video output.
@@ -424,7 +424,7 @@ VLC_PUBLIC_API void libvlc_toggle_fullscreen( libvlc_media_instance_t *, libvlc_
  * \param b_fullscreen boolean for fullscreen status
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_player_t *, int, libvlc_exception_t * );
 
 /**
  * Get current fullscreen status.
@@ -433,7 +433,7 @@ VLC_PUBLIC_API void libvlc_set_fullscreen( libvlc_media_instance_t *, int, libvl
  * \param p_e an initialized exception pointer
  * \return the fullscreen status (boolean)
  */
-VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Get current video height.
@@ -442,7 +442,7 @@ VLC_PUBLIC_API int libvlc_get_fullscreen( libvlc_media_instance_t *, libvlc_exce
  * \param p_e an initialized exception pointer
  * \return the video height
  */
-VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Get current video width.
@@ -451,7 +451,7 @@ VLC_PUBLIC_API int libvlc_video_get_height( libvlc_media_instance_t *, libvlc_ex
  * \param p_e an initialized exception pointer
  * \return the video width
  */
-VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Get current video aspect ratio.
@@ -460,7 +460,7 @@ VLC_PUBLIC_API int libvlc_video_get_width( libvlc_media_instance_t *, libvlc_exc
  * \param p_e an initialized exception pointer
  * \return the video aspect ratio
  */
-VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Set new video aspect ratio.
@@ -469,7 +469,7 @@ VLC_PUBLIC_API char *libvlc_video_get_aspect_ratio( libvlc_media_instance_t *, l
  * \param psz_aspect new video aspect-ratio
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, char *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_player_t *, char *, libvlc_exception_t * );
 
 /**
  * Get current video subtitle.
@@ -478,7 +478,7 @@ VLC_PUBLIC_API void libvlc_video_set_aspect_ratio( libvlc_media_instance_t *, ch
  * \param p_e an initialized exception pointer
  * \return the video subtitle selected
  */
-VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Set new video subtitle.
@@ -487,7 +487,7 @@ VLC_PUBLIC_API int libvlc_video_get_spu( libvlc_media_instance_t *, libvlc_excep
  * \param i_spu new video subtitle to select
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_player_t *, int , libvlc_exception_t * );
 
 /**
  * Get current crop filter geometry.
@@ -496,7 +496,7 @@ VLC_PUBLIC_API void libvlc_video_set_spu( libvlc_media_instance_t *, int , libvl
  * \param p_e an initialized exception pointer
  * \return the crop filter geometry
  */
-VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Set new crop filter geometry.
@@ -505,7 +505,7 @@ VLC_PUBLIC_API char *libvlc_video_get_crop_geometry( libvlc_media_instance_t *,
  * \param psz_geometry new crop filter geometry
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, char *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_player_t *, char *, libvlc_exception_t * );
 
 /**
  * Toggle teletext transparent status on video output.
@@ -513,7 +513,7 @@ VLC_PUBLIC_API void libvlc_video_set_crop_geometry( libvlc_media_instance_t *, c
  * \param p_input the input
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Get current teletext page requested.
@@ -522,7 +522,7 @@ VLC_PUBLIC_API void libvlc_toggle_teletext( libvlc_media_instance_t *, libvlc_ex
  * \param p_e an initialized exception pointer
  * \return the current teletext page requested.
  */
-VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Set new teletext page to retrieve.
@@ -531,7 +531,7 @@ VLC_PUBLIC_API int libvlc_video_get_teletext( libvlc_media_instance_t *, libvlc_
  * \param i_page teletex page number requested
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_player_t *, int, libvlc_exception_t * );
 
 /**
  * Take a snapshot of the current video window.
@@ -545,9 +545,9 @@ VLC_PUBLIC_API void libvlc_video_set_teletext( libvlc_media_instance_t *, int, l
  * \param i_height the snapshot's height
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_instance_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_take_snapshot( libvlc_media_player_t *, char *,unsigned int, unsigned int, libvlc_exception_t * );
 
-VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_exception_t *);
+VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_player_t *, libvlc_exception_t *);
 
 /**
  * Resize the current video output window.
@@ -558,7 +558,7 @@ VLC_PUBLIC_API int libvlc_video_destroy( libvlc_media_instance_t *, libvlc_excep
  * \param p_e an initialized exception pointer
  * \return the success status (boolean)
  */
-VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, libvlc_exception_t *);
+VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_player_t *, int, int, libvlc_exception_t *);
 
 /**
  * Change the parent for the current the video output.
@@ -568,7 +568,7 @@ VLC_PUBLIC_API void libvlc_video_resize( libvlc_media_instance_t *, int, int, li
  * \param p_e an initialized exception pointer
  * \return the success status (boolean)
  */
-VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_drawable_t, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_player_t *, libvlc_drawable_t, libvlc_exception_t * );
 
 /**
  * Tell windowless video output to redraw rectangular area (MacOS X only).
@@ -577,7 +577,7 @@ VLC_PUBLIC_API int libvlc_video_reparent( libvlc_media_instance_t *, libvlc_draw
  * \param area coordinates within video drawable
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_instance_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_video_redraw_rectangle( libvlc_media_player_t *, const libvlc_rectangle_t *, libvlc_exception_t * );
 
 /**
  * Set the default video output's parent.
@@ -629,7 +629,7 @@ VLC_PUBLIC_API void libvlc_video_set_viewport( libvlc_instance_t *, const libvlc
 /** @} video */
 
 /** \defgroup libvlc_audio libvlc_audio
- * \ingroup libvlc_media_instance
+ * \ingroup libvlc_media_player
  * LibVLC Audio handling
  * @{
  */
@@ -685,7 +685,7 @@ VLC_PUBLIC_API void libvlc_audio_set_volume( libvlc_instance_t *, int, libvlc_ex
  * \param p_e an initialized exception
  * \return the number of available audio tracks (int)
  */
-VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *,  libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_player_t *,  libvlc_exception_t * );
 
 /**
  * Get current audio track.
@@ -694,7 +694,7 @@ VLC_PUBLIC_API int libvlc_audio_get_track_count( libvlc_media_instance_t *,  lib
  * \param p_e an initialized exception pointer
  * \return the audio track (int)
  */
-VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exception_t * );
+VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_player_t *, libvlc_exception_t * );
 
 /**
  * Set current audio track.
@@ -703,7 +703,7 @@ VLC_PUBLIC_API int libvlc_audio_get_track( libvlc_media_instance_t *, libvlc_exc
  * \param i_track the track (int)
  * \param p_e an initialized exception pointer
  */
-VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_instance_t *, int, libvlc_exception_t * );
+VLC_PUBLIC_API void libvlc_audio_set_track( libvlc_media_player_t *, int, libvlc_exception_t * );
 
 /**
  * Get current audio channel.
@@ -725,7 +725,7 @@ VLC_PUBLIC_API void libvlc_audio_set_channel( libvlc_instance_t *, int, libvlc_e
 
 /** @} audio */
 
-/** @} media_instance */
+/** @} media_player */
 
 /*****************************************************************************
  * Event handling
index 849f3e7..fe7f2e0 100644 (file)
@@ -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;
 
index 23c9a29..9af8bf7 100644 (file)
@@ -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
index 3ab440d..f8c6768 100644 (file)
@@ -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
  * @{
  */
index 5158281..80ca9ff 100644 (file)
@@ -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);
index 22a1ed4..1f0e942 100644 (file)
@@ -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);
             }
         }
     }
index d319b54..21acf54 100644 (file)
@@ -213,9 +213,9 @@ STDMETHODIMP VLCAudio::get_track(long* track)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         *track = libvlc_audio_get_track(p_md, &ex);
-        libvlc_media_instance_release(p_md);
+        libvlc_media_player_release(p_md);
         if( libvlc_exception_raised(&ex) )
         {
             _p_instance->setErrorInfo(IID_IVLCAudio,
@@ -237,9 +237,9 @@ STDMETHODIMP VLCAudio::put_track(long track)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         libvlc_audio_set_track(p_md, track, &ex);
-        libvlc_media_instance_release(p_md);
+        libvlc_media_player_release(p_md);
         if( libvlc_exception_raised(&ex) )
         {
             _p_instance->setErrorInfo(IID_IVLCAudio,
@@ -412,11 +412,11 @@ STDMETHODIMP VLCInput::get_length(double* length)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *length = (double)libvlc_media_instance_get_length(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            *length = (double)libvlc_media_player_get_length(p_md, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -441,11 +441,11 @@ STDMETHODIMP VLCInput::get_position(double* position)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *position = libvlc_media_instance_get_position(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            *position = libvlc_media_player_get_position(p_md, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -467,11 +467,11 @@ STDMETHODIMP VLCInput::put_position(double position)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            libvlc_media_instance_set_position(p_md, position, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_set_position(p_md, position, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -496,11 +496,11 @@ STDMETHODIMP VLCInput::get_time(double* time)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *time = (double)libvlc_media_instance_get_time(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            *time = (double)libvlc_media_player_get_time(p_md, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -522,11 +522,11 @@ STDMETHODIMP VLCInput::put_time(double time)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            libvlc_media_instance_set_time(p_md, (vlc_int64_t)time, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_set_time(p_md, (vlc_int64_t)time, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -551,11 +551,11 @@ STDMETHODIMP VLCInput::get_state(long* state)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *state = libvlc_media_instance_get_state(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            *state = libvlc_media_player_get_state(p_md, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -581,11 +581,11 @@ STDMETHODIMP VLCInput::get_rate(double* rate)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *rate = libvlc_media_instance_get_rate(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            *rate = libvlc_media_player_get_rate(p_md, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -607,11 +607,11 @@ STDMETHODIMP VLCInput::put_rate(double rate)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            libvlc_media_instance_set_rate(p_md, rate, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_set_rate(p_md, rate, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -637,11 +637,11 @@ STDMETHODIMP VLCInput::get_fps(double* fps)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *fps = libvlc_media_instance_get_fps(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            *fps = libvlc_media_player_get_fps(p_md, &ex);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -666,11 +666,11 @@ STDMETHODIMP VLCInput::get_hasVout(VARIANT_BOOL* hasVout)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
-            *hasVout = libvlc_media_instance_has_vout(p_md, &ex) ? VARIANT_TRUE : VARIANT_FALSE;
-            libvlc_media_instance_release(p_md);
+            *hasVout = libvlc_media_player_has_vout(p_md, &ex) ? VARIANT_TRUE : VARIANT_FALSE;
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2043,11 +2043,11 @@ STDMETHODIMP VLCVideo::get_fullscreen(VARIANT_BOOL* fullscreen)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             *fullscreen = libvlc_get_fullscreen(p_md, &ex) ? VARIANT_TRUE : VARIANT_FALSE;
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2069,11 +2069,11 @@ STDMETHODIMP VLCVideo::put_fullscreen(VARIANT_BOOL fullscreen)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             libvlc_set_fullscreen(p_md, VARIANT_FALSE != fullscreen, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2098,11 +2098,11 @@ STDMETHODIMP VLCVideo::get_width(long* width)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             *width = libvlc_video_get_width(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2127,11 +2127,11 @@ STDMETHODIMP VLCVideo::get_height(long* height)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             *height = libvlc_video_get_height(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2156,12 +2156,12 @@ STDMETHODIMP VLCVideo::get_aspectRatio(BSTR* aspect)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             char *psz_aspect = libvlc_video_get_aspect_ratio(p_md, &ex);
 
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 if( NULL == psz_aspect )
@@ -2197,7 +2197,7 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             char *psz_aspect = CStrFromBSTR(CP_UTF8, aspect);
@@ -2209,7 +2209,7 @@ STDMETHODIMP VLCVideo::put_aspectRatio(BSTR aspect)
             libvlc_video_set_aspect_ratio(p_md, psz_aspect, &ex);
 
             CoTaskMemFree(psz_aspect);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( libvlc_exception_raised(&ex) )
             {
                 _p_instance->setErrorInfo(IID_IVLCVideo,
@@ -2235,11 +2235,11 @@ STDMETHODIMP VLCVideo::get_subtitle(long* spu)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             *spu = libvlc_video_get_spu(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2261,9 +2261,9 @@ STDMETHODIMP VLCVideo::put_subtitle(long spu)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         libvlc_video_set_spu(p_md, spu, &ex);
-        libvlc_media_instance_release(p_md);
+        libvlc_media_player_release(p_md);
         if( libvlc_exception_raised(&ex) )
         {
             _p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
@@ -2287,12 +2287,12 @@ STDMETHODIMP VLCVideo::get_crop(BSTR* geometry)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             char *psz_geometry = libvlc_video_get_crop_geometry(p_md, &ex);
 
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 if( NULL == psz_geometry )
@@ -2328,7 +2328,7 @@ STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             char *psz_geometry = CStrFromBSTR(CP_UTF8, geometry);
@@ -2340,7 +2340,7 @@ STDMETHODIMP VLCVideo::put_crop(BSTR geometry)
             libvlc_video_set_crop_geometry(p_md, psz_geometry, &ex);
 
             CoTaskMemFree(psz_geometry);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( libvlc_exception_raised(&ex) )
             {
                 _p_instance->setErrorInfo(IID_IVLCVideo,
@@ -2366,11 +2366,11 @@ STDMETHODIMP VLCVideo::get_teletext(long* page)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             *page = libvlc_video_get_teletext(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2392,9 +2392,9 @@ STDMETHODIMP VLCVideo::put_teletext(long page)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         libvlc_video_set_teletext(p_md, page, &ex);
-        libvlc_media_instance_release(p_md);
+        libvlc_media_player_release(p_md);
         if( libvlc_exception_raised(&ex) )
         {
             _p_instance->setErrorInfo(IID_IVLCVideo, libvlc_exception_get_message(&ex));
@@ -2418,7 +2418,7 @@ STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             static int uniqueId = 0;
@@ -2480,7 +2480,7 @@ STDMETHODIMP VLCVideo::takeSnapshot(LPPICTUREDISP* picture)
 
             /* take snapshot into file */
             libvlc_video_take_snapshot(p_md, psz_filepath, 0, 0, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 hr = E_FAIL;
@@ -2522,11 +2522,11 @@ STDMETHODIMP VLCVideo::toggleFullscreen()
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             libvlc_toggle_fullscreen(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
@@ -2548,11 +2548,11 @@ STDMETHODIMP VLCVideo::toggleTeletext()
         libvlc_exception_t ex;
         libvlc_exception_init(&ex);
 
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_libvlc, &ex);
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_libvlc, &ex);
         if( ! libvlc_exception_raised(&ex) )
         {
             libvlc_toggle_teletext(p_md, &ex);
-            libvlc_media_instance_release(p_md);
+            libvlc_media_player_release(p_md);
             if( ! libvlc_exception_raised(&ex) )
             {
                 return NOERROR;
index 70b2473..9cbe434 100644 (file)
@@ -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");
 
index 9fc4e2b..8d1cc96 100644 (file)
@@ -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);
index 35a8521..dc181f7 100644 (file)
@@ -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];
index 76214fe..ba8d797 100644 (file)
@@ -66,7 +66,7 @@ static void HandleMediaTimeChanged(const libvlc_event_t * event, void * self)
 
     [[VLCEventManager sharedManager] callOnMainThreadObject:self 
                                                  withMethod:@selector(mediaPlayerTimeChanged:) 
-                                       withArgumentAsObject:[NSNumber numberWithLongLong:event->u.media_instance_time_changed.new_time]];
+                                       withArgumentAsObject:[NSNumber numberWithLongLong:event->u.media_player_time_changed.new_time]];
 
     [[VLCEventManager sharedManager] callOnMainThreadDelegateOfObject:self
                                                    withDelegateMethod:@selector(mediaPlayerTimeChanged:)
@@ -80,7 +80,7 @@ static void HandleMediaPositionChanged(const libvlc_event_t * event, void * self
 
     [[VLCEventManager sharedManager] callOnMainThreadObject:self 
                                                  withMethod:@selector(mediaPlayerPositionChanged:) 
-                                       withArgumentAsObject:[NSNumber numberWithFloat:event->u.media_instance_position_changed.new_position]];
+                                       withArgumentAsObject:[NSNumber numberWithFloat:event->u.media_player_position_changed.new_position]];
     [pool release];
 }
 
@@ -190,7 +190,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     // TODO: Should we tell the delegate that we're shutting down?
     delegate = nil;
 
-    libvlc_media_instance_release((libvlc_media_instance_t *)instance);
+    libvlc_media_player_release((libvlc_media_player_t *)instance);
     
     // Get rid of everything else
     [media release];
@@ -224,7 +224,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     // Make sure that this instance has been associated with the drawing canvas.
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    libvlc_media_instance_set_drawable ((libvlc_media_instance_t *)instance, 
+    libvlc_media_player_set_drawable ((libvlc_media_player_t *)instance, 
                                         (libvlc_drawable_t)aDrawable, 
                                         &ex);
     catch_exception( &ex );
@@ -234,7 +234,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    libvlc_drawable_t ret = libvlc_media_instance_get_drawable ((libvlc_media_instance_t *)instance, 
+    libvlc_drawable_t ret = libvlc_media_player_get_drawable ((libvlc_media_player_t *)instance, 
                                         &ex);
     catch_exception( &ex );
     return (id)ret;
@@ -303,14 +303,14 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 
 - (void)setRate:(float)value
 {
-    libvlc_media_instance_set_rate( instance, value, NULL );
+    libvlc_media_player_set_rate( instance, value, NULL );
 }
 
 - (float)rate
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    float result = libvlc_media_instance_get_rate( instance, &ex );
+    float result = libvlc_media_player_get_rate( instance, &ex );
     catch_exception( &ex );
     return result;
 }
@@ -319,8 +319,8 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    NSSize result = NSMakeSize(libvlc_video_get_height((libvlc_media_instance_t *)instance, &ex),
-                               libvlc_video_get_width((libvlc_media_instance_t *)instance, &ex));
+    NSSize result = NSMakeSize(libvlc_video_get_height((libvlc_media_player_t *)instance, &ex),
+                               libvlc_video_get_width((libvlc_media_player_t *)instance, &ex));
     catch_exception( &ex );
     return result;    
 }
@@ -329,7 +329,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    BOOL result = libvlc_media_instance_has_vout((libvlc_media_instance_t *)instance, &ex);
+    BOOL result = libvlc_media_player_has_vout((libvlc_media_player_t *)instance, &ex);
     if (libvlc_exception_raised( &ex ))
     {
         libvlc_exception_clear( &ex );
@@ -343,7 +343,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    float result = libvlc_media_instance_get_fps( (libvlc_media_instance_t *)instance, &ex );
+    float result = libvlc_media_player_get_fps( (libvlc_media_player_t *)instance, &ex );
     catch_exception( &ex );
     return result;
 }
@@ -354,7 +354,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     libvlc_exception_init( &ex );
     // Time is managed in seconds, while duration is managed in microseconds
     // TODO: Redo VLCTime to provide value numberAsMilliseconds, numberAsMicroseconds, numberAsSeconds, numberAsMinutes, numberAsHours
-    libvlc_media_instance_set_time( (libvlc_media_instance_t *)instance, 
+    libvlc_media_player_set_time( (libvlc_media_player_t *)instance, 
                                     (value ? [[value numberValue] longLongValue] / 1000 : 0),
                                     &ex );
     catch_exception( &ex );
@@ -367,14 +367,14 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 
 - (void)setChapter:(int)value;
 {
-    libvlc_media_instance_set_chapter( instance, value, NULL );
+    libvlc_media_player_set_chapter( instance, value, NULL );
 }
 
 - (int)chapter
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    int result = libvlc_media_instance_get_chapter( instance, &ex );
+    int result = libvlc_media_player_get_chapter( instance, &ex );
     catch_exception( &ex );
     return result;
 }
@@ -383,7 +383,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    int result = libvlc_media_instance_get_chapter_count( instance, &ex );
+    int result = libvlc_media_player_get_chapter_count( instance, &ex );
     catch_exception( &ex );
     return result;
 }
@@ -437,7 +437,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 
         libvlc_exception_t ex;
         libvlc_exception_init( &ex );
-        libvlc_media_instance_set_media_descriptor( instance, [media libVLCMediaDescriptor], &ex );
+        libvlc_media_player_set_media( instance, [media libVLCMediaDescriptor], &ex );
         catch_exception( &ex );
     }
 }
@@ -451,7 +451,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {    
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    libvlc_media_instance_play( (libvlc_media_instance_t *)instance, &ex );
+    libvlc_media_player_play( (libvlc_media_player_t *)instance, &ex );
     catch_exception( &ex );
     return YES;
 }
@@ -481,7 +481,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     // Pause the stream
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    libvlc_media_instance_pause( (libvlc_media_instance_t *)instance, &ex );
+    libvlc_media_player_pause( (libvlc_media_player_t *)instance, &ex );
     catch_exception( &ex );
     
     // TODO: Should we record the time in case the media instance is destroyed
@@ -507,7 +507,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
     
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    libvlc_media_instance_stop((libvlc_media_instance_t *)instance, &ex);
+    libvlc_media_player_stop((libvlc_media_player_t *)instance, &ex);
     catch_exception( &ex );
 }
 
@@ -547,7 +547,7 @@ static void HandleMediaInstanceStateChanged(const libvlc_event_t * event, void *
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    BOOL ret = libvlc_media_instance_will_play( (libvlc_media_instance_t *)instance, &ex );
+    BOOL ret = libvlc_media_player_will_play( (libvlc_media_player_t *)instance, &ex );
     if (libvlc_exception_raised(&ex))
     {
         libvlc_exception_clear(&ex);
@@ -582,7 +582,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    libvlc_media_instance_set_position( instance, newPosition, &ex );
+    libvlc_media_player_set_position( instance, newPosition, &ex );
     catch_exception( &ex );
 }
 
@@ -590,7 +590,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    BOOL ret = libvlc_media_instance_is_seekable( instance, &ex );
+    BOOL ret = libvlc_media_player_is_seekable( instance, &ex );
     catch_exception( &ex );
     return ret;
 }
@@ -599,7 +599,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
 {
     libvlc_exception_t ex;
     libvlc_exception_init( &ex );
-    BOOL ret = libvlc_media_instance_can_pause( instance, &ex );
+    BOOL ret = libvlc_media_player_can_pause( instance, &ex );
     catch_exception( &ex );
     return ret;
 }
@@ -623,7 +623,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
         // instance
         libvlc_exception_t ex;
         libvlc_exception_init( &ex );
-        instance = (void *)libvlc_media_instance_new([VLCLibrary sharedInstance], &ex);
+        instance = (void *)libvlc_media_player_new([VLCLibrary sharedInstance], &ex);
         catch_exception( &ex );
         
         [self registerObservers];
@@ -639,7 +639,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
     libvlc_exception_init( &ex );
 
     // Attach event observers into the media instance
-    libvlc_event_manager_t * p_em = libvlc_media_instance_event_manager( instance, &ex );
+    libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, &ex );
     libvlc_event_attach( p_em, libvlc_MediaInstancePlayed,          HandleMediaInstanceStateChanged, self, &ex );
     libvlc_event_attach( p_em, libvlc_MediaInstancePaused,          HandleMediaInstanceStateChanged, self, &ex );
     libvlc_event_attach( p_em, libvlc_MediaInstanceReachedEnd,      HandleMediaInstanceStateChanged, self, &ex );
@@ -651,7 +651,7 @@ static const VLCMediaPlayerState libvlc_to_local_state[] =
 
 - (void)unregisterObservers
 {
-    libvlc_event_manager_t * p_em = libvlc_media_instance_event_manager( instance, NULL );
+    libvlc_event_manager_t * p_em = libvlc_media_player_event_manager( instance, NULL );
     libvlc_event_detach( p_em, libvlc_MediaInstancePlayed,          HandleMediaInstanceStateChanged, self, NULL );
     libvlc_event_detach( p_em, libvlc_MediaInstancePaused,          HandleMediaInstanceStateChanged, self, NULL );
     libvlc_event_detach( p_em, libvlc_MediaInstanceReachedEnd,      HandleMediaInstanceStateChanged, self, NULL );
index c9d6861..65469f6 100755 (executable)
@@ -242,7 +242,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVari
             }\r
             case ID_audio_track:\r
             {\r
-                libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -250,7 +250,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::getProperty(int index, NPVari
                     return INVOKERESULT_GENERIC_ERROR;\r
                 }\r
                 int track = libvlc_audio_get_track(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -321,7 +321,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
             case ID_audio_track:\r
                 if( isNumberValue(value) )\r
                 {\r
-                    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                    libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                     if( libvlc_exception_raised(&ex) )\r
                     {\r
                         NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -330,7 +330,7 @@ RuntimeNPObject::InvokeResult LibvlcAudioNPObject::setProperty(int index, const
                     }\r
                     libvlc_audio_set_track(p_md,\r
                                            numberValue(value), &ex);\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     if( libvlc_exception_raised(&ex) )\r
                     {\r
                         NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -445,7 +445,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
         libvlc_exception_t ex;\r
         libvlc_exception_init(&ex);\r
 \r
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
         if( libvlc_exception_raised(&ex) )\r
         {\r
             if( index != ID_input_state )\r
@@ -466,8 +466,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
         {\r
             case ID_input_length:\r
             {\r
-                double val = (double)libvlc_media_instance_get_length(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                double val = (double)libvlc_media_player_get_length(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -479,8 +479,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             }\r
             case ID_input_position:\r
             {\r
-                double val = libvlc_media_instance_get_position(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                double val = libvlc_media_player_get_position(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -492,8 +492,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             }\r
             case ID_input_time:\r
             {\r
-                double val = (double)libvlc_media_instance_get_time(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                double val = (double)libvlc_media_player_get_time(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -505,8 +505,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             }\r
             case ID_input_state:\r
             {\r
-                int val = libvlc_media_instance_get_state(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                int val = libvlc_media_player_get_state(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -518,8 +518,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             }\r
             case ID_input_rate:\r
             {\r
-                float val = libvlc_media_instance_get_rate(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                float val = libvlc_media_player_get_rate(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -531,8 +531,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             }\r
             case ID_input_fps:\r
             {\r
-                double val = libvlc_media_instance_get_fps(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                double val = libvlc_media_player_get_fps(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -544,8 +544,8 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             }\r
             case ID_input_hasvout:\r
             {\r
-                vlc_bool_t val = libvlc_media_instance_has_vout(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                vlc_bool_t val = libvlc_media_player_has_vout(p_md, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -558,7 +558,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::getProperty(int index, NPVari
             default:\r
                 ;\r
         }\r
-        libvlc_media_instance_release(p_md);\r
+        libvlc_media_player_release(p_md);\r
     }\r
     return INVOKERESULT_GENERIC_ERROR;\r
 }\r
@@ -572,7 +572,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
         libvlc_exception_t ex;\r
         libvlc_exception_init(&ex);\r
 \r
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
         if( libvlc_exception_raised(&ex) )\r
         {\r
             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -586,13 +586,13 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
             {\r
                 if( ! NPVARIANT_IS_DOUBLE(value) )\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_INVALID_VALUE;\r
                 }\r
 \r
                 float val = (float)NPVARIANT_TO_DOUBLE(value);\r
-                libvlc_media_instance_set_position(p_md, val, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_set_position(p_md, val, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -610,12 +610,12 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
                     val = (vlc_int64_t)NPVARIANT_TO_DOUBLE(value);\r
                 else\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_INVALID_VALUE;\r
                 }\r
 \r
-                libvlc_media_instance_set_time(p_md, val, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_set_time(p_md, val, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -633,12 +633,12 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
                     val = (float)NPVARIANT_TO_DOUBLE(value);\r
                 else\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_INVALID_VALUE;\r
                 }\r
 \r
-                libvlc_media_instance_set_rate(p_md, val, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_set_rate(p_md, val, &ex);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -650,7 +650,7 @@ RuntimeNPObject::InvokeResult LibvlcInputNPObject::setProperty(int index, const
             default:\r
                 ;\r
         }\r
-        libvlc_media_instance_release(p_md);\r
+        libvlc_media_player_release(p_md);\r
     }\r
     return INVOKERESULT_GENERIC_ERROR;\r
 }\r
@@ -1815,7 +1815,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
         libvlc_exception_t ex;\r
         libvlc_exception_init(&ex);\r
 \r
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
         if( libvlc_exception_raised(&ex) )\r
         {\r
             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1828,7 +1828,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_fullscreen:\r
             {\r
                 int val = libvlc_get_fullscreen(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1841,7 +1841,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_height:\r
             {\r
                 int val = libvlc_video_get_height(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1854,7 +1854,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_width:\r
             {\r
                 int val = libvlc_video_get_width(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1867,7 +1867,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_aspectratio:\r
             {\r
                 NPUTF8 *psz_aspect = libvlc_video_get_aspect_ratio(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1883,7 +1883,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_subtitle:\r
             {\r
                 int i_spu = libvlc_video_get_spu(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1896,7 +1896,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_crop:\r
             {\r
                 NPUTF8 *psz_geometry = libvlc_video_get_crop_geometry(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1912,7 +1912,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
             case ID_video_teletext:\r
             {\r
                 int i_page = libvlc_video_get_teletext(p_md, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
                     NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1923,7 +1923,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::getProperty(int index, NPVari
                 return INVOKERESULT_NO_ERROR;\r
             }\r
         }\r
-        libvlc_media_instance_release(p_md);\r
+        libvlc_media_player_release(p_md);\r
     }\r
     return INVOKERESULT_GENERIC_ERROR;\r
 }\r
@@ -1937,7 +1937,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
         libvlc_exception_t ex;\r
         libvlc_exception_init(&ex);\r
 \r
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
         if( libvlc_exception_raised(&ex) )\r
         {\r
             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -1951,13 +1951,13 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
             {\r
                 if( ! NPVARIANT_IS_BOOLEAN(value) )\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_INVALID_VALUE;\r
                 }\r
 \r
                 int val = NPVARIANT_TO_BOOLEAN(value);\r
                 libvlc_set_fullscreen(p_md, val, &ex);\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
 \r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
@@ -1973,20 +1973,20 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
 \r
                 if( ! NPVARIANT_IS_STRING(value) )\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_INVALID_VALUE;\r
                 }\r
 \r
                 psz_aspect = stringValue(NPVARIANT_TO_STRING(value));\r
                 if( !psz_aspect )\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_GENERIC_ERROR;\r
                 }\r
 \r
                 libvlc_video_set_aspect_ratio(p_md, psz_aspect, &ex);\r
                 delete psz_aspect;\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
 \r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
@@ -2002,7 +2002,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
                 {\r
                     libvlc_video_set_spu(p_md,\r
                                          numberValue(value), &ex);\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     if( libvlc_exception_raised(&ex) )\r
                     {\r
                         NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -2011,7 +2011,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
                     }\r
                     return INVOKERESULT_NO_ERROR;\r
                 }\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 return INVOKERESULT_INVALID_VALUE;\r
             }\r
             case ID_video_crop:\r
@@ -2020,20 +2020,20 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
 \r
                 if( ! NPVARIANT_IS_STRING(value) )\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_INVALID_VALUE;\r
                 }\r
 \r
                 psz_geometry = stringValue(NPVARIANT_TO_STRING(value));\r
                 if( !psz_geometry )\r
                 {\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     return INVOKERESULT_GENERIC_ERROR;\r
                 }\r
 \r
                 libvlc_video_set_crop_geometry(p_md, psz_geometry, &ex);\r
                 delete psz_geometry;\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
 \r
                 if( libvlc_exception_raised(&ex) )\r
                 {\r
@@ -2049,7 +2049,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
                 {\r
                     libvlc_video_set_teletext(p_md,\r
                                          numberValue(value), &ex);\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     if( libvlc_exception_raised(&ex) )\r
                     {\r
                         NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -2058,11 +2058,11 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::setProperty(int index, const
                     }\r
                     return INVOKERESULT_NO_ERROR;\r
                 }\r
-                libvlc_media_instance_release(p_md);\r
+                libvlc_media_player_release(p_md);\r
                 return INVOKERESULT_INVALID_VALUE;\r
             }\r
         }\r
-        libvlc_media_instance_release(p_md);\r
+        libvlc_media_player_release(p_md);\r
     }\r
     return INVOKERESULT_GENERIC_ERROR;\r
 }\r
@@ -2090,7 +2090,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::invoke(int index, const NPVar
         libvlc_exception_t ex;\r
         libvlc_exception_init(&ex);\r
 \r
-        libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+        libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
         if( libvlc_exception_raised(&ex) )\r
         {\r
             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -2104,7 +2104,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::invoke(int index, const NPVar
                 if( argCount == 0 )\r
                 {\r
                     libvlc_toggle_fullscreen(p_md, &ex);\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     if( libvlc_exception_raised(&ex) )\r
                     {\r
                         NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -2132,7 +2132,7 @@ RuntimeNPObject::InvokeResult LibvlcVideoNPObject::invoke(int index, const NPVar
                 if( argCount == 0 )\r
                 {\r
                     libvlc_toggle_teletext(p_md, &ex);\r
-                    libvlc_media_instance_release(p_md);\r
+                    libvlc_media_player_release(p_md);\r
                     if( libvlc_exception_raised(&ex) )\r
                     {\r
                         NPN_SetException(this, libvlc_exception_get_message(&ex));\r
index 30189ba..c842de9 100755 (executable)
@@ -169,11 +169,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_fullscreen: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                    libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                     if( p_md )\r
                     {\r
                         libvlc_toggle_fullscreen(p_md, &ex);\r
-                        libvlc_media_instance_release(p_md);\r
+                        libvlc_media_player_release(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -533,11 +533,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_get_length: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                    libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                     if( p_md )\r
                     {\r
-                        vlc_int64_t val = libvlc_media_instance_get_length(p_md, &ex);\r
-                        libvlc_media_instance_release(p_md);\r
+                        vlc_int64_t val = libvlc_media_player_get_length(p_md, &ex);\r
+                        libvlc_media_player_release(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -565,11 +565,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_get_position: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                    libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                     if( p_md )\r
                     {\r
-                        float val = libvlc_media_instance_get_position(p_md, &ex);\r
-                        libvlc_media_instance_release(p_md);\r
+                        float val = libvlc_media_player_get_position(p_md, &ex);\r
+                        libvlc_media_player_release(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -597,11 +597,11 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
             case ID_get_time: /* deprecated */\r
                 if( argCount == 0 )\r
                 {\r
-                    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                    libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                     if( p_md )\r
                     {\r
-                        vlc_int64_t val = libvlc_media_instance_get_time(p_md, &ex);\r
-                        libvlc_media_instance_release(p_md);\r
+                        vlc_int64_t val = libvlc_media_player_get_time(p_md, &ex);\r
+                        libvlc_media_player_release(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
@@ -631,7 +631,7 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
                   && isNumberValue(args[0])\r
                   && NPVARIANT_IS_BOOLEAN(args[1]) )\r
                 {\r
-                    libvlc_media_instance_t *p_md = libvlc_playlist_get_media_instance(p_plugin->getVLC(), &ex);\r
+                    libvlc_media_player_t *p_md = libvlc_playlist_get_media_player(p_plugin->getVLC(), &ex);\r
                     if( p_md )\r
                     {\r
                         vlc_int64_t pos = 0;\r
@@ -643,10 +643,10 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
                         if( NPVARIANT_TO_BOOLEAN(args[1]) )\r
                         {\r
                             /* relative seek */\r
-                            vlc_int64_t from = libvlc_media_instance_get_time(p_md, &ex);\r
+                            vlc_int64_t from = libvlc_media_player_get_time(p_md, &ex);\r
                             if( libvlc_exception_raised(&ex) )\r
                             {\r
-                                libvlc_media_instance_release(p_md);\r
+                                libvlc_media_player_release(p_md);\r
                                 NPN_SetException(this, libvlc_exception_get_message(&ex));\r
                                 libvlc_exception_clear(&ex);\r
                                 return INVOKERESULT_GENERIC_ERROR;\r
@@ -654,8 +654,8 @@ RuntimeNPObject::InvokeResult VlcNPObject::invoke(int index, const NPVariant *ar
                             pos += from;\r
                         }\r
                         /* jump to time */\r
-                        libvlc_media_instance_set_time(p_md, pos, &ex);\r
-                        libvlc_media_instance_release(p_md);\r
+                        libvlc_media_player_set_time(p_md, pos, &ex);\r
+                        libvlc_media_player_release(p_md);\r
                         if( libvlc_exception_raised(&ex) )\r
                         {\r
                             NPN_SetException(this, libvlc_exception_get_message(&ex));\r
index 1b5ccee..7a4e05b 100644 (file)
@@ -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 );
index de0011a..b4445a6 100644 (file)
@@ -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 );
 }
index f690d1c..4290a75 100644 (file)
@@ -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 \
index 3744d78..ccba14b 100644 (file)
@@ -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 );
index 1a7170b..f367e7b 100644 (file)
@@ -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 );
index 3f18eb5..d3a4eda 100644 (file)
@@ -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;
index 36a9147..40f48ce 100644 (file)
@@ -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;
index 278f795..bfeac10 100644 (file)
@@ -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 */
diff --git a/src/control/media.c b/src/control/media.c
new file mode 100644 (file)
index 0000000..38326bc
--- /dev/null
@@ -0,0 +1,584 @@
+/*****************************************************************************
+ * media.c: Libvlc API media descripor management
+ *****************************************************************************
+ * Copyright (C) 2007 the VideoLAN team
+ * $Id$
+ *
+ * Authors: Pierre d'Herbemont <pdherbemont@videolan.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#include "libvlc_internal.h"
+
+#include <vlc/libvlc.h>
+#include <vlc_input.h>
+#include <vlc_meta.h>
+
+/* For the preparser */
+#include <vlc_playlist.h>
+
+static const vlc_meta_type_t libvlc_to_vlc_meta[] =
+{
+    [libvlc_meta_Title]        = vlc_meta_Title,
+    [libvlc_meta_Artist]       = vlc_meta_Artist,
+    [libvlc_meta_Genre]        = vlc_meta_Genre,
+    [libvlc_meta_Copyright]    = vlc_meta_Copyright,
+    [libvlc_meta_Album]        = vlc_meta_Album,
+    [libvlc_meta_TrackNumber]  = vlc_meta_TrackNumber,
+    [libvlc_meta_Description]  = vlc_meta_Description,
+    [libvlc_meta_Rating]       = vlc_meta_Rating,
+    [libvlc_meta_Date]         = vlc_meta_Date,
+    [libvlc_meta_Setting]      = vlc_meta_Setting,
+    [libvlc_meta_URL]          = vlc_meta_URL,
+    [libvlc_meta_Language]     = vlc_meta_Language,
+    [libvlc_meta_NowPlaying]   = vlc_meta_NowPlaying,
+    [libvlc_meta_Publisher]    = vlc_meta_Publisher,
+    [libvlc_meta_EncodedBy]    = vlc_meta_EncodedBy,
+    [libvlc_meta_ArtworkURL]   = vlc_meta_ArtworkURL,
+    [libvlc_meta_TrackID]      = vlc_meta_TrackID
+};
+
+static const libvlc_meta_t vlc_to_libvlc_meta[] =
+{
+    [vlc_meta_Title]        = libvlc_meta_Title,
+    [vlc_meta_Artist]       = libvlc_meta_Artist,
+    [vlc_meta_Genre]        = libvlc_meta_Genre,
+    [vlc_meta_Copyright]    = libvlc_meta_Copyright,
+    [vlc_meta_Album]        = libvlc_meta_Album,
+    [vlc_meta_TrackNumber]  = libvlc_meta_TrackNumber,
+    [vlc_meta_Description]  = libvlc_meta_Description,
+    [vlc_meta_Rating]       = libvlc_meta_Rating,
+    [vlc_meta_Date]         = libvlc_meta_Date,
+    [vlc_meta_Setting]      = libvlc_meta_Setting,
+    [vlc_meta_URL]          = libvlc_meta_URL,
+    [vlc_meta_Language]     = libvlc_meta_Language,
+    [vlc_meta_NowPlaying]   = libvlc_meta_NowPlaying,
+    [vlc_meta_Publisher]    = libvlc_meta_Publisher,
+    [vlc_meta_EncodedBy]    = libvlc_meta_EncodedBy,
+    [vlc_meta_ArtworkURL]   = libvlc_meta_ArtworkURL,
+    [vlc_meta_TrackID]      = libvlc_meta_TrackID
+};
+
+/**************************************************************************
+ * input_item_subitem_added (Private) (vlc event Callback)
+ **************************************************************************/
+static void input_item_subitem_added( const vlc_event_t *p_event,
+                                       void * user_data )
+{
+    libvlc_media_t * p_md = user_data;
+    libvlc_media_t * p_md_child;
+    libvlc_event_t event;
+
+    p_md_child = libvlc_media_new_from_input_item(
+                p_md->p_libvlc_instance,
+                p_event->u.input_item_subitem_added.p_new_child, NULL );
+
+    /* Add this to our media list */
+    if( !p_md->p_subitems )
+    {
+        p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance, NULL );
+        libvlc_media_list_set_media( p_md->p_subitems, p_md, NULL );
+    }
+    if( p_md->p_subitems )
+    {
+        libvlc_media_list_add_media( p_md->p_subitems, p_md_child, NULL );
+    }
+
+    /* Construct the event */
+    event.type = libvlc_MediaDescriptorSubItemAdded;
+    event.u.media_subitem_added.new_child = p_md_child;
+
+    /* Send the event */
+    libvlc_event_send( p_md->p_event_manager, &event );
+    libvlc_media_release( p_md_child );
+}
+
+/**************************************************************************
+ * input_item_meta_changed (Private) (vlc event Callback)
+ **************************************************************************/
+static void input_item_meta_changed( const vlc_event_t *p_event,
+                                     void * user_data )
+{
+    libvlc_media_t * p_md = user_data;
+    libvlc_event_t event;
+
+    /* Construct the event */
+    event.type = libvlc_MediaDescriptorMetaChanged;
+    event.u.media_meta_changed.meta_type =
+        vlc_to_libvlc_meta[p_event->u.input_item_meta_changed.meta_type];
+
+    /* Send the event */
+    libvlc_event_send( p_md->p_event_manager, &event );
+}
+
+/**************************************************************************
+ * input_item_duration_changed (Private) (vlc event Callback)
+ **************************************************************************/
+static void input_item_duration_changed( const vlc_event_t *p_event,
+                                         void * user_data )
+{
+    libvlc_media_t * p_md = user_data;
+    libvlc_event_t event;
+
+    /* Construct the event */
+    event.type = libvlc_MediaDescriptorDurationChanged;
+    event.u.media_duration_changed.new_duration = 
+        p_event->u.input_item_duration_changed.new_duration;
+
+    /* Send the event */
+    libvlc_event_send( p_md->p_event_manager, &event );
+}
+
+/**************************************************************************
+ * input_item_preparsed_changed (Private) (vlc event Callback)
+ **************************************************************************/
+static void input_item_preparsed_changed( const vlc_event_t *p_event,
+                                          void * user_data )
+{
+    libvlc_media_t * p_md = user_data;
+    libvlc_event_t event;
+
+    /* Construct the event */
+    event.type = libvlc_MediaDescriptorPreparsedChanged;
+    event.u.media_preparsed_changed.new_status = 
+        p_event->u.input_item_preparsed_changed.new_status;
+
+    /* Send the event */
+    libvlc_event_send( p_md->p_event_manager, &event );
+}
+
+/**************************************************************************
+ * Install event handler (Private)
+ **************************************************************************/
+static void install_input_item_observer( libvlc_media_t *p_md )
+{
+    vlc_event_attach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemSubItemAdded,
+                      input_item_subitem_added,
+                      p_md );
+    vlc_event_attach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemMetaChanged,
+                      input_item_meta_changed,
+                      p_md );
+    vlc_event_attach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemDurationChanged,
+                      input_item_duration_changed,
+                      p_md );
+    vlc_event_attach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemPreparsedChanged,
+                      input_item_preparsed_changed,
+                      p_md );
+}
+
+/**************************************************************************
+ * Uninstall event handler (Private)
+ **************************************************************************/
+static void uninstall_input_item_observer( libvlc_media_t *p_md )
+{
+    vlc_event_detach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemSubItemAdded,
+                      input_item_subitem_added,
+                      p_md );
+    vlc_event_detach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemMetaChanged,
+                      input_item_meta_changed,
+                      p_md );
+    vlc_event_detach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemDurationChanged,
+                      input_item_duration_changed,
+                      p_md );
+    vlc_event_detach( &p_md->p_input_item->event_manager,
+                      vlc_InputItemPreparsedChanged,
+                      input_item_preparsed_changed,
+                      p_md );
+}
+
+/**************************************************************************
+ * Preparse if not already done (Private)
+ **************************************************************************/
+static void preparse_if_needed( libvlc_media_t *p_md )
+{
+    /* XXX: need some locking here */
+    if (!p_md->b_preparsed)
+    {
+        playlist_PreparseEnqueue(
+                p_md->p_libvlc_instance->p_libvlc_int->p_playlist,
+                p_md->p_input_item );
+        p_md->b_preparsed = VLC_TRUE;
+    }
+}
+
+/**************************************************************************
+ * Create a new media descriptor object from an input_item
+ * (libvlc internal)
+ * That's the generic constructor
+ **************************************************************************/
+libvlc_media_t * libvlc_media_new_from_input_item(
+                                   libvlc_instance_t *p_instance,
+                                   input_item_t *p_input_item,
+                                   libvlc_exception_t *p_e )
+{
+    libvlc_media_t * p_md;
+
+    if (!p_input_item)
+    {
+        libvlc_exception_raise( p_e, "No input item given" );
+        return NULL;
+    }
+
+    p_md = malloc( sizeof(libvlc_media_t) );
+    p_md->p_libvlc_instance = p_instance;
+    p_md->p_input_item      = p_input_item;
+    p_md->b_preparsed       = VLC_FALSE;
+    p_md->i_refcount        = 1;
+    p_md->p_user_data       = NULL;
+
+    p_md->state = libvlc_NothingSpecial;
+
+    /* A media descriptor can be a playlist. When you open a playlist
+     * It can give a bunch of item to read. */
+    p_md->p_subitems        = NULL;
+
+    p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance, p_e );
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
+        libvlc_MediaDescriptorMetaChanged, p_e );
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
+        libvlc_MediaDescriptorSubItemAdded, p_e );
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
+        libvlc_MediaDescriptorFreed, p_e );
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
+        libvlc_MediaDescriptorDurationChanged, p_e );
+    libvlc_event_manager_register_event_type( p_md->p_event_manager,
+        libvlc_MediaDescriptorStateChanged, p_e );
+
+    vlc_gc_incref( p_md->p_input_item );
+
+    install_input_item_observer( p_md );
+
+    return p_md;
+}
+
+/**************************************************************************
+ * Create a new media descriptor object
+ **************************************************************************/
+libvlc_media_t * libvlc_media_new(
+                                   libvlc_instance_t *p_instance,
+                                   const char * psz_mrl,
+                                   libvlc_exception_t *p_e )
+{
+    input_item_t * p_input_item;
+    libvlc_media_t * p_md;
+
+    p_input_item = input_ItemNew( p_instance->p_libvlc_int, psz_mrl, NULL );
+
+    if (!p_input_item)
+    {
+        libvlc_exception_raise( p_e, "Can't create md's input_item" );
+        return NULL;
+    }
+
+    p_md = libvlc_media_new_from_input_item( p_instance,
+                p_input_item, p_e );
+
+    /* The p_input_item is retained in libvlc_media_new_from_input_item */
+    vlc_gc_decref( p_input_item );
+    
+    return p_md;
+}
+
+/**************************************************************************
+ * Create a new media descriptor object
+ **************************************************************************/
+libvlc_media_t * libvlc_media_new_as_node(
+                                   libvlc_instance_t *p_instance,
+                                   const char * psz_name,
+                                   libvlc_exception_t *p_e )
+{
+    input_item_t * p_input_item;
+    libvlc_media_t * p_md;
+
+    p_input_item = input_ItemNew( p_instance->p_libvlc_int, "vlc://nop", psz_name );
+
+    if (!p_input_item)
+    {
+        libvlc_exception_raise( p_e, "Can't create md's input_item" );
+        return NULL;
+    }
+
+    p_md = libvlc_media_new_from_input_item( p_instance,
+                p_input_item, p_e );
+
+    p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance, NULL );
+
+    return p_md;
+}
+
+/**************************************************************************
+ * Add an option to the media descriptor,
+ * that will be used to determine how the media_player will read the
+ * media. This allow to use VLC advanced reading/streaming
+ * options in a per-media basis
+ *
+ * The options are detailled in vlc --long-help, for instance "--sout-all"
+ **************************************************************************/
+void libvlc_media_add_option(
+                                   libvlc_media_t * p_md,
+                                   const char * ppsz_option,
+                                   libvlc_exception_t *p_e )
+{
+    (void)p_e;
+    input_ItemAddOpt( p_md->p_input_item, ppsz_option,
+                      VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED );
+}
+
+/**************************************************************************
+ * Delete a media descriptor object
+ **************************************************************************/
+void libvlc_media_release( libvlc_media_t *p_md )
+{
+    if (!p_md)
+        return;
+
+    p_md->i_refcount--;
+
+    if( p_md->i_refcount > 0 )
+        return;
+
+    if( p_md->p_subitems )
+        libvlc_media_list_release( p_md->p_subitems );
+
+    uninstall_input_item_observer( p_md );
+    vlc_gc_decref( p_md->p_input_item );
+
+    /* Construct the event */
+    libvlc_event_t event;
+    event.type = libvlc_MediaDescriptorFreed;
+    event.u.media_freed.md = p_md;
+
+    /* Send the event */
+    libvlc_event_send( p_md->p_event_manager, &event );
+
+    libvlc_event_manager_release( p_md->p_event_manager );
+
+    free( p_md );
+}
+
+/**************************************************************************
+ * Retain a media descriptor object
+ **************************************************************************/
+void libvlc_media_retain( libvlc_media_t *p_md )
+{
+    if (!p_md)
+        return;
+
+    p_md->i_refcount++;
+}
+
+/**************************************************************************
+ * Duplicate a media descriptor object
+ **************************************************************************/
+libvlc_media_t *
+libvlc_media_duplicate( libvlc_media_t *p_md_orig )
+{
+    return libvlc_media_new_from_input_item(
+        p_md_orig->p_libvlc_instance, p_md_orig->p_input_item, NULL );
+}
+
+/**************************************************************************
+ * Retain a media descriptor object
+ **************************************************************************/
+char *
+libvlc_media_get_mrl( libvlc_media_t * p_md,
+                                 libvlc_exception_t * p_e )
+{
+    (void)p_e;
+    return input_item_GetURI( p_md->p_input_item );
+}
+
+/**************************************************************************
+ * Getter for meta information
+ **************************************************************************/
+
+char * libvlc_media_get_meta( libvlc_media_t *p_md,
+                                         libvlc_meta_t e_meta,
+                                         libvlc_exception_t *p_e )
+{
+    VLC_UNUSED(p_e);
+
+    char * psz_meta;
+
+    /* XXX: locking */
+
+    preparse_if_needed( p_md );
+
+    psz_meta = input_item_GetMeta( p_md->p_input_item,
+                                   libvlc_to_vlc_meta[e_meta] );
+    
+    if( e_meta == libvlc_meta_ArtworkURL && !psz_meta )
+    {
+        playlist_AskForArtEnqueue(
+                p_md->p_libvlc_instance->p_libvlc_int->p_playlist,
+                p_md->p_input_item );
+    }
+
+    /* Should be integrated in core */
+    if( !psz_meta && e_meta == libvlc_meta_Title && p_md->p_input_item->psz_name )
+    {
+        free( psz_meta );
+        return strdup( p_md->p_input_item->psz_name );
+    }
+
+    return psz_meta;
+}
+
+/**************************************************************************
+ * Getter for state information
+ * Can be error, playing, buffering, NothingSpecial.
+ **************************************************************************/
+
+libvlc_state_t
+libvlc_media_get_state( libvlc_media_t *p_md,
+                                   libvlc_exception_t *p_e )
+{
+    (void)p_e;
+    return p_md->state;
+}
+
+/**************************************************************************
+ * Setter for state information (LibVLC Internal)
+ **************************************************************************/
+
+void
+libvlc_media_set_state( libvlc_media_t *p_md,
+                                   libvlc_state_t state,
+                                   libvlc_exception_t *p_e )
+{
+    (void)p_e;
+    libvlc_event_t event;
+
+    p_md->state = state;
+
+    /* Construct the event */
+    event.type = libvlc_MediaDescriptorStateChanged;
+    event.u.media_state_changed.new_state = state;
+
+    /* Send the event */
+    libvlc_event_send( p_md->p_event_manager, &event );
+}
+
+/**************************************************************************
+ * subitems
+ **************************************************************************/
+libvlc_media_list_t *
+libvlc_media_subitems( libvlc_media_t * p_md,
+                                  libvlc_exception_t * p_e )
+{
+    VLC_UNUSED(p_e);
+
+    if( p_md->p_subitems )
+        libvlc_media_list_retain( p_md->p_subitems );
+    return p_md->p_subitems;
+}
+
+/**************************************************************************
+ * event_manager
+ **************************************************************************/
+libvlc_event_manager_t *
+libvlc_media_event_manager( libvlc_media_t * p_md,
+                                       libvlc_exception_t * p_e )
+{
+    VLC_UNUSED(p_e);
+
+    return p_md->p_event_manager;
+}
+
+/**************************************************************************
+ * Get duration of media object.
+ **************************************************************************/
+vlc_int64_t
+libvlc_media_get_duration( libvlc_media_t * p_md,
+                                      libvlc_exception_t * p_e )
+{
+    VLC_UNUSED(p_e);
+
+    if( p_md && p_md->p_input_item)
+    {
+        return input_item_GetDuration( p_md->p_input_item );
+    }
+    else
+    {
+        return -1;
+    }
+}
+
+/**************************************************************************
+ * Get preparsed status for media object.
+ **************************************************************************/
+int
+libvlc_media_is_preparsed( libvlc_media_t * p_md,
+                                       libvlc_exception_t * p_e )
+{
+    VLC_UNUSED(p_e);
+
+    if( p_md && p_md->p_input_item)
+    {
+        return input_item_IsPreparsed( p_md->p_input_item );
+    }
+    else
+    {
+        return VLC_FALSE;
+    }
+}
+
+/**************************************************************************
+ * Sets media descriptor's user_data. user_data is specialized data 
+ * accessed by the host application, VLC.framework uses it as a pointer to 
+ * an native object that references a libvlc_media_t pointer
+ **************************************************************************/
+void 
+libvlc_media_set_user_data( libvlc_media_t * p_md,
+                                       void * p_new_user_data,
+                                       libvlc_exception_t * p_e )
+{
+    VLC_UNUSED(p_e);
+
+    if( p_md )
+    {
+        p_md->p_user_data = p_new_user_data;
+    }
+}
+
+/**************************************************************************
+ * Get media descriptor's user_data. user_data is specialized data 
+ * accessed by the host application, VLC.framework uses it as a pointer to 
+ * an native object that references a libvlc_media_t pointer
+ **************************************************************************/
+void *
+libvlc_media_get_user_data( libvlc_media_t * p_md,
+                                       libvlc_exception_t * p_e )
+{
+    VLC_UNUSED(p_e);
+
+    if( p_md )
+    {
+        return p_md->p_user_data;
+    }
+    else
+    {
+        return NULL;
+    }
+}
+
diff --git a/src/control/media_descriptor.c b/src/control/media_descriptor.c
deleted file mode 100644 (file)
index 34c35ef..0000000
+++ /dev/null
@@ -1,584 +0,0 @@
-/*****************************************************************************
- * media_descriptor.c: Libvlc API media descripor management
- *****************************************************************************
- * Copyright (C) 2007 the VideoLAN team
- * $Id$
- *
- * Authors: Pierre d'Herbemont <pdherbemont@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "libvlc_internal.h"
-
-#include <vlc/libvlc.h>
-#include <vlc_input.h>
-#include <vlc_meta.h>
-
-/* For the preparser */
-#include <vlc_playlist.h>
-
-static const vlc_meta_type_t libvlc_to_vlc_meta[] =
-{
-    [libvlc_meta_Title]        = vlc_meta_Title,
-    [libvlc_meta_Artist]       = vlc_meta_Artist,
-    [libvlc_meta_Genre]        = vlc_meta_Genre,
-    [libvlc_meta_Copyright]    = vlc_meta_Copyright,
-    [libvlc_meta_Album]        = vlc_meta_Album,
-    [libvlc_meta_TrackNumber]  = vlc_meta_TrackNumber,
-    [libvlc_meta_Description]  = vlc_meta_Description,
-    [libvlc_meta_Rating]       = vlc_meta_Rating,
-    [libvlc_meta_Date]         = vlc_meta_Date,
-    [libvlc_meta_Setting]      = vlc_meta_Setting,
-    [libvlc_meta_URL]          = vlc_meta_URL,
-    [libvlc_meta_Language]     = vlc_meta_Language,
-    [libvlc_meta_NowPlaying]   = vlc_meta_NowPlaying,
-    [libvlc_meta_Publisher]    = vlc_meta_Publisher,
-    [libvlc_meta_EncodedBy]    = vlc_meta_EncodedBy,
-    [libvlc_meta_ArtworkURL]   = vlc_meta_ArtworkURL,
-    [libvlc_meta_TrackID]      = vlc_meta_TrackID
-};
-
-static const libvlc_meta_t vlc_to_libvlc_meta[] =
-{
-    [vlc_meta_Title]        = libvlc_meta_Title,
-    [vlc_meta_Artist]       = libvlc_meta_Artist,
-    [vlc_meta_Genre]        = libvlc_meta_Genre,
-    [vlc_meta_Copyright]    = libvlc_meta_Copyright,
-    [vlc_meta_Album]        = libvlc_meta_Album,
-    [vlc_meta_TrackNumber]  = libvlc_meta_TrackNumber,
-    [vlc_meta_Description]  = libvlc_meta_Description,
-    [vlc_meta_Rating]       = libvlc_meta_Rating,
-    [vlc_meta_Date]         = libvlc_meta_Date,
-    [vlc_meta_Setting]      = libvlc_meta_Setting,
-    [vlc_meta_URL]          = libvlc_meta_URL,
-    [vlc_meta_Language]     = libvlc_meta_Language,
-    [vlc_meta_NowPlaying]   = libvlc_meta_NowPlaying,
-    [vlc_meta_Publisher]    = libvlc_meta_Publisher,
-    [vlc_meta_EncodedBy]    = libvlc_meta_EncodedBy,
-    [vlc_meta_ArtworkURL]   = libvlc_meta_ArtworkURL,
-    [vlc_meta_TrackID]      = libvlc_meta_TrackID
-};
-
-/**************************************************************************
- * input_item_subitem_added (Private) (vlc event Callback)
- **************************************************************************/
-static void input_item_subitem_added( const vlc_event_t *p_event,
-                                       void * user_data )
-{
-    libvlc_media_descriptor_t * p_md = user_data;
-    libvlc_media_descriptor_t * p_md_child;
-    libvlc_event_t event;
-
-    p_md_child = libvlc_media_descriptor_new_from_input_item(
-                p_md->p_libvlc_instance,
-                p_event->u.input_item_subitem_added.p_new_child, NULL );
-
-    /* Add this to our media list */
-    if( !p_md->p_subitems )
-    {
-        p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance, NULL );
-        libvlc_media_list_set_media_descriptor( p_md->p_subitems, p_md, NULL );
-    }
-    if( p_md->p_subitems )
-    {
-        libvlc_media_list_add_media_descriptor( p_md->p_subitems, p_md_child, NULL );
-    }
-
-    /* Construct the event */
-    event.type = libvlc_MediaDescriptorSubItemAdded;
-    event.u.media_descriptor_subitem_added.new_child = p_md_child;
-
-    /* Send the event */
-    libvlc_event_send( p_md->p_event_manager, &event );
-    libvlc_media_descriptor_release( p_md_child );
-}
-
-/**************************************************************************
- * input_item_meta_changed (Private) (vlc event Callback)
- **************************************************************************/
-static void input_item_meta_changed( const vlc_event_t *p_event,
-                                     void * user_data )
-{
-    libvlc_media_descriptor_t * p_md = user_data;
-    libvlc_event_t event;
-
-    /* Construct the event */
-    event.type = libvlc_MediaDescriptorMetaChanged;
-    event.u.media_descriptor_meta_changed.meta_type =
-        vlc_to_libvlc_meta[p_event->u.input_item_meta_changed.meta_type];
-
-    /* Send the event */
-    libvlc_event_send( p_md->p_event_manager, &event );
-}
-
-/**************************************************************************
- * input_item_duration_changed (Private) (vlc event Callback)
- **************************************************************************/
-static void input_item_duration_changed( const vlc_event_t *p_event,
-                                         void * user_data )
-{
-    libvlc_media_descriptor_t * p_md = user_data;
-    libvlc_event_t event;
-
-    /* Construct the event */
-    event.type = libvlc_MediaDescriptorDurationChanged;
-    event.u.media_descriptor_duration_changed.new_duration = 
-        p_event->u.input_item_duration_changed.new_duration;
-
-    /* Send the event */
-    libvlc_event_send( p_md->p_event_manager, &event );
-}
-
-/**************************************************************************
- * input_item_preparsed_changed (Private) (vlc event Callback)
- **************************************************************************/
-static void input_item_preparsed_changed( const vlc_event_t *p_event,
-                                          void * user_data )
-{
-    libvlc_media_descriptor_t * p_md = user_data;
-    libvlc_event_t event;
-
-    /* Construct the event */
-    event.type = libvlc_MediaDescriptorPreparsedChanged;
-    event.u.media_descriptor_preparsed_changed.new_status = 
-        p_event->u.input_item_preparsed_changed.new_status;
-
-    /* Send the event */
-    libvlc_event_send( p_md->p_event_manager, &event );
-}
-
-/**************************************************************************
- * Install event handler (Private)
- **************************************************************************/
-static void install_input_item_observer( libvlc_media_descriptor_t *p_md )
-{
-    vlc_event_attach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemSubItemAdded,
-                      input_item_subitem_added,
-                      p_md );
-    vlc_event_attach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemMetaChanged,
-                      input_item_meta_changed,
-                      p_md );
-    vlc_event_attach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemDurationChanged,
-                      input_item_duration_changed,
-                      p_md );
-    vlc_event_attach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemPreparsedChanged,
-                      input_item_preparsed_changed,
-                      p_md );
-}
-
-/**************************************************************************
- * Uninstall event handler (Private)
- **************************************************************************/
-static void uninstall_input_item_observer( libvlc_media_descriptor_t *p_md )
-{
-    vlc_event_detach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemSubItemAdded,
-                      input_item_subitem_added,
-                      p_md );
-    vlc_event_detach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemMetaChanged,
-                      input_item_meta_changed,
-                      p_md );
-    vlc_event_detach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemDurationChanged,
-                      input_item_duration_changed,
-                      p_md );
-    vlc_event_detach( &p_md->p_input_item->event_manager,
-                      vlc_InputItemPreparsedChanged,
-                      input_item_preparsed_changed,
-                      p_md );
-}
-
-/**************************************************************************
- * Preparse if not already done (Private)
- **************************************************************************/
-static void preparse_if_needed( libvlc_media_descriptor_t *p_md )
-{
-    /* XXX: need some locking here */
-    if (!p_md->b_preparsed)
-    {
-        playlist_PreparseEnqueue(
-                p_md->p_libvlc_instance->p_libvlc_int->p_playlist,
-                p_md->p_input_item );
-        p_md->b_preparsed = VLC_TRUE;
-    }
-}
-
-/**************************************************************************
- * Create a new media descriptor object from an input_item
- * (libvlc internal)
- * That's the generic constructor
- **************************************************************************/
-libvlc_media_descriptor_t * libvlc_media_descriptor_new_from_input_item(
-                                   libvlc_instance_t *p_instance,
-                                   input_item_t *p_input_item,
-                                   libvlc_exception_t *p_e )
-{
-    libvlc_media_descriptor_t * p_md;
-
-    if (!p_input_item)
-    {
-        libvlc_exception_raise( p_e, "No input item given" );
-        return NULL;
-    }
-
-    p_md = malloc( sizeof(libvlc_media_descriptor_t) );
-    p_md->p_libvlc_instance = p_instance;
-    p_md->p_input_item      = p_input_item;
-    p_md->b_preparsed       = VLC_FALSE;
-    p_md->i_refcount        = 1;
-    p_md->p_user_data       = NULL;
-
-    p_md->state = libvlc_NothingSpecial;
-
-    /* A media descriptor can be a playlist. When you open a playlist
-     * It can give a bunch of item to read. */
-    p_md->p_subitems        = NULL;
-
-    p_md->p_event_manager = libvlc_event_manager_new( p_md, p_instance, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager,
-        libvlc_MediaDescriptorMetaChanged, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager,
-        libvlc_MediaDescriptorSubItemAdded, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager,
-        libvlc_MediaDescriptorFreed, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager,
-        libvlc_MediaDescriptorDurationChanged, p_e );
-    libvlc_event_manager_register_event_type( p_md->p_event_manager,
-        libvlc_MediaDescriptorStateChanged, p_e );
-
-    vlc_gc_incref( p_md->p_input_item );
-
-    install_input_item_observer( p_md );
-
-    return p_md;
-}
-
-/**************************************************************************
- * Create a new media descriptor object
- **************************************************************************/
-libvlc_media_descriptor_t * libvlc_media_descriptor_new(
-                                   libvlc_instance_t *p_instance,
-                                   const char * psz_mrl,
-                                   libvlc_exception_t *p_e )
-{
-    input_item_t * p_input_item;
-    libvlc_media_descriptor_t * p_md;
-
-    p_input_item = input_ItemNew( p_instance->p_libvlc_int, psz_mrl, NULL );
-
-    if (!p_input_item)
-    {
-        libvlc_exception_raise( p_e, "Can't create md's input_item" );
-        return NULL;
-    }
-
-    p_md = libvlc_media_descriptor_new_from_input_item( p_instance,
-                p_input_item, p_e );
-
-    /* The p_input_item is retained in libvlc_media_descriptor_new_from_input_item */
-    vlc_gc_decref( p_input_item );
-    
-    return p_md;
-}
-
-/**************************************************************************
- * Create a new media descriptor object
- **************************************************************************/
-libvlc_media_descriptor_t * libvlc_media_descriptor_new_as_node(
-                                   libvlc_instance_t *p_instance,
-                                   const char * psz_name,
-                                   libvlc_exception_t *p_e )
-{
-    input_item_t * p_input_item;
-    libvlc_media_descriptor_t * p_md;
-
-    p_input_item = input_ItemNew( p_instance->p_libvlc_int, "vlc://nop", psz_name );
-
-    if (!p_input_item)
-    {
-        libvlc_exception_raise( p_e, "Can't create md's input_item" );
-        return NULL;
-    }
-
-    p_md = libvlc_media_descriptor_new_from_input_item( p_instance,
-                p_input_item, p_e );
-
-    p_md->p_subitems = libvlc_media_list_new( p_md->p_libvlc_instance, NULL );
-
-    return p_md;
-}
-
-/**************************************************************************
- * Add an option to the media descriptor,
- * that will be used to determine how the media_instance will read the
- * media_descriptor. This allow to use VLC advanced reading/streaming
- * options in a per-media basis
- *
- * The options are detailled in vlc --long-help, for instance "--sout-all"
- **************************************************************************/
-void libvlc_media_descriptor_add_option(
-                                   libvlc_media_descriptor_t * p_md,
-                                   const char * ppsz_option,
-                                   libvlc_exception_t *p_e )
-{
-    (void)p_e;
-    input_ItemAddOpt( p_md->p_input_item, ppsz_option,
-                      VLC_INPUT_OPTION_UNIQUE|VLC_INPUT_OPTION_TRUSTED );
-}
-
-/**************************************************************************
- * Delete a media descriptor object
- **************************************************************************/
-void libvlc_media_descriptor_release( libvlc_media_descriptor_t *p_md )
-{
-    if (!p_md)
-        return;
-
-    p_md->i_refcount--;
-
-    if( p_md->i_refcount > 0 )
-        return;
-
-    if( p_md->p_subitems )
-        libvlc_media_list_release( p_md->p_subitems );
-
-    uninstall_input_item_observer( p_md );
-    vlc_gc_decref( p_md->p_input_item );
-
-    /* Construct the event */
-    libvlc_event_t event;
-    event.type = libvlc_MediaDescriptorFreed;
-    event.u.media_descriptor_freed.md = p_md;
-
-    /* Send the event */
-    libvlc_event_send( p_md->p_event_manager, &event );
-
-    libvlc_event_manager_release( p_md->p_event_manager );
-
-    free( p_md );
-}
-
-/**************************************************************************
- * Retain a media descriptor object
- **************************************************************************/
-void libvlc_media_descriptor_retain( libvlc_media_descriptor_t *p_md )
-{
-    if (!p_md)
-        return;
-
-    p_md->i_refcount++;
-}
-
-/**************************************************************************
- * Duplicate a media descriptor object
- **************************************************************************/
-libvlc_media_descriptor_t *
-libvlc_media_descriptor_duplicate( libvlc_media_descriptor_t *p_md_orig )
-{
-    return libvlc_media_descriptor_new_from_input_item(
-        p_md_orig->p_libvlc_instance, p_md_orig->p_input_item, NULL );
-}
-
-/**************************************************************************
- * Retain a media descriptor object
- **************************************************************************/
-char *
-libvlc_media_descriptor_get_mrl( libvlc_media_descriptor_t * p_md,
-                                 libvlc_exception_t * p_e )
-{
-    (void)p_e;
-    return input_item_GetURI( p_md->p_input_item );
-}
-
-/**************************************************************************
- * Getter for meta information
- **************************************************************************/
-
-char * libvlc_media_descriptor_get_meta( libvlc_media_descriptor_t *p_md,
-                                         libvlc_meta_t e_meta,
-                                         libvlc_exception_t *p_e )
-{
-    VLC_UNUSED(p_e);
-
-    char * psz_meta;
-
-    /* XXX: locking */
-
-    preparse_if_needed( p_md );
-
-    psz_meta = input_item_GetMeta( p_md->p_input_item,
-                                   libvlc_to_vlc_meta[e_meta] );
-    
-    if( e_meta == libvlc_meta_ArtworkURL && !psz_meta )
-    {
-        playlist_AskForArtEnqueue(
-                p_md->p_libvlc_instance->p_libvlc_int->p_playlist,
-                p_md->p_input_item );
-    }
-
-    /* Should be integrated in core */
-    if( !psz_meta && e_meta == libvlc_meta_Title && p_md->p_input_item->psz_name )
-    {
-        free( psz_meta );
-        return strdup( p_md->p_input_item->psz_name );
-    }
-
-    return psz_meta;
-}
-
-/**************************************************************************
- * Getter for state information
- * Can be error, playing, buffering, NothingSpecial.
- **************************************************************************/
-
-libvlc_state_t
-libvlc_media_descriptor_get_state( libvlc_media_descriptor_t *p_md,
-                                   libvlc_exception_t *p_e )
-{
-    (void)p_e;
-    return p_md->state;
-}
-
-/**************************************************************************
- * Setter for state information (LibVLC Internal)
- **************************************************************************/
-
-void
-libvlc_media_descriptor_set_state( libvlc_media_descriptor_t *p_md,
-                                   libvlc_state_t state,
-                                   libvlc_exception_t *p_e )
-{
-    (void)p_e;
-    libvlc_event_t event;
-
-    p_md->state = state;
-
-    /* Construct the event */
-    event.type = libvlc_MediaDescriptorStateChanged;
-    event.u.media_descriptor_state_changed.new_state = state;
-
-    /* Send the event */
-    libvlc_event_send( p_md->p_event_manager, &event );
-}
-
-/**************************************************************************
- * subitems
- **************************************************************************/
-libvlc_media_list_t *
-libvlc_media_descriptor_subitems( libvlc_media_descriptor_t * p_md,
-                                  libvlc_exception_t * p_e )
-{
-    VLC_UNUSED(p_e);
-
-    if( p_md->p_subitems )
-        libvlc_media_list_retain( p_md->p_subitems );
-    return p_md->p_subitems;
-}
-
-/**************************************************************************
- * event_manager
- **************************************************************************/
-libvlc_event_manager_t *
-libvlc_media_descriptor_event_manager( libvlc_media_descriptor_t * p_md,
-                                       libvlc_exception_t * p_e )
-{
-    VLC_UNUSED(p_e);
-
-    return p_md->p_event_manager;
-}
-
-/**************************************************************************
- * Get duration of media_descriptor object.
- **************************************************************************/
-vlc_int64_t
-libvlc_media_descriptor_get_duration( libvlc_media_descriptor_t * p_md,
-                                      libvlc_exception_t * p_e )
-{
-    VLC_UNUSED(p_e);
-
-    if( p_md && p_md->p_input_item)
-    {
-        return input_item_GetDuration( p_md->p_input_item );
-    }
-    else
-    {
-        return -1;
-    }
-}
-
-/**************************************************************************
- * Get preparsed status for media_descriptor object.
- **************************************************************************/
-int
-libvlc_media_descriptor_is_preparsed( libvlc_media_descriptor_t * p_md,
-                                       libvlc_exception_t * p_e )
-{
-    VLC_UNUSED(p_e);
-
-    if( p_md && p_md->p_input_item)
-    {
-        return input_item_IsPreparsed( p_md->p_input_item );
-    }
-    else
-    {
-        return VLC_FALSE;
-    }
-}
-
-/**************************************************************************
- * Sets media descriptor's user_data. user_data is specialized data 
- * accessed by the host application, VLC.framework uses it as a pointer to 
- * an native object that references a libvlc_media_descriptor_t pointer
- **************************************************************************/
-void 
-libvlc_media_descriptor_set_user_data( libvlc_media_descriptor_t * p_md,
-                                       void * p_new_user_data,
-                                       libvlc_exception_t * p_e )
-{
-    VLC_UNUSED(p_e);
-
-    if( p_md )
-    {
-        p_md->p_user_data = p_new_user_data;
-    }
-}
-
-/**************************************************************************
- * Get media descriptor's user_data. user_data is specialized data 
- * accessed by the host application, VLC.framework uses it as a pointer to 
- * an native object that references a libvlc_media_descriptor_t pointer
- **************************************************************************/
-void *
-libvlc_media_descriptor_get_user_data( libvlc_media_descriptor_t * p_md,
-                                       libvlc_exception_t * p_e )
-{
-    VLC_UNUSED(p_e);
-
-    if( p_md )
-    {
-        return p_md->p_user_data;
-    }
-    else
-    {
-        return NULL;
-    }
-}
-
index 0a1d1a2..2d75fed 100644 (file)
@@ -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 );
diff --git a/src/control/media_instance.c b/src/control/media_instance.c
deleted file mode 100644 (file)
index a9856c0..0000000
+++ /dev/null
@@ -1,936 +0,0 @@
-/*****************************************************************************
- * media_instance.c: Libvlc API Media Instance management functions
- *****************************************************************************
- * Copyright (C) 2005 the VideoLAN team
- * $Id$
- *
- * Authors: ClĂ©ment Stenac <zorglub@videolan.org>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
- *****************************************************************************/
-
-#include "libvlc_internal.h"
-
-#include <vlc/libvlc.h>
-#include <vlc_demux.h>
-#include <vlc_input.h>
-#include "libvlc.h"
-
-static int
-input_state_changed( vlc_object_t * p_this, char const * psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval,
-                     void * p_userdata );
-static int
-input_seekable_changed( vlc_object_t * p_this, char const * psz_cmd,
-                        vlc_value_t oldval, vlc_value_t newval,
-                        void * p_userdata );
-static int
-input_pausable_changed( vlc_object_t * p_this, char const * psz_cmd,
-                        vlc_value_t oldval, vlc_value_t newval,
-                        void * p_userdata );
-static int
-input_position_changed( vlc_object_t * p_this, char const * psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval,
-                     void * p_userdata );
-static int
-input_time_changed( vlc_object_t * p_this, char const * psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval,
-                     void * p_userdata );
-
-static const libvlc_state_t vlc_to_libvlc_state_array[] =
-{
-    [INIT_S]        = libvlc_Opening,
-    [OPENING_S]     = libvlc_Opening,
-    [BUFFERING_S]   = libvlc_Buffering,    
-    [PLAYING_S]     = libvlc_Playing,    
-    [PAUSE_S]       = libvlc_Paused,    
-    [END_S]         = libvlc_Ended,    
-    [ERROR_S]       = libvlc_Error,    
-};
-static inline libvlc_state_t vlc_to_libvlc_state( int vlc_state )
-{
-    if( vlc_state < 0 || vlc_state > 6 )
-        return libvlc_Stopped;
-
-    return vlc_to_libvlc_state_array[vlc_state];
-}
-
-/*
- * Release the associated input thread
- *
- * Object lock is NOT held.
- */
-static void release_input_thread( libvlc_media_instance_t *p_mi )
-{
-    input_thread_t * p_input_thread;
-
-    if( !p_mi || !p_mi->p_input_thread )
-        return;
-
-    p_input_thread = p_mi->p_input_thread;
-
-    /* No one is tracking this input_thread appart us. Destroy it */
-    if( p_mi->b_own_its_input_thread )
-    {
-        var_DelCallback( p_input_thread, "state", input_state_changed, p_mi );
-        var_DelCallback( p_input_thread, "seekable", input_seekable_changed, p_mi );
-        var_DelCallback( p_input_thread, "pausable", input_pausable_changed, p_mi );
-        var_DelCallback( p_input_thread, "intf-change", input_position_changed, p_mi );
-        var_DelCallback( p_input_thread, "intf-change", input_time_changed, p_mi );
-
-        /* We owned this one */
-        input_StopThread( p_input_thread );
-
-        var_Destroy( p_input_thread, "drawable" );
-    }
-
-    vlc_object_release( p_input_thread );
-
-    p_mi->p_input_thread = NULL;
-}
-
-/*
- * Retrieve the input thread. Be sure to release the object
- * once you are done with it. (libvlc Internal)
- *
- * Object lock is held.
- */
-input_thread_t *libvlc_get_input_thread( libvlc_media_instance_t *p_mi,
-                                         libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-
-    if( !p_mi ) RAISENULL( "Media Instance is NULL" );
-    
-    vlc_mutex_lock( &p_mi->object_lock );
-
-    if( !p_mi->p_input_thread )
-    {
-        vlc_mutex_unlock( &p_mi->object_lock );
-        RAISENULL( "Input is NULL" );
-    }
-
-    p_input_thread = p_mi->p_input_thread;
-    vlc_object_yield( p_input_thread );
-
-    vlc_mutex_unlock( &p_mi->object_lock );
-
-    return p_input_thread;
-}
-
-/*
- * input_state_changed (Private) (input var "state" Callback)
- */
-static int
-input_state_changed( vlc_object_t * p_this, char const * psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval,
-                     void * p_userdata )
-{
-    VLC_UNUSED(oldval);
-    VLC_UNUSED(p_this);
-    VLC_UNUSED(psz_cmd);
-    libvlc_media_instance_t * p_mi = p_userdata;
-    libvlc_event_t event;
-    libvlc_event_type_t type = newval.i_int;
-
-    switch ( type )
-    {
-        case END_S:
-            libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
-            event.type = libvlc_MediaInstanceReachedEnd;
-            break;
-        case PAUSE_S:
-            libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_Playing, NULL);
-            event.type = libvlc_MediaInstancePaused;
-            break;
-        case PLAYING_S:
-            libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_Playing, NULL);
-            event.type = libvlc_MediaInstancePlayed;
-            break;
-        case ERROR_S:
-            libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_Error, NULL);
-            event.type = libvlc_MediaInstanceEncounteredError;
-            break;
-        default:
-            return VLC_SUCCESS;
-    }
-
-    libvlc_event_send( p_mi->p_event_manager, &event );
-    return VLC_SUCCESS;
-}
-
-static int
-input_seekable_changed( vlc_object_t * p_this, char const * psz_cmd,
-                        vlc_value_t oldval, vlc_value_t newval,
-                        void * p_userdata )
-{
-    VLC_UNUSED(oldval);
-    VLC_UNUSED(p_this);
-    VLC_UNUSED(psz_cmd);
-    libvlc_media_instance_t * p_mi = p_userdata;
-    libvlc_event_t event;
-
-    libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
-    event.type = libvlc_MediaInstanceSeekableChanged;
-    event.u.media_instance_seekable_changed.new_seekable = newval.b_bool;
-
-    libvlc_event_send( p_mi->p_event_manager, &event );
-    return VLC_SUCCESS;
-}
-
-static int
-input_pausable_changed( vlc_object_t * p_this, char const * psz_cmd,
-                        vlc_value_t oldval, vlc_value_t newval,
-                        void * p_userdata )
-{
-    VLC_UNUSED(oldval);
-    VLC_UNUSED(p_this);
-    VLC_UNUSED(psz_cmd);
-    libvlc_media_instance_t * p_mi = p_userdata;
-    libvlc_event_t event;
-
-    libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL);
-    event.type = libvlc_MediaInstancePausableChanged;
-    event.u.media_instance_pausable_changed.new_pausable = newval.b_bool;
-
-    libvlc_event_send( p_mi->p_event_manager, &event );
-    return VLC_SUCCESS;
-}
-
-/*
- * input_position_changed (Private) (input var "intf-change" Callback)
- */
-static int
-input_position_changed( vlc_object_t * p_this, char const * psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval,
-                     void * p_userdata )
-{
-    VLC_UNUSED(oldval);
-    libvlc_media_instance_t * p_mi = p_userdata;
-    vlc_value_t val;
-
-    if (!strncmp(psz_cmd, "intf", 4 /* "-change" no need to go further */))
-    {
-        input_thread_t * p_input = (input_thread_t *)p_this;
-
-        var_Get( p_input, "state", &val );
-        if( val.i_int != PLAYING_S )
-            return VLC_SUCCESS; /* Don't send the position while stopped */
-
-        var_Get( p_input, "position", &val );
-    }
-    else
-        val.i_time = newval.i_time;
-
-    libvlc_event_t event;
-    event.type = libvlc_MediaInstancePositionChanged;
-    event.u.media_instance_position_changed.new_position = val.f_float;
-
-    libvlc_event_send( p_mi->p_event_manager, &event );
-    return VLC_SUCCESS;
-}
-
-/*
- * input_time_changed (Private) (input var "intf-change" Callback)
- */
-static int
-input_time_changed( vlc_object_t * p_this, char const * psz_cmd,
-                     vlc_value_t oldval, vlc_value_t newval,
-                     void * p_userdata )
-{
-    VLC_UNUSED(oldval);
-    libvlc_media_instance_t * p_mi = p_userdata;
-    vlc_value_t val;
-
-    if (!strncmp(psz_cmd, "intf", 4 /* "-change" no need to go further */))
-    {
-        input_thread_t * p_input = (input_thread_t *)p_this;
-    
-        var_Get( p_input, "state", &val );
-        if( val.i_int != PLAYING_S )
-            return VLC_SUCCESS; /* Don't send the position while stopped */
-
-        var_Get( p_input, "time", &val );
-    }
-    else
-        val.i_time = newval.i_time;
-
-    libvlc_event_t event;
-    event.type = libvlc_MediaInstanceTimeChanged;
-    event.u.media_instance_time_changed.new_time = val.i_time;
-    libvlc_event_send( p_mi->p_event_manager, &event );
-    return VLC_SUCCESS;
-}
-
-/**************************************************************************
- * Create a Media Instance object
- **************************************************************************/
-libvlc_media_instance_t *
-libvlc_media_instance_new( libvlc_instance_t * p_libvlc_instance,
-                           libvlc_exception_t * p_e )
-{
-    libvlc_media_instance_t * p_mi;
-
-    if( !p_libvlc_instance )
-    {
-        libvlc_exception_raise( p_e, "invalid libvlc instance" );
-        return NULL;
-    }
-
-    p_mi = malloc( sizeof(libvlc_media_instance_t) );
-    p_mi->p_md = NULL;
-    p_mi->drawable = 0;
-    p_mi->p_libvlc_instance = p_libvlc_instance;
-    p_mi->p_input_thread = NULL;
-    /* refcount strategy:
-     * - All items created by _new start with a refcount set to 1
-     * - Accessor _release decrease the refcount by 1, if after that
-     *   operation the refcount is 0, the object is destroyed.
-     * - Accessor _retain increase the refcount by 1 (XXX: to implement) */
-    p_mi->i_refcount = 1;
-    p_mi->b_own_its_input_thread = VLC_TRUE;
-    /* object_lock strategy:
-     * - No lock held in constructor
-     * - Lock when accessing all variable this lock is held
-     * - Lock when attempting to destroy the object the lock is also held */
-    vlc_mutex_init( p_mi->p_libvlc_instance->p_libvlc_int,
-                    &p_mi->object_lock );
-    p_mi->p_event_manager = libvlc_event_manager_new( p_mi,
-            p_libvlc_instance, p_e );
-    if( libvlc_exception_raised( p_e ) )
-    {
-        free( p_mi );
-        return NULL;
-    }
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstanceReachedEnd, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstanceEncounteredError, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstancePaused, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstancePlayed, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstancePositionChanged, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstanceTimeChanged, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstanceSeekableChanged, p_e );
-    libvlc_event_manager_register_event_type( p_mi->p_event_manager,
-            libvlc_MediaInstancePausableChanged, p_e );
-
-    return p_mi;
-}
-
-/**************************************************************************
- * Create a Media Instance object with a media descriptor
- **************************************************************************/
-libvlc_media_instance_t *
-libvlc_media_instance_new_from_media_descriptor(
-                                    libvlc_media_descriptor_t * p_md,
-                                    libvlc_exception_t *p_e )
-{
-    libvlc_media_instance_t * p_mi;
-    p_mi = libvlc_media_instance_new( p_md->p_libvlc_instance, p_e );
-
-    if( !p_mi )
-        return NULL;
-
-    libvlc_media_descriptor_retain( p_md );
-    p_mi->p_md = p_md;
-
-    return p_mi;
-}
-
-/**************************************************************************
- * Create a new media instance object from an input_thread (Libvlc Internal)
- **************************************************************************/
-libvlc_media_instance_t * libvlc_media_instance_new_from_input_thread(
-                                   struct libvlc_instance_t *p_libvlc_instance,
-                                   input_thread_t *p_input,
-                                   libvlc_exception_t *p_e )
-{
-    libvlc_media_instance_t * p_mi;
-
-    if( !p_input )
-    {
-        libvlc_exception_raise( p_e, "invalid input thread" );
-        return NULL;
-    }
-
-    p_mi = libvlc_media_instance_new( p_libvlc_instance, p_e );
-
-    if( !p_mi )
-        return NULL;
-
-    p_mi->p_md = libvlc_media_descriptor_new_from_input_item(
-                    p_libvlc_instance,
-                    input_GetItem( p_input ), p_e );
-
-    if( !p_mi->p_md )
-    {
-        libvlc_media_instance_destroy( p_mi );
-        return NULL;
-    }
-
-    /* will be released in media_instance_release() */
-    vlc_object_yield( p_input );
-
-    p_mi->p_input_thread = p_input;
-    p_mi->b_own_its_input_thread = VLC_FALSE;
-
-    return p_mi;
-}
-
-/**************************************************************************
- * Destroy a Media Instance object (libvlc internal)
- *
- * Warning: No lock held here, but hey, this is internal.
- **************************************************************************/
-void libvlc_media_instance_destroy( libvlc_media_instance_t *p_mi )
-{
-    input_thread_t *p_input_thread;
-    libvlc_exception_t p_e;
-
-    libvlc_exception_init( &p_e );
-
-    if( !p_mi )
-        return;
-
-    p_input_thread = libvlc_get_input_thread( p_mi, &p_e );
-
-    if( libvlc_exception_raised( &p_e ) )
-    {
-        libvlc_event_manager_release( p_mi->p_event_manager );
-        libvlc_exception_clear( &p_e );
-        free( p_mi );
-        return; /* no need to worry about no input thread */
-    }
-    vlc_mutex_destroy( &p_mi->object_lock );
-
-    vlc_object_release( p_input_thread );
-
-    libvlc_media_descriptor_release( p_mi->p_md );
-
-    free( p_mi );
-}
-
-/**************************************************************************
- * Release a Media Instance object
- **************************************************************************/
-void libvlc_media_instance_release( libvlc_media_instance_t *p_mi )
-{
-    if( !p_mi )
-        return;
-
-    vlc_mutex_lock( &p_mi->object_lock );
-    p_mi->i_refcount--;
-
-    if( p_mi->i_refcount > 0 )
-    {
-        vlc_mutex_unlock( &p_mi->object_lock );
-        return;
-    }
-    vlc_mutex_unlock( &p_mi->object_lock );
-    vlc_mutex_destroy( &p_mi->object_lock );
-
-    release_input_thread( p_mi );
-
-    libvlc_event_manager_release( p_mi->p_event_manager );
-    libvlc_media_descriptor_release( p_mi->p_md );
-
-    free( p_mi );
-}
-
-/**************************************************************************
- * Retain a Media Instance object
- **************************************************************************/
-void libvlc_media_instance_retain( libvlc_media_instance_t *p_mi )
-{
-    if( !p_mi )
-        return;
-
-    p_mi->i_refcount++;
-}
-
-/**************************************************************************
- * Set the Media descriptor associated with the instance
- **************************************************************************/
-void libvlc_media_instance_set_media_descriptor(
-                            libvlc_media_instance_t *p_mi,
-                            libvlc_media_descriptor_t *p_md,
-                            libvlc_exception_t *p_e )
-{
-    (void)p_e;
-
-    if( !p_mi )
-        return;
-
-    vlc_mutex_lock( &p_mi->object_lock );
-
-    release_input_thread( p_mi );
-
-    if( p_mi->p_md )
-        libvlc_media_descriptor_set_state( p_mi->p_md, libvlc_NothingSpecial, NULL );
-
-    libvlc_media_descriptor_release( p_mi->p_md );
-
-    if( !p_md )
-    {
-        p_mi->p_md = NULL;
-        vlc_mutex_unlock( &p_mi->object_lock );
-        return; /* It is ok to pass a NULL md */
-    }
-
-    libvlc_media_descriptor_retain( p_md );
-    p_mi->p_md = p_md;
-    /* The policy here is to ignore that we were created using a different
-     * libvlc_instance, because we don't really care */
-    p_mi->p_libvlc_instance = p_md->p_libvlc_instance;
-
-    vlc_mutex_unlock( &p_mi->object_lock );
-}
-
-/**************************************************************************
- * Get the Media descriptor associated with the instance
- **************************************************************************/
-libvlc_media_descriptor_t *
-libvlc_media_instance_get_media_descriptor(
-                            libvlc_media_instance_t *p_mi,
-                            libvlc_exception_t *p_e )
-{
-    (void)p_e;
-
-    if( !p_mi->p_md )
-        return NULL;
-
-    libvlc_media_descriptor_retain( p_mi->p_md );
-    return p_mi->p_md;
-}
-
-/**************************************************************************
- * Get the event Manager
- **************************************************************************/
-libvlc_event_manager_t *
-libvlc_media_instance_event_manager(
-                            libvlc_media_instance_t *p_mi,
-                            libvlc_exception_t *p_e )
-{
-    (void)p_e;
-
-    return p_mi->p_event_manager;
-}
-
-/**************************************************************************
- * Play
- **************************************************************************/
-void libvlc_media_instance_play( libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t * p_input_thread;
-
-    if( (p_input_thread = libvlc_get_input_thread( p_mi, p_e )) )
-    {
-        /* A thread already exists, send it a play message */
-        input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S );
-        vlc_object_release( p_input_thread );
-        return;
-    }
-
-    /* Ignore previous exception */
-    libvlc_exception_clear( p_e );
-
-    vlc_mutex_lock( &p_mi->object_lock );
-    if( !p_mi->p_md )
-    {
-        libvlc_exception_raise( p_e, "no associated media descriptor" );
-        vlc_mutex_unlock( &p_mi->object_lock );
-        return;
-    }
-
-    p_mi->p_input_thread = input_CreateThread( p_mi->p_libvlc_instance->p_libvlc_int,
-                      p_mi->p_md->p_input_item );
-
-
-    if( !p_mi->p_input_thread )
-    {
-        vlc_mutex_unlock( &p_mi->object_lock );
-        return;
-    }
-
-    p_input_thread = p_mi->p_input_thread;
-
-    if( p_mi->drawable )
-    {
-        vlc_value_t val;
-        val.i_int = p_mi->drawable;
-        var_Create( p_input_thread, "drawable", VLC_VAR_DOINHERIT );
-        var_Set( p_input_thread, "drawable", val );
-    }
-    var_AddCallback( p_input_thread, "state", input_state_changed, p_mi );
-    var_AddCallback( p_input_thread, "seekable", input_seekable_changed, p_mi );
-    var_AddCallback( p_input_thread, "pausable", input_pausable_changed, p_mi );
-    var_AddCallback( p_input_thread, "intf-change", input_position_changed, p_mi );
-    var_AddCallback( p_input_thread, "intf-change", input_time_changed, p_mi );
-
-    vlc_mutex_unlock( &p_mi->object_lock );
-}
-
-/**************************************************************************
- * Pause
- **************************************************************************/
-void libvlc_media_instance_pause( libvlc_media_instance_t *p_mi,
-                                  libvlc_exception_t *p_e )
-{
-    input_thread_t * p_input_thread = libvlc_get_input_thread( p_mi, p_e );
-
-    if( !p_input_thread )
-        return;
-
-    int state = var_GetInteger( p_input_thread, "state" );
-
-    if( state == PLAYING_S )
-    {
-        if( libvlc_media_instance_can_pause( p_mi, p_e ) )
-            input_Control( p_input_thread, INPUT_SET_STATE, PAUSE_S );
-        else
-            libvlc_media_instance_stop( p_mi, p_e );
-    }
-    else
-        input_Control( p_input_thread, INPUT_SET_STATE, PLAYING_S );
-
-    vlc_object_release( p_input_thread );
-}
-
-/**************************************************************************
- * Stop
- **************************************************************************/
-void libvlc_media_instance_stop( libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    if( p_mi->b_own_its_input_thread )
-    {
-        vlc_mutex_lock( &p_mi->object_lock );
-        release_input_thread( p_mi ); /* This will stop the input thread */
-        vlc_mutex_unlock( &p_mi->object_lock );
-    }
-    else
-    {
-        input_thread_t * p_input_thread = libvlc_get_input_thread( p_mi, p_e );
-
-        if( !p_input_thread )
-            return;
-
-        input_StopThread( p_input_thread );
-        vlc_object_release( p_input_thread );
-    }
-}
-
-/**************************************************************************
- * Set Drawable
- **************************************************************************/
-void libvlc_media_instance_set_drawable( libvlc_media_instance_t *p_mi,
-                                         libvlc_drawable_t drawable,
-                                         libvlc_exception_t *p_e )
-{
-    (void)p_e;
-    p_mi->drawable = drawable;
-}
-
-/**************************************************************************
- * Get Drawable
- **************************************************************************/
-libvlc_drawable_t
-libvlc_media_instance_get_drawable ( libvlc_media_instance_t *p_mi, libvlc_exception_t *p_e )
-{
-    (void)p_e;
-    return p_mi->drawable;
-}
-
-/**************************************************************************
- * Getters for stream information
- **************************************************************************/
-libvlc_time_t libvlc_media_instance_get_length(
-                             libvlc_media_instance_t *p_mi,
-                             libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
-    if( !p_input_thread )
-        return -1;
-
-    var_Get( p_input_thread, "length", &val );
-    vlc_object_release( p_input_thread );
-
-    return (val.i_time+500LL)/1000LL;
-}
-
-libvlc_time_t libvlc_media_instance_get_time(
-                                   libvlc_media_instance_t *p_mi,
-                                   libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if( !p_input_thread )
-        return -1;
-
-    var_Get( p_input_thread , "time", &val );
-    vlc_object_release( p_input_thread );
-    return (val.i_time+500LL)/1000LL;
-}
-
-void libvlc_media_instance_set_time(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_time_t time,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t value;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if( !p_input_thread )
-        return;
-
-    value.i_time = time*1000LL;
-    var_Set( p_input_thread, "time", value );
-    vlc_object_release( p_input_thread );
-}
-
-void libvlc_media_instance_set_position(
-                                libvlc_media_instance_t *p_mi,
-                                float position,
-                                libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-    val.f_float = position;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
-    if( !p_input_thread )
-        return;
-
-    var_Set( p_input_thread, "position", val );
-    vlc_object_release( p_input_thread );
-}
-
-float libvlc_media_instance_get_position(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if( !p_input_thread )
-        return -1.0;
-
-    var_Get( p_input_thread, "position", &val );
-    vlc_object_release( p_input_thread );
-
-    return val.f_float;
-}
-
-void libvlc_media_instance_set_chapter(
-                                 libvlc_media_instance_t *p_mi,
-                                 int chapter,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-    val.i_int = chapter;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
-    if( !p_input_thread )
-        return;
-
-    var_Set( p_input_thread, "chapter", val );
-    vlc_object_release( p_input_thread );
-}
-
-int libvlc_media_instance_get_chapter(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if( !p_input_thread )
-        return -1.0;
-
-    var_Get( p_input_thread, "chapter", &val );
-    vlc_object_release( p_input_thread );
-
-    return val.i_int;
-}
-
-int libvlc_media_instance_get_chapter_count(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if( !p_input_thread )
-        return -1.0;
-
-    var_Change( p_input_thread, "chapter", VLC_VAR_CHOICESCOUNT, &val, NULL );
-    vlc_object_release( p_input_thread );
-
-    return val.i_int;
-}
-
-float libvlc_media_instance_get_fps(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e)
-{
-    input_thread_t *p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    double f_fps = 0.0;
-
-    if( p_input_thread )
-    {
-        if( input_Control( p_input_thread, INPUT_GET_VIDEO_FPS, &f_fps ) )
-            f_fps = 0.0;
-        vlc_object_release( p_input_thread );
-    }
-    return f_fps;
-}
-
-int libvlc_media_instance_will_play( libvlc_media_instance_t *p_mi,
-                                     libvlc_exception_t *p_e)
-{
-    input_thread_t *p_input_thread =
-                            libvlc_get_input_thread ( p_mi, p_e);
-    if ( !p_input_thread )
-        return VLC_FALSE;
-
-    if ( !p_input_thread->b_die && !p_input_thread->b_dead )
-    {
-        vlc_object_release( p_input_thread );
-        return VLC_TRUE;
-    }
-    vlc_object_release( p_input_thread );
-    return VLC_FALSE;
-}
-
-void libvlc_media_instance_set_rate(
-                                 libvlc_media_instance_t *p_mi,
-                                 float rate,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    if( rate <= 0 )
-        RAISEVOID( "Rate value is invalid" );
-
-    val.i_int = 1000.0f/rate;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
-    if ( !p_input_thread )
-        return;
-
-    var_Set( p_input_thread, "rate", val );
-    vlc_object_release( p_input_thread );
-}
-
-float libvlc_media_instance_get_rate(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e);
-    if ( !p_input_thread )
-        return -1.0;
-
-    var_Get( p_input_thread, "rate", &val );
-    vlc_object_release( p_input_thread );
-
-    return (float)1000.0f/val.i_int;
-}
-
-libvlc_state_t libvlc_media_instance_get_state(
-                                 libvlc_media_instance_t *p_mi,
-                                 libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if ( !p_input_thread )
-    {
-        /* We do return the right value, no need to throw an exception */
-        if( libvlc_exception_raised( p_e ) )
-            libvlc_exception_clear( p_e );
-        return libvlc_Stopped;
-    }
-
-    var_Get( p_input_thread, "state", &val );
-    vlc_object_release( p_input_thread );
-
-    return vlc_to_libvlc_state(val.i_int);
-}
-
-int libvlc_media_instance_is_seekable( libvlc_media_instance_t *p_mi,
-                                       libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if ( !p_input_thread )
-    {
-        /* We do return the right value, no need to throw an exception */
-        if( libvlc_exception_raised( p_e ) )
-            libvlc_exception_clear( p_e );
-        return VLC_FALSE;
-    }
-    var_Get( p_input_thread, "seekable", &val );
-    vlc_object_release( p_input_thread );
-
-    return val.b_bool;
-}
-
-int libvlc_media_instance_can_pause( libvlc_media_instance_t *p_mi,
-                                     libvlc_exception_t *p_e )
-{
-    input_thread_t *p_input_thread;
-    vlc_value_t val;
-
-    p_input_thread = libvlc_get_input_thread ( p_mi, p_e );
-    if ( !p_input_thread )
-    {
-        /* We do return the right value, no need to throw an exception */
-        if( libvlc_exception_raised( p_e ) )
-            libvlc_exception_clear( p_e );
-        return VLC_FALSE;
-    }
-    var_Get( p_input_thread, "can-pause", &val );
-    vlc_object_release( p_input_thread );
-
-    return val.b_bool;
-}
index da9cd48..e97e86f 100644 (file)
@@ -1,6 +1,6 @@
 /*****************************************************************************
  * 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$
index e01b4a8..0eb8136 100644 (file)
@@ -52,7 +52,7 @@ typedef enum EventPlaceInTime {
  **************************************************************************/
 static void
 notify_item_addition( libvlc_media_list_t * p_mlist,
-                      libvlc_media_descriptor_t * p_md,
+                      libvlc_media_t * p_md,
                       int index,
                       EventPlaceInTime event_status )
 {
@@ -84,7 +84,7 @@ notify_item_addition( libvlc_media_list_t * p_mlist,
  **************************************************************************/
 static void
 notify_item_deletion( libvlc_media_list_t * p_mlist,
-                      libvlc_media_descriptor_t * p_md,
+                      libvlc_media_t * p_md,
                       int index,
                       EventPlaceInTime event_status )
 {
@@ -168,7 +168,7 @@ libvlc_media_list_new( libvlc_instance_t * p_inst,
  **************************************************************************/
 void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
 {
-    libvlc_media_descriptor_t * p_md;
+    libvlc_media_t * p_md;
     int i;
 
     vlc_mutex_lock( &p_mlist->object_lock );
@@ -185,12 +185,12 @@ void libvlc_media_list_release( libvlc_media_list_t * p_mlist )
     libvlc_event_manager_release( p_mlist->p_event_manager );
 
     if( p_mlist->p_md )
-        libvlc_media_descriptor_release( p_mlist->p_md );
+        libvlc_media_release( p_mlist->p_md );
 
     for ( i = 0; i < vlc_array_count( &p_mlist->items ); i++ )
     {
         p_md = vlc_array_item_at_index( &p_mlist->items, i );
-        libvlc_media_descriptor_release( p_md );
+        libvlc_media_release( p_md );
     }
 
     vlc_mutex_destroy( &p_mlist->object_lock );
@@ -221,7 +221,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
                                     libvlc_exception_t * p_e )
 {
     input_item_t * p_input_item;
-    libvlc_media_descriptor_t * p_md;
+    libvlc_media_t * p_md;
 
     p_input_item = input_ItemNewExt( p_mlist->p_libvlc_instance->p_libvlc_int, psz_uri,
                                 _("Media Library"), 0, NULL, -1 );
@@ -232,7 +232,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
         return;
     }
 
-    p_md = libvlc_media_descriptor_new_from_input_item(
+    p_md = libvlc_media_new_from_input_item(
             p_mlist->p_libvlc_instance,
             p_input_item, p_e );
 
@@ -242,7 +242,7 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
         return;
     }
 
-    libvlc_media_list_add_media_descriptor( p_mlist, p_md, p_e );
+    libvlc_media_list_add_media( p_mlist, p_md, p_e );
     if( libvlc_exception_raised( p_e ) )
         return;
 
@@ -252,42 +252,42 @@ libvlc_media_list_add_file_content( libvlc_media_list_t * p_mlist,
 }
 
 /**************************************************************************
- *       set_media_descriptor (Public)
+ *       set_media (Public)
  **************************************************************************/
-void libvlc_media_list_set_media_descriptor( libvlc_media_list_t * p_mlist,
-                                             libvlc_media_descriptor_t * p_md,
+void libvlc_media_list_set_media( libvlc_media_list_t * p_mlist,
+                                             libvlc_media_t * p_md,
                                              libvlc_exception_t * p_e)
 
 {
     (void)p_e;
     vlc_mutex_lock( &p_mlist->object_lock );
     if( p_mlist->p_md )
-        libvlc_media_descriptor_release( p_mlist->p_md );
-    libvlc_media_descriptor_retain( p_md );
+        libvlc_media_release( p_mlist->p_md );
+    libvlc_media_retain( p_md );
     p_mlist->p_md = p_md;
     vlc_mutex_unlock( &p_mlist->object_lock );
 }
 
 /**************************************************************************
- *       media_descriptor (Public)
+ *       media (Public)
  *
- * If this media_list comes is a media_descriptor's subitems,
- * This holds the corresponding media_descriptor.
+ * If this media_list comes is a media's subitems,
+ * This holds the corresponding media.
  * This md is also seen as the information holder for the media_list.
  * Indeed a media_list can have meta information through this
- * media_descriptor.
+ * media.
  **************************************************************************/
-libvlc_media_descriptor_t *
-libvlc_media_list_media_descriptor( libvlc_media_list_t * p_mlist,
+libvlc_media_t *
+libvlc_media_list_media( libvlc_media_list_t * p_mlist,
                                     libvlc_exception_t * p_e)
 {
-    libvlc_media_descriptor_t *p_md;
+    libvlc_media_t *p_md;
     (void)p_e;
 
     vlc_mutex_lock( &p_mlist->object_lock );
     p_md = p_mlist->p_md;
     if( p_md )
-        libvlc_media_descriptor_retain( p_md );
+        libvlc_media_retain( p_md );
     vlc_mutex_unlock( &p_mlist->object_lock );
 
     return p_md;
@@ -306,13 +306,13 @@ int libvlc_media_list_count( libvlc_media_list_t * p_mlist,
 }
 
 /**************************************************************************
- *       libvlc_media_list_add_media_descriptor (Public)
+ *       libvlc_media_list_add_media (Public)
  *
  * Lock should be hold when entering.
  **************************************************************************/
-void libvlc_media_list_add_media_descriptor(
+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 )
 {
     if( p_mlist->b_read_only )
@@ -322,17 +322,17 @@ void libvlc_media_list_add_media_descriptor(
         return;
     }
 
-    _libvlc_media_list_add_media_descriptor( p_mlist, p_md, p_e );
+    _libvlc_media_list_add_media( p_mlist, p_md, p_e );
 }
 
 /* LibVLC internal version */
-void _libvlc_media_list_add_media_descriptor(
+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 )
 {
     (void)p_e;
-    libvlc_media_descriptor_retain( p_md );
+    libvlc_media_retain( p_md );
 
     notify_item_addition( p_mlist, p_md, vlc_array_count( &p_mlist->items ), EventWillHappen );
     vlc_array_append( &p_mlist->items, p_md );
@@ -340,13 +340,13 @@ void _libvlc_media_list_add_media_descriptor(
 }
 
 /**************************************************************************
- *       libvlc_media_list_insert_media_descriptor (Public)
+ *       libvlc_media_list_insert_media (Public)
  *
  * Lock should be hold when entering.
  **************************************************************************/
-void libvlc_media_list_insert_media_descriptor(
+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 )
 {
@@ -356,18 +356,18 @@ void libvlc_media_list_insert_media_descriptor(
         libvlc_exception_raise( p_e, "Trying to write into a read-only media list." );
         return;
     }
-    _libvlc_media_list_insert_media_descriptor( p_mlist, p_md, index, p_e );
+    _libvlc_media_list_insert_media( p_mlist, p_md, index, p_e );
 }
 
 /* LibVLC internal version */
-void _libvlc_media_list_insert_media_descriptor(
+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 )
 {
     (void)p_e;
-    libvlc_media_descriptor_retain( p_md );
+    libvlc_media_retain( p_md );
 
     notify_item_addition( p_mlist, p_md, index, EventWillHappen );
     vlc_array_insert( &p_mlist->items, p_md, index );
@@ -398,7 +398,7 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
                                      libvlc_exception_t * p_e )
 {
 
-    libvlc_media_descriptor_t * p_md;
+    libvlc_media_t * p_md;
 
     if( index < 0 || index >= vlc_array_count( &p_mlist->items ))
     {
@@ -412,7 +412,7 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
     vlc_array_remove( &p_mlist->items, index );
     notify_item_deletion( p_mlist, p_md, index, EventDidHappen );
 
-    libvlc_media_descriptor_release( p_md );
+    libvlc_media_release( p_md );
 }
 
 /**************************************************************************
@@ -420,7 +420,7 @@ void _libvlc_media_list_remove_index( libvlc_media_list_t * p_mlist,
  *
  * Lock should be hold when entering.
  **************************************************************************/
-libvlc_media_descriptor_t *
+libvlc_media_t *
 libvlc_media_list_item_at_index( libvlc_media_list_t * p_mlist,
                                  int index,
                                  libvlc_exception_t * p_e )
@@ -433,9 +433,9 @@ libvlc_media_list_item_at_index( libvlc_media_list_t * p_mlist,
         return NULL;
     }
 
-    libvlc_media_descriptor_t * p_md;
+    libvlc_media_t * p_md;
     p_md = vlc_array_item_at_index( &p_mlist->items, index );
-    libvlc_media_descriptor_retain( p_md );
+    libvlc_media_retain( p_md );
     return p_md;
 }
 
@@ -446,12 +446,12 @@ libvlc_media_list_item_at_index( libvlc_media_list_t * p_mlist,
  * Warning: this function would return the first matching item
  **************************************************************************/
 int libvlc_media_list_index_of_item( libvlc_media_list_t * p_mlist,
-                                     libvlc_media_descriptor_</