ExternalAPI
From VideoLAN Wiki
Contents |
Explanations
VLC has an external API, "libvlc". It gives access to the most important internal functions.
There are two APIs for playing using VLC's core for playback:
- MediaControlAPI (simplified)
- LibVLC (powerful)
(There is an older "legacy" API, desribed below. Its symbols are prefixed by VLC_. However, developers are strongly encouraged to use the new, improved API, and to migrate older applications away from the legacy API.)
For those API it exists multiple bindings:
- .NET bindings
- java bindings
- python bindings
- cocoa bindings through the Mac OS X Framework
There is also a non official delphi bindings. -- Is that still maintained? Pdherbemont 03:52, 1 March 2008 (CET)
- delphi bindings: VideoLAN for Delphi (non official)
LibVLC
Description
- Declaration : include/vlc/vlc.h
- Implementation : src/control/*
New "official" VLC-specific API. Provides advanced control over VLC internals. You can read more info on the LibVLC page.
Symbols (out of date)
Structures
- libvlc_exception { int code; char *message }
- libvlc_instance { vlc_object_t *p_vlc } opaque
- libvlc_input { int i_input_id } opaque
Core
- libvlc_instance* libvlc_new( int argc , char **args , libvlc_exception )
- void libvlc_destroy( libvlc_instance *)
Playlist (deprecated, use libvlc_media_list_* API)
No need for a libvlc_playlist object as playlist is a singleton within a libvlc_instance
- void libvlc_playlist_play( libvlc_instance *, int item, int argc, char **options, libvlc_exception )
- void libvlc_playlist_stop( libvlc_instance *, libvlc_exception )
- void libvlc_playlist_pause( libvlc_instance *, libvlc_exception )
- int libvlc_playlist_add( libvlc_instance * , char *mrl, char **options, libvlc_exception )
- void libvlc_playlist_remove( libvlc_instance *, int item, libvlc_exception )
- void libvlc_playlist_clear( libvlc_instance *, libvlc_exception )
- void libvlc_playlist_next( libvlc_instance *, libvlc_exception )
- void libvlc_playlist_prev( libvlc_instance *, libvlc_exception )
- char ** libvlc_playlist_get_list( libvlc_instance *, libvlc_exception )
- void libvlc_playlist_sort( libvlc_instance * , int rule, libvlc_exception )
- libvlc_input_t * libvlc_playlist_get_input( libvlc_instance *, libvlc_exception )
Stream control and info
- mtime_t libvlc_input_get_length( libvlc_input_t *, libvlc_exception ) // Length in ms
- mtime_t libvlc_input_get_time( libvlc_input_t *, libvlc_exception ) // Current time in ms
- void libvlc_input_set_time( libvlc_input_t *, mtime_t , libvlc_exception )
- float libvlc_input_get_position( libvlc_input_t *, libvlc_exception ) // Position in %
- void libvlc_input_set_position( libvlc_input_t *, float , libvlc_exception )
- void libvlc_set_rate( libvlc_input_t *, float rate, libvlc_exception )
- float libvlc_get_rate( libvlc_input_t *, libvlc_exception )
- ??? libvlc_input_get_information( libvlc_input_t *, libvlc_exception )
Aout
Global so use a libvlc_instance
- vlc_bool_t libvlc_audio_get_mute( libvlc_instance *, libvlc_exception )
- void libvlc_audio_set_mute( libvlc_instance *, vlc_bool_t status, libvlc_exception )
- int libvlc_audio_volume_get( libvlc_instance *, libvlc_exception )
- void libvlc_audio_volume_set( libvlc_instance *, int, libvlc_exception )
Vout
libvlc_video_format_t { width, height, aspect, frame_rate }
Local, at least to a libvlc_input
- vlc_bool_t libvlc_video_get_fullscreen( libvlc_input *, libvlc_exception )
- void libvlc_set_fullscreen( libvlc_input *, int status, libvlc_exception *)
- libvlc_video_format_t * libvlc_video_get_format( libvlc_input *, libvlc_exception )
- ??? libvlc_video_snapshot( libvlc_input *, libvlc_exception ) // We would need to take a position parameter (should return char* with the location of the taken snapshot ???)
- void libvlc_video_display_text( libvlc_input *, char *text, mtime i_start, mtime i_stop, libvlc_exception )
- void libvlc_video_set_visual( libvlc_instance *, long visual_id, libvlc_exception ) // Used to embed the video output
VLM
- void libvlc_vlm_add_broadcast( libvlc_instance, char *name, char *input, char *output, char **options, libvlc_exception)
- void libvlc_vlm_add_vod( idem )
- ??? libvlc_vlm_get_broadcasts( libvlc_instance *, libvlc_exception)
- ??? libvlc_vlm_get_vods( libvlc_instance *, libvlc_exception )
- void libvlc_vlm_delete_broadcast( libvlc_instance, char *name, libvlc_exception)
- void libvlc_vlm_delete_vod( libvlc_instance, char *name, libvlc_exception )
- void libvlc_vlm_load( char *file, libvlc_exception )
- void libvlc_vlm_save( char *file, libvlc_exception )
Old LibVLC (Deprecated, scheduled for deletion)
Description
- Declaration : include/vlc/vlc.h
- Implementation : src/libvlc.c
The "original" legacy interface. Only provides minimal control and feedback. Should be changed as little as possible
Symbols
Structures
- vlc_value_t
- vlc_bool_t
General information
- char const * VLC_Version ( void );
- char const * VLC_CompileTime ( void );
- char const * VLC_CompileBy ( void );
- char const * VLC_CompileHost ( void );
- char const * VLC_CompileDomain ( void );
- char const * VLC_Compiler ( void );
- char const * VLC_Changeset ( void );
- char const * VLC_Error ( int i_err );
Management
- int VLC_Create( void );
All following symbols take the vlc_object_id as parameter
- int VLC_Init( int, int, char *[] );
- int VLC_AddIntf( int, char const *, vlc_bool_t, vlc_bool_t );
- int VLC_Die( int );
- int VLC_CleanUp( int );
- int VLC_Destroy( int );
- int VLC_VariableSet( int, char const *, vlc_value_t );
- int VLC_VariableGet( int, char const *, vlc_value_t * );
- int VLC_VariableType( int, char const *, int * );
Playback / Playlist
- int VLC_AddTarget( int, char const *, const char **, int, int, int );
- int VLC_Play( int )
- int VLC_Pause( int )
- int VLC_Stop( int )
- vlc_bool_t VLC_IsPlaying( int );
- float VLC_PositionGet( int );
- float VLC_PositionSet( int, float );
- int VLC_TimeGet( int );
- int VLC_TimeSet( int, int, vlc_bool_t );
- int VLC_LengthGet( int );
- float VLC_SpeedFaster( int );
- float VLC_SpeedSlower( int );
- int VLC_PlaylistIndex( int );
- int VLC_PlaylistNumberOfItems( int );
- int VLC_PlaylistNext( int );
- int VLC_PlaylistPrev( int );
- int VLC_PlaylistClear( int );
Audio
- int VLC_VolumeSet( int, int );
- int VLC_VolumeGet( int );
- int VLC_VolumeMute( int );
Video
- int VLC_FullScreen( int );
