Commit e70d1f5c authored by Ilkka Ollakka's avatar Ilkka Ollakka

dvb: add ability to scann modulation from dvb-c

Basicly code loops over all modulation before moving to
next frequency position untill we find some channels.

Side effect is that estimate-timer shows funky values.
parent 22da19b4
......@@ -583,6 +583,9 @@ static block_t *BlockScan( access_t *p_access )
if ( cfg.c_polarization )
var_SetInteger( p_access, "dvb-voltage", cfg.c_polarization == 'H' ? 18 : 13 );
if ( cfg.i_modulation )
var_SetInteger( p_access, "dvb-modulation", cfg.i_modulation );
/* Setting frontend parameters for tuning the hardware */
if( FrontendSet( p_access ) < 0 )
{
......
......@@ -424,6 +424,17 @@ static int ScanParametersDvbC( access_t *p_access, scan_parameter_t *p_scan )
? p_frontend->info.frequency_stepsize : 166667;
p_scan->frequency.i_count = (p_scan->frequency.i_max-p_scan->frequency.i_min)/p_scan->frequency.i_step;
/* if user supplies modulation or frontend can do auto, dont scan them */
if( var_GetInteger( p_access, "dvb-modulation" ) ||
p_frontend->info.caps & FE_CAN_QAM_AUTO )
{
p_scan->b_modulation_set = true;
} else {
p_scan->b_modulation_set = false;
/* our scanning code flips modulation from 16..256 automaticly*/
p_scan->i_modulation = 0;
}
/* */
p_scan->bandwidth.i_min = 6;
p_scan->bandwidth.i_max = 8;
......
......@@ -165,6 +165,7 @@ scan_t *scan_New( vlc_object_t *p_obj, const scan_parameter_t *p_parameter )
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" );
msg_Dbg( p_obj, " - scannin modulations %s", p_parameter->b_modulation_set ? "off" : "on" );
}
else if( p_parameter->type == SCAN_DVB_S )
{
......@@ -553,7 +554,23 @@ int scan_Next( scan_t *p_scan, scan_configuration_t *p_cfg )
free( psz_text );
}
p_scan->i_index++;
if( i_service == 0 &&
p_scan->parameter.type == SCAN_DVB_C &&
!p_scan->parameter.b_modulation_set )
{
p_scan->parameter.i_modulation = (p_scan->parameter.i_modulation << 1 ) % 512;
/* if we iterated all modulations, move on */
if( !p_cfg->i_modulation )
{
p_scan->parameter.i_modulation = 16;
p_scan->i_index++;
}
msg_Dbg( p_scan->p_obj, "modulation %d ", p_cfg->i_modulation );
} else {
p_scan->i_index++;
}
if( p_scan->parameter.type == SCAN_DVB_C )
p_cfg->i_modulation = p_scan->parameter.i_modulation;
return VLC_SUCCESS;
}
......@@ -1010,10 +1027,10 @@ block_t *scan_GetM3U( scan_t *p_scan )
psz_type = "Unknown";
break;
}
msg_Warn( p_obj, "scan_GetM3U: service number %d type '%s' name '%s' channel %d cypted=%d| network_id %d (nit:%d sdt:%d)| f=%d bw=%d snr=%d",
msg_Warn( p_obj, "scan_GetM3U: service number %d type '%s' name '%s' channel %d cypted=%d| network_id %d (nit:%d sdt:%d)| f=%d bw=%d snr=%d modulation=%d",
s->i_program, psz_type, s->psz_name, s->i_channel, s->b_crypted,
s->i_network_id, s->i_nit_version, s->i_sdt_version,
s->cfg.i_frequency, s->cfg.i_bandwidth, s->i_snr );
s->cfg.i_frequency, s->cfg.i_bandwidth, s->i_snr, s->cfg.i_modulation );
if( !s->cfg.i_fec )
s->cfg.i_fec = 9; /* FEC_AUTO */
......@@ -1021,14 +1038,15 @@ block_t *scan_GetM3U( scan_t *p_scan )
char *psz;
if( asprintf( &psz, "#EXTINF:,,%s\n"
"#EXTVLCOPT:program=%d\n"
"dvb://frequency=%d:bandwidth=%d:voltage=%d:fec=%d\n"
"dvb://frequency=%d:bandwidth=%d:voltage=%d:fec=%d:modulation=%d\n"
"\n",
s->psz_name && * s->psz_name ? s->psz_name : "Unknown",
s->i_program,
s->cfg.i_frequency,
s->cfg.i_bandwidth,
s->cfg.c_polarization == 'H' ? 18 : 13,
s->cfg.i_fec ) < 0 )
s->cfg.i_fec,
s->cfg.i_modulation ) < 0 )
psz = NULL;
if( psz )
{
......
......@@ -43,7 +43,9 @@ typedef struct scan_parameter_t
bool b_exhaustive;
bool b_use_nit;
bool b_free_only;
bool b_modulation_set;
int i_modulation;
struct
{
int i_min;
......@@ -82,6 +84,7 @@ typedef struct
int i_symbol_rate;
};
int i_fec;
int i_modulation;
char c_polarization;
} scan_configuration_t;
......
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