]> git.sesse.net Git - vlc/blobdiff - src/libvlc.c
Less and less information with compile
[vlc] / src / libvlc.c
index 72e96f9c4621b4b8621e47b69227b648574230af..e8d3a4f6439a97b1c18601bd30c02fb35bfe1274 100644 (file)
@@ -1,7 +1,7 @@
 /*****************************************************************************
  * libvlc.c: Implementation of the old libvlc API
  *****************************************************************************
- * Copyright (C) 1998-2006 the VideoLAN team
+ * Copyright (C) 1998-2007 the VideoLAN team
  * $Id$
  *
  * Authors: Vincent Seguin <seguin@via.ecp.fr>
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
 #include <vlc/vlc.h>
-#include <vlc/input.h>
 
-#include <libvlc_internal.h>
+#include "control/libvlc_internal.h"
+#include "libvlc.h"
 
-#include <vlc_error.h>
+#include <vlc_playlist.h>
 
-#include "audio_output.h"
-#include "vlc_video.h"
-#include "video_output.h"
+#include <vlc_aout.h>
+#include <vlc_vout.h>
 
 /*****************************************************************************
  * VLC_Version: return the libvlc version.
@@ -71,13 +74,11 @@ DECLARE_VLC_VERSION( CompileHost, COMPILE_HOST );
 DECLARE_VLC_VERSION( CompileDomain, COMPILE_DOMAIN );
 DECLARE_VLC_VERSION( Compiler, COMPILER );
 
-#ifndef HAVE_SHARED_LIBVLC
 extern const char psz_vlc_changeset[];
-char const * VLC_Changeset( void )
+const char* VLC_Changeset( void )
 {
     return psz_vlc_changeset;
 }
-#endif
 
 /*****************************************************************************
  * VLC_Error: strerror() equivalent
@@ -118,7 +119,7 @@ int VLC_Create( void )
  *  - message queue, module bank and playlist initialization
  *  - configuration and commandline parsing
  *****************************************************************************/
