This page provides a quick VLC architecture overview. Follow the links for a deeper exploration.
The VLC Media player is made of:
More information can be found on the VLC developer site.
Several VLC user interfaces are available, implemented by dedicated modules.
libVLCcore creates the interface: see intf_Create in interface.c.
set_capability( "interface", 151 ): See qt.cpp. Each module belongs to a category (main and sub): these categories are defined in vlc_plugin.h: Interface, Audio, Video, Input, Output, Advanced, Playlist.
More importantly, a module exposes capabilities (described by a string) associated to a score (module priority), like 'interface', 'decoder', 'audio output'. See Videolan wiki for details.
The following sequence is indicative.
main function is executed. It creates a new libvlc instance ( libvlc_new, function implemented by libvlc )libvlc_new calls libvlc_InternalInit, which initializes VLC. This creates a user interface (libvlc_InternalAddIntf). This function starts the playlist with its control thread (intf_GetPlaylist) and creates the user interface (intf_Create). If there is a command line argument to open a file, libvlc_InternalInit inserts the item in the playlist (intf_InsertItem)play and enqueueplaylist_AddExt functionplaylist_Activate starts the thread; Thread is the main function with the playlist high level tasks.PlayItem function creates an Input and starts it.input_Start in src/input/input.cMainLoop runs. This calls InputSourceNew, then InputDemuxNew to initialize an access-demux module (2 in 1), otherwise an access and demux modules are created.demux_NewAdvanced function gets a demux module to seperate the streams (in container files like AVI or MKV): module_need( p_demux, "access_demux", ... access_New function gets an access module to read the input stream (from a file, http, ...): module_need(access, "access", ... static int Open( vlc_object_t * p_this ) function.decoder_New creates a decoder and spawns a decoder thread . LoadDecoder function, gets a decoder module (audio, video or spu): module_need(decoder, caps[decoder->fmt_in.i_cat], ...) /* "video decoder" or "audio decoder" or "spu" */ input_resource_RequestVout )VoutCreate function, spawns the Video output Thread, this will lead to the video output creation.vout_display_New function, gets a "vout display" module: module_need(vd, "vout display",...input_resource_GetAout )aout_New function, gets a "audio output" module: module_need (aout, "audio output",...