Difference between revisions of "Documentation:VLC Modules Loading"

From VideoLAN Wiki
Jump to navigation Jump to search
m (+{{Back to|Hacker Guide}})
 
(22 intermediate revisions by 9 users not shown)
Line 1: Line 1:
 +
{{Back to|Hacker Guide}}
 
'''VLC modules loading'''  
 
'''VLC modules loading'''  
  
= How does VLC load modules?  =
+
== <span id="How"></span> How does VLC load modules?  ==
  
== Introduction about Modules  ==
+
=== <span id="Introduction"></span> Introduction about Modules  ===
  
 
VLC has a core and a lot of modules (between 200 and 400 depending on the build).  
 
VLC has a core and a lot of modules (between 200 and 400 depending on the build).  
  
VLC cannot do much without modules, since modules are providing most of the functionnalities we expect. See the "Major Capabilites" sections.  
+
VLC cannot do much without modules, since modules are providing most of the functionalities we expect. See the [[#Capabilities|Major Capabilities]] sections.  
  
 
A VLC module has 2 ''major'' ''properties'':  
 
A VLC module has 2 ''major'' ''properties'':  
Line 14: Line 15:
 
*the score, VLC_MODULE_SCORE, that holds the priority of the module
 
*the score, VLC_MODULE_SCORE, that holds the priority of the module
  
<br>  
+
=== <span id="Process"></span> How does the loading of modules happen  ===
  
== How does the loading of modules happens  ==
+
The first time you load VLC, it will scan the default '''plugins''' directories that should contain VLC modules and generate a cache (named the '''plugins cache''') so that the modules can be loaded quickly the next time VLC launches. Modules can be organized into directories (up to 5 layers deep) beneath the '''plugins''' directory.
  
VLC keeps a list of detected VLC modules (named the '''plugins cache''').  
+
Recent versions of VLC require that the modules follow a specific naming convention or they will not be loaded. Modules must be named in the following format: '''lib''module_name''_plugin.''ext''''' where ''module_name'' should be the name of your module in lower case, and ''ext'' is the system's shared library extension. For example, the '''http''' access module is named '''libaccess_http_plugin.dll''' on a Windows machine.
 +
 
 +
When VLC needs a module, it tries to open the module with the highest score that has the required capability and accepts the request.
  
When VLC needs a module, it tries to open a the higher-score capability-matching module that accept the request.<br>
 
  
 
Let's do an '''example'''.  
 
Let's do an '''example'''.  
Line 26: Line 28:
 
When VLC needs a "decoder" ("decoder" is one category/capability), it opens all "decoder" modules, until one matches.  
 
When VLC needs a "decoder" ("decoder" is one category/capability), it opens all "decoder" modules, until one matches.  
  
It opens them in decreasing score order (bigger score first, smaller ones at the end), and runs the Open() function of the modules. When one module returns OK, VLC uses this module.<br>
+
It opens them in decreasing score order (biggest score first, smaller ones at the end), and runs the Open() function of the modules. When one module returns OK, VLC uses this module.
  
== Advanced infos ==
+
=== <span id="Advanced"></span> Advanced info about modules loading ===
  
=== Score of 0  ===
+
==== Score of 0  ====
  
If a module has a score of 0, it needs to be explicitly requested by the user (like forcing --codec or --vout) to be loaded.<br>
+
If a module has a score of 0, it needs to be explicitly requested by the user or vlc (like forcing --codec, --vout or <code>module_need("foo")</code>) to be loaded.<br>
  
=== all, none and other special tweaks  ===
+
==== all, none and other special tweaks  ====
  
 
*The '''"all"''' mode means all modules will be tested in decreasing order of score.
 
*The '''"all"''' mode means all modules will be tested in decreasing order of score.
Line 42: Line 44:
 
*Any module can be requested by using its direct shortname. This is useful for 0-scored modules.
 
*Any module can be requested by using its direct shortname. This is useful for 0-scored modules.
  
 
+
==== Examples  ====
  
 
Modules requests can be chained, as the '''examples''' show:  
 
Modules requests can be chained, as the '''examples''' show:  
Line 54: Line 56:
 
By default, modules requests are in the '''"all"''' mode, and "all" can be omitted.  
 
By default, modules requests are in the '''"all"''' mode, and "all" can be omitted.  
  
== How to list Modules  ==
+
 
 +
=== How to list Modules  ===
  
 
*Using Console
 
*Using Console
Line 60: Line 63:
 
  vlc --list
 
  vlc --list
  
*Using GUI
+
*Using the Qt GUI
 +
 
 +
Menu → Tools → Plugins and extensions
 +
 
 +
== <span id="Capabilities"></span> Major Capabilities of Modules ==
 +
 
 +
; <code>audio filter</code>
 +
: An audio filter, like an equalizer
 +
; <code>audio mixer</code>
 +
: An audio channel mixer, like a downmixer
 +
; <code>audio output</code>
 +
: An audio output, like Windows DirectX audio output
 +
; <code>decoder</code>
 +
: A codec decoder, like theora
 +
; <code>demux</code>
 +
: A demuxer, to open a file format, like mkv
 +
; <code>encoder</code>
 +
: A codec encoder, like x264
 +
; <code>interface</code>
 +
: An interface, like the Qt interface
 +
; <code>meta reader</code>
 +
: A meta reader, to read metadata
 +
; <code>packetizer</code>
 +
: A packetizer
 +
; <code>playlist export</code>
 +
: A module to write playlist, like .m3u
 +
; <code>services_discovery</code>
 +
: A module to get extra content from your computer or the network, like Upnp, DLNA
 +
; <code>sout access</code>
 +
: An access for the streaming
 +
; <code>sout mux</code>
 +
: A muxer when streaming and encoding
 +
; <code>stream_filter</code>
 +
: A stream filter
 +
; <code>text renderer</code>
 +
: A way to display subtitles and other text on top of the video
 +
; <code>video filter</code>
 +
: A video filter, like contrast adjusting
 +
; <code>visualization2</code>
 +
: A visualizer, to create videos from the music
 +
; <code>vout display</code>
 +
: A video output, to display videos like Direct3D or Xv
  
Menu -&gt; Tools -&gt; Plugins and extensions
 
  
= Major Capabilities =
+
{{Documentation}}

Latest revision as of 03:47, 17 April 2019

← Back to Hacker Guide
VLC modules loading

How does VLC load modules?

Introduction about Modules

VLC has a core and a lot of modules (between 200 and 400 depending on the build).

VLC cannot do much without modules, since modules are providing most of the functionalities we expect. See the Major Capabilities sections.

A VLC module has 2 major properties:

  • the capability, VLC_MODULE_CAPABILITY, that describes the category of the module
  • the score, VLC_MODULE_SCORE, that holds the priority of the module

How does the loading of modules happen

The first time you load VLC, it will scan the default plugins directories that should contain VLC modules and generate a cache (named the plugins cache) so that the modules can be loaded quickly the next time VLC launches. Modules can be organized into directories (up to 5 layers deep) beneath the plugins directory.

Recent versions of VLC require that the modules follow a specific naming convention or they will not be loaded. Modules must be named in the following format: libmodule_name_plugin.ext where module_name should be the name of your module in lower case, and ext is the system's shared library extension. For example, the http access module is named libaccess_http_plugin.dll on a Windows machine.

When VLC needs a module, it tries to open the module with the highest score that has the required capability and accepts the request.


Let's do an example.

When VLC needs a "decoder" ("decoder" is one category/capability), it opens all "decoder" modules, until one matches.

It opens them in decreasing score order (biggest score first, smaller ones at the end), and runs the Open() function of the modules. When one module returns OK, VLC uses this module.

Advanced info about modules loading

Score of 0

If a module has a score of 0, it needs to be explicitly requested by the user or vlc (like forcing --codec, --vout or module_need("foo")) to be loaded.

all, none and other special tweaks

  • The "all" mode means all modules will be tested in decreasing order of score.
  • The "none" mode means no modules will be tested.
  • Any module can be requested by using its direct shortname. This is useful for 0-scored modules.

Examples

Modules requests can be chained, as the examples show:

--codec avcodec,all
try the avcodec module than all modules as a "decoder"
--demux avformat,none
 try the avformat module and no other module

By default, modules requests are in the "all" mode, and "all" can be omitted.


How to list Modules

  • Using Console
vlc --list
  • Using the Qt GUI
Menu → Tools → Plugins and extensions

Major Capabilities of Modules

audio filter
An audio filter, like an equalizer
audio mixer
An audio channel mixer, like a downmixer
audio output
An audio output, like Windows DirectX audio output
decoder
A codec decoder, like theora
demux
A demuxer, to open a file format, like mkv
encoder
A codec encoder, like x264
interface
An interface, like the Qt interface
meta reader
A meta reader, to read metadata
packetizer
A packetizer
playlist export
A module to write playlist, like .m3u
services_discovery
A module to get extra content from your computer or the network, like Upnp, DLNA
sout access
An access for the streaming
sout mux
A muxer when streaming and encoding
stream_filter
A stream filter
text renderer
A way to display subtitles and other text on top of the video
video filter
A video filter, like contrast adjusting
visualization2
A visualizer, to create videos from the music
vout display
A video output, to display videos like Direct3D or Xv


This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document 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.