<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stondage123</id>
	<title>VideoLAN Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.videolan.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Stondage123"/>
	<link rel="alternate" type="text/html" href="https://wiki.videolan.org/Special:Contributions/Stondage123/"/>
	<updated>2026-11-04T20:40:46Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Documentation:Streaming_HowTo/Receive_and_Save_a_Stream&amp;diff=15621</id>
		<title>Documentation:Streaming HowTo/Receive and Save a Stream</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Documentation:Streaming_HowTo/Receive_and_Save_a_Stream&amp;diff=15621"/>
		<updated>2010-03-04T17:52:59Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: fix typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{RightMenu|documentation streaming howto toc}}&lt;br /&gt;
&lt;br /&gt;
==Receive a stream with VLC==&lt;br /&gt;
&lt;br /&gt;
===Receive an unicast stream===&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv rtp://&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
===Receive a multicast stream===&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv rtp://@239.255.12.42&#039;&#039;&#039;&lt;br /&gt;
where &#039;&#039;&#039;239.255.12.42&#039;&#039;&#039; is the multicast IP address you want to join.&lt;br /&gt;
&lt;br /&gt;
===Receive an HTTP/FTP/MMS stream===&lt;br /&gt;
&lt;br /&gt;
Use one of the following command lines:&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv http://example/stream.xyz&#039;&#039;&#039;&lt;br /&gt;
where &#039;&#039;&#039;http://example/stream.xyz&#039;&#039;&#039; is the HTTP address of the stream;&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv ftp://example/stream.xyz&#039;&#039;&#039;&lt;br /&gt;
where &#039;&#039;&#039;ftp://example/stream.xyz&#039;&#039;&#039; is the FTP address of the stream;&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv mms://viptvr.yacast.fr/encoderfranceinfo&#039;&#039;&#039;&lt;br /&gt;
where &#039;&#039;&#039;mms://viptvr.yacast.fr/encoderfranceinfo&#039;&#039;&#039; is the MMS address of the stream.&lt;br /&gt;
&lt;br /&gt;
===Receive a RTP stream available through RTSP===&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv rtsp://www.hardradio.com/tonbeme.mov&#039;&#039;&#039;&lt;br /&gt;
where &#039;&#039;&#039;rtsp://www.hardradio.com/tonbeme.mov&#039;&#039;&#039; is the address of the stream.&lt;br /&gt;
&lt;br /&gt;
===Receive a stream described by an SDP file===&lt;br /&gt;
&lt;br /&gt;
 % &#039;&#039;&#039;vlc -vvv http://server.example.org/stream.sdp&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==Save a stream with VLC==&lt;br /&gt;
&lt;br /&gt;
VLC can save the stream to the disk. In order to do this, use the Stream Output of VLC : you can do it via the graphical interface, or you can add to the command line the following argument:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;--sout file/muxer:stream.xyz&#039;&#039;&#039;&lt;br /&gt;
where:&lt;br /&gt;
*&#039;&#039;&#039;muxer&#039;&#039;&#039; is one of the formats supported by VLC&#039;s stream output, i.e. :&lt;br /&gt;
**&#039;&#039;&#039;ogg&#039;&#039;&#039; for OGG format,&lt;br /&gt;
**&#039;&#039;&#039;ps&#039;&#039;&#039; MPEG2-PS format,&lt;br /&gt;
**&#039;&#039;&#039;ts&#039;&#039;&#039; for MPEG2-TS format.&lt;br /&gt;
* and &#039;&#039;&#039;stream.xyz&#039;&#039;&#039; is the name of the file you want to save the stream to, with the right extension.&lt;br /&gt;
&lt;br /&gt;
==Receive a stream with a set-top-box==&lt;br /&gt;
&lt;br /&gt;
Some set-top-boxes with Ethernet cards can receive MPEG2-TS streams over UDP and support multicast.&lt;br /&gt;
&lt;br /&gt;
Set-top-boxes known to work with VLC are :&lt;br /&gt;
*[http://www.pace.co.uk Pace] set top boxes. (Pace Micro DSL 4000)&lt;br /&gt;
*[http://www.aminocom.com Aminocom] set top boxes. (all the models with mpeg2)&lt;br /&gt;
*tuxia / gct-allwell (mpeg4 and mpeg2) sigma designs8174 chipset&lt;br /&gt;
*i3micro mood200 (mpeg4 and mpeg2 in transport streams)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=9549</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=9549"/>
		<updated>2007-07-15T19:23:06Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being constructed. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Introduction| What is this?]]&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/VLM Internals| VLM Internals]]&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Module Writers Guide|VLC modules]] (also see [[Modules source tree]] )&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Object Management|VLC Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
