Code: Select all
...
static void ConfigTuner( vlc_object_t *, ICaptureGraphBuilder2 *,
IBaseFilter * );
...
#define CHANNEL_TEXT N_("TV Channel selection")
#define CHANNEL_LONGTEXT N_( \
"You can select the tv channel that will be used by the DirectShow plugin." )
#define COUNTRY_TEXT N_("Country selection")
#define COUNTRY_LONGTEXT N_( \
"You can select the country that will be used by the DirectShow plugin." )
#define INPUT_TEXT N_("Input selection (Cable/Antenna)")
#define INPUT_LONGTEXT N_( \
"You can select the input that will be used by the DirectShow plugin." )
...
add_integer( "dshow-channel", 1, NULL, CHANNEL_TEXT, CHANNEL_LONGTEXT,
VLC_TRUE );
add_integer( "dshow-country", 1, NULL, COUNTRY_TEXT, COUNTRY_LONGTEXT,
VLC_TRUE );
add_bool( "dshow-input", VLC_FALSE, NULL, INPUT_TEXT, INPUT_LONGTEXT,
VLC_TRUE );
...
var_Create( p_this, "dshow-channel", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-country", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-input", VLC_VAR_BOOL | VLC_VAR_DOINHERIT );
...
ConfigTuner( p_this, p_sys->p_capture_graph_builder2,
p_device_filter );
...
static void ConfigTuner( vlc_object_t *p_this,
ICaptureGraphBuilder2 *p_capture_graph,
IBaseFilter *p_device_filter )
{
int i_channel, i_country;
long l_modes = 0;
bool b_input;
HRESULT hr;
i_channel = var_GetInteger( p_this, "dshow-channel" );
i_country = var_GetInteger( p_this, "dshow-country" );
b_input = var_GetBool( p_this, "dshow-input" );
msg_Dbg( p_this, "Config channel: %i, country: %i",
i_channel, i_country );
if( p_capture_graph )
{
IAMTVTuner *p_TV = NULL;
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Interleaved,
p_device_filter,
IID_IAMTVTuner, (void **)&p_TV );
if( FAILED(hr) )
{
hr = p_capture_graph->FindInterface( &PIN_CATEGORY_CAPTURE,
&MEDIATYPE_Video,
p_device_filter,
IID_IAMTVTuner,
(void **)&p_TV );
}
if( SUCCEEDED(hr) )
{
hr = p_TV->GetAvailableModes(&l_modes);
if (SUCCEEDED(hr) && (l_modes & AMTUNER_MODE_TV))
{
hr = p_TV->put_Mode(AMTUNER_MODE_TV);
}
if ( b_input )
p_TV->put_InputType( 0, TunerInputAntenna );
else
p_TV->put_InputType( 0, TunerInputCable );
p_TV->put_CountryCode( (long)i_country );
p_TV->put_Channel( (long)i_channel,
AMTUNER_SUBCHAN_NO_TUNE,
AMTUNER_SUBCHAN_NO_TUNE );
p_TV->Release();
}
}
}
Code: Select all
#EXTM3U
#EXTINF:0,<Programname1>
#EXTVLCOPT:dshow-vdev=
#EXTVLCOPT:dshow-adev=
#EXTVLCOPT:dshow-size=
#EXTVLCOPT:no-dshow-config
#EXTVLCOPT:no-dshow-tuner
#EXTVLCOPT:dshow-caching=200
#EXTVLCOPT:dshow-chroma=
#EXTVLCOPT:dshow-tuner-channel=<channel1>
#EXTVLCOPT:dshow-tuner-country=<country-code>
#EXTVLCOPT:dshow-tuner-input=<input>
dshow://
#EXTINF:0,<Programname2>
#EXTVLCOPT:dshow-vdev=
#EXTVLCOPT:dshow-adev=
#EXTVLCOPT:dshow-size=
#EXTVLCOPT:no-dshow-config
#EXTVLCOPT:no-dshow-tuner
#EXTVLCOPT:dshow-caching=200
#EXTVLCOPT:dshow-chroma=
#EXTVLCOPT:dshow-tuner-channel=<channel2>
#EXTVLCOPT:dshow-tuner-country=<country-code>
#EXTVLCOPT:dshow-tuner-input=<input>
dshow://
Return to “General VLC media player Troubleshooting”
Users browsing this forum: No registered users and 7 guests