Commit 955ea1e9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

DVB: remove access

This temporarily removes CAM support (which was reportedly broken a few
days ago). Scan is left for the time being.
parent 01810bfc
...@@ -2,8 +2,6 @@ SOURCES_dvb = \ ...@@ -2,8 +2,6 @@ SOURCES_dvb = \
access.c \ access.c \
linux_dvb.c \ linux_dvb.c \
scan.c scan.h \ scan.c scan.h \
en50221.c en50221.h \
../../demux/dvb-text.h \ ../../demux/dvb-text.h \
http.c \
dvb.h \ dvb.h \
$(NULL) $(NULL)
...@@ -68,40 +68,6 @@ static void Close( vlc_object_t *p_this ); ...@@ -68,40 +68,6 @@ static void Close( vlc_object_t *p_this );
#define SATELLITE_TEXT N_("Satellite scanning config") #define SATELLITE_TEXT N_("Satellite scanning config")
#define SATELLITE_LONGTEXT N_("filename of config file in share/dvb/dvb-s") #define SATELLITE_LONGTEXT N_("filename of config file in share/dvb/dvb-s")
#define HOST_TEXT N_( "HTTP Host address" )
#define HOST_LONGTEXT N_( \
"To enable the internal HTTP server, set its address and port here." )
#define USER_TEXT N_( "HTTP user name" )
#define USER_LONGTEXT N_( \
"User name the administrator will use to log into " \
"the internal HTTP server." )
#define PASSWORD_TEXT N_( "HTTP password" )
#define PASSWORD_LONGTEXT N_( \
"Password the administrator will use to log into " \
"the internal HTTP server." )
#define ACL_TEXT N_( "HTTP ACL" )
#define ACL_LONGTEXT N_( \
"Access control list (equivalent to .hosts) file path, " \
"which will limit the range of IPs entitled to log into the internal " \
"HTTP server." )
#define CERT_TEXT N_( "Certificate file" )
#define CERT_LONGTEXT N_( "HTTP interface x509 PEM certificate file " \
"(enables SSL)" )
#define KEY_TEXT N_( "Private key file" )
#define KEY_LONGTEXT N_( "HTTP interface x509 PEM private key file" )
#define CA_TEXT N_( "Root CA file" )
#define CA_LONGTEXT N_( "HTTP interface x509 PEM trusted root CA " \
"certificates file" )
#define CRL_TEXT N_( "CRL file" )
#define CRL_LONGTEXT N_( "HTTP interface Certificates Revocation List file" )
vlc_module_begin () vlc_module_begin ()
set_shortname( N_("DVB") ) set_shortname( N_("DVB") )
set_description( N_("DVB input with v4l2 support") ) set_description( N_("DVB input with v4l2 support") )
...@@ -112,34 +78,12 @@ vlc_module_begin () ...@@ -112,34 +78,12 @@ vlc_module_begin ()
/* DVB-S (satellite) */ /* DVB-S (satellite) */
add_string( "dvb-satellite", NULL, SATELLITE_TEXT, SATELLITE_LONGTEXT, add_string( "dvb-satellite", NULL, SATELLITE_TEXT, SATELLITE_LONGTEXT,
true ) true )
#ifdef ENABLE_HTTPD
/* MMI HTTP interface */
set_section( N_("HTTP server" ), 0 )
add_string( "dvb-http-host", NULL, HOST_TEXT, HOST_LONGTEXT,
true )
add_string( "dvb-http-user", NULL, USER_TEXT, USER_LONGTEXT,
true )
add_password( "dvb-http-password", NULL, PASSWORD_TEXT,
PASSWORD_LONGTEXT, true )
add_string( "dvb-http-acl", NULL, ACL_TEXT, ACL_LONGTEXT,
true )
add_loadfile( "dvb-http-intf-cert", NULL, CERT_TEXT, CERT_LONGTEXT,
true )
add_loadfile( "dvb-http-intf-key", NULL, KEY_TEXT, KEY_LONGTEXT,
true )
add_loadfile( "dvb-http-intf-ca", NULL, CA_TEXT, CA_LONGTEXT,
true )
add_loadfile( "dvb-http-intf-crl", NULL, CRL_TEXT, CRL_LONGTEXT,
true )
#endif
set_capability( "access", 0 ) set_capability( "access", 0 )
add_shortcut( "dvb", /* Generic name */ add_shortcut( "dvb", /* Generic name */
"dvb-s", "qpsk", "satellite", /* Satellite */ "dvb-s", "qpsk", "satellite", /* Satellite */
"dvb-c", "cable", /* Cable */ "dvb-c", "cable", /* Cable */
"dvb-t", "terrestrial", /* Terrestrial */ "dvb-t", "terrestrial" ) /* Terrestrial */
"atsc" ) /* Atsc */
add_shortcut( "usdigital" )
set_callbacks( Open, Close ) set_callbacks( Open, Close )
...@@ -149,7 +93,6 @@ vlc_module_end () ...@@ -149,7 +93,6 @@ vlc_module_end ()
/***************************************************************************** /*****************************************************************************
* Local prototypes * Local prototypes
*****************************************************************************/ *****************************************************************************/
static block_t *Block( access_t * );
static int Control( access_t *, int, va_list ); static int Control( access_t *, int, va_list );
static block_t *BlockScan( access_t * ); static block_t *BlockScan( access_t * );
...@@ -164,7 +107,6 @@ static block_t *BlockScan( access_t * ); ...@@ -164,7 +107,6 @@ static block_t *BlockScan( access_t * );
#define DVB_SCAN_MAX_PROBE_TIME (45000*1000) #define DVB_SCAN_MAX_PROBE_TIME (45000*1000)
static void FilterUnset( access_t *, int i_max ); static void FilterUnset( access_t *, int i_max );
static void FilterUnsetPID( access_t *, int i_pid );
static void FilterSet( access_t *, int i_pid, int i_type ); static void FilterSet( access_t *, int i_pid, int i_type );
static void VarInit( access_t * ); static void VarInit( access_t * );
...@@ -184,7 +126,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -184,7 +126,6 @@ static int Open( vlc_object_t *p_this )
/* Set up access */ /* Set up access */
p_access->pf_read = NULL; p_access->pf_read = NULL;
p_access->pf_block = Block;
p_access->pf_control = Control; p_access->pf_control = Control;
p_access->pf_seek = NULL; p_access->pf_seek = NULL;
...@@ -204,14 +145,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -204,14 +145,6 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
/* Getting frontend info */
if( FrontendOpen( p_access) )
{
free( p_sys );
return VLC_EGENERIC;
}
/* */
bool b_scan_mode = var_GetInteger( p_access, "dvb-frequency" ) == 0; bool b_scan_mode = var_GetInteger( p_access, "dvb-frequency" ) == 0;
if( b_scan_mode ) if( b_scan_mode )
{ {
...@@ -219,16 +152,14 @@ static int Open( vlc_object_t *p_this ) ...@@ -219,16 +152,14 @@ static int Open( vlc_object_t *p_this )
p_access->pf_block = BlockScan; p_access->pf_block = BlockScan;
} }
else else
return VLC_EGENERIC; /* let the DTV plugin do the work */
/* Getting frontend info */
if( FrontendOpen( p_access) )
{ {
/* Setting frontend parameters for tuning the hardware */
msg_Dbg( p_access, "trying to tune the frontend...");
if( FrontendSet( p_access ) < 0 )
{
FrontendClose( p_access );
free( p_sys ); free( p_sys );
return VLC_EGENERIC; return VLC_EGENERIC;
} }
}
/* Opening DVR device */ /* Opening DVR device */
if( DVROpen( p_access ) < 0 ) if( DVROpen( p_access ) < 0 )
...@@ -238,7 +169,6 @@ static int Open( vlc_object_t *p_this ) ...@@ -238,7 +169,6 @@ static int Open( vlc_object_t *p_this )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
if( b_scan_mode )
{ {
scan_parameter_t parameter; scan_parameter_t parameter;
scan_t *p_scan; scan_t *p_scan;
...@@ -257,31 +187,9 @@ static int Open( vlc_object_t *p_this ) ...@@ -257,31 +187,9 @@ static int Open( vlc_object_t *p_this )
p_sys->scan = p_scan; p_sys->scan = p_scan;
p_sys->i_read_once = DVB_READ_ONCE_SCAN; p_sys->i_read_once = DVB_READ_ONCE_SCAN;
} }
else
{
p_sys->b_budget_mode = var_GetBool( p_access, "dvb-budget-mode" );
if( p_sys->b_budget_mode )
{
msg_Dbg( p_access, "setting filter on all PIDs" );
FilterSet( p_access, 0x2000, OTHER_TYPE );
p_sys->i_read_once = DVB_READ_ONCE;
}
else
{
msg_Dbg( p_access, "setting filter on PAT" );
FilterSet( p_access, 0x0, OTHER_TYPE );
p_sys->i_read_once = DVB_READ_ONCE_START;
}
CAMOpen( p_access );
#ifdef ENABLE_HTTPD
HTTPOpen( p_access );
#endif
}
free( p_access->psz_demux ); free( p_access->psz_demux );
p_access->psz_demux = strdup( p_sys->scan ? "m3u8" : "ts" ); p_access->psz_demux = strdup( "m3u8" );
return VLC_SUCCESS; return VLC_SUCCESS;
} }
...@@ -293,129 +201,15 @@ static void Close( vlc_object_t *p_this ) ...@@ -293,129 +201,15 @@ static void Close( vlc_object_t *p_this )
access_t *p_access = (access_t*)p_this; access_t *p_access = (access_t*)p_this;
access_sys_t *p_sys = p_access->p_sys; access_sys_t *p_sys = p_access->p_sys;
FilterUnset( p_access, p_sys->b_budget_mode && !p_sys->scan ? 1 : MAX_DEMUX ); FilterUnset( p_access, MAX_DEMUX );
DVRClose( p_access ); DVRClose( p_access );
FrontendClose( p_access ); FrontendClose( p_access );
if( p_sys->scan != NULL )
scan_Destroy( p_sys->scan ); scan_Destroy( p_sys->scan );
else
{
CAMClose( p_access );
#ifdef ENABLE_HTTPD
HTTPClose( p_access );
#endif
}
free( p_sys ); free( p_sys );
} }
/*****************************************************************************
* Block:
*****************************************************************************/
static block_t *Block( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
block_t *p_block;
for ( ; ; )
{
struct pollfd ufds[2];
int i_ret;
/* Initialize file descriptor sets */
memset (ufds, 0, sizeof (ufds));
ufds[0].fd = p_sys->i_handle;
ufds[0].events = POLLIN;
ufds[1].fd = p_sys->i_frontend_handle;
ufds[1].events = POLLPRI;
/* We'll wait 0.5 second if nothing happens */
/* Find if some data is available */
i_ret = poll( ufds, 2, 500 );
if ( !vlc_object_alive (p_access) )
return NULL;
if ( i_ret < 0 )
{
if( errno == EINTR )
continue;
msg_Err( p_access, "poll error: %m" );
return NULL;
}
CAMPoll( p_access );
if ( ufds[1].revents )
{
FrontendPoll( p_access );
}
#ifdef ENABLE_HTTPD
if ( p_sys->i_httpd_timeout && mdate() > p_sys->i_httpd_timeout )
{
vlc_mutex_lock( &p_sys->httpd_mutex );
if ( p_sys->b_request_frontend_info )
{
msg_Warn( p_access, "frontend timeout for HTTP interface" );
p_sys->b_request_frontend_info = false;
p_sys->psz_frontend_info = strdup( "Timeout getting info\n" );
}
if ( p_sys->b_request_mmi_info )
{
msg_Warn( p_access, "MMI timeout for HTTP interface" );
p_sys->b_request_mmi_info = false;
p_sys->psz_mmi_info = strdup( "Timeout getting info\n" );
}
vlc_cond_signal( &p_sys->httpd_cond );
vlc_mutex_unlock( &p_sys->httpd_mutex );
}
if ( p_sys->b_request_frontend_info )
{
FrontendStatus( p_access );
}
if ( p_sys->b_request_mmi_info )
{
CAMStatus( p_access );
}
#endif
if ( p_sys->i_frontend_timeout && mdate() > p_sys->i_frontend_timeout )
{
msg_Warn( p_access, "no lock, tuning again" );
FrontendSet( p_access );
}
if ( ufds[0].revents )
{
p_block = block_New( p_access,
p_sys->i_read_once * TS_PACKET_SIZE );
if( ( i_ret = read( p_sys->i_handle, p_block->p_buffer,
p_sys->i_read_once * TS_PACKET_SIZE ) ) <= 0 )
{
msg_Warn( p_access, "read failed (%m)" );
block_Release( p_block );
continue;
}
p_block->i_buffer = i_ret;
break;
}
}
if( p_sys->i_read_once < DVB_READ_ONCE )
p_sys->i_read_once++;
/* Update moderatly the signal properties */
if( (p_sys->i_stat_counter++ % 100) == 0 )
p_access->info.i_update |= INPUT_UPDATE_SIGNAL;
return p_block;
}
/***************************************************************************** /*****************************************************************************
* BlockScan: * BlockScan:
*****************************************************************************/ *****************************************************************************/
...@@ -583,12 +377,9 @@ static block_t *BlockScan( access_t *p_access ) ...@@ -583,12 +377,9 @@ static block_t *BlockScan( access_t *p_access )
*****************************************************************************/ *****************************************************************************/
static int Control( access_t *p_access, int i_query, va_list args ) static int Control( access_t *p_access, int i_query, va_list args )
{ {
access_sys_t *p_sys = p_access->p_sys; bool *pb_bool;
bool *pb_bool, b_bool;
int i_int;
int64_t *pi_64; int64_t *pi_64;
double *pf1, *pf2; double *pf1, *pf2;
dvbpsi_pmt_t *p_pmt;
frontend_statistic_t stat; frontend_statistic_t stat;
switch( i_query ) switch( i_query )
...@@ -628,30 +419,9 @@ static int Control( access_t *p_access, int i_query, va_list args ) ...@@ -628,30 +419,9 @@ static int Control( access_t *p_access, int i_query, va_list args )
return VLC_SUCCESS; return VLC_SUCCESS;
case ACCESS_SET_PRIVATE_ID_STATE: case ACCESS_SET_PRIVATE_ID_STATE:
if( p_sys->scan )
return VLC_EGENERIC;
i_int = (int)va_arg( args, int ); /* Private data (pid for now)*/
b_bool = (bool)va_arg( args, int ); /* b_selected */
if( !p_sys->b_budget_mode )
{
/* FIXME we may want to give the real type (me ?, I don't ;) */
if( b_bool )
FilterSet( p_access, i_int, OTHER_TYPE );
else
FilterUnsetPID( p_access, i_int );
}
break;
case ACCESS_SET_PRIVATE_ID_CA: case ACCESS_SET_PRIVATE_ID_CA:
if( p_sys->scan )
return VLC_EGENERIC; return VLC_EGENERIC;
p_pmt = (dvbpsi_pmt_t *)va_arg( args, dvbpsi_pmt_t * );
CAMSet( p_access, p_pmt );
break;
default: default:
msg_Warn( p_access, "unimplemented query in control" ); msg_Warn( p_access, "unimplemented query in control" );
return VLC_EGENERIC; return VLC_EGENERIC;
...@@ -712,22 +482,6 @@ static void FilterUnset( access_t *p_access, int i_max ) ...@@ -712,22 +482,6 @@ static void FilterUnset( access_t *p_access, int i_max )
} }
} }
static void FilterUnsetPID( access_t *p_access, int i_pid )
{
access_sys_t *p_sys = p_access->p_sys;
int i;
for( i = 0; i < MAX_DEMUX; i++ )
{
if( p_sys->p_demux_handles[i].i_type &&
p_sys->p_demux_handles[i].i_pid == i_pid )
{
DMXUnsetFilter( p_access, p_sys->p_demux_handles[i].i_handle );
p_sys->p_demux_handles[i].i_type = 0;
}
}
}
/***************************************************************************** /*****************************************************************************
* VarInit/ParseMRL: * VarInit/ParseMRL:
*****************************************************************************/ *****************************************************************************/
...@@ -742,7 +496,6 @@ static void VarInit( access_t *p_access ) ...@@ -742,7 +496,6 @@ static void VarInit( access_t *p_access )
var_Create( p_access, "dvb-frequency", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "dvb-frequency", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-inversion", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "dvb-inversion", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-probe", VLC_VAR_BOOL | VLC_VAR_DOINHERIT ); var_Create( p_access, "dvb-probe", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-budget-mode", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
/* */ /* */
var_Create( p_access, "dvb-satellite", VLC_VAR_STRING | VLC_VAR_DOINHERIT ); var_Create( p_access, "dvb-satellite", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
...@@ -766,17 +519,6 @@ static void VarInit( access_t *p_access ) ...@@ -766,17 +519,6 @@ static void VarInit( access_t *p_access )
var_Create( p_access, "dvb-transmission", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "dvb-transmission", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-guard", VLC_VAR_INTEGER ); var_Create( p_access, "dvb-guard", VLC_VAR_INTEGER );
var_Create( p_access, "dvb-hierarchy", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT ); var_Create( p_access, "dvb-hierarchy", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
#ifdef ENABLE_HTTPD
var_Create( p_access, "dvb-http-host", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-user", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-password", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-acl", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-intf-cert", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-intf-key", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-intf-ca", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
var_Create( p_access, "dvb-http-intf-crl", VLC_VAR_STRING | VLC_VAR_DOINHERIT );
#endif
} }
/* */ /* */
......
...@@ -68,20 +68,6 @@ struct access_sys_t ...@@ -68,20 +68,6 @@ struct access_sys_t
int i_stat_counter; int i_stat_counter;
#ifdef ENABLE_HTTPD
/* Local HTTP server */
httpd_host_t *p_httpd_host;
httpd_file_sys_t *p_httpd_file;
httpd_redirect_t *p_httpd_redir;
vlc_mutex_t httpd_mutex;
vlc_cond_t httpd_cond;
mtime_t i_httpd_timeout;
bool b_request_frontend_info, b_request_mmi_info;
char *psz_frontend_info, *psz_mmi_info;
char *psz_request;
#endif
/* Scan */ /* Scan */
struct scan_t *scan; struct scan_t *scan;
}; };
...@@ -102,9 +88,6 @@ int FrontendOpen( access_t * ); ...@@ -102,9 +88,6 @@ int FrontendOpen( access_t * );
void FrontendPoll( access_t *p_access ); void FrontendPoll( access_t *p_access );
int FrontendSet( access_t * ); int FrontendSet( access_t * );
void FrontendClose( access_t * ); void FrontendClose( access_t * );
#ifdef ENABLE_HTTPD
void FrontendStatus( access_t * );
#endif
int FrontendGetStatistic( access_t *, frontend_statistic_t * ); int FrontendGetStatistic( access_t *, frontend_statistic_t * );
void FrontendGetStatus( access_t *, frontend_status_t * ); void FrontendGetStatus( access_t *, frontend_status_t * );
...@@ -115,18 +98,3 @@ int DMXUnsetFilter( access_t *, int i_fd ); ...@@ -115,18 +98,3 @@ int DMXUnsetFilter( access_t *, int i_fd );
int DVROpen( access_t * ); int DVROpen( access_t * );
void DVRClose( access_t * ); void DVRClose( access_t * );
int CAMOpen( access_t * );
void CAMPoll( access_t * );
int CAMSet( access_t *, dvbpsi_pmt_t * );
void CAMClose( access_t * );
#ifdef ENABLE_HTTPD
void CAMStatus( access_t * );
#endif
#ifdef ENABLE_HTTPD
int HTTPOpen( access_t *p_access );
void HTTPClose( access_t *p_access );
const char *HTTPExtractValue( const char *psz_uri, const char *psz_name,
char *psz_value, int i_value_max );
#endif
...@@ -57,12 +57,10 @@ ...@@ -57,12 +57,10 @@
#include "dvb.h" #include "dvb.h"
#include "scan.h" #include "scan.h"
#include "en50221.h"
#define DMX "/dev/dvb/adapter%d/demux%d" #define DMX "/dev/dvb/adapter%d/demux%d"
#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"
#define CA "/dev/dvb/adapter%d/ca%d"
/* /*
* Frontends * Frontends
...@@ -484,152 +482,6 @@ int FrontendGetScanParameter( access_t *p_access, scan_parameter_t *p_scan ) ...@@ -484,152 +482,6 @@ int FrontendGetScanParameter( access_t *p_access, scan_parameter_t *p_scan )
return VLC_EGENERIC; return VLC_EGENERIC;
} }
#ifdef ENABLE_HTTPD
/*****************************************************************************
* FrontendStatus : Read frontend status
*****************************************************************************/
void FrontendStatus( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
frontend_t *p_frontend = p_sys->p_frontend;
char *p = p_sys->psz_frontend_info = malloc( 10000 );
fe_status_t i_status;
/* Determine type of frontend */
if( ioctl( p_sys->i_frontend_handle, FE_GET_INFO, &p_frontend->info ) < 0 )
{
char buf[1000];
strerror_r( errno, buf, sizeof( buf ) );
p += sprintf( p, "ioctl FE_GET_INFO failed %s\n", buf );
goto out;
}
/* Print out frontend capabilities. */
p += sprintf( p, "<table border=1><tr><th>name</th><td>%s</td></tr>\n",
p_frontend->info.name );
switch( p_frontend->info.type )
{
case FE_QPSK:
p += sprintf( p, "<tr><th>type</th><td>QPSK (DVB-S)</td></tr>\n" );
break;
case FE_QAM:
p += sprintf( p, "<tr><th>type</th><td>QAM (DVB-C)</td></tr>\n" );
break;
case FE_OFDM:
p += sprintf( p, "<tr><th>type</th><td>OFDM (DVB-T)</td></tr>\n" );
break;
#if 0 /* DVB_API_VERSION == 3 */
case FE_MEMORY:
p += sprintf( p, "<tr><th>type</th><td>MEMORY</td></tr>\n" );
break;
case FE_NET:
p += sprintf( p, "<tr><th>type</th><td>NETWORK</td></tr>\n" );
break;
#endif
default:
p += sprintf( p, "<tr><th>type</th><td>UNKNOWN (%d)</td></tr>\n",
p_frontend->info.type );
goto out;
}
#define CHECK_INFO( x ) \
p += sprintf( p, \
"<tr><th>" STRINGIFY(x) "</th><td>%u</td></tr>\n", \
p_frontend->info.x );
CHECK_INFO( frequency_min );
CHECK_INFO( frequency_max );
CHECK_INFO( frequency_stepsize );
CHECK_INFO( frequency_tolerance );
CHECK_INFO( symbol_rate_min );
CHECK_INFO( symbol_rate_max );
CHECK_INFO( symbol_rate_tolerance );
CHECK_INFO( notifier_delay );
#undef CHECK_INFO
p += sprintf( p, "</table><p>Frontend capability list:\n<table border=1>" );
#define CHECK_CAPS( x ) \
if ( p_frontend->info.caps & (FE_##x) ) \
p += sprintf( p, "<tr><td>" STRINGIFY(x) "</td></tr>\n" );
CHECK_CAPS( IS_STUPID );
CHECK_CAPS( CAN_INVERSION_AUTO );
CHECK_CAPS( CAN_FEC_1_2 );
CHECK_CAPS( CAN_FEC_2_3 );
CHECK_CAPS( CAN_FEC_3_4 );
CHECK_CAPS( CAN_FEC_4_5 );
CHECK_CAPS( CAN_FEC_5_6 );
CHECK_CAPS( CAN_FEC_6_7 );
CHECK_CAPS( CAN_FEC_7_8 );
CHECK_CAPS( CAN_FEC_8_9 );
CHECK_CAPS( CAN_FEC_AUTO );
CHECK_CAPS( CAN_QPSK );
CHECK_CAPS( CAN_QAM_16 );
CHECK_CAPS( CAN_QAM_32 );
CHECK_CAPS( CAN_QAM_64 );
CHECK_CAPS( CAN_QAM_128 );
CHECK_CAPS( CAN_QAM_256 );
CHECK_CAPS( CAN_QAM_AUTO );
CHECK_CAPS( CAN_TRANSMISSION_MODE_AUTO );
CHECK_CAPS( CAN_BANDWIDTH_AUTO );
CHECK_CAPS( CAN_GUARD_INTERVAL_AUTO );
CHECK_CAPS( CAN_HIERARCHY_AUTO );
CHECK_CAPS( CAN_MUTE_TS );
CHECK_CAPS( CAN_RECOVER );
#if 0 /* Disabled because of older distributions */
CHECK_CAPS( CAN_CLEAN_SETUP );
#endif
#undef CHECK_CAPS
p += sprintf( p, "</table><p>Current frontend status:\n<table border=1>" );
if( ioctl( p_sys->i_frontend_handle, FE_READ_STATUS, &i_status ) < 0 )
{
char buf[1000];
strerror_r( errno, buf, sizeof( buf ) );
p += sprintf( p, "</table>ioctl FE_READ_STATUS failed %s\n", buf );
goto out;
}
#define CHECK_STATUS( x ) \
if ( i_status & (FE_##x) ) \
p += sprintf( p, "<tr><td>" STRINGIFY(x) "</td></tr>\n" );
CHECK_STATUS( HAS_SIGNAL );
CHECK_STATUS( HAS_CARRIER );
CHECK_STATUS( HAS_VITERBI );
CHECK_STATUS( HAS_SYNC );
CHECK_STATUS( HAS_LOCK );
CHECK_STATUS( REINIT );
if( i_status == 0 )
p += sprintf( p, "<tr><td>Tuning failed</td></tr>\n" );
#undef CHECK_STATUS
if ( i_status & FE_HAS_LOCK )
{
int32_t i_value;
p += sprintf( p, "</table><p>Signal status:\n<table border=1>" );
if( ioctl( p_sys->i_frontend_handle, FE_READ_BER, &i_value ) >= 0 )
p += sprintf( p, "<tr><th>Bit error rate</th><td>%d</td></tr>\n",
i_value );
if( ioctl( p_sys->i_frontend_handle, FE_READ_SIGNAL_STRENGTH,
&i_value ) >= 0 )
p += sprintf( p, "<tr><th>Signal strength</th><td>%d</td></tr>\n",
i_value );
if( ioctl( p_sys->i_frontend_handle, FE_READ_SNR, &i_value ) >= 0 )
p += sprintf( p, "<tr><th>SNR</th><td>%d</td></tr>\n",
i_value );
}
p += sprintf( p, "</table>" );
out:
vlc_mutex_lock( &p_sys->httpd_mutex );
p_sys->b_request_frontend_info = false;
vlc_cond_signal( &p_sys->httpd_cond );
vlc_mutex_unlock( &p_sys->httpd_mutex );
}
#endif
/***************************************************************************** /*****************************************************************************
* FrontendInfo : Return information about given frontend * FrontendInfo : Return information about given frontend
*****************************************************************************/ *****************************************************************************/
...@@ -1463,98 +1315,3 @@ void DVRClose( access_t * p_access ) ...@@ -1463,98 +1315,3 @@ void DVRClose( access_t * p_access )
close( p_sys->i_handle ); close( p_sys->i_handle );
} }
/*
* CAM device
*/
/*****************************************************************************
* CAMOpen :
*****************************************************************************/
int CAMOpen( access_t *p_access )
{
int i_adapter = var_GetInteger( p_access, "dvb-adapter" );
int i_device = var_GetInteger( p_access, "dvb-device" );
char ca[128];
if( snprintf( ca, sizeof(ca), CA, i_adapter, i_device ) >= (int)sizeof(ca) )
{
msg_Err( p_access, "snprintf() truncated string for CA" );
ca[sizeof(ca) - 1] = '\0';
}
msg_Dbg( p_access, "Opening device %s", ca );
int fd = vlc_open(ca, O_RDWR | O_NONBLOCK);
if( fd == -1 )
{
msg_Warn( p_access, "CAMInit: opening CAM device failed (%m)" );
return VLC_EGENERIC;
}
if( !(p_access->p_sys->p_cam = en50221_Init( VLC_OBJECT(p_access), fd )) )
{
close( fd );
return VLC_EGENERIC;
}
return VLC_SUCCESS;
}
/*****************************************************************************
* CAMPoll :
*****************************************************************************/
void CAMPoll( access_t * p_access )
{
cam_t *p_cam = p_access->p_sys->p_cam;
if( p_cam != NULL )
en50221_Poll( p_cam );
}
#ifdef ENABLE_HTTPD
/*****************************************************************************
* CAMStatus :
*****************************************************************************/
void CAMStatus( access_t * p_access )
{
access_sys_t *p_sys = p_access->p_sys;
cam_t *p_cam = p_sys->p_cam;
p_sys->psz_mmi_info = en50221_Status( p_cam, p_sys->psz_request );
p_sys->psz_request = NULL;
if( p_sys->psz_mmi_info != NULL )
{
vlc_mutex_lock( &p_sys->httpd_mutex );
p_sys->b_request_mmi_info = false;
vlc_cond_signal( &p_sys->httpd_cond );
vlc_mutex_unlock( &p_sys->httpd_mutex );
}
}
#endif
/*****************************************************************************
* CAMSet :
*****************************************************************************/
int CAMSet( access_t * p_access, dvbpsi_pmt_t *p_pmt )
{
cam_t *p_cam = p_access->p_sys->p_cam;
if( p_cam == NULL )
{
dvbpsi_DeletePMT( p_pmt );
return VLC_EGENERIC;
}
en50221_SetCAPMT( p_cam, p_pmt );
return VLC_SUCCESS;
}
/*****************************************************************************
* CAMClose :
*****************************************************************************/
void CAMClose( access_t * p_access )
{
cam_t *p_cam = p_access->p_sys->p_cam;
if ( p_cam != NULL )
en50221_End( p_cam );
}
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