p_status->b_has_carrier = (p_frontend->i_last_status & FE_HAS_CARRIER) != 0;
p_status->b_has_lock = (p_frontend->i_last_status & FE_HAS_LOCK) != 0;
}
+static int ScanParametersDvbC( access_t *p_access, scan_parameter_t *p_scan )
+{
+ const frontend_t *p_frontend = p_access->p_sys->p_frontend;
+
+
+ memset( p_scan, 0, sizeof(*p_scan) );
+ p_scan->type = SCAN_DVB_C;
+ p_scan->b_exhaustive = false;
+
+ /* */
+ p_scan->frequency.i_min = p_frontend->info.frequency_min;
+ p_scan->frequency.i_max = p_frontend->info.frequency_max;
+ p_scan->frequency.i_step = p_frontend->info.frequency_stepsize;
+ p_scan->frequency.i_count = (p_scan->frequency.i_max-p_scan->frequency.i_min)/p_scan->frequency.i_step;
+
+ /* */
+ p_scan->bandwidth.i_min = 6;
+ p_scan->bandwidth.i_max = 8;
+ p_scan->bandwidth.i_step = 1;
+ p_scan->bandwidth.i_count = 3;
+ return VLC_SUCCESS;
+}
static int ScanParametersDvbT( access_t *p_access, scan_parameter_t *p_scan )
{
const frontend_t *p_frontend = p_access->p_sys->p_frontend;
if( p_frontend->info.type == FE_OFDM ) // DVB-T
return ScanParametersDvbT( p_access, p_scan );
+ else if( p_frontend->info.type == FE_QAM ) // DVB-C
+ return ScanParametersDvbC( p_access, p_scan );
msg_Err( p_access, "Frontend type not supported for scanning" );
return VLC_EGENERIC;
p_parameter->bandwidth.i_min, p_parameter->bandwidth.i_max );
msg_Dbg( p_obj, " - exhaustive mode %s", p_parameter->b_exhaustive ? "on" : "off" );
}
+ else if( p_parameter->type == SCAN_DVB_C )
+ {
+ msg_Dbg( p_obj, "DVB-C scanning:" );
+ msg_Dbg( p_obj, " - frequency [%d, %d]",
+ p_parameter->frequency.i_min, p_parameter->frequency.i_max );
+ msg_Dbg( p_obj, " - bandwidth [%d,%d]",
+ p_parameter->bandwidth.i_min, p_parameter->bandwidth.i_max );
+ msg_Dbg( p_obj, " - exhaustive mode %s", p_parameter->b_exhaustive ? "on" : "off" );
+ }
else
{
return VLC_EGENERIC;
TAB_CLEAN( p_scan->i_service, p_scan->pp_service );
}
+static int ScanDvbCNextFast( scan_t *p_scan, scan_configuration_t *p_cfg, double *pf_pos )
+{
+ msg_Dbg( p_scan->p_obj, "Scan index %d", p_scan->i_index );
+ if( p_scan->i_index <= ( 10 ) )
+ {
+ p_cfg->i_frequency = 100500000 + ( ( p_scan->i_index ) * 700000);
+ }
+ else if ( p_scan->i_index <= (10 + 9 ) )
+ {
+ p_cfg->i_frequency = 97000000 + ( ( p_scan->i_index - 20 ) * 800000);
+ }
+ else if ( p_scan->i_index <= (38 + 17 ) )
+ {
+ p_cfg->i_frequency = 14250000 + ( ( p_scan->i_index - 33 ) * 700000);
+ }
+ else if ( p_scan->i_index <= (72 + (90-21) ) )
+ {
+ p_cfg->i_frequency = 13800000 + ( ( p_scan->i_index - (72 + 21 ) ) * 800000);
+ }
+ else
+ {
+ return VLC_EGENERIC;
+ }
+ *pf_pos = (double)p_scan->i_index / ( (90-21+22-5+10+9));
+ return VLC_SUCCESS;
+
+}
static int ScanDvbTNextExhaustive( scan_t *p_scan, scan_configuration_t *p_cfg, double *pf_pos )
{
}
}
+static int ScanDvbCNext( scan_t *p_scan, scan_configuration_t *p_cfg, double *pf_pos )
+{
+ if( p_scan->parameter.b_exhaustive )
+ return ScanDvbTNextExhaustive( p_scan, p_cfg, pf_pos );
+ else
+ return ScanDvbCNextFast( p_scan, p_cfg, pf_pos );
+}
+
static int ScanDvbTNext( scan_t *p_scan, scan_configuration_t *p_cfg, double *pf_pos )
{
if( p_scan->parameter.b_exhaustive )
case SCAN_DVB_T:
i_ret = ScanDvbTNext( p_scan, p_cfg, &f_position );
break;
+ case SCAN_DVB_C:
+ i_ret = ScanDvbCNext( p_scan, p_cfg, &f_position );
+ break;
default:
i_ret = VLC_EGENERIC;
break;