Commit 872976e5 authored by Ken Self's avatar Ken Self

More BDA DVB-S and DVB-T parameters bring it closer to the linux version

parent 147305c6
......@@ -57,6 +57,9 @@ static int Control( access_t *, int, va_list );
#define INVERSION_TEXT N_("Inversion mode")
#define INVERSION_LONGTEXT N_("Inversion mode [0=off, 1=on, 2=auto]")
static const int i_inversion_list[] = { -1, 0, 1, 2 };
static const char *ppsz_inversion_text[] = { N_("Undefined"), N_("Off"),
N_("On"), N_("Auto") };
#define PROBE_TEXT N_("Probe DVB card for capabilities")
#define PROBE_LONGTEXT N_("Some DVB cards do not like to be probed for their " \
......@@ -68,8 +71,13 @@ static int Control( access_t *, int, va_list );
"with a \"budget\" card.")
/* Satellite */
#define SATNO_TEXT N_("Satellite number in the Diseqc system")
#define SATNO_LONGTEXT N_("[0=no diseqc, 1-4=satellite number].")
#if defined(WIN32) || defined(WINCE)
# define NETID_TEXT N_("Network Identifier")
# define NETID_LONGTEXT ""
#else
# define SATNO_TEXT N_("Satellite number in the Diseqc system")
# define SATNO_LONGTEXT N_("[0=no diseqc, 1-4=satellite number].")
#endif
#define VOLTAGE_TEXT N_("LNB voltage")
#define VOLTAGE_LONGTEXT N_("In Volts [0, 13=vertical, 18=horizontal].")
......@@ -107,10 +115,18 @@ static const char *ppsz_qam_text[] = { N_("Undefined"), N_("16"), N_("32"),
/* Terrestrial */
#define CODE_RATE_HP_TEXT N_("Terrestrial high priority stream code rate (FEC)")
#define CODE_RATE_HP_LONGTEXT ""
#define CODE_RATE_HP_LONGTEXT N_("High Priority FEC Rate " \
"[Undefined,1/2,2/3,3/4,5/6,7/8]")
static const int i_hp_fec_list[] = { -1, 1, 2, 3, 4, 5 };
static const char *ppsz_hp_fec_text[] = { N_("Undefined"), N_("1/2"), N_("2/3"),
N_("3/4"), N_("5/6"), N_("7/8") };
#define CODE_RATE_LP_TEXT N_("Terrestrial low priority stream code rate (FEC)")
#define CODE_RATE_LP_LONGTEXT ""
#define CODE_RATE_LP_LONGTEXT N_("Low Priority FEC Rate " \
"[Undefined,1/2,2/3,3/4,5/6,7/8]")
static const int i_lp_fec_list[] = { -1, 1, 2, 3, 4, 5 };
static const char *ppsz_lp_fec_text[] = { N_("Undefined"), N_("1/2"), N_("2/3"),
N_("3/4"), N_("5/6"), N_("7/8") };
#define BANDWIDTH_TEXT N_("Terrestrial bandwidth")
#define BANDWIDTH_LONGTEXT N_("Terrestrial bandwidth [0=auto,6,7,8 in MHz]")
......@@ -119,13 +135,22 @@ static const char *ppsz_band_text[] = { N_("Undefined"), N_("6"), N_("7"),
N_("8") };
#define GUARD_TEXT N_("Terrestrial guard interval")
#define GUARD_LONGTEXT ""
#define GUARD_LONGTEXT N_("Guard interval [Undefined,1/4,1/8,1/16,1/32]")
static const int i_guard_list[] = { -1, 4, 8, 16, 32 };
static const char *ppsz_guard_text[] = { N_("Undefined"), N_("1/4"), N_("1/8"),
N_("1/16"), N_("1/32") };
#define TRANSMISSION_TEXT N_("Terrestrial transmission mode")
#define TRANSMISSION_LONGTEXT ""
#define TRANSMISSION_LONGTEXT N_("Transmission mode [Undefined,2k,8k]")
static const int i_transmission_list[] = { -1, 2, 8 };
static const char *ppsz_transmission_text[] = { N_("Undefined"), N_("2k"),
N_("8k") };
#define HIERARCHY_TEXT N_("Terrestrial hierarchy mode")
#define HIERARCHY_LONGTEXT ""
#define HIERARCHY_LONGTEXT N_("Hierarchy alpha value [Undefined,1,2,4]")
static const int i_hierarchy_list[] = { -1, 1, 2, 4 };
static const char *ppsz_hierarchy_text[] = { N_("Undefined"), N_("1"),
N_("2"), N_("4") };
/* BDA module additional DVB-S Parameters */
#define AZIMUTH_TEXT N_("Satellite Azimuth")
......@@ -157,24 +182,27 @@ vlc_module_begin();
VLC_FALSE );
add_integer( "dvb-device", 0, NULL, DEVICE_TEXT, DEVICE_LONGTEXT,
VLC_TRUE );
add_integer( "dvb-inversion", 2, NULL, INVERSION_TEXT,
INVERSION_LONGTEXT, VLC_TRUE );
add_bool( "dvb-probe", 1, NULL, PROBE_TEXT, PROBE_LONGTEXT, VLC_TRUE );
add_bool( "dvb-budget-mode", 0, NULL, BUDGET_TEXT, BUDGET_LONGTEXT,
VLC_TRUE );
# endif
/* DVB-S (satellite) */
add_integer( "dvb-inversion", 2, NULL, INVERSION_TEXT,
INVERSION_LONGTEXT, VLC_TRUE );
change_integer_list( i_inversion_list, ppsz_inversion_text, 0 );
# if defined(WIN32) || defined(WINCE)
add_string( "dvb-polarisation", NULL, NULL, POLARISATION_TEXT,
POLARISATION_LONGTEXT, VLC_TRUE );
change_string_list( ppsz_polar_list, ppsz_polar_text, 0 );
add_integer( "dvb-network-id", 0, NULL, NETID_TEXT, NETID_LONGTEXT,
VLC_TRUE );
add_integer( "dvb-azimuth", 0, NULL, AZIMUTH_TEXT, AZIMUTH_LONGTEXT,
VLC_TRUE );
add_integer( "dvb-elevation", 0, NULL, ELEVATION_TEXT,
ELEVATION_LONGTEXT, VLC_TRUE );
add_integer( "dvb-longitude", 0, NULL, LONGITUDE_TEXT,
LONGITUDE_LONGTEXT, VLC_TRUE );
add_string( "dvb-polarisation", NULL, NULL, POLARISATION_TEXT,
POLARISATION_LONGTEXT, VLC_TRUE );
change_string_list( ppsz_polar_list, ppsz_polar_text, 0 );
/* Note: Polaristion H = voltage 18; V = voltage 13; */
# else
add_integer( "dvb-satno", 0, NULL, SATNO_TEXT, SATNO_LONGTEXT,
......@@ -198,23 +226,28 @@ vlc_module_begin();
VLC_FALSE );
/* DVB-C (cable) */
add_integer( "dvb-modulation", 0, NULL, MODULATION_TEXT,
add_integer( "dvb-modulation", -1, NULL, MODULATION_TEXT,
MODULATION_LONGTEXT, VLC_TRUE );
change_integer_list( i_qam_list, ppsz_qam_text, 0 );
/* DVB-T (terrestrial) */
add_integer( "dvb-code-rate-hp", 9, NULL, CODE_RATE_HP_TEXT,
add_integer( "dvb-code-rate-hp", -1, NULL, CODE_RATE_HP_TEXT,
CODE_RATE_HP_LONGTEXT, VLC_TRUE );
add_integer( "dvb-code-rate-lp", 9, NULL, CODE_RATE_LP_TEXT,
change_integer_list( i_hp_fec_list, ppsz_hp_fec_text, 0 );
add_integer( "dvb-code-rate-lp", -1, NULL, CODE_RATE_LP_TEXT,
CODE_RATE_LP_LONGTEXT, VLC_TRUE );
change_integer_list( i_lp_fec_list, ppsz_lp_fec_text, 0 );
add_integer( "dvb-bandwidth", 0, NULL, BANDWIDTH_TEXT, BANDWIDTH_LONGTEXT,
VLC_TRUE );
change_integer_list( i_band_list, ppsz_band_text, 0 );
add_integer( "dvb-guard", 0, NULL, GUARD_TEXT, GUARD_LONGTEXT, VLC_TRUE );
add_integer( "dvb-transmission", 0, NULL, TRANSMISSION_TEXT,
add_integer( "dvb-guard", -1, NULL, GUARD_TEXT, GUARD_LONGTEXT, VLC_TRUE );
change_integer_list( i_guard_list, ppsz_guard_text, 0 );
add_integer( "dvb-transmission", -1, NULL, TRANSMISSION_TEXT,
TRANSMISSION_LONGTEXT, VLC_TRUE );
add_integer( "dvb-hierarchy", 0, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT,
change_integer_list( i_transmission_list, ppsz_transmission_text, 0 );
add_integer( "dvb-hierarchy", -1, NULL, HIERARCHY_TEXT, HIERARCHY_LONGTEXT,
VLC_TRUE );
change_integer_list( i_hierarchy_list, ppsz_hierarchy_text, 0 );
set_capability( "access2", 0 );
add_shortcut( "dvb" ); /* Generic name */
......@@ -244,15 +277,19 @@ static int Open( vlc_object_t *p_this )
access_t *p_access = (access_t*)p_this;
access_sys_t *p_sys;
const char* psz_module = "dvb";
const int i_param_count = 12;
const int i_param_count = 19;
const char* psz_param[] = { "frequency", "bandwidth",
"srate", "azimuth", "elevation", "longitude", "polarisation",
"modulation", "caching", "lnb-lof1", "lnb-lof2", "lnb-slof" };
"modulation", "caching", "lnb-lof1", "lnb-lof2", "lnb-slof",
"inversion", "network-id", "code-rate-hp", "code-rate-lp",
"guard", "transmission", "hierarchy" };
const int i_type[] = { VLC_VAR_INTEGER, VLC_VAR_INTEGER,
VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER,
VLC_VAR_STRING, VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER,
VLC_VAR_INTEGER, VLC_VAR_INTEGER };
VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER,
VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER, VLC_VAR_INTEGER,
VLC_VAR_INTEGER };
char psz_full_name[128];
int i_ret;
......
......@@ -235,11 +235,70 @@ int BDAGraph::SubmitDVBTTuneRequest()
p_dvbt_locator->Release();
}
} l;
long l_frequency, l_bandwidth;
l_frequency = l_bandwidth = -1;
long l_frequency, l_bandwidth, l_hp_fec, l_lp_fec, l_guard;
long l_transmission, l_hierarchy;
BinaryConvolutionCodeRate i_hp_fec, i_lp_fec;
GuardInterval i_guard;
TransmissionMode i_transmission;
HierarchyAlpha i_hierarchy;
l_frequency = l_bandwidth = l_hp_fec = l_lp_fec = l_guard = -1;
l_transmission = l_hierarchy = -1;
l_frequency = var_GetInteger( p_access, "dvb-frequency" );
l_bandwidth = var_GetInteger( p_access, "dvb-bandwidth" );
l_hp_fec = var_GetInteger( p_access, "dvb-code-rate-hp" );
l_lp_fec = var_GetInteger( p_access, "dvb-code-rate-lp" );
l_guard = var_GetInteger( p_access, "dvb-guard" );
l_transmission = var_GetInteger( p_access, "dvb-transmission" );
l_hierarchy = var_GetInteger( p_access, "dvb-hierarchy" );
i_hp_fec = BDA_BCC_RATE_NOT_SET;
if( l_hp_fec == 1 )
i_hp_fec = BDA_BCC_RATE_1_2;
if( l_hp_fec == 2 )
i_hp_fec = BDA_BCC_RATE_2_3;
if( l_hp_fec == 3 )
i_hp_fec = BDA_BCC_RATE_3_4;
if( l_hp_fec == 4 )
i_hp_fec = BDA_BCC_RATE_5_6;
if( l_hp_fec == 5 )
i_hp_fec = BDA_BCC_RATE_7_8;
i_lp_fec = BDA_BCC_RATE_NOT_SET;
if( l_lp_fec == 1 )
i_lp_fec = BDA_BCC_RATE_1_2;
if( l_lp_fec == 2 )
i_lp_fec = BDA_BCC_RATE_2_3;
if( l_lp_fec == 3 )
i_lp_fec = BDA_BCC_RATE_3_4;
if( l_lp_fec == 4 )
i_lp_fec = BDA_BCC_RATE_5_6;
if( l_lp_fec == 5 )
i_lp_fec = BDA_BCC_RATE_7_8;
i_guard = BDA_GUARD_NOT_SET;
if( l_guard == 32 )
i_guard = BDA_GUARD_1_32;
if( l_guard == 16 )
i_guard = BDA_GUARD_1_16;
if( l_guard == 8 )
i_guard = BDA_GUARD_1_8;
if( l_guard == 4 )
i_guard = BDA_GUARD_1_4;
i_transmission = BDA_XMIT_MODE_NOT_SET;
if( l_transmission == 2 )
i_transmission = BDA_XMIT_MODE_2K;
if( l_transmission == 8 )
i_transmission = BDA_XMIT_MODE_8K;
i_hierarchy = BDA_HALPHA_NOT_SET;
if( l_hierarchy == 1 )
i_hierarchy = BDA_HALPHA_1;
if( l_hierarchy == 2 )
i_hierarchy = BDA_HALPHA_2;
if( l_hierarchy == 4 )
i_hierarchy = BDA_HALPHA_4;
guid_network_type = CLSID_DVBTNetworkProvider;
hr = CreateTuneRequest();
......@@ -276,6 +335,16 @@ int BDAGraph::SubmitDVBTTuneRequest()
hr = l.p_dvbt_locator->put_CarrierFrequency( l_frequency );
if( SUCCEEDED( hr ) && l_bandwidth > 0 )
hr = l.p_dvbt_locator->put_Bandwidth( l_bandwidth );
if( SUCCEEDED( hr ) && i_hp_fec != BDA_BCC_RATE_NOT_SET )
hr = l.p_dvbt_locator->put_InnerFECRate( i_hp_fec );
if( SUCCEEDED( hr ) && i_lp_fec != BDA_BCC_RATE_NOT_SET )
hr = l.p_dvbt_locator->put_LPInnerFECRate( i_lp_fec );
if( SUCCEEDED( hr ) && i_guard != BDA_GUARD_NOT_SET )
hr = l.p_dvbt_locator->put_Guard( i_guard );
if( SUCCEEDED( hr ) && i_transmission != BDA_XMIT_MODE_NOT_SET )
hr = l.p_dvbt_locator->put_Mode( i_transmission );
if( SUCCEEDED( hr ) && i_hierarchy != BDA_HALPHA_NOT_SET )
hr = l.p_dvbt_locator->put_HAlpha( i_hierarchy );
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBTTuneRequest: "\
......@@ -449,13 +518,14 @@ int BDAGraph::SubmitDVBSTuneRequest()
}
} l;
long l_frequency, l_symbolrate, l_azimuth, l_elevation, l_longitude;
long l_lnb_lof1, l_lnb_lof2, l_lnb_slof;
long l_lnb_lof1, l_lnb_lof2, l_lnb_slof, l_inversion, l_network_id;
char* psz_polarisation;
Polarisation i_polar;
SpectralInversion i_inversion;
VARIANT_BOOL b_west;
l_frequency = l_symbolrate = l_azimuth = l_elevation = l_longitude = -1;
l_lnb_lof1 = l_lnb_lof2 = l_lnb_slof = -1;
l_lnb_lof1 = l_lnb_lof2 = l_lnb_slof = l_inversion = l_network_id = -1;
l_frequency = var_GetInteger( p_access, "dvb-frequency" );
l_symbolrate = var_GetInteger( p_access, "dvb-srate" );
l_azimuth = var_GetInteger( p_access, "dvb-azimuth" );
......@@ -465,6 +535,8 @@ int BDAGraph::SubmitDVBSTuneRequest()
l_lnb_lof2 = var_GetInteger( p_access, "dvb-lnb-lof2" );
l_lnb_slof = var_GetInteger( p_access, "dvb-lnb-slof" );
psz_polarisation = var_GetString( p_access, "dvb-polarisation" );
l_inversion = var_GetInteger( p_access, "dvb-inversion" );
l_network_id = var_GetInteger( p_access, "dvb-network_id" );
b_west = ( l_longitude < 0 ) ? TRUE : FALSE;
......@@ -478,6 +550,14 @@ int BDAGraph::SubmitDVBSTuneRequest()
if( *psz_polarisation == 'R' || *psz_polarisation == 'r' )
i_polar = BDA_POLARISATION_CIRCULAR_R;
i_inversion = BDA_SPECTRAL_INVERSION_NOT_SET;
if( l_inversion == 0 )
i_inversion = BDA_SPECTRAL_INVERSION_NORMAL;
if( l_inversion == 1 )
i_inversion = BDA_SPECTRAL_INVERSION_INVERTED;
if( l_inversion == 2 )
i_inversion = BDA_SPECTRAL_INVERSION_AUTOMATIC;
guid_network_type = CLSID_DVBSNetworkProvider;
hr = CreateTuneRequest();
if( FAILED( hr ) )
......@@ -537,7 +617,11 @@ int BDAGraph::SubmitDVBSTuneRequest()
if( SUCCEEDED( hr ) && l_lnb_lof2 > 0 )
hr = l.p_dvbs_tuning_space->put_HighOscillator( l_lnb_lof2 );
if( SUCCEEDED( hr ) && l_lnb_slof > 0 )
hr = l.p_dvbs_tuning_space->put_HighOscillator( l_lnb_slof );
hr = l.p_dvbs_tuning_space->put_LNBSwitch( l_lnb_slof );
if( SUCCEEDED( hr ) && i_inversion != BDA_SPECTRAL_INVERSION_NOT_SET )
hr = l.p_dvbs_tuning_space->put_SpectralInversion( i_inversion );
if( SUCCEEDED( hr ) && l_network_id > 0 )
hr = l.p_dvbs_tuning_space->put_NetworkID( l_network_id );
if( FAILED( hr ) )
{
msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
......
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