void dvb_deleteBDAGraph( access_t* p_access )
{
- delete p_access->p_sys->p_bda_module;
+ if( p_access->p_sys->p_bda_module )
+ delete p_access->p_sys->p_bda_module;
};
int dvb_SubmitATSCTuneRequest( access_t* p_access )
{
- return p_access->p_sys->p_bda_module->SubmitATSCTuneRequest();
+ if( p_access->p_sys->p_bda_module )
+ return p_access->p_sys->p_bda_module->SubmitATSCTuneRequest();
+ return VLC_EGENERIC;
};
int dvb_SubmitDVBTTuneRequest( access_t* p_access )
{
- return p_access->p_sys->p_bda_module->SubmitDVBTTuneRequest();
+ if( p_access->p_sys->p_bda_module )
+ return p_access->p_sys->p_bda_module->SubmitDVBTTuneRequest();
+ return VLC_EGENERIC;
};
int dvb_SubmitDVBCTuneRequest( access_t* p_access )
{
- return p_access->p_sys->p_bda_module->SubmitDVBCTuneRequest();
- };
+ if( p_access->p_sys->p_bda_module )
+ return p_access->p_sys->p_bda_module->SubmitDVBCTuneRequest();
+ return VLC_EGENERIC;
+ };
int dvb_SubmitDVBSTuneRequest( access_t* p_access )
{
- return p_access->p_sys->p_bda_module->SubmitDVBSTuneRequest();
+ if( p_access->p_sys->p_bda_module )
+ return p_access->p_sys->p_bda_module->SubmitDVBSTuneRequest();
+ return VLC_EGENERIC;
};
long dvb_GetBufferSize( access_t* p_access )
{
- return p_access->p_sys->p_bda_module->GetBufferSize();
+ if( p_access->p_sys->p_bda_module )
+ return p_access->p_sys->p_bda_module->GetBufferSize();
+ return -1;
};
long dvb_ReadBuffer( access_t* p_access, long* l_buffer_len, BYTE* p_buff )
{
- return p_access->p_sys->p_bda_module->ReadBuffer( l_buffer_len,
- p_buff );
+ if( p_access->p_sys->p_bda_module )
+ return p_access->p_sys->p_bda_module->ReadBuffer( l_buffer_len,
+ p_buff );
+ return -1;
};
};
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();
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: "\
public:
IDVBTuneRequest* p_dvbs_tune_request;
IDVBSLocator* p_dvbs_locator;
- localComPtr(): p_dvbs_tune_request(NULL), p_dvbs_locator(NULL) {};
+ IDVBSTuningSpace* p_dvbs_tuning_space;
+ localComPtr(): p_dvbs_tune_request(NULL), p_dvbs_locator(NULL),
+ p_dvbs_tuning_space(NULL) {};
~localComPtr()
{
+ if( p_dvbs_tuning_space )
+ p_dvbs_tuning_space->Release();
if( p_dvbs_tune_request )
p_dvbs_tune_request->Release();
if( p_dvbs_locator )
}
} l;
long l_frequency, l_symbolrate, l_azimuth, l_elevation, l_longitude;
+ 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 = 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" );
l_elevation = var_GetInteger( p_access, "dvb-elevation" );
l_longitude = var_GetInteger( p_access, "dvb-longitude" );
+ l_lnb_lof1 = var_GetInteger( p_access, "dvb-lnb-lof1" );
+ 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;
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 ) )
{
- msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
+ msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot create Tune Request: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
(void**)&l.p_dvbs_tune_request );
if( FAILED( hr ) )
{
- msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
+ msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot QI for IDVBTuneRequest: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
IID_IDVBSLocator, (void**)&l.p_dvbs_locator );
if( FAILED( hr ) )
{
- msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
+ msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot create the DVBS Locator: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
+ hr = p_tuning_space->QueryInterface( IID_IDVBSTuningSpace,
+ (void**)&l.p_dvbs_tuning_space );
+ if( FAILED( hr ) )
+ {
+ msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
+ "Cannot QI for IDVBSTuningSpace: hr=0x%8lx", hr );
+ return VLC_EGENERIC;
+ }
+
hr = S_OK;
if( l_frequency > 0 )
hr = l.p_dvbs_locator->put_CarrierFrequency( l_frequency );
hr = l.p_dvbs_locator->put_WestPosition( b_west );
if( SUCCEEDED( hr ) && i_polar != BDA_POLARISATION_NOT_SET )
hr = l.p_dvbs_locator->put_SignalPolarisation( i_polar );
+ if( SUCCEEDED( hr ) && l_lnb_lof1 > 0 )
+ hr = l.p_dvbs_tuning_space->put_LowOscillator( l_lnb_lof1 );
+ 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_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, "SubmitDVBCTuneRequest: "\
+ msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot set tuning parameters on Locator: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
hr = p_tune_request->put_Locator( l.p_dvbs_locator );
if( FAILED( hr ) )
{
- msg_Warn( p_access, "SubmitDVBCTuneRequest: "\
+ msg_Warn( p_access, "SubmitDVBSTuneRequest: "\
"Cannot put the locator: hr=0x%8lx", hr );
return VLC_EGENERIC;
}
return hr;
/* The Graph is not running so stop it and return an error */
+ msg_Warn( p_access, "Start: Graph not started: %d", i_state );
hr = p_media_control->Stop();
if( FAILED( hr ) )
{
p_media_control->Release();
p_media_control = NULL;
}
- if( p_scanning_tuner )
+ if( p_filter_graph )
{
p_filter_graph->Release();
p_filter_graph = NULL;