Difference between revisions of "Hacker Guide/Access Demux"

From VideoLAN Wiki
Jump to navigation Jump to search
m (+{{Back to|Hacker Guide}})
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{Back to|Hacker Guide}}
 
== Description  ==
 
== Description  ==
  
The modules of ''''access_demux'''' capability are designed to handle the [[Documentation:Hacker's_Guide/Access|access]] and part of the [[Documentation:Hacker's_Guide/Demux|demux]] stage in the same module.
+
The modules of ''''access_demux'''' capability are designed to handle the [[{{#rel2abs:../Access}}|access]] and part of the [[{{#rel2abs:../Demux}}|demux]] stage in the same module.
  
Therefore, you are '''required''' to read [[Documentation:Hacker's_Guide/Access|access]] and [[Documentation:Hacker's_Guide/Demux|demux]] pages before going on.
+
Therefore, you are '''required''' to read [[{{#rel2abs:../Access}}|access]] and [[{{#rel2abs:../Demux}}|demux]] pages before going on.
  
 
An access-demuxer could be seen as a demuxer that handles the access at the same time.  
 
An access-demuxer could be seen as a demuxer that handles the access at the same time.  
Line 13: Line 14:
 
== Write an access-demux module  ==
 
== Write an access-demux module  ==
  
To write an access_demuxer module, start by reading the [[Documentation:Hacker's Guide/Module Writers Guide|introduction to module writing]].  
+
To write an access_demuxer module, start by reading the [[{{#rel2abs:../How To Write a Module}}|introduction to module writing]].  
  
 
Then, you should specify your module of being of access_demux type:  
 
Then, you should specify your module of being of access_demux type:  
Line 25: Line 26:
 
After implementing Open() and Close() functions, you will need to implement a few majors features that will be implemented by your functions.  
 
After implementing Open() and Close() functions, you will need to implement a few majors features that will be implemented by your functions.  
  
As you can see in [[Documentation:Hacker's_Guide/Demux|demux]], you should define:  
+
As you can see in [[{{#rel2abs:../Demux}}|demux]], you should define:  
  
 
*Demux, as in pf_demux  
 
*Demux, as in pf_demux  
*Control, as in pf_control ''' NB:''' please refer to [[Documentation:Hacker's_Guide/Demux#Control|demux Control documentation]]
+
*Control, as in pf_control ''' NB:''' please refer to [[{{#rel2abs:../Demux#Control}}|demux Control documentation]]
  
 
After implementing those functions, you should assign them to the corresponding pf_ function.
 
After implementing those functions, you should assign them to the corresponding pf_ function.
  
See {{VLCSourceFile|name=include/vlc_demux.h}} and {{VLCSourceFile|name=include/vlc_access.h}}
+
See {{VLCSourceFile|include/vlc_demux.h}} and {{VLCSourceFile|include/vlc_access.h}}
  
 
== Demux  ==
 
== Demux  ==
Line 47: Line 48:
 
It should return 0 for EOF, something positive when success and something negative when fail to demux.
 
It should return 0 for EOF, something positive when success and something negative when fail to demux.
  
[[Category:Coding]]
 
 
{{Hacker_Guide}}
 
{{Hacker_Guide}}
{{Documentation}}
 

Latest revision as of 06:37, 17 April 2019

← Back to Hacker Guide

Description

The modules of 'access_demux' capability are designed to handle the access and part of the demux stage in the same module.

Therefore, you are required to read access and demux pages before going on.

An access-demuxer could be seen as a demuxer that handles the access at the same time.

In an access-demuxer, the stream s is null.

Examples of access-demuxer are DVD, Bluray, v4l2 modules.

Write an access-demux module

To write an access_demuxer module, start by reading the introduction to module writing.

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

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

Functions to implement

After implementing Open() and Close() functions, you will need to implement a few majors features that will be implemented by your functions.

As you can see in demux, you should define:

After implementing those functions, you should assign them to the corresponding pf_ function.

See include/vlc_demux.h and include/vlc_access.h

Demux

Demux in access_demux is a bit different than in a demux module, because all the seeking and access of the stream is internal to the module.

Prototype:

 int (*pf_demux)  ( demux_t * ); 


Return:

It should return 0 for EOF, something positive when success and something negative when fail to demux.

This page is part of official VLC media player Documentation (User GuideStreaming HowToHacker GuideModules)
Please read the Documentation Editing Guidelines before you edit the documentation
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.