Commit 44e87ccd authored by Antoine Cellerier's avatar Antoine Cellerier

Untested change to support different AMTUNER modes in dshow input (see...

Untested change to support different AMTUNER modes in dshow input (see http://forum.videolan.org/viewtopic.php?t=19814 )
parent fe3acfea
......@@ -76,6 +76,16 @@ static char *ppsz_adev_text[] = { N_("Default"), N_("None") };
static int pi_tuner_input[] = { 0, 1, 2 };
static char *ppsz_tuner_input_text[] =
{N_("Default"), N_("Cable"), N_("Antenna")};
static int pi_amtuner_mode[] = { AMTUNER_MODE_DEFAULT,
AMTUNER_MODE_TV,
AMTUNER_MODE_FM_RADIO,
AMTUNER_MODE_AM_RADIO,
AMTUNER_MODE_DSS };
static char *ppsz_amtuner_mode_text[] = { N_("Default"),
N_("TV"),
N_("FM radio"),
N_("AM radio"),
N_("DSS") };
#define CACHING_TEXT N_("Caching value in ms")
#define CACHING_LONGTEXT N_( \
......@@ -139,6 +149,10 @@ static char *ppsz_tuner_input_text[] =
#define AUDIO_OUT_LONGTEXT N_( \
"Select the audio output type. See the \"video input\" option." )
#define AMTUNER_MODE_TEXT N_("AM Tuner mode")
#define AMTUNER_MODE_LONGTEST N_( \
"AM Tuner mode. Can be one of DEFAULT, TV, AM_RADIO, FM_RADIO or DSS.")
static int CommonOpen ( vlc_object_t *, access_sys_t *, vlc_bool_t );
static void CommonClose( vlc_object_t *, access_sys_t * );
......@@ -202,6 +216,10 @@ vlc_module_begin();
add_integer( "dshow-audio-output", -1, NULL, AUDIO_OUT_TEXT,
AUDIO_OUT_LONGTEXT, VLC_TRUE );
add_string( "dshow-amtuner-mode", AMTUNER_MODE_TV, NULL,
AMTUNER_MODE_TEXT, AMTUNER_MODE_LONGTEXT, VLC_FALSE);
change_integer_list( pi_amtuner_mode, ppsz_amtuner_mode_text, 0 );
add_shortcut( "dshow" );
set_capability( "access_demux", 0 );
set_callbacks( DemuxOpen, DemuxClose );
......@@ -371,6 +389,9 @@ static int CommonOpen( vlc_object_t *p_this, access_sys_t *p_sys,
var_Create( p_this, "dshow-tuner-input",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-amtuner-mode",
VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-caching", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
var_Create( p_this, "dshow-video-input", VLC_VAR_INTEGER | VLC_VAR_DOINHERIT );
......@@ -2031,7 +2052,7 @@ static void ShowTunerProperties( vlc_object_t *p_this,
static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
IBaseFilter *p_device_filter )
{
int i_channel, i_country, i_input;
int i_channel, i_country, i_input, i_amtuner_mode;
long l_modes = 0;
IAMTVTuner *p_TV;
HRESULT hr;
......@@ -2041,6 +2062,7 @@ static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
i_channel = var_GetInteger( p_this, "dshow-tuner-channel" );
i_country = var_GetInteger( p_this, "dshow-tuner-country" );
i_input = var_GetInteger( p_this, "dshow-tuner-input" );
i_amtuner_mode = var_GetInteger( p_this, "dshow-amtuner-mode" );
if( !i_channel && !i_country && !i_input ) return; /* Nothing to do */
......@@ -2071,9 +2093,9 @@ static void ConfigTuner( vlc_object_t *p_this, ICaptureGraphBuilder2 *p_graph,
}
hr = p_TV->GetAvailableModes( &l_modes );
if( SUCCEEDED(hr) && (l_modes & AMTUNER_MODE_TV) )
if( SUCCEEDED(hr) && (l_modes & i_amtuner_mode) )
{
hr = p_TV->put_Mode( AMTUNER_MODE_TV );
hr = p_TV->put_Mode( i_amtuner_mode );
}
if( i_input == 1 ) p_TV->put_InputType( 0, TunerInputCable );
......
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