Commit f12d6405 authored by Christophe Massiot's avatar Christophe Massiot

* modules/access/dvb: Major rewrite of the code.

  - new options (now prepended with --dvb) :
     --dvb-program : to work around the non-working --program
     --dvb-inversion : to (optionally) specify the inversion, which is not
                       the same as polarization
     --dvb-budget-mode : if you have a budget card this will set a filter
                         on 0x2000, meaning all PIDs will be returned by
                         the driver. The budget-mode is compatible with demux2.
     --dvb-satno : to specify a sat number in the diseqc system
     --dvb-voltage : to specify the voltage of the LNB (0 is a permitted
                     value in special configurations)
     --dvb-tone : to enable/disable the 22kHz tone (by default it is sent
                  if frequency >= lnb-slof)
  - fixed a handful of QPSK tuning bugs, especially the diseqc was not
    working and frequencies above 11700 couldn't be tuned to.
  - the modules now uses the inherited object variables for its
    configuration.
  - symbol-rate= url option is now srate= for consistency with the
    configuration variable.
  - all linux-dvb specific code is now in linux_dvb.c. access.c contains
    only code which could be reused on other platforms.
  - better keep track of demux file descriptors (especially useful on
    limited boards).
  - do not block in read() when no data is available.
  - fixed msleep() calls (reminder : mtime_t is in _microseconds_).

