Difference between revisions of "Hacker Guide/libvlc"

From VideoLAN Wiki
Jump to navigation Jump to search
m (+{{Back to|Hacker Guide}})
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
 +
{{Back to|Hacker Guide}}
 
==Libvlc Startup==
 
==Libvlc Startup==
  
 
===Introduction===
 
===Introduction===
Libvlc represents the underlying API of vlc. VLC itself is just a wrapper around libvlc. By utilizing libvlc developers can take advantage of all the complex functionalities of vlc. Libvlc is generated as a shared library and can be wrapped up with numerous interfaces, including both Python and Java bindings. This allows the end user to build applications around the vlc code base and take advantage of all the plugins available to vlc instead of writing everything from scratch.
+
[[Libvlc]] represents the underlying {{API}} of {{VLC}}. VLC itself is just a wrapper around libvlc. By utilizing libvlc developers can take advantage of all the complex functionalities of vlc. Libvlc is generated as a shared library and can be wrapped up with numerous interfaces, including both Python and Java bindings. This allows the end user to build applications around the vlc code base and take advantage of all the plugins available to vlc instead of writing everything from scratch.
  
 
This document will explain how to get started using libvlc. It will step through the instantiation of a libvlc instance and explain the typical startup procedure of libvlc.
 
This document will explain how to get started using libvlc. It will step through the instantiation of a libvlc instance and explain the typical startup procedure of libvlc.
Line 8: Line 9:
 
===Libvlc Instantiation===
 
===Libvlc Instantiation===
  
Libvlc is a singleton. For each application wrapped around libvlc, only one libvlc instance should be running. In order to create an instance of libvlc, you must call '''''libvlc_new()'''''. This function initializes the thread system and allocates a libvlc instance. '''''libvlc_new()''''' resides in '''''src/control/core.c'''''.
+
Libvlc is a singleton. For each application wrapped around libvlc, only one libvlc instance should be running. In order to create an instance of libvlc, you must call <code>libvlc_new()</code>. This function initializes the thread system and allocates a libvlc instance. <code>libvlc_new()</code> resides in {{VLCSourceFile|src/config/core.c}}.
  
'''''libvlc_new()''''' calls '''''libvlc_InternalInit()''''' which handles command line parsing, loads the module bank, and spawns a number of threads to handle various vlc subsystems. The threads are spawned from inside the function '''''playlist_ThreadCreate()'''''. Below is a list of thread start functions that are run for playlist processing. The threads corresponding to these functions are spawned in the order listed.
+
<code>libvlc_new()</code> calls <code>libvlc_InternalInit()</code> which handles command line parsing, loads the module bank, and spawns a number of threads to handle various vlc subsystems. The threads are spawned from inside the function <code>playlist_ThreadCreate()</code>. Below is a list of thread start functions that are run for playlist processing. The threads corresponding to these functions are spawned in the order listed.
  
* '''''RunPreparse()''''' - Perform initial parsing of the playlist
+
* <code>RunPreparse()</code> - Perform initial parsing of the playlist
* '''''RunFetcher()''''' - load artwork associated with playlist item
+
* <code>RunFetcher()</code> - load artwork associated with playlist item
* '''''RunControlThread()''''' - perform playlist scheduling and playing
+
* <code>RunControlThread()</code> - perform playlist scheduling and playing
  
See [[Documentation:Hacker's Guide/Playlists|Playlists]] for more details.
+
See [[{{#rel2abs:../Playlist}}|Playlist]] for more details.
  
 
{{Hacker_Guide}}
 
{{Hacker_Guide}}
 +
 +
[[Category:libVLC|*]]

Latest revision as of 03:46, 17 April 2019

← Back to Hacker Guide

Libvlc Startup

Introduction

Libvlc represents the underlying API of VLC media player. VLC itself is just a wrapper around libvlc. By utilizing libvlc developers can take advantage of all the complex functionalities of vlc. Libvlc is generated as a shared library and can be wrapped up with numerous interfaces, including both Python and Java bindings. This allows the end user to build applications around the vlc code base and take advantage of all the plugins available to vlc instead of writing everything from scratch.

This document will explain how to get started using libvlc. It will step through the instantiation of a libvlc instance and explain the typical startup procedure of libvlc.

Libvlc Instantiation

Libvlc is a singleton. For each application wrapped around libvlc, only one libvlc instance should be running. In order to create an instance of libvlc, you must call libvlc_new(). This function initializes the thread system and allocates a libvlc instance. libvlc_new() resides in src/config/core.c.

libvlc_new() calls libvlc_InternalInit() which handles command line parsing, loads the module bank, and spawns a number of threads to handle various vlc subsystems. The threads are spawned from inside the function playlist_ThreadCreate(). Below is a list of thread start functions that are run for playlist processing. The threads corresponding to these functions are spawned in the order listed.

  • RunPreparse() - Perform initial parsing of the playlist
  • RunFetcher() - load artwork associated with playlist item
  • RunControlThread() - perform playlist scheduling and playing

See Playlist for more details.

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.