Commit 85a0c752 authored by Benjamin Pracht's avatar Benjamin Pracht

* Patch to add ATSC support by Dennis Lou

* This is untested, but shouldn't have any adverse effect at least
* Any feedback much welcomed
parent 6eec4bf0
......@@ -49,6 +49,7 @@ Daniel Nylander <info@danielnylander at se> - Swedish translation
David Weber <david_weber at gmx.de> - Mac OS X interface design & graphics (v0.5.0)
Davor Orel <syntheticamac at yahoo.it> - Mac OS X icons
Dennis van Amerongen <Dennis dot vanAmerongen at nob dot nl> - x264 options unification
Dennis Lou <dlou99 at yahoo dot com> - ATSC support in the DVB module
Diego Petteno <flameeyes at gentoo dot org> - remove usage of internal ffmpeg symbols
DirektX <direktx at freemail.hu> - Hungarian translation
Dugal Harris - DirectShow fixes and MJPEG patches
......
......@@ -83,6 +83,7 @@ static int FrontendInfo( access_t * );
static int FrontendSetQPSK( access_t * );
static int FrontendSetQAM( access_t * );
static int FrontendSetOFDM( access_t * );
static int FrontendSetATSC( access_t * );
/*****************************************************************************
* FrontendOpen : Determine frontend device information and capabilities
......@@ -139,6 +140,9 @@ int E_(FrontendOpen)( access_t *p_access )
case FE_QPSK:
psz_real = "DVB-S";
break;
case FE_ATSC:
psz_real = "ATSC";
break;
default:
psz_real = "unknown";
}
......@@ -164,6 +168,13 @@ int E_(FrontendOpen)( access_t *p_access )
psz_expected = "DVB-T";
}
if( (!strncmp( p_access->psz_access, "usdigital", 9 ) ||
!strncmp( p_access->psz_access, "atsc", 4 ) ) &&
(p_frontend->info.type != FE_ATSC) )
{
psz_expected = "ATSC";
}
if( psz_expected != NULL )
{
msg_Err( p_access, "the user asked for %s, and the tuner is %s",
......@@ -188,6 +199,9 @@ int E_(FrontendOpen)( access_t *p_access )
else if( !strncmp( p_access->psz_access, "terrestrial", 11 ) ||
!strncmp( p_access->psz_access, "dvb-t", 5 ) )
p_frontend->info.type = FE_OFDM;
else if( !strncmp( p_access->psz_access, "usdigital", 9 ) ||
!strncmp( p_access->psz_access, "atsc", 4 ) )
p_frontend->info.type = FE_ATSC;
}
return VLC_SUCCESS;
......@@ -245,6 +259,15 @@ int E_(FrontendSet)( access_t *p_access )
}
break;
/* ATSC */
case FE_ATSC:
if( FrontendSetATSC( p_access ) < 0 )
{
msg_Err( p_access, "ATSC: tuning failed" );
return VLC_EGENERIC;
}
break;
default:
msg_Err( p_access, "Could not determine frontend type on %s",
p_sys->p_frontend->info.name );
......@@ -520,6 +543,9 @@ static int FrontendInfo( access_t *p_access )
case FE_OFDM:
msg_Dbg( p_access, " type = OFDM (DVB-T)" );
break;
case FE_ATSC:
msg_Dbg( p_access, " type = ATSC (USA)" );
break;
#if 0 /* DVB_API_VERSION == 3 */
case FE_MEMORY:
msg_Dbg(p_access, " type = MEMORY" );
......@@ -599,6 +625,10 @@ static int FrontendInfo( access_t *p_access )
msg_Dbg(p_access, " card can mute TS");
if( p_frontend->info.caps & FE_CAN_RECOVER)
msg_Dbg(p_access, " card can recover from a cable unplug");
if( p_frontend->info.caps & FE_CAN_8VSB)
msg_Dbg(p_access, " card can do 8vsb");
if( p_frontend->info.caps & FE_CAN_16VSB)
msg_Dbg(p_access, " card can do 16vsb");
msg_Dbg(p_access, "End of capability list");
return VLC_SUCCESS;
......@@ -666,6 +696,7 @@ static fe_modulation_t DecodeModulation( access_t *p_access )
{
case -1: fe_modulation = QPSK; break;
case 0: fe_modulation = QAM_AUTO; break;
case 8: fe_modulation = VSB_8; break; // ugly hack
case 16: fe_modulation = QAM_16; break;
case 32: fe_modulation = QAM_32; break;
case 64: fe_modulation = QAM_64; break;
......@@ -1131,6 +1162,43 @@ static int FrontendSetOFDM( access_t * p_access )
return VLC_SUCCESS;
}
/*****************************************************************************
* FrontendSetATSC : controls the FE device
*****************************************************************************/
static int FrontendSetATSC( access_t *p_access )
{
access_sys_t *p_sys = p_access->p_sys;
struct dvb_frontend_parameters fep;
vlc_value_t val;
int i_ret;
/* Prepare the fep structure */
var_Get( p_access, "dvb-frequency", &val );
fep.frequency = val.i_int;
fep.u.vsb.modulation = DecodeModulation( p_access );
/* Empty the event queue */
for( ; ; )
{
struct dvb_frontend_event event;
if ( ioctl( p_sys->i_frontend_handle, FE_GET_EVENT, &event ) < 0
&& errno == EWOULDBLOCK )
break;
}
/* Now send it all to the frontend device */
if( (i_ret = ioctl( p_sys->i_frontend_handle, FE_SET_FRONTEND, &fep )) < 0 )
{
msg_Err( p_access, "ATSC: setting frontend failed (%d) %s", i_ret,
strerror(errno) );
return VLC_EGENERIC;
}
return VLC_SUCCESS;
}
/*
* Demux
......
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