I didn't test the QAM and OFDM variants, so please report.
parent 2a6648ee
SOURCES_dvb = \ SOURCES_dvb = \
qpsk.c \
access.c \ access.c \
dvb.c \ linux_dvb.c \
dvb.h \ dvb.h \
$(NULL) $(NULL)
This diff is collapsed.
This diff is collapsed.
/***************************************************************************** /*****************************************************************************
* dvb.h : functions to control a DVB card under Linux with v4l2 * dvb.h : functions to control a DVB card under Linux with v4l2
***************************************************************************** *****************************************************************************
* Copyright (C) 1998-2003 VideoLAN * Copyright (C) 1998-2004 VideoLAN
* *
* Authors: Johan Bilien <jobi@via.ecp.fr> * Authors: Johan Bilien <jobi@via.ecp.fr>
* Jean-Paul Saman <jpsaman@saman> * Jean-Paul Saman <jpsaman@saman>
* Christopher Ross <chris@tebibyte.org> * Christopher Ross <chris@tebibyte.org>
* Christophe Massiot <massiot@via.ecp.fr>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -30,54 +31,43 @@ ...@@ -30,54 +31,43 @@
#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 * Local structures
*****************************************************************************/ *****************************************************************************/
typedef struct typedef struct demux_handle_t
{ {
int i_frontend; int i_pid;
unsigned int u_adapter; int i_handle;
unsigned int u_device; int i_type;
unsigned int u_freq; } demux_handle_t;
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; #define MAX_DEMUX 24
} input_dvb_t;
typedef struct thread_dvb_data_t
{
int i_handle;
demux_handle_t p_demux_handles[MAX_DEMUX];
void * p_frontend;
vlc_bool_t b_budget_mode;
} thread_dvb_data_t;
/***************************************************************************** #define VIDEO0_TYPE 1
* Prototypes #define AUDIO0_TYPE 2
*****************************************************************************/ #define TELETEXT0_TYPE 3
int ioctl_SetQPSKFrontend( input_thread_t * p_input, struct dvb_frontend_parameters fep ); #define SUBTITLE0_TYPE 4
int ioctl_SetOFDMFrontend( input_thread_t * p_input, struct dvb_frontend_parameters fep ); #define PCR0_TYPE 5
int ioctl_SetQAMFrontend( input_thread_t * p_input, struct dvb_frontend_parameters fep ); #define TYPE_INTERVAL 5
int ioctl_SetDMXFilter( input_thread_t * p_input, int i_pid, int *pi_fd, int i_type ); #define OTHER_TYPE 21
int ioctl_UnsetDMXFilter( input_thread_t * p_input, int pi_fd );
int ioctl_InfoFrontend( input_thread_t * p_input, struct dvb_frontend_info *info );
/***************************************************************************** /*****************************************************************************
* dvb argument helper functions * Prototypes
*****************************************************************************/ *****************************************************************************/
fe_bandwidth_t dvb_DecodeBandwidth( input_thread_t * p_input, int bandwidth ); int E_(FrontendOpen)( input_thread_t * p_input );
fe_code_rate_t dvb_DecodeFEC( input_thread_t * p_input, int fec ); void E_(FrontendClose)( input_thread_t * p_input );
fe_modulation_t dvb_DecodeModulation( input_thread_t * p_input, int modulation ); int E_(FrontendSet)( input_thread_t * p_input );
fe_transmit_mode_t dvb_DecodeTransmission( input_thread_t * p_input, int transmission ); int E_(DMXSetFilter)( input_thread_t * p_input, int i_pid, int * pi_fd,
fe_guard_interval_t dvb_DecodeGuardInterval( input_thread_t * p_input, int guard ); int i_type );
fe_hierarchy_t dvb_DecodeHierarchy( input_thread_t * p_input, int hierarchy ); int E_(DMXUnsetFilter)( input_thread_t * p_input, int i_fd );
fe_spectral_inversion_t dvb_DecodeInversion( input_thread_t * p_input, int inversion); int E_(DVROpen)( input_thread_t * p_input );
void E_(DVRClose)( input_thread_t * p_input );
This diff is collapsed.
/*****************************************************************************
* qpsk.c : Satellite input module for vlc
*****************************************************************************
* Copyright (C) 2003-2004 VideoLAN
*
* Authors: Sam Hocevar <sam@zoy.org>
* Jean-Paul Saman <jpsaman@wxs.nl>
* Christopher Ross <chris@tebibyte.org>
*
* This program is free software; you can redistribute it and/or modify
* it 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.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include <stdlib.h> /* malloc(), free() */
#include <string.h> /* strdup() */
#include <vlc/vlc.h>
/*****************************************************************************
* External prototypes
*****************************************************************************/
int E_(Open) ( vlc_object_t * );
void E_(Close) ( vlc_object_t * );
/*****************************************************************************
* Module descriptor
*****************************************************************************/
/* Satellite options */
#define ADAPTER_TEXT N_("Adapter card to tune")
#define ADAPTER_LONGTEXT N_("Adapter cards have a device file in directory named /dev/dvb/adapter[n] with n>=0.")
#define DEVICE_TEXT N_("Device number to use on adapter")
#define DEVICE_LONGTEXT ""
#define FREQ_TEXT N_("Satellite transponder frequency for DVB-S (kHz) and for DVB-C/T (Hz)")
#define FREQ_LONGTEXT ""
#define POL_TEXT N_("Satellite transponder polarization")
#define POL_LONGTEXT ""
#define FEC_TEXT N_("Satellite transponder FEC")
#define FEC_LONGTEXT N_("FEC=Forward Error Correction mode.")
#define SRATE_TEXT N_("Satellite transponder symbol rate in kHz")
#define SRATE_LONGTEXT ""
#define DISEQC_TEXT N_("Use diseqc with antenna")
#define DISEQC_LONGTEXT ""
#define LNB_LOF1_TEXT N_("Antenna lnb_lof1 (kHz)")
#define LNB_LOF1_LONGTEXT ""
#define LNB_LOF2_TEXT N_("Antenna lnb_lof2 (kHz)")
#define LNB_LOF2_LONGTEXT ""
#define LNB_SLOF_TEXT N_("Antenna lnb_slof (kHz)")
#define LNB_SLOF_LONGTEXT ""
#define PROBE_TEXT N_("Probe DVB card for capabilities")
#define PROBE_LONGTEXT N_("Some DVB cards do not like to be probed for their capabilities.")
/* Cable */
#define MODULATION_TEXT N_("Modulation type")
#define MODULATION_LONGTEXT N_("Modulation type for front-end device.")
/* Terrestrial */
#define CODE_RATE_HP_TEXT N_("Terrestrial high priority stream code rate (FEC)")
#define CODE_RATE_HP_LONGTEXT ""
#define CODE_RATE_LP_TEXT N_("Terrestrial low priority stream code rate (FEC)")
#define CODE_RATE_LP_LONGTEXT ""
#define BANDWIDTH_TEXT N_("Terrestrial bandwidth")
#define BANDWIDTH_LONGTEXT N_("Terrestrial bandwidth [0=auto,6,7,8 in MHz]")
#define GUARD_TEXT N_("Terrestrial guard interval")
#define GUARD_LONGTEXT ""
#define TRANSMISSION_TEXT N_("Terrestrial transmission mode")
#define TRANSMISSION_LONGTEXT ""
#define HIERARCHY_TEXT N_("Terrestrial hierarchy mode")
#define HIERARCHY_LONGTEXT ""
vlc_module_begin();
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,
VLC_FALSE );
add_integer( "device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT, VLC_FALSE );
add_integer( "frequency", 11954000, NULL, FREQ_TEXT, FREQ_LONGTEXT,
VLC_FALSE );
/* DVB-S (satellite) */
add_integer( "polarization", 0, NULL, POL_TEXT, POL_LONGTEXT, VLC_FALSE );
add_integer( "fec", 3, NULL, FEC_TEXT, FEC_LONGTEXT, VLC_FALSE );
add_integer( "symbol-rate", 27500000, NULL, SRATE_TEXT, SRATE_LONGTEXT,
VLC_FALSE );
add_bool( "diseqc", 0, NULL, DISEQC_TEXT, DISEQC_LONGTEXT, VLC_TRUE );
add_integer( "lnb-lof1", 9750000, NULL, LNB_LOF1_TEXT, LNB_LOF1_LONGTEXT,
VLC_TRUE );
add_integer( "lnb-lof2", 12999000, NULL, LNB_LOF2_TEXT, LNB_LOF2_LONGTEXT,
VLC_TRUE );
add_integer( "lnb-slof", 11700000, NULL, LNB_SLOF_TEXT, LNB_SLOF_LONGTEXT,
VLC_TRUE );
/* DVB-T (terrestrial) */
add_integer( "code-rate-hp", 9, NULL, CODE_RATE_HP_TEXT,
CODE_RATE_HP_LONGTEXT, VLC_TRUE );
add_integer( "code-rate-lp", 9, NULL, CODE_RATE_LP_TEXT,
CODE_RATE_LP_LONGTEXT, VLC_TRUE );
add_integer( "bandwidth", 0, NULL, BANDWIDTH_TEXT, BANDWIDTH_LONGTEXT,
VLC_TRUE );
add_integer( "modulation", 0, NULL, MODULATION_TEXT, MODULATION_LONGTEXT,
VLC_TRUE );
add_integer( "guard", 0, NULL, GUARD_TEXT, GUARD_LONGTEXT, VLC_TRUE );
add_integer( "transmission", 0, NULL, TRANSMISSION_TEXT,
TRANSMISSION_LONGTEXT, VLC_TRUE );
add_integer( "hierarchy", 0, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT,
VLC_TRUE );
/* short cuts */
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( "dvb-c" ); /* DVB-C (cable) */
add_shortcut( "cable" );
add_shortcut( "dvb-t" ); /* DVB-T (terrestrial) */
add_shortcut( "terrestrial" );
add_shortcut( "satellite" ); /* compatibility with the interface. */
set_callbacks( E_(Open), E_(Close) );
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