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)
This diff is collapsed.
...@@ -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