-int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
+int VLC_Init( int i_object, int i_argc, const char *ppsz_argv[] )
 {
     int i_ret;
     LIBVLC_FUNC;
@@ -137,7 +138,7 @@ int VLC_Init( int i_object, int i_argc, char *ppsz_argv[] )
  * the playlist when it is completely initialised.
  *****************************************************************************/
 int VLC_AddIntf( int i_object, char const *psz_module,
-                 vlc_bool_t b_block, vlc_bool_t b_play )
+                 bool b_block, bool b_play )
 {
     int i_ret;
     LIBVLC_FUNC;
@@ -151,13 +152,13 @@ int VLC_AddIntf( int i_object, char const *psz_module,
 /*****************************************************************************
  * VLC_Die: ask vlc to die.
  *****************************************************************************
- * This function sets p_vlc->b_die to VLC_TRUE, but does not do any other
+ * This function sets p_libvlc->b_die to true, but does not do any other
  * task. It is your duty to call VLC_CleanUp and VLC_Destroy afterwards.
  *****************************************************************************/
 int VLC_Die( int i_object )
 {
     LIBVLC_FUNC;
-    p_libvlc->b_die = VLC_TRUE;
+    vlc_object_kill( p_libvlc );
     LIBVLC_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -183,7 +184,7 @@ int VLC_CleanUp( int i_object )
 int VLC_Destroy( int i_object )
 {
     LIBVLC_FUNC;
-    return libvlc_InternalDestroy( p_libvlc, i_object ? VLC_TRUE : VLC_FALSE );
+    return libvlc_InternalDestroy( p_libvlc, i_object ? true : false );
 }
 
 /*****************************************************************************
@@ -295,11 +296,12 @@ int VLC_VariableType( int i_object, char const *psz_var, int *pi_type )
 
 #define LIBVLC_PLAYLIST_FUNC \
     libvlc_int_t *p_libvlc = vlc_current_object( i_object );\
-    if( !p_libvlc || !p_libvlc->p_playlist ) return VLC_ENOOBJ; \
-    vlc_object_yield( p_libvlc->p_playlist );
+    if( !p_libvlc ) return VLC_ENOOBJ; \
+    playlist_t *p_playlist = pl_Yield( p_libvlc ); \
+    if( !p_playlist ) return VLC_ENOOBJ
 
 #define LIBVLC_PLAYLIST_FUNC_END \
-    vlc_object_release( p_libvlc->p_playlist ); \
+    pl_Release( p_libvlc ); \
     if( i_object ) vlc_object_release( p_libvlc );
 
 /*****************************************************************************
@@ -314,9 +316,9 @@ int VLC_AddTarget( int i_object, char const *psz_target,
 {
     int i_err;
     LIBVLC_PLAYLIST_FUNC;
-    i_err = playlist_PlaylistAddExt( p_libvlc->p_playlist, psz_target,
-                                     psz_target,  i_mode, i_pos, -1,
-                                     ppsz_options, i_options );
+    i_err = playlist_AddExt( p_playlist, psz_target,
+                             NULL,  i_mode, i_pos, -1,
+                             ppsz_options, i_options, true, false );
     LIBVLC_PLAYLIST_FUNC_END;
     return i_err;
 }
@@ -327,7 +329,7 @@ int VLC_AddTarget( int i_object, char const *psz_target,
 int VLC_Play( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Play( p_libvlc->p_playlist );
+    playlist_Play( p_playlist );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -338,7 +340,7 @@ int VLC_Play( int i_object )
 int VLC_Pause( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Pause( p_libvlc->p_playlist );
+    playlist_Pause( p_playlist );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -349,7 +351,7 @@ int VLC_Pause( int i_object )
 int VLC_Stop( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Stop( p_libvlc->p_playlist );
+    playlist_Stop( p_playlist );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -357,20 +359,20 @@ int VLC_Stop( int i_object )
 /*****************************************************************************
  * VLC_IsPlaying: Query for Playlist Status
  *****************************************************************************/
-vlc_bool_t VLC_IsPlaying( int i_object )
+bool VLC_IsPlaying( int i_object )
 {
-    vlc_bool_t   b_playing;
+    bool   b_playing;
 
     LIBVLC_PLAYLIST_FUNC;
-    if( p_libvlc->p_playlist->p_input )
+    if( p_playlist->p_input )
     {
         vlc_value_t  val;
-        var_Get( p_libvlc->p_playlist->p_input, "state", &val );
+        var_Get( p_playlist->p_input, "state", &val );
         b_playing = ( val.i_int == PLAYING_S );
     }
     else
     {
-        b_playing = playlist_IsPlaying( p_libvlc->p_playlist );
+        b_playing = playlist_IsPlaying( p_playlist );
     }
     LIBVLC_PLAYLIST_FUNC_END;
     return b_playing;
@@ -495,7 +497,7 @@ int VLC_TimeGet( int i_object )
  * \param b_relative seek relative from current position
  * \return VLC_SUCCESS on success
  */
-int VLC_TimeSet( int i_object, int i_seconds, vlc_bool_t b_relative )
+int VLC_TimeSet( int i_object, int i_seconds, bool b_relative )
 {
     input_thread_t *p_input;
     vlc_value_t val;
@@ -598,7 +600,7 @@ float VLC_SpeedFaster( int i_object )
         return VLC_ENOOBJ;
     }
 
-    val.b_bool = VLC_TRUE;
+    val.b_bool = true;
     var_Set( p_input, "rate-faster", val );
     var_Get( p_input, "rate", &val );
     vlc_object_release( p_input );
@@ -636,7 +638,7 @@ float VLC_SpeedSlower( int i_object )
         return VLC_ENOOBJ;
     }
 
-    val.b_bool = VLC_TRUE;
+    val.b_bool = true;
     var_Set( p_input, "rate-slower", val );
     var_Get( p_input, "rate", &val );
     vlc_object_release( p_input );
@@ -656,6 +658,7 @@ float VLC_SpeedSlower( int i_object )
  */
 int VLC_PlaylistIndex( int i_object )
 {
+    (void)i_object;
     printf( "This function is deprecated and should not be used anymore" );
     return -1;
 }
@@ -670,7 +673,7 @@ int VLC_PlaylistNumberOfItems( int i_object )
 {
     int i_size;
     LIBVLC_PLAYLIST_FUNC;
-    i_size = p_libvlc->p_playlist->i_size;
+    i_size = p_playlist->items.i_size;
     LIBVLC_PLAYLIST_FUNC_END;
     return i_size;
 }
@@ -683,7 +686,7 @@ int VLC_PlaylistNumberOfItems( int i_object )
 int VLC_PlaylistNext( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Next( p_libvlc->p_playlist );
+    playlist_Next( p_playlist );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -696,7 +699,7 @@ int VLC_PlaylistNext( int i_object )
 int VLC_PlaylistPrev( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Prev( p_libvlc->p_playlist );
+    playlist_Prev( p_playlist );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }
@@ -707,7 +710,7 @@ int VLC_PlaylistPrev( int i_object )
 int VLC_PlaylistClear( int i_object )
 {
     LIBVLC_PLAYLIST_FUNC;
-    playlist_Clear( p_libvlc->p_playlist );
+    playlist_Clear( p_playlist, true );
     LIBVLC_PLAYLIST_FUNC_END;
     return VLC_SUCCESS;
 }