* [[Doxygen Documentation]]&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using [[Documentation:Hacker&#039;s Guide/libvlc|libvlc]]&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Talk:Hacker_Guide/How_To_Write_a_Module&amp;diff=9547</id>
		<title>Talk:Hacker Guide/How To Write a Module</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Talk:Hacker_Guide/How_To_Write_a_Module&amp;diff=9547"/>
		<updated>2007-07-15T19:20:13Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: Talk:Module Writers Guide moved to Documentation Talk:Hacker&amp;#039;s Guide/Module Writers Guide: Move to Hacker&amp;#039;s Guide for consistency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Nice work! Tell us if you need any help. (on a side note: thedj wanted to start a VLC [[Documentation:Hacker&#039;s_Guide|Hacker&#039;s Guide]], you could try to see with him if your modules documentation could fit in the &amp;quot;VLC modules&amp;quot; subsection)&lt;br /&gt;
&lt;br /&gt;
-- [[User:Dionoea|Dionoea]] 01:07, 13 February 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
Great. I just made a few Wiki Cosmetic changes, and modify the links to the source code. &lt;br /&gt;
-- [[User:J-b|J-b]] 09:16, 13 February 2007 (CET)&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Module_Writers_Guide&amp;diff=9546</id>
		<title>Module Writers Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Module_Writers_Guide&amp;diff=9546"/>
		<updated>2007-07-15T19:20:13Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: Module Writers Guide moved to Documentation:Hacker&amp;#039;s Guide/Module Writers Guide: Move to Hacker&amp;#039;s Guide for consistency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Documentation:Hacker&#039;s Guide/Module Writers Guide]]&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/How_To_Write_a_Module&amp;diff=9545</id>
		<title>Hacker Guide/How To Write a Module</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/How_To_Write_a_Module&amp;diff=9545"/>
		<updated>2007-07-15T19:20:13Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: Module Writers Guide moved to Documentation:Hacker&amp;#039;s Guide/Module Writers Guide: Move to Hacker&amp;#039;s Guide for consistency&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* This guide is being written by a {{VLC}} novice.  Please check all statements below.&lt;br /&gt;
* Using [http://trac.videolan.org/vlc/browser/trunk/modules/access/dvdread.c dvdread.c] as the template.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Module Descriptor ==&lt;br /&gt;
&lt;br /&gt;
A {{VLC}} Module must include a description of itself, and the parameters it accepts.&lt;br /&gt;
&lt;br /&gt;
The module descriptor begins with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vlc_module_being();&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You should set some category information on your module:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    set_shortname( _(&amp;quot;DVD without menus&amp;quot;) );&lt;br /&gt;
    set_description( _(&amp;quot;DVDRead Input (DVD without menu support)&amp;quot;) );&lt;br /&gt;
    set_category( CAT_INPUT );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note the use of _(&amp;quot;&amp;quot;) to create a string that needs to be translated.&lt;br /&gt;
&lt;br /&gt;
Predefined Categories include:&lt;br /&gt;
* CAT_INTERFACE &lt;br /&gt;
* CAT_AUDIO&lt;br /&gt;
* CAT_VIDEO&lt;br /&gt;
* CAT_INPUT&lt;br /&gt;
* CAT_SOUT&lt;br /&gt;
* CAT_ADVANCED&lt;br /&gt;
* CAT_PLAYLIST&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    set_subcategory( SUBCAT_INPUT_ACCESS );&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
See [http://trac.videolan.org/vlc/browser/trunk/include/vlc_configuration.h include/vlc_configuration.h] &lt;br /&gt;
for definition of all categories and sub-categories.&lt;br /&gt;
&lt;br /&gt;
=== Adding Parameters ===&lt;br /&gt;
All macros take the following argument list:&lt;br /&gt;
&amp;lt;pre&amp;gt; add_integer(name, value, p_callback, text, longtext, advc) &amp;lt;/pre&amp;gt;&lt;br /&gt;
* &#039;&#039;&#039;name&#039;&#039;&#039; is the string that identifies this parameter in the configuration.  This name may be used at the command prompt to set the configuration value.&lt;br /&gt;
* &#039;&#039;&#039;value&#039;&#039;&#039; is the default value for this parameter,&lt;br /&gt;
* &#039;&#039;&#039;p_callback&#039;&#039;&#039; is a function pointer that will be called when the value of this parameter is changed.&lt;br /&gt;
** p_callback is called with the following arguments:  &amp;lt;pre&amp;gt;( p_this, psz_name, oldval, val, p_config-&amp;gt;p_callback_data )&amp;lt;/pre&amp;gt;&lt;br /&gt;
*** &#039;&#039;&#039;p_this&#039;&#039;&#039; is a pointer to a vlc_object_t struct,&lt;br /&gt;
*** &#039;&#039;&#039;psz_name&#039;&#039;&#039; is the &#039;&#039;&#039;name&#039;&#039;&#039; of your parameter that is being changed,&lt;br /&gt;
*** &#039;&#039;&#039;oldval&#039;&#039;&#039; is the old value of the parameter,&lt;br /&gt;
*** &#039;&#039;&#039;val&#039;&#039;&#039; is the new value of the parameter,&lt;br /&gt;
*** &#039;&#039;&#039;p_call_back_data&#039;&#039;&#039; is void* data that you can assign for each parameter.  Usually NULL.&lt;br /&gt;
* &#039;&#039;&#039;text&#039;&#039;&#039; A short description of the parameter,&lt;br /&gt;
* &#039;&#039;&#039;longtext&#039;&#039;&#039; A complete description of the parameter,&lt;br /&gt;
* &#039;&#039;&#039;advc&#039;&#039;&#039; Boolean, ADVanced Configuration.  If TRUE, this parameter will only be displayed when using the --advanced flag. e.g. &lt;br /&gt;
&amp;lt;pre&amp;gt;vlc -p dvdread --advanced&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
e.g.&lt;br /&gt;
&amp;lt;pre&amp;gt; add_integer(&amp;quot;dvdread-angle&amp;quot;, 1, NULL, &amp;quot;DVD Angle&amp;quot;, &amp;quot;Default DVD Angle&amp;quot;, NULL&amp;quot;) &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You may add the following parameters to your module:&lt;br /&gt;
* add_integer,&lt;br /&gt;
* add_string,&lt;br /&gt;
* add_float,&lt;br /&gt;
* add_bool,&lt;br /&gt;
* add_key,&lt;br /&gt;
* add_file,&lt;br /&gt;
* add_directory,&lt;br /&gt;
&lt;br /&gt;
For complete definitions, see [http://trac.videolan.org/vlc/browser/trunk/include/vlc_configuration.h include/vlc_configuration.h]&lt;br /&gt;
&lt;br /&gt;
== Open(vlc_object_t *) ==&lt;br /&gt;
&lt;br /&gt;
== Close(vlc_object_t *) ==&lt;br /&gt;
&lt;br /&gt;
[[Category:Coding]]&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=9179</id>
		<title>Hacker Guide/VLM Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=9179"/>
		<updated>2007-06-11T16:05:55Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
VideoLAN Manager is a small media manager designed to control multiple streams with only one instance of VLC. It allows multiple streaming and video on demand (VoD). VLM can be controlled through the telnet and http interfaces of VLC as described in [[Documentation:Streaming_HowTo/VLM]].&lt;br /&gt;
&lt;br /&gt;
This document will describe the internals of VLM including data structures and functions, as well the the libvlc bindings for control of vlm. &lt;br /&gt;
&lt;br /&gt;
==vlm_t==&lt;br /&gt;
&lt;br /&gt;
In a running instance of VLC or libvlc only 1 instance of VLM can be running. This instance of VLM is represented by &#039;&#039;&#039;&#039;&#039;struct vlm_t&#039;&#039;&#039;&#039;&#039; as defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; contains a list of Medias, Schedules and vod servers, as well as a lock for the data structure, and a unique id. In essence, the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; data structure is the global container for all VLM related data.&lt;br /&gt;
&lt;br /&gt;
==Medias and Instances==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;Media&#039;&#039; is composed with a list of inputs (the video and audio streams you want to stream), an output (how and where you want to stream them) and some options.&lt;br /&gt;
&lt;br /&gt;
There are two types of medias:&lt;br /&gt;
*&#039;&#039;&#039;vod&#039;&#039;&#039;: A vod media is commonly used for Video on Demand. It will be launched only if a vod client asks for it.&lt;br /&gt;
*&#039;&#039;&#039;broadcast&#039;&#039;&#039;: A broadcast media is very close to a TV program or channel. It is launched, stopped or paused by the administrator and may be repeated several times. The client has no control over this media.&lt;br /&gt;
&lt;br /&gt;
A media is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; contains a configuration structure, a list of instances of the media, as well as a structure representing a vod server which is initialized only if the media is of type vod.&lt;br /&gt;
&lt;br /&gt;
The configuration structure is of type &#039;&#039;&#039;&#039;&#039;vlm_media_t&#039;&#039;&#039;&#039;&#039; (a misnomer due to historical reasons) and contains the name of the media, as well as its type and a host of other details. It is defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also.&lt;br /&gt;
&lt;br /&gt;
A media instance is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_instance_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also. This structure contains a playlist index as well as the current input thread and output stream instance. Mulitple media instances can exist for each media.&lt;br /&gt;
&lt;br /&gt;
Each VOD server is represented by the struct &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039;. This structure contains a pointer to the module that will be loaded to help the vod server, as well as a pointer to an RTSP server. It also contains several function pointers to help create and delete vod medias of type &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is actually referenced by a &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; if that media is of vod type. &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;include/vlc_vod.h&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;modules/misc/rtsp.c&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The layout of the main vlm structures hierarchically looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vlm_t&lt;br /&gt;
    vlm_media_sys_t&lt;br /&gt;
        vlm_media_t&lt;br /&gt;
        vlm_media_instance_sys_t&lt;br /&gt;
        vod_media_t&lt;br /&gt;
    vod_t&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Schedules==&lt;br /&gt;
&lt;br /&gt;
==Initializing VLM and Adding Medias==&lt;br /&gt;
&lt;br /&gt;
Since VLM is a part of libvlc, I will describe initialization of VLM with respect to libvlc. If we want to use VLM we are probably going to have at least one media. Therefore we can use the libvlc functions &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; or &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; to instantiate and initialize VLM. Each one of these functions checks to see if a VLM instance exists. If it does not, the function creates a &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance and creates and adds either a broadcast or vod media to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance. If the media is of type vod, then a separate &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is created and linked to the media of type &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; and a vod server of type &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is created and linked to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance.&lt;br /&gt;
&lt;br /&gt;
Note also, that the VLM instance is attached to the libvlc instance as a singleton, therefore allowing only one VLM instance per libvlc instance. Both &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; wrap around the &#039;&#039;&#039;&#039;&#039;VLM()&#039;&#039;&#039;&#039;&#039; macro which wraps around &#039;&#039;&#039;&#039;&#039;__vlm_New()&#039;&#039;&#039;&#039;&#039; which actually does the instantiation, initialization, and binding of the VLM instance to the libvlc instance. These functions are found in the &#039;&#039;&#039;&#039;&#039;src/control/vlm.c&#039;&#039;&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;__vlm_New()&#039;&#039;&#039;&#039;&#039; is found in &#039;&#039;&#039;&#039;&#039;src/input/vlm.c&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Control==&lt;br /&gt;
&lt;br /&gt;
Once VLM is initialized, there needs to be some way to control it, such as adding medias, starting and stopping a media instance, etc... The &#039;&#039;&#039;&#039;&#039;vlm_Control()&#039;&#039;&#039;&#039;&#039; function is used for this purpose. This allows all VLM commands to be issued through one common interface, and it takes care of locking issues. By executing &#039;&#039;&#039;&#039;&#039;vlm_Control()&#039;&#039;&#039;&#039;&#039; with the proper command code, such as &#039;&#039;&#039;&#039;&#039;VLM_ADD_MEDIA&#039;&#039;&#039;&#039;&#039;, and a variable argument list, any VLM command can be executed without the need to understand the lower level details. This allows for easily wrapping the VLM code to be used by many interfaces. &#039;&#039;&#039;&#039;&#039;vlm_Control()&#039;&#039;&#039;&#039;&#039; can be found in &#039;&#039;&#039;&#039;&#039;src/input/vlm.c&#039;&#039;&#039;&#039;&#039;. The list of VLM command codes can be found in the enumerated type &#039;&#039;&#039;&#039;&#039;vlm_query_e&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;&#039;&#039;&#039;include/vlc_vlm.h&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Thread Creation==&lt;br /&gt;
&lt;br /&gt;
VLM is a complex subsystem within VLC. When VLM is initialized, when a media is created etc..., threads are created to handle these tasks. This section will describe the thread model used by VLM.&lt;br /&gt;
&lt;br /&gt;
When new instance of VLM is created by the &#039;&#039;&#039;&#039;&#039;__vlm_New()&#039;&#039;&#039;&#039;&#039; function, a management thread is created which has as its start function &#039;&#039;&#039;&#039;&#039;Manage()&#039;&#039;&#039;&#039;&#039; residing in &#039;&#039;&#039;&#039;&#039;src/input/vlm.c&#039;&#039;&#039;&#039;&#039;. This takes care of scheduling, as well as destruction of dead input objects.&lt;br /&gt;
&lt;br /&gt;
when a new vod media is added to VLM, an input thread is created with &#039;&#039;&#039;&#039;&#039;Run()&#039;&#039;&#039;&#039;&#039; as its start function. This thread takes care of all streaming for that media.&lt;br /&gt;
&lt;br /&gt;
If a broadcast media is added, it needs to be played. When The libvlc function &#039;&#039;&#039;&#039;&#039;libvlc_vlm_play_media()&#039;&#039;&#039;&#039;&#039; is called, an instance of the broadcast media is created as well as an input thread with &#039;&#039;&#039;&#039;&#039;Run()&#039;&#039;&#039;&#039;&#039; as its start function. This thread takes care of all streaming for the broadcast instance by calling appropriate demux, codec, and sout modules.&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/libvlc&amp;diff=9021</id>
		<title>Hacker Guide/libvlc</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/libvlc&amp;diff=9021"/>
		<updated>2007-06-08T18:18:16Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Libvlc Startup==&lt;br /&gt;
&lt;br /&gt;
===Introduction===&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
===Libvlc Instantiation===&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;&#039;&#039;&#039;libvlc_new()&#039;&#039;&#039;&#039;&#039;. This function initializes the thread system and allocates a libvlc instance. &#039;&#039;&#039;&#039;&#039;libvlc_new()&#039;&#039;&#039;&#039;&#039; resides in &#039;&#039;&#039;&#039;&#039;src/control/core.c&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;&#039;&#039;libvlc_new()&#039;&#039;&#039;&#039;&#039; calls &#039;&#039;&#039;&#039;&#039;libvlc_InternalInit()&#039;&#039;&#039;&#039;&#039; 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 &#039;&#039;&#039;&#039;&#039;playlist_ThreadCreate()&#039;&#039;&#039;&#039;&#039;. 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.&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;&#039;&#039;RunPreparse()&#039;&#039;&#039;&#039;&#039; - Perform initial parsing of the playlist&lt;br /&gt;
* &#039;&#039;&#039;&#039;&#039;RunFetcher()&#039;&#039;&#039;&#039;&#039; - load artwork associated with playlist item&lt;br /&gt;
* &#039;&#039;&#039;&#039;&#039;RunControlThread()&#039;&#039;&#039;&#039;&#039; - perform playlist scheduling and playing&lt;br /&gt;
&lt;br /&gt;
See [[Documentation:Hacker&#039;s Guide/Playlists|Playlists]] for more details.&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=9020</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=9020"/>
		<updated>2007-06-08T18:16:56Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* Coding for VLC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being construced. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Introduction| What is this?]]&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/VLM Internals| VLM Internals]]&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* VLC modules&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Object Management|VLC Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using [[Documentation:Hacker&#039;s Guide/libvlc|libvlc]]&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8999</id>
		<title>Hacker Guide/VLM Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8999"/>
		<updated>2007-06-06T16:07:39Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
VideoLAN Manager is a small media manager designed to control multiple streams with only one instance of VLC. It allows multiple streaming and video on demand (VoD). VLM can be controlled through the telnet and http interfaces of VLC as described in [[Documentation:Streaming_HowTo/VLM]].&lt;br /&gt;
&lt;br /&gt;
This document will describe the internals of VLM including data structures and functions, as well the the libvlc bindings for control of vlm. &lt;br /&gt;
&lt;br /&gt;
==vlm_t==&lt;br /&gt;
&lt;br /&gt;
In a running instance of VLC or libvlc only 1 instance of VLM can be running. This instance of VLM is represented by &#039;&#039;&#039;&#039;&#039;struct vlm_t&#039;&#039;&#039;&#039;&#039; as defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; contains a list of Medias, Schedules and vod servers, as well as a lock for the data structure, and a unique id. In essence, the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; data structure is the global container for all VLM related data.&lt;br /&gt;
&lt;br /&gt;
==Medias and Instances==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;Media&#039;&#039; is composed with a list of inputs (the video and audio streams you want to stream), an output (how and where you want to stream them) and some options.&lt;br /&gt;
&lt;br /&gt;
There are two types of medias:&lt;br /&gt;
*&#039;&#039;&#039;vod&#039;&#039;&#039;: A vod media is commonly used for Video on Demand. It will be launched only if a vod client asks for it.&lt;br /&gt;
*&#039;&#039;&#039;broadcast&#039;&#039;&#039;: A broadcast media is very close to a TV program or channel. It is launched, stopped or paused by the administrator and may be repeated several times. The client has no control over this media.&lt;br /&gt;
&lt;br /&gt;
A media is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; contains a configuration structure, a list of instances of the media, as well as a structure representing a vod server which is initialized only if the media is of type vod.&lt;br /&gt;
&lt;br /&gt;
The configuration structure is of type &#039;&#039;&#039;&#039;&#039;vlm_media_t&#039;&#039;&#039;&#039;&#039; (a misnomer due to historical reasons) and contains the name of the media, as well as its type and a host of other details. It is defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also.&lt;br /&gt;
&lt;br /&gt;
A media instance is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_instance_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also. This structure contains a playlist index as well as the current input thread and output stream instance. Mulitple media instances can exist for each media.&lt;br /&gt;
&lt;br /&gt;
Each VOD server is represented by the struct &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039;. This structure contains a pointer to the module that will be loaded to help the vod server, as well as a pointer to an RTSP server. It also contains several function pointers to help create and delete vod medias of type &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is actually referenced by a &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; if that media is of vod type. &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;include/vlc_vod.h&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;modules/misc/rtsp.c&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The layout of the main vlm structures hierarchically looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vlm_t&lt;br /&gt;
    vlm_media_sys_t&lt;br /&gt;
        vlm_media_t&lt;br /&gt;
        vlm_media_instance_sys_t&lt;br /&gt;
        vod_media_t&lt;br /&gt;
    vod_t&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Schedules==&lt;br /&gt;
&lt;br /&gt;
==Initializing VLM and Adding Medias==&lt;br /&gt;
&lt;br /&gt;
Since VLM is a part of libvlc, I will describe initialization of VLM with respect to libvlc. If we want to use VLM we are probably going to have at least one media. Therefore we can use the libvlc functions &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; or &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; to instantiate and initialize VLM. Each one of these functions checks to see if a VLM instance exists. If it does not, the function creates a &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance and creates and adds either a broadcast or vod media to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance. If the media is of type vod, then a separate &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is created and linked to the media of type &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; and a vod server of type &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is created and linked to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance.&lt;br /&gt;
&lt;br /&gt;
Note also, that the VLM instance is attached to the libvlc instance as a singleton, therefore allowing only one VLM instance per libvlc instance. Both &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; wrap around the &#039;&#039;&#039;&#039;&#039;VLM()&#039;&#039;&#039;&#039;&#039; macro which actually does the instantiation, initialization, and binding of the VLM instance to the libvlc instance. These functions are found in the &#039;&#039;&#039;&#039;&#039;src/control/vlm.c&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Control==&lt;br /&gt;
&lt;br /&gt;
Once VLM is initialized, there needs to be some way to control it, such as adding medias, starting and stopping a media instance, etc... The &#039;&#039;&#039;&#039;&#039;vlm_Control()&#039;&#039;&#039;&#039;&#039; function is used for this purpose. This allows all VLM commands to be issued through one common interface, and it takes care of locking issues. By executing &#039;&#039;&#039;&#039;&#039;vlm_Control()&#039;&#039;&#039;&#039;&#039; with the proper command code, such as &#039;&#039;&#039;&#039;&#039;VLM_ADD_MEDIA&#039;&#039;&#039;&#039;&#039;, and a variable argument list, any VLM command can be executed without the need to understand the lower level details. This allows for easily wrapping the VLM code to be used by many interfaces. &#039;&#039;&#039;&#039;&#039;vlm_Control()&#039;&#039;&#039;&#039;&#039; can be found in &#039;&#039;&#039;&#039;&#039;src/input/vlm.c&#039;&#039;&#039;&#039;&#039;. The list of VLM command codes can be found in the enumerated type &#039;&#039;&#039;&#039;&#039;vlm_query_e&#039;&#039;&#039;&#039;&#039; in the file &#039;&#039;&#039;&#039;&#039;include/vlc_vlm.h&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TO BE CONTINUED...==&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8998</id>
		<title>Hacker Guide/VLM Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8998"/>
		<updated>2007-06-06T15:21:09Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* Initializing VLM and Adding Medias */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
VideoLAN Manager is a small media manager designed to control multiple streams with only one instance of VLC. It allows multiple streaming and video on demand (VoD). VLM can be controlled through the telnet and http interfaces of VLC as described in [[Documentation:Streaming_HowTo/VLM]].&lt;br /&gt;
&lt;br /&gt;
This document will describe the internals of VLM including data structures and functions, as well the the libvlc bindings for control of vlm. &lt;br /&gt;
&lt;br /&gt;
==vlm_t==&lt;br /&gt;
&lt;br /&gt;
In a running instance of VLC or libvlc only 1 instance of VLM can be running. This instance of VLM is represented by &#039;&#039;&#039;&#039;&#039;struct vlm_t&#039;&#039;&#039;&#039;&#039; as defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; contains a list of Medias, Schedules and vod servers, as well as a lock for the data structure, and a unique id. In essence, the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; data structure is the global container for all VLM related data.&lt;br /&gt;
&lt;br /&gt;
==Medias and Instances==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;Media&#039;&#039; is composed with a list of inputs (the video and audio streams you want to stream), an output (how and where you want to stream them) and some options.&lt;br /&gt;
&lt;br /&gt;
There are two types of medias:&lt;br /&gt;
*&#039;&#039;&#039;vod&#039;&#039;&#039;: A vod media is commonly used for Video on Demand. It will be launched only if a vod client asks for it.&lt;br /&gt;
*&#039;&#039;&#039;broadcast&#039;&#039;&#039;: A broadcast media is very close to a TV program or channel. It is launched, stopped or paused by the administrator and may be repeated several times. The client has no control over this media.&lt;br /&gt;
&lt;br /&gt;
A media is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; contains a configuration structure, a list of instances of the media, as well as a structure representing a vod server which is initialized only if the media is of type vod.&lt;br /&gt;
&lt;br /&gt;
The configuration structure is of type &#039;&#039;&#039;&#039;&#039;vlm_media_t&#039;&#039;&#039;&#039;&#039; (a misnomer due to historical reasons) and contains the name of the media, as well as its type and a host of other details. It is defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also.&lt;br /&gt;
&lt;br /&gt;
A media instance is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_instance_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also. This structure contains a playlist index as well as the current input thread and output stream instance. Mulitple media instances can exist for each media.&lt;br /&gt;
&lt;br /&gt;
Each VOD server is represented by the struct &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039;. This structure contains a pointer to the module that will be loaded to help the vod server, as well as a pointer to an RTSP server. It also contains several function pointers to help create and delete vod medias of type &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is actually referenced by a &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; if that media is of vod type. &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;include/vlc_vod.h&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;modules/misc/rtsp.c&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The layout of the main vlm structures hierarchically looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vlm_t&lt;br /&gt;
    vlm_media_sys_t&lt;br /&gt;
        vlm_media_t&lt;br /&gt;
        vlm_media_instance_sys_t&lt;br /&gt;
        vod_media_t&lt;br /&gt;
    vod_t&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Schedules==&lt;br /&gt;
&lt;br /&gt;
==Initializing VLM and Adding Medias==&lt;br /&gt;
&lt;br /&gt;
Since VLM is a part of libvlc, I will describe initialization of VLM with respect to libvlc. If we want to use VLM we are probably going to have at least one media. Therefore we can use the libvlc functions &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; or &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; to instantiate and initialize VLM. Each one of these functions checks to see if a VLM instance exists. If it does not, the function creates a &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance and creates and adds either a broadcast or vod media to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance. If the media is of type vod, then a separate &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is created and linked to the media of type &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; and a vod server of type &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is created and linked to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance.&lt;br /&gt;
&lt;br /&gt;
Note also, that the VLM instance is attached to the libvlc instance as a singleton, therefore allowing only one VLM instance per libvlc instance. Both &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; wrap around the &#039;&#039;&#039;&#039;&#039;VLM()&#039;&#039;&#039;&#039;&#039; macro which actually does the instantiation, initialization, and binding of the VLM instance to the libvlc instance. These functions are found in the &#039;&#039;&#039;&#039;&#039;src/control/vlm.c&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==TO BE CONTINUED...==&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8997</id>
		<title>Hacker Guide/VLM Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8997"/>
		<updated>2007-06-06T15:12:57Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
VideoLAN Manager is a small media manager designed to control multiple streams with only one instance of VLC. It allows multiple streaming and video on demand (VoD). VLM can be controlled through the telnet and http interfaces of VLC as described in [[Documentation:Streaming_HowTo/VLM]].&lt;br /&gt;
&lt;br /&gt;
This document will describe the internals of VLM including data structures and functions, as well the the libvlc bindings for control of vlm. &lt;br /&gt;
&lt;br /&gt;
==vlm_t==&lt;br /&gt;
&lt;br /&gt;
In a running instance of VLC or libvlc only 1 instance of VLM can be running. This instance of VLM is represented by &#039;&#039;&#039;&#039;&#039;struct vlm_t&#039;&#039;&#039;&#039;&#039; as defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; contains a list of Medias, Schedules and vod servers, as well as a lock for the data structure, and a unique id. In essence, the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; data structure is the global container for all VLM related data.&lt;br /&gt;
&lt;br /&gt;
==Medias and Instances==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;Media&#039;&#039; is composed with a list of inputs (the video and audio streams you want to stream), an output (how and where you want to stream them) and some options.&lt;br /&gt;
&lt;br /&gt;
There are two types of medias:&lt;br /&gt;
*&#039;&#039;&#039;vod&#039;&#039;&#039;: A vod media is commonly used for Video on Demand. It will be launched only if a vod client asks for it.&lt;br /&gt;
*&#039;&#039;&#039;broadcast&#039;&#039;&#039;: A broadcast media is very close to a TV program or channel. It is launched, stopped or paused by the administrator and may be repeated several times. The client has no control over this media.&lt;br /&gt;
&lt;br /&gt;
A media is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; contains a configuration structure, a list of instances of the media, as well as a structure representing a vod server which is initialized only if the media is of type vod.&lt;br /&gt;
&lt;br /&gt;
The configuration structure is of type &#039;&#039;&#039;&#039;&#039;vlm_media_t&#039;&#039;&#039;&#039;&#039; (a misnomer due to historical reasons) and contains the name of the media, as well as its type and a host of other details. It is defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also.&lt;br /&gt;
&lt;br /&gt;
A media instance is represented by the structure &#039;&#039;&#039;&#039;&#039;vlm_media_instance_sys_t&#039;&#039;&#039;&#039;&#039; defined in &#039;&#039;&#039;&#039;&#039;src/input/vlm_internal.h&#039;&#039;&#039;&#039;&#039; also. This structure contains a playlist index as well as the current input thread and output stream instance. Mulitple media instances can exist for each media.&lt;br /&gt;
&lt;br /&gt;
Each VOD server is represented by the struct &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039;. This structure contains a pointer to the module that will be loaded to help the vod server, as well as a pointer to an RTSP server. It also contains several function pointers to help create and delete vod medias of type &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039;. Each &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is actually referenced by a &#039;&#039;&#039;&#039;&#039;vlm_media_sys_t&#039;&#039;&#039;&#039;&#039; if that media is of vod type. &#039;&#039;&#039;&#039;&#039;vod_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;include/vlc_vod.h&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;vod_media_t&#039;&#039;&#039;&#039;&#039; is defined in &#039;&#039;&#039;&#039;&#039;modules/misc/rtsp.c&#039;&#039;&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The layout of the main vlm structures hierarchically looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vlm_t&lt;br /&gt;
    vlm_media_sys_t&lt;br /&gt;
        vlm_media_t&lt;br /&gt;
        vlm_media_instance_sys_t&lt;br /&gt;
        vod_media_t&lt;br /&gt;
    vod_t&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Schedules==&lt;br /&gt;
&lt;br /&gt;
==Initializing VLM and Adding Medias==&lt;br /&gt;
&lt;br /&gt;
Since VLM is a part of libvlc, I will describe initialization of VLM with respect to libvlc. If we want to use VLM we are probably going to have at least one media. Therefore we can use the libvlc functions &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; or &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; to instantiate and initialize VLM. Each one of these functions checks to see if a VLM instance exists. If it does not, the function creates a &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance and creates and adds either a broadcast or vod media to the &#039;&#039;&#039;&#039;&#039;vlm_t&#039;&#039;&#039;&#039;&#039; instance. Note also, that the VLM instance is attached to the libvlc instance as a singleton, therefore allowing only one VLM instance per libvlc instance. Both &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039;&#039;&#039;&#039; and &#039;&#039;&#039;&#039;&#039;libvlc_vlm_add_vod()&#039;&#039;&#039;&#039;&#039; wrap around the &#039;&#039;&#039;&#039;&#039;VLM()&#039;&#039;&#039;&#039;&#039; macro which actually does the instantiation, initialization, and binding of the VLM instance to the libvlc instance. These functions are found in the &#039;&#039;&#039;&#039;&#039;src/control/vlm.c&#039;&#039;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==TO BE CONTINUED...==&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8996</id>
		<title>Hacker Guide/VLM Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8996"/>
		<updated>2007-06-06T13:59:20Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
VideoLAN Manager is a small media manager designed to control multiple streams with only one instance of VLC. It allows multiple streaming and video on demand (VoD). VLM can be controlled through the telnet and http interfaces of VLC as described in [[Documentation:Streaming_HowTo/VLM]].&lt;br /&gt;
&lt;br /&gt;
This document will describe the internals of VLM including data structures and functions, as well the the libvlc bindings for control of vlm. &lt;br /&gt;
&lt;br /&gt;
==vlm_t==&lt;br /&gt;
&lt;br /&gt;
In a running instance of VLC or libvlc only 1 instance of VLM can be running. This instance of VLM is represented by &#039;&#039;struct vlm_t&#039;&#039; as defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039;. &#039;&#039;vlm_t&#039;&#039; contains a list of Medias, Schedules and vod servers, as well as a lock for the data structure, and a unique id. In essence, the vlm_t data structure is the global container for all VLM related data.&lt;br /&gt;
&lt;br /&gt;
==Medias and Instances==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;Media&#039;&#039; is composed with a list of inputs (the video and audio streams you want to stream), an output (how and where you want to stream them) and some options.&lt;br /&gt;
&lt;br /&gt;
There are two types of medias:&lt;br /&gt;
*&#039;&#039;&#039;vod&#039;&#039;&#039;: A vod media is commonly used for Video on Demand. It will be launched only if a vod client asks for it.&lt;br /&gt;
*&#039;&#039;&#039;broadcast&#039;&#039;&#039;: A broadcast media is very close to a TV program or channel. It is launched, stopped or paused by the administrator and may be repeated several times. The client has no control over this media.&lt;br /&gt;
&lt;br /&gt;
A media is represented by the structure &#039;&#039;vlm_media_sys_t&#039;&#039; defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039;. Each &#039;&#039;vlm_media_sys_t&#039;&#039; contains a configuration structure, a list of instances of the media, as well as a structure representing a vod server which is initialized only if the media is of type vod.&lt;br /&gt;
&lt;br /&gt;
The configuration structure is of type &#039;&#039;vlm_media_t&#039;&#039; (a misnomer due to historical reasons) and contains the name of the media, as well as its type and a host of other details. It is defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039; also.&lt;br /&gt;
&lt;br /&gt;
A media instance is represented by the structure &#039;&#039;vlm_media_instance_sys_t&#039;&#039; defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039; also. This structure contains a playlist index as well as the current input thread and output stream instance. Mulitple media instances can exist for each media.&lt;br /&gt;
&lt;br /&gt;
Each VOD server is represented by the struct &#039;&#039;vod_t&#039;&#039;. This structure contains a pointer to the module that will be loaded to help the vod server, as well as a pointer to an RTSP server. It also contains several function pointers to help create and delete vod medias of type &#039;&#039;vod_media_t&#039;&#039;. Each &#039;&#039;vod_media_t&#039;&#039; is actually referenced by a &#039;&#039;vlm_media_sys_t&#039;&#039; if that media is of vod type. &#039;&#039;vod_t&#039;&#039; is defined in &#039;&#039;include/vlc_vod.h&#039;&#039; and &#039;&#039;vod_media_t&#039;&#039; is defined in &#039;&#039;modules/misc/rtsp.c&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
The layout of the main vlm structures hierarchically looks like this:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
vlm_t&lt;br /&gt;
    vlm_media_sys_t&lt;br /&gt;
        vlm_media_t&lt;br /&gt;
        vlm_media_instance_sys_t&lt;br /&gt;
        vod_media_t&lt;br /&gt;
    vod_t&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Schedules==&lt;br /&gt;
&lt;br /&gt;
==Initializing VLM==&lt;br /&gt;
&lt;br /&gt;
Since VLM is a part of libvlc, I will describe initialization of VLM with respect to libvlc. If we want to use VLM we are probably going to have at least one media. Therefore we can use the libvlc functions &#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039; or &#039;&#039;libvlc_vlm_add_vod()&#039;&#039; to instantiate and initialize VLM. Each one of these functions checks to see if a VLM instance exists. If it does not, the function creates a &#039;&#039;vlm_t&#039;&#039; instance and creates and adds either a broadcast or vod media to the &#039;&#039;vlm_t&#039;&#039; instance. Note also, that the VLM instance is attached to the libvlc instance as a singleton, thus allowing only one VLM instance per libvlc instance. Both &#039;&#039;libvlc_vlm_add_broadcast()&#039;&#039; and &#039;&#039;libvlc_vlm_add_vod()&#039;&#039; wrap around the &#039;&#039;VLM()&#039;&#039; macro which actually does the instantiation, initialization, and binding of the VLM instance to the libvlc instance. These functions are found in the &#039;&#039;src/control/vlm.c&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
==Adding Medias==&lt;br /&gt;
&lt;br /&gt;
==TO BE CONTINUED...==&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8995</id>
		<title>User talk:Stondage123</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8995"/>
		<updated>2007-06-06T13:22:15Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--#REDIRECT [[Coding:Object Management]]&lt;br /&gt;
[[VLM Internals]]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
Hi. Thanks for writing documentation. I&#039;d really appreciate if you could keep the documentation pages in the Documentation namespace. (As stated here: [[Documentation_Talk:Hacker&#039;s Guide]] ). Thanks, [[User:Dionoea|Dionoea]] 09:32, 6 June 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Hi Dionoea. I&#039;m sorry about using the wrong namespace. I&#039;m still new to the wild world of wikis :) I&#039;ll put everything in the right place from now on. As I reverse engineer/understand more of the code I will add documentation and some patches. You guys really do some great work here.&lt;br /&gt;
&lt;br /&gt;
-Andrew&lt;br /&gt;
&lt;br /&gt;
: I already moved all the pages to the correct namespaces [[User:J-b|jb]] 15:11, 6 June 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Thanks J-B !&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8993</id>
		<title>User talk:Stondage123</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8993"/>
		<updated>2007-06-06T12:58:34Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!--#REDIRECT [[Coding:Object Management]]&lt;br /&gt;
[[VLM Internals]]--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
Hi. Thanks for writing documentation. I&#039;d really appreciate if you could keep the documentation pages in the Documentation namespace. (As stated here: [[Documentation_Talk:Hacker&#039;s Guide]] ). Thanks, [[User:Dionoea|Dionoea]] 09:32, 6 June 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
Hi Dionoea. I&#039;m sorry about using the wrong namespace. I&#039;m still new to the wild world of wikis :) I&#039;ll put everything in the right place from now on. As I reverse engineer/understand more of the code I will add documentation and some patches. You guys really do some great work here.&lt;br /&gt;
&lt;br /&gt;
-Andrew&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8977</id>
		<title>Hacker Guide/VLM Internals</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/VLM_Internals&amp;diff=8977"/>
		<updated>2007-06-05T22:16:42Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: VLM Internals&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Introduction==&lt;br /&gt;
VideoLAN Manager is a small media manager designed to control multiple streams with only one instance of VLC. It allows multiple streaming and video on demand (VoD). VLM can be controlled through the telnet and http interfaces of VLC as described in [[Documentation:Streaming_HowTo/VLM]].&lt;br /&gt;
&lt;br /&gt;
This document will describe the internals of VLM including data structures and functions, as well the the libvlc bindings for control of vlm. &lt;br /&gt;
&lt;br /&gt;
==vlm_t==&lt;br /&gt;
&lt;br /&gt;
In a running instance of VLC or libvlc only 1 instance of VLM can be running. This instance of VLM is represented by &#039;&#039;struct vlm_t&#039;&#039; as defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039;. &#039;&#039;vlm_t&#039;&#039; contains a list of Medias, Schedules and vod servers, as well as a lock for the data structure, and a unique id. In essence, the vlm_t data structure is the global container for all VLM related data.&lt;br /&gt;
&lt;br /&gt;
==Medias and Instances==&lt;br /&gt;
&lt;br /&gt;
A &#039;&#039;Media&#039;&#039; is composed with a list of inputs (the video and audio streams you want to stream), an output (how and where you want to stream them) and some options.&lt;br /&gt;
&lt;br /&gt;
There are two types of medias:&lt;br /&gt;
*&#039;&#039;&#039;vod&#039;&#039;&#039;: A vod media is commonly used for Video on Demand. It will be launched only if a vod client asks for it.&lt;br /&gt;
*&#039;&#039;&#039;broadcast&#039;&#039;&#039;: A broadcast media is very close to a TV program or channel. It is launched, stopped or paused by the administrator and may be repeated several times. The client has no control over this media.&lt;br /&gt;
&lt;br /&gt;
A media is represented by the structure &#039;&#039;vlm_media_sys_t&#039;&#039; defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039;. Each &#039;&#039;vlm_media_sys_t&#039;&#039; contains a configuration structure, a list of instances of the media, as well as a structure representing a vod server which is initialized only if the media is of type vod.&lt;br /&gt;
&lt;br /&gt;
The configuration structure is of type &#039;&#039;vlm_media_t&#039;&#039; (a misnomer due to historical reasons) and contains the name of the media, as well as its type and a host of other details. It is defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039; also.&lt;br /&gt;
&lt;br /&gt;
A media instance is represented by the structure &#039;&#039;vlm_media_instance_sys_t&#039;&#039; defined in &#039;&#039;src/input/vlm_internal.h&#039;&#039; also. This structure contains a playlist index as well as the current input thread and output stream instance. &lt;br /&gt;
&lt;br /&gt;
Vod servers will be discussed in the following section.&lt;br /&gt;
&lt;br /&gt;
==VOD Servers==&lt;br /&gt;
&lt;br /&gt;
Each VOD server is represented by the struct &#039;&#039;vod_t&#039;&#039;. This structure contains a pointer to the module that will be loaded to help the vod server, as well as a pointer to an RTSP server. It also contains several function pointers to help create and delete vod medias of type &#039;&#039;vod_media_t&#039;&#039;. Each &#039;&#039;vod_media_t&#039;&#039; is actually referenced by a &#039;&#039;vlm_media_sys_t&#039;&#039; if that media is of vod type. &#039;&#039;vod_t&#039;&#039; is defined in &#039;&#039;include/vlc_vod.h&#039;&#039; and &#039;&#039;vod_media_t&#039;&#039; is defined in &#039;&#039;modules/misc/rtsp.c&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
==TO BE CONTINUED...==&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8976</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8976"/>
		<updated>2007-06-05T22:05:32Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* The many layers of VLC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being construced. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* [[What is this?]]&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* [[VLM Internals]]&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* VLC modules&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Object Management|VLC Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using libvlc&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8975</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8975"/>
		<updated>2007-06-05T22:04:59Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* The many layers of VLC */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being construced. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* [[What is this?]]&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* [[VLM]]&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* VLC modules&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Object Management|VLC Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using libvlc&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8974</id>
		<title>User talk:Stondage123</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8974"/>
		<updated>2007-06-05T20:14:34Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: Redirecting to Coding:Object Management&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Coding:Object Management]]&lt;br /&gt;
[[VLM Internals]]&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8952</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8952"/>
		<updated>2007-06-04T14:57:08Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being construced. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* [[What is this?]]&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* VLM&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* VLC modules&lt;br /&gt;
* [[Documentation:Hacker&#039;s Guide/Object Management|VLC Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using libvlc&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8906</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8906"/>
		<updated>2007-05-31T21:52:45Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* VLC source code overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being construced. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* What is this?&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* VLM&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* VLC modules&lt;br /&gt;
* VLC [[Documentation:Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using libvlc&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8905</id>
		<title>Hacker Guide</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide&amp;diff=8905"/>
		<updated>2007-05-31T21:50:14Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: /* VLC source code overview */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;div style=&amp;quot;background:red;&amp;quot;&amp;gt;&lt;br /&gt;
This guide is still being construced. Please see http://developers.videolan.org/vlc/ for the current information &lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
===Authors=== &lt;br /&gt;
* Derk-Jan Hartman&lt;br /&gt;
&lt;br /&gt;
==Introduction==&lt;br /&gt;
* What is this?&lt;br /&gt;
* What you need to know about VLC&lt;br /&gt;
&lt;br /&gt;
==The many layers of VLC==&lt;br /&gt;
* Core&lt;br /&gt;
* Access&lt;br /&gt;
* Demux&lt;br /&gt;
* Packetizers&lt;br /&gt;
* Codec&lt;br /&gt;
* Stream Output&lt;br /&gt;
* Interfaces&lt;br /&gt;
* Audio/Video Output&lt;br /&gt;
* VLM&lt;br /&gt;
* Filters&lt;br /&gt;
&lt;br /&gt;
==VLC source code overview==&lt;br /&gt;
* [[VLC source tree]]&lt;br /&gt;
* VLC modules&lt;br /&gt;
* VLC [[Object Management]]&lt;br /&gt;
* VLC preferences&lt;br /&gt;
* VLC variables&lt;br /&gt;
&lt;br /&gt;
==Coding for VLC==&lt;br /&gt;
* Coding style&lt;br /&gt;
* Adding a module&lt;br /&gt;
* Using libvlc&lt;br /&gt;
* Bindings&lt;br /&gt;
&lt;br /&gt;
{{Documentation}}&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/Object_Management&amp;diff=8903</id>
		<title>Hacker Guide/Object Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/Object_Management&amp;diff=8903"/>
		<updated>2007-05-31T21:45:55Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: Coding:Object Management moved to Documentation:Object Management: I messed up&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== VLC Object Management ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This paper will discuss VLC objects and the general object oriented practices involved in developing and extending libvlc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Object Creation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In VLC everything is an object. Each object can have a parent and multiple children. The following functions are used for creating an object and attaching to parents and children. Note that this list may not be complete.  For reference see the file &#039;&#039;include/vlc_objects.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_create()&#039;&#039; - create an object and set its refcount to 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_destroy()&#039;&#039; - de-allocate an object iff its refcount = 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_attach()&#039;&#039; - bidirectionally link an object with its parent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_detach()&#039;&#039; - remove all links between an object and its parent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Inheritance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Objects can have multiple levels of inheritance. Each object is represented by the type &#039;&#039;vlc_object_t&#039;&#039; . Every object inherits from this type and can be cast to it. Inheritance is achieved in the C language by embedding a macro of common structure elements (VLC_COMMON_MEMBERS) inside each inherited object structure. For example, a libvlc instance of type &#039;&#039;libvlc_int_t&#039;&#039; inherits from &#039;&#039;vlc_object_t&#039;&#039; by embedding the VLC_COMMON_MEMBERS inside the &#039;&#039;libvlc_int_t structure&#039;&#039; as seen in example 1 below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Example 1: libvlc_int_t : vlc_object_t&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct libvlc_int_t &lt;br /&gt;
{&lt;br /&gt;
    VLC_COMMON_MEMBERS&lt;br /&gt;
&lt;br /&gt;
    /* Everything Else */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reference Counts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to simplify garbage collection, every object has a reference count. When an object is created (malloc()&#039;d) its reference count is set to 0. Anytime the object is acquired for use by a caller that caller must increase its reference count by 1.  When the caller is done using the object it must decrease the object&#039;s reference count by 1. Luckily, most of this is handled by internal object management acquisition and removal functions. In order to destroy (free()) the object the reference count of the object must be 0. The following functions are used to manipulate object reference counts. Note that this list may not be complete.  For reference see the file &#039;&#039;include/vlc_objects.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_yield()&#039;&#039; - increase the refcount of an object by 1. This function should only be used in object management functions! Careless usage will lead to memory leaks!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_release()&#039;&#039; - decrease the refcount of an object by 1. This function should only be used in object management functions! Careless usage can lead to early object destruction, while the object may still be in use!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Threads&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VLC is a multithreaded application. Thread handling is performed by the following functuions. See &#039;&#039;include/vlc_threads_funcs.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_create()&#039;&#039; - spawn a new thread&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_set_priority()&#039;&#039; - set the priority of a thread&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_ready()&#039;&#039; - alert the parent that we were successfully spawned&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_join()&#039;&#039; - wait for a thread to exit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mutexes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VLC is a multithreaded program and as such it requires objects to be protected from concurrency related issues such as race conditions. In order to protect objects a mutex object is used. The mutex is of type vlc_mutex_t and contains a pointer to the object that the mutex is protecting as well as an OS level mutex primitive. See Example 2 below for a sample declaration of &#039;&#039;vlc_mutex_t&#039;&#039; under Linux using pthreads. Actual implementations for your OS can be found in &#039;&#039;include/vlc_threads.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Example 2: vlc_mutex_t&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    pthread_mutex_t mutex;  /* OS primitive */&lt;br /&gt;
    vlc_object_t * p_this;  /* pointer to object that mutex protects */&lt;br /&gt;
}  vlc_mutex_t;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Operations on &#039;&#039;vlc_mutex_t&#039;&#039; objects are wrapped by VLC to enhance portability. Below is a list of operations on mutex objects. This list is incomplete. See &#039;&#039;include/vlc_threads_funcs.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_init()&#039;&#039; - initialize a mutex&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_lock()&#039;&#039; - lock an object&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_unlock()&#039;&#039; - unlock an object&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8902</id>
		<title>User talk:Stondage123</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=User_talk:Stondage123&amp;diff=8902"/>
		<updated>2007-05-31T21:21:58Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: User talk:Stondage123 moved to Coding:Object Management: Publish for everyone&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Coding:Object Management]]&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/Object_Management&amp;diff=8901</id>
		<title>Hacker Guide/Object Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/Object_Management&amp;diff=8901"/>
		<updated>2007-05-31T21:21:57Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: User talk:Stondage123 moved to Coding:Object Management: Publish for everyone&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== VLC Object Management ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This paper will discuss VLC objects and the general object oriented practices involved in developing and extending libvlc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Object Creation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In VLC everything is an object. Each object can have a parent and multiple children. The following functions are used for creating an object and attaching to parents and children. Note that this list may not be complete.  For reference see the file &#039;&#039;include/vlc_objects.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_create()&#039;&#039; - create an object and set its refcount to 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_destroy()&#039;&#039; - de-allocate an object iff its refcount = 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_attach()&#039;&#039; - bidirectionally link an object with its parent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_detach()&#039;&#039; - remove all links between an object and its parent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Inheritance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Objects can have multiple levels of inheritance. Each object is represented by the type &#039;&#039;vlc_object_t&#039;&#039; . Every object inherits from this type and can be cast to it. Inheritance is achieved in the C language by embedding a macro of common structure elements (VLC_COMMON_MEMBERS) inside each inherited object structure. For example, a libvlc instance of type &#039;&#039;libvlc_int_t&#039;&#039; inherits from &#039;&#039;vlc_object_t&#039;&#039; by embedding the VLC_COMMON_MEMBERS inside the &#039;&#039;libvlc_int_t structure&#039;&#039; as seen in example 1 below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Example 1: libvlc_int_t : vlc_object_t&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct libvlc_int_t &lt;br /&gt;
{&lt;br /&gt;
    VLC_COMMON_MEMBERS&lt;br /&gt;
&lt;br /&gt;
    /* Everything Else */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reference Counts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to simplify garbage collection, every object has a reference count. When an object is created (malloc()&#039;d) its reference count is set to 0. Anytime the object is acquired for use by a caller that caller must increase its reference count by 1.  When the caller is done using the object it must decrease the object&#039;s reference count by 1. Luckily, most of this is handled by internal object management acquisition and removal functions. In order to destroy (free()) the object the reference count of the object must be 0. The following functions are used to manipulate object reference counts. Note that this list may not be complete.  For reference see the file &#039;&#039;include/vlc_objects.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_yield()&#039;&#039; - increase the refcount of an object by 1. This function should only be used in object management functions! Careless usage will lead to memory leaks!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_release()&#039;&#039; - decrease the refcount of an object by 1. This function should only be used in object management functions! Careless usage can lead to early object destruction, while the object may still be in use!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Threads&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VLC is a multithreaded application. Thread handling is performed by the following functuions. See &#039;&#039;include/vlc_threads_funcs.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_create()&#039;&#039; - spawn a new thread&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_set_priority()&#039;&#039; - set the priority of a thread&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_ready()&#039;&#039; - alert the parent that we were successfully spawned&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_join()&#039;&#039; - wait for a thread to exit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mutexes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VLC is a multithreaded program and as such it requires objects to be protected from concurrency related issues such as race conditions. In order to protect objects a mutex object is used. The mutex is of type vlc_mutex_t and contains a pointer to the object that the mutex is protecting as well as an OS level mutex primitive. See Example 2 below for a sample declaration of &#039;&#039;vlc_mutex_t&#039;&#039; under Linux using pthreads. Actual implementations for your OS can be found in &#039;&#039;include/vlc_threads.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Example 2: vlc_mutex_t&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    pthread_mutex_t mutex;  /* OS primitive */&lt;br /&gt;
    vlc_object_t * p_this;  /* pointer to object that mutex protects */&lt;br /&gt;
}  vlc_mutex_t;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Operations on &#039;&#039;vlc_mutex_t&#039;&#039; objects are wrapped by VLC to enhance portability. Below is a list of operations on mutex objects. This list is incomplete. See &#039;&#039;include/vlc_threads_funcs.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_init()&#039;&#039; - initialize a mutex&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_lock()&#039;&#039; - lock an object&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_unlock()&#039;&#039; - unlock an object&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
	<entry>
		<id>https://wiki.videolan.org/index.php?title=Hacker_Guide/Object_Management&amp;diff=8900</id>
		<title>Hacker Guide/Object Management</title>
		<link rel="alternate" type="text/html" href="https://wiki.videolan.org/index.php?title=Hacker_Guide/Object_Management&amp;diff=8900"/>
		<updated>2007-05-31T21:14:40Z</updated>

		<summary type="html">&lt;p&gt;Stondage123: VLC Object Management&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== VLC Object Management ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Introduction&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This paper will discuss VLC objects and the general object oriented practices involved in developing and extending libvlc.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Object Creation&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In VLC everything is an object. Each object can have a parent and multiple children. The following functions are used for creating an object and attaching to parents and children. Note that this list may not be complete.  For reference see the file &#039;&#039;include/vlc_objects.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_create()&#039;&#039; - create an object and set its refcount to 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_destroy()&#039;&#039; - de-allocate an object iff its refcount = 0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_attach()&#039;&#039; - bidirectionally link an object with its parent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_detach()&#039;&#039; - remove all links between an object and its parent&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Inheritance&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Objects can have multiple levels of inheritance. Each object is represented by the type &#039;&#039;vlc_object_t&#039;&#039; . Every object inherits from this type and can be cast to it. Inheritance is achieved in the C language by embedding a macro of common structure elements (VLC_COMMON_MEMBERS) inside each inherited object structure. For example, a libvlc instance of type &#039;&#039;libvlc_int_t&#039;&#039; inherits from &#039;&#039;vlc_object_t&#039;&#039; by embedding the VLC_COMMON_MEMBERS inside the &#039;&#039;libvlc_int_t structure&#039;&#039; as seen in example 1 below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Example 1: libvlc_int_t : vlc_object_t&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
struct libvlc_int_t &lt;br /&gt;
{&lt;br /&gt;
    VLC_COMMON_MEMBERS&lt;br /&gt;
&lt;br /&gt;
    /* Everything Else */&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Reference Counts&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to simplify garbage collection, every object has a reference count. When an object is created (malloc()&#039;d) its reference count is set to 0. Anytime the object is acquired for use by a caller that caller must increase its reference count by 1.  When the caller is done using the object it must decrease the object&#039;s reference count by 1. Luckily, most of this is handled by internal object management acquisition and removal functions. In order to destroy (free()) the object the reference count of the object must be 0. The following functions are used to manipulate object reference counts. Note that this list may not be complete.  For reference see the file &#039;&#039;include/vlc_objects.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_yield()&#039;&#039; - increase the refcount of an object by 1. This function should only be used in object management functions! Careless usage will lead to memory leaks!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_object_release()&#039;&#039; - decrease the refcount of an object by 1. This function should only be used in object management functions! Careless usage can lead to early object destruction, while the object may still be in use!&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Threads&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VLC is a multithreaded application. Thread handling is performed by the following functuions. See &#039;&#039;include/vlc_threads_funcs.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_create()&#039;&#039; - spawn a new thread&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_set_priority()&#039;&#039; - set the priority of a thread&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_ready()&#039;&#039; - alert the parent that we were successfully spawned&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_thread_join()&#039;&#039; - wait for a thread to exit&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Mutexes&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
VLC is a multithreaded program and as such it requires objects to be protected from concurrency related issues such as race conditions. In order to protect objects a mutex object is used. The mutex is of type vlc_mutex_t and contains a pointer to the object that the mutex is protecting as well as an OS level mutex primitive. See Example 2 below for a sample declaration of &#039;&#039;vlc_mutex_t&#039;&#039; under Linux using pthreads. Actual implementations for your OS can be found in &#039;&#039;include/vlc_threads.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;u&amp;gt;Example 2: vlc_mutex_t&amp;lt;/u&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
typedef struct&lt;br /&gt;
{&lt;br /&gt;
    pthread_mutex_t mutex;  /* OS primitive */&lt;br /&gt;
    vlc_object_t * p_this;  /* pointer to object that mutex protects */&lt;br /&gt;
}  vlc_mutex_t;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Operations on &#039;&#039;vlc_mutex_t&#039;&#039; objects are wrapped by VLC to enhance portability. Below is a list of operations on mutex objects. This list is incomplete. See &#039;&#039;include/vlc_threads_funcs.h&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_init()&#039;&#039; - initialize a mutex&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_lock()&#039;&#039; - lock an object&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;vlc_mutex_unlock()&#039;&#039; - unlock an object&lt;/div&gt;</summary>
		<author><name>Stondage123</name></author>
	</entry>
</feed>