Commit 057ed2ca authored by Jean-Paul Saman's avatar Jean-Paul Saman

Rework in DVB plugin to allow tuning to DVB-T cards.

- cleanup of messages
- adding status events messages from frontend
- separated tuning for DVB-S, DVB-T and DVB-C into seperate functions.
parent e26f8fd1
...@@ -334,7 +334,7 @@ int E_(Open) ( vlc_object_t *p_this ) ...@@ -334,7 +334,7 @@ int E_(Open) ( vlc_object_t *p_this )
} }
else else
{ {
msg_Warn(p_input,"DVV Input syntax has changed, please see documentation for further informations"); msg_Warn(p_input,"DVB Input syntax has changed, please see documentation for further informations");
u_freq = (unsigned int)i_test; u_freq = (unsigned int)i_test;
if( *psz_next ) if( *psz_next )
{ {
...@@ -408,7 +408,9 @@ int E_(Open) ( vlc_object_t *p_this ) ...@@ -408,7 +408,9 @@ int E_(Open) ( vlc_object_t *p_this )
return -1; return -1;
} }
} }
/* Setting frontend parameters for tuning the hardware */ /* Setting frontend parameters for tuning the hardware */
msg_Dbg( p_input, "Trying to tune to channel ...");
switch( frontend_info.type ) switch( frontend_info.type )
{ {
/* DVB-S: satellite and budget cards (nova) */ /* DVB-S: satellite and budget cards (nova) */
...@@ -418,6 +420,14 @@ int E_(Open) ( vlc_object_t *p_this ) ...@@ -418,6 +420,14 @@ int E_(Open) ( vlc_object_t *p_this )
fep.u.qpsk.symbol_rate = u_srate; fep.u.qpsk.symbol_rate = u_srate;
fep.u.qpsk.fec_inner = dvb_DecodeFEC(p_input, i_fec); fep.u.qpsk.fec_inner = dvb_DecodeFEC(p_input, i_fec);
msg_Dbg( p_input, "satellite (QPSK) frontend found on %s", frontend_info.name ); msg_Dbg( p_input, "satellite (QPSK) frontend found on %s", frontend_info.name );
if (ioctl_SetQPSKFrontend (p_input, fep, b_polarisation,
u_lnb_lof1, u_lnb_lof2, u_lnb_slof,
u_adapter, u_device )<0)
{
msg_Err( p_input, "DVB-S frontend returned a failure event" );
return -1;
}
break; break;
/* DVB-C */ /* DVB-C */
...@@ -428,6 +438,11 @@ int E_(Open) ( vlc_object_t *p_this ) ...@@ -428,6 +438,11 @@ int E_(Open) ( vlc_object_t *p_this )
fep.u.qam.fec_inner = dvb_DecodeFEC(p_input, i_fec); fep.u.qam.fec_inner = dvb_DecodeFEC(p_input, i_fec);
fep.u.qam.modulation = dvb_DecodeModulation(p_input, i_modulation); fep.u.qam.modulation = dvb_DecodeModulation(p_input, i_modulation);
msg_Dbg( p_input, "cable (QAM) frontend found on %s", frontend_info.name ); msg_Dbg( p_input, "cable (QAM) frontend found on %s", frontend_info.name );
if (ioctl_SetQAMFrontend (p_input, fep, u_adapter, u_device )<0)
{
msg_Err( p_input, "DVB-C frontend returned a failure event" );
return -1;
}
break; break;
/* DVB-T */ /* DVB-T */
...@@ -442,12 +457,17 @@ int E_(Open) ( vlc_object_t *p_this ) ...@@ -442,12 +457,17 @@ int E_(Open) ( vlc_object_t *p_this )
fep.u.ofdm.guard_interval = dvb_DecodeGuardInterval(p_input, i_guard); fep.u.ofdm.guard_interval = dvb_DecodeGuardInterval(p_input, i_guard);
fep.u.ofdm.hierarchy_information = dvb_DecodeHierarchy(p_input, i_hierarchy); fep.u.ofdm.hierarchy_information = dvb_DecodeHierarchy(p_input, i_hierarchy);
msg_Dbg( p_input, "terrestrial (OFDM) frontend found on %s", frontend_info.name ); msg_Dbg( p_input, "terrestrial (OFDM) frontend found on %s", frontend_info.name );
if (ioctl_SetOFDMFrontend (p_input, fep,u_adapter, u_device )<0)
{
msg_Err( p_input, "DVB-T frontend returned a failure event" );
return -1;
}
break; break;
default: default:
msg_Err( p_input, "Could not determine frontend type on %s", frontend_info.name ); msg_Err( p_input, "Could not determine frontend type on %s", frontend_info.name );
return -1; return -1;
} }
msg_Dbg( p_input, "Tuning done.");
/* Initialise structure */ /* Initialise structure */
p_satellite = malloc( sizeof( input_socket_t ) ); p_satellite = malloc( sizeof( input_socket_t ) );
...@@ -481,40 +501,6 @@ int E_(Open) ( vlc_object_t *p_this ) ...@@ -481,40 +501,6 @@ int E_(Open) ( vlc_object_t *p_this )
return -1; return -1;
} }
/* Initialize the Satellite Card */
switch (ioctl_SetFrontend (p_input, fep, b_polarisation,
u_lnb_lof1, u_lnb_lof2, u_lnb_slof,
u_adapter, u_device ))
{
case -2:
msg_Err( p_input, "frontend returned an unexpected event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
case -3:
msg_Err( p_input, "frontend returned no event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
case -4:
msg_Err( p_input, "frontend: timeout when polling for event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
case -5:
msg_Err( p_input, "an error occured when polling frontend device" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
case -1:
msg_Err( p_input, "frontend returned a failure event" );
close( p_satellite->i_handle );
free( p_satellite );
return -1;
default:
break;
}
msg_Dbg( p_input, "setting filter on PAT" ); msg_Dbg( p_input, "setting filter on PAT" );
/* Set Filter on PAT packet */ /* Set Filter on PAT packet */
......
This diff is collapsed.
...@@ -33,9 +33,13 @@ ...@@ -33,9 +33,13 @@
/***************************************************************************** /*****************************************************************************
* Prototypes * Prototypes
*****************************************************************************/ *****************************************************************************/
int ioctl_SetFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep, int b_polarisation, int ioctl_SetQPSKFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep, int b_polarisation,
unsigned int u_lnb_lof1, unsigned int u_lnb_lof2, unsigned int u_lnb_slof, unsigned int u_lnb_lof1, unsigned int u_lnb_lof2, unsigned int u_lnb_slof,
unsigned int u_adapter, unsigned int u_device ); unsigned int u_adapter, unsigned int u_device );
int ioctl_SetOFDMFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep,
unsigned int u_adapter, unsigned int u_device );
int ioctl_SetQAMFrontend (input_thread_t * p_input, struct dvb_frontend_parameters fep,
unsigned int u_adapter, unsigned int u_device );
int ioctl_SetDMXFilter(input_thread_t * p_input, int i_pid, int *pi_fd, int i_type, unsigned int u_adapter, unsigned int u_device ); int ioctl_SetDMXFilter(input_thread_t * p_input, int i_pid, int *pi_fd, int i_type, unsigned int u_adapter, unsigned int u_device );
int ioctl_UnsetDMXFilter(input_thread_t * p_input, int pi_fd); int ioctl_UnsetDMXFilter(input_thread_t * p_input, int pi_fd);
int ioctl_InfoFrontend(input_thread_t * p_input, struct dvb_frontend_info *info, unsigned int u_adapter, unsigned int u_device ); int ioctl_InfoFrontend(input_thread_t * p_input, struct dvb_frontend_info *info, unsigned int u_adapter, unsigned int u_device );
...@@ -50,3 +54,4 @@ fe_transmit_mode_t dvb_DecodeTransmission(input_thread_t * p_input, int transmis ...@@ -50,3 +54,4 @@ fe_transmit_mode_t dvb_DecodeTransmission(input_thread_t * p_input, int transmis
fe_guard_interval_t dvb_DecodeGuardInterval(input_thread_t * p_input, int guard); fe_guard_interval_t dvb_DecodeGuardInterval(input_thread_t * p_input, int guard);
fe_hierarchy_t dvb_DecodeHierarchy(input_thread_t * p_input, int hierarchy); fe_hierarchy_t dvb_DecodeHierarchy(input_thread_t * p_input, int hierarchy);
fe_spectral_inversion_t dvb_DecodeInversion(input_thread_t * p_input, int inversion); fe_spectral_inversion_t dvb_DecodeInversion(input_thread_t * p_input, int inversion);
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