Commit e2fc6acb authored by Jean-Paul Saman's avatar Jean-Paul Saman

Refactoring of dvb.c and access.c. Coding style and messages cleanup.

parent 82957718
This diff is collapsed.
This diff is collapsed.
...@@ -30,28 +30,54 @@ ...@@ -30,28 +30,54 @@
#define FRONTEND "/dev/dvb/adapter%d/frontend%d" #define FRONTEND "/dev/dvb/adapter%d/frontend%d"
#define DVR "/dev/dvb/adapter%d/dvr%d" #define DVR "/dev/dvb/adapter%d/dvr%d"
/*****************************************************************************
* DVB input data structure
*****************************************************************************/
typedef struct
{
int i_frontend;
unsigned int u_adapter;
unsigned int u_device;
unsigned int u_freq;
unsigned int u_srate;
unsigned int u_lnb_lof1;
unsigned int u_lnb_lof2;
unsigned int u_lnb_slof;
int i_bandwidth;
int i_modulation;
int i_guard;
int i_transmission;
int i_hierarchy;
int i_polarisation;
int i_fec;
int i_code_rate_HP;
int i_code_rate_LP;
vlc_bool_t b_diseqc;
vlc_bool_t b_probe;
input_socket_t * p_satellite;
} input_dvb_t;
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
int ioctl_SetQPSKFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep, int b_polarisation, int ioctl_SetQPSKFrontend( input_thread_t * p_input, struct dvb_frontend_parameters fep );
unsigned int u_lnb_lof1, unsigned int u_lnb_lof2, unsigned int u_lnb_slof, int ioctl_SetOFDMFrontend( input_thread_t * p_input, struct dvb_frontend_parameters fep );
unsigned int u_adapter, unsigned int u_device ); int ioctl_SetQAMFrontend( input_thread_t * p_input, struct dvb_frontend_parameters fep );
int ioctl_SetOFDMFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep, int ioctl_SetDMXFilter( input_thread_t * p_input, int i_pid, int *pi_fd, int i_type );
unsigned int u_adapter, unsigned int u_device ); int ioctl_UnsetDMXFilter( input_thread_t * p_input, int pi_fd );
int ioctl_SetQAMFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep, int ioctl_InfoFrontend( input_thread_t * p_input, struct dvb_frontend_info *info );
unsigned int u_adapter, unsigned int u_device );
int ioctl_SetDMXFilter(input_thread_t * p_input, int i_pid, int *pi_fd, int i_type, unsigned int u_adapter, unsigned int u_device );
int ioctl_UnsetDMXFilter(input_thread_t * p_input, int pi_fd);
int ioctl_InfoFrontend(input_thread_t * p_input, struct dvb_frontend_info *info, unsigned int u_adapter, unsigned int u_device );
/***************************************************************************** /*****************************************************************************
* dvb argument helper functions * dvb argument helper functions
*****************************************************************************/ *****************************************************************************/
fe_bandwidth_t dvb_DecodeBandwidth(input_thread_t * p_input, int bandwidth); fe_bandwidth_t dvb_DecodeBandwidth( input_thread_t * p_input, int bandwidth );
fe_code_rate_t dvb_DecodeFEC(input_thread_t * p_input, int fec); fe_code_rate_t dvb_DecodeFEC( input_thread_t * p_input, int fec );
fe_modulation_t dvb_DecodeModulation(input_thread_t * p_input, int modulation); fe_modulation_t dvb_DecodeModulation( input_thread_t * p_input, int modulation );
fe_transmit_mode_t dvb_DecodeTransmission(input_thread_t * p_input, int transmission); fe_transmit_mode_t dvb_DecodeTransmission( input_thread_t * p_input, int transmission );
fe_guard_interval_t dvb_DecodeGuardInterval(input_thread_t * p_input, int guard); fe_guard_interval_t dvb_DecodeGuardInterval( input_thread_t * p_input, int guard );
fe_hierarchy_t dvb_DecodeHierarchy(input_thread_t * p_input, int hierarchy); fe_hierarchy_t dvb_DecodeHierarchy( input_thread_t * p_input, int hierarchy );
fe_spectral_inversion_t dvb_DecodeInversion(input_thread_t * p_input, int inversion); fe_spectral_inversion_t dvb_DecodeInversion( input_thread_t * p_input, int inversion);
...@@ -47,7 +47,7 @@ void E_(Close) ( vlc_object_t * ); ...@@ -47,7 +47,7 @@ void E_(Close) ( vlc_object_t * );
#define DEVICE_TEXT N_("Device number to use on adapter") #define DEVICE_TEXT N_("Device number to use on adapter")
#define DEVICE_LONGTEXT "" #define DEVICE_LONGTEXT ""
#define FREQ_TEXT N_("Satellite transponder frequency in kHz for DVB-S and in Hz for DVB-C/T") #define FREQ_TEXT N_("Satellite transponder frequency for DVB-S (kHz) and for DVB-C/T (Hz)")
#define FREQ_LONGTEXT "" #define FREQ_LONGTEXT ""
#define POL_TEXT N_("Satellite transponder polarization") #define POL_TEXT N_("Satellite transponder polarization")
...@@ -99,12 +99,14 @@ void E_(Close) ( vlc_object_t * ); ...@@ -99,12 +99,14 @@ void E_(Close) ( vlc_object_t * );
vlc_module_begin(); vlc_module_begin();
set_description( _("DVB input with v4l2 support") ); set_description( _("DVB input with v4l2 support") );
/* General options */
add_bool( "probe", 0, NULL, PROBE_TEXT, PROBE_LONGTEXT, VLC_FALSE );
add_integer( "adapter", 0, NULL, ADAPTER_TEXT, ADAPTER_LONGTEXT, add_integer( "adapter", 0, NULL, ADAPTER_TEXT, ADAPTER_LONGTEXT,
VLC_FALSE ); VLC_FALSE );
add_integer( "device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT, VLC_FALSE ); add_integer( "device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT, VLC_FALSE );
add_integer( "frequency", 11954000, NULL, FREQ_TEXT, FREQ_LONGTEXT, add_integer( "frequency", 11954000, NULL, FREQ_TEXT, FREQ_LONGTEXT,
VLC_FALSE ); VLC_FALSE );
/* DVB-S (satellite) */
add_integer( "polarization", 0, NULL, POL_TEXT, POL_LONGTEXT, VLC_FALSE ); add_integer( "polarization", 0, NULL, POL_TEXT, POL_LONGTEXT, VLC_FALSE );
add_integer( "fec", 3, NULL, FEC_TEXT, FEC_LONGTEXT, VLC_FALSE ); add_integer( "fec", 3, NULL, FEC_TEXT, FEC_LONGTEXT, VLC_FALSE );
add_integer( "symbol-rate", 27500000, NULL, SRATE_TEXT, SRATE_LONGTEXT, add_integer( "symbol-rate", 27500000, NULL, SRATE_TEXT, SRATE_LONGTEXT,
...@@ -116,7 +118,7 @@ vlc_module_begin(); ...@@ -116,7 +118,7 @@ vlc_module_begin();
VLC_TRUE ); VLC_TRUE );
add_integer( "lnb-slof", 11700000, NULL, LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT, add_integer( "lnb-slof", 11700000, NULL, LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT,
VLC_TRUE ); VLC_TRUE );
add_bool( "probe", 0, NULL, PROBE_TEXT, PROBE_LONGTEXT, VLC_FALSE ); /* DVB-T (terrestrial) */
add_integer( "code-rate-hp", 9, NULL, CODE_RATE_HP_TEXT, add_integer( "code-rate-hp", 9, NULL, CODE_RATE_HP_TEXT,
CODE_RATE_HP_LONGTEXT, VLC_TRUE ); CODE_RATE_HP_LONGTEXT, VLC_TRUE );
add_integer( "code-rate-lp", 9, NULL, CODE_RATE_LP_TEXT, add_integer( "code-rate-lp", 9, NULL, CODE_RATE_LP_TEXT,
...@@ -130,12 +132,15 @@ vlc_module_begin(); ...@@ -130,12 +132,15 @@ vlc_module_begin();
TRANSMISSION_LONGTEXT, VLC_TRUE ); TRANSMISSION_LONGTEXT, VLC_TRUE );
add_integer( "hierarchy", 0, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT, add_integer( "hierarchy", 0, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT,
VLC_TRUE ); VLC_TRUE );
/* short cuts */
set_capability( "access", 0 ); set_capability( "access", 0 );
add_shortcut( "dvb" ); /* General DVB-C/S/T MRL */
add_shortcut( "dvb-s" ); /* DVB-S (satillite) */
add_shortcut( "qpsk" ); add_shortcut( "qpsk" );
add_shortcut( "dvb-c" ); /* DVB-C (cable) */
add_shortcut( "cable" ); add_shortcut( "cable" );
add_shortcut( "dvb-t" ); /* DVB-T (terrestrial) */
add_shortcut( "terrestrial" ); add_shortcut( "terrestrial" );
add_shortcut( "dvb" ); add_shortcut( "satellite" ); /* compatibility with the interface. */
add_shortcut( "satellite" );
set_callbacks( E_(Open), E_(Close) ); set_callbacks( E_(Open), E_(Close) );
vlc_module_end(); vlc_module_end();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment