Difference between revisions of "Hacker Guide/Access"

From VideoLAN Wiki
Jump to navigation Jump to search
Line 1: Line 1:
== Usage ==
+
== Description ==
  
As the name suggests, these modules are designed to be the first and last elements of a modules chain. Access [[Documentation:Hacker's Guide/Access|input]]  and [[Documentation:Hacker's Guide/Access output|output]]  handles most of the basic I/O for VLC. Protocol implementations, device access (like V4L2), file access and network I/O are all examples of access modules.  
+
The modules of ''''access'''' capability are designed to be the first and last elements of a modules chain.
  
 +
Access [[Documentation:Hacker's Guide/Access|input]] and [[Documentation:Hacker's Guide/Access output|output]] handles most of the basic '''I/O''' for VLC. They are usually '''protocols''' implementations (http, ftp,...) or '''devices''' access (Webcams, Capture cards).
 +
 +
We will discuss about ''''input access'''' in this page.
 +
 +
== Writing an access module ==
 +
 +
To write an access module, read the [[Documentation:Hacker's_Guide/Module_Writers_Guide|introduction to module writing]].
 +
 +
Then, you should specify your module of being of access type:
 +
set_capability( "access", 60 ) 
 +
set_category( CAT_INPUT )                                                                                                                                                                                 
 +
set_subcategory( SUBCAT_INPUT_ACCESS ) 
 +
 +
                                                                                                                                                                 
 
== Functionality  ==
 
== Functionality  ==
  
Generally speaking, [[Documentation:Hacker's Guide/Access|access input]] will provide Read() functions and [[Documentation:Hacker's Guide/Access output|output]] Write().
+
Generally speaking, [[Documentation:Hacker's Guide/Access|access input]] will provide Read() functions and [[Documentation:Hacker's Guide/Access output|output]] Write().  
  
 
Both needs to provide Seek() and Control() even if the underlying architecture does not support these actions. In this case, Seek() and Control() should return VLC_EGENERIC, although Control() might need to answer ACCESS_OUT_CONTROLS_PACE requests. See modules/access_output/http.c about using a source without seeking.
 
Both needs to provide Seek() and Control() even if the underlying architecture does not support these actions. In this case, Seek() and Control() should return VLC_EGENERIC, although Control() might need to answer ACCESS_OUT_CONTROLS_PACE requests. See modules/access_output/http.c about using a source without seeking.

Revision as of 16:02, 11 November 2010

Description

The modules of 'access' capability are designed to be the first and last elements of a modules chain.

Access input and output handles most of the basic I/O for VLC. They are usually protocols implementations (http, ftp,...) or devices access (Webcams, Capture cards).

We will discuss about 'input access' in this page.

Writing an access module

To write an access module, read the introduction to module writing.

Then, you should specify your module of being of access type:

set_capability( "access", 60 )  
set_category( CAT_INPUT )                                                                                                                                                                                  
set_subcategory( SUBCAT_INPUT_ACCESS )   


Functionality

Generally speaking, access input will provide Read() functions and output Write().

Both needs to provide Seek() and Control() even if the underlying architecture does not support these actions. In this case, Seek() and Control() should return VLC_EGENERIC, although Control() might need to answer ACCESS_OUT_CONTROLS_PACE requests. See modules/access_output/http.c about using a source without seeking.