#include <string.h>
#include <vlc/vlc.h>
-#include <vlc/input.h>
-#include <vlc/vout.h>
+#include <vlc_input.h>
+#include <vlc_access.h>
+#include <vlc_demux.h>
+#include <vlc_vout.h>
+#include <vlc_interface.h>
#include "common.h"
#include "filter.h"
/*****************************************************************************
* Module descriptor
*****************************************************************************/
-static char *ppsz_vdev[] = { "", "none" };
-static char *ppsz_vdev_text[] = { N_("Default"), N_("None") };
-static char *ppsz_adev[] = { "", "none" };
-static char *ppsz_adev_text[] = { N_("Default"), N_("None") };
+static const char *ppsz_vdev[] = { "", "none" };
+static const char *ppsz_vdev_text[] = { N_("Default"), N_("None") };
+static const char *ppsz_adev[] = { "", "none" };
+static const char *ppsz_adev_text[] = { N_("Default"), N_("None") };
static int pi_tuner_input[] = { 0, 1, 2 };
-static char *ppsz_tuner_input_text[] =
+static const char *ppsz_tuner_input_text[] =
{N_("Default"), N_("Cable"), N_("Antenna")};
+static const int pi_amtuner_mode[] = { AMTUNER_MODE_DEFAULT,
+ AMTUNER_MODE_TV,
+ AMTUNER_MODE_FM_RADIO,
+ AMTUNER_MODE_AM_RADIO,
+ AMTUNER_MODE_DSS };
+static const 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_( \
"Name of the video device that will be used by the " \
"DirectShow plugin. If you don't specify anything, the default device " \
"will be used.")
-/// \bug [String] size stuff should be on video !
#define ADEV_TEXT N_("Audio device name")
#define ADEV_LONGTEXT N_( \
"Name of the audio device that will be used by the " \
"DirectShow plugin. If you don't specify anything, the default device " \
- "will be used. You can specify a standard size (cif, d1, ...) or <width>x<height>")
+ "will be used. ")
#define SIZE_TEXT N_("Video size")
#define SIZE_LONGTEXT N_( \
"Size of the video that will be displayed by the " \
"DirectShow plugin. If you don't specify anything the default size for " \
- "your device will be used.")
+ "your device will be used. You can specify a standard size (cif, d1, ...) or <width>x<height>.")
#define CHROMA_TEXT N_("Video input chroma format")
#define CHROMA_LONGTEXT N_( \
"Force the DirectShow video input to use a specific chroma format " \
#define VIDEO_IN_TEXT N_("Video input pin")
#define VIDEO_IN_LONGTEXT N_( \
"Select the video input source, such as composite, s-video, " \
- "or tuner. Since these settings are hardware-specfic, you should find good " \
+ "or tuner. Since these settings are hardware-specific, you should find good " \
"settings in the \"Device config\" area, and use those numbers here. -1 " \
"means that settings will not be changed.")
#define AUDIO_IN_TEXT N_("Audio input pin")
#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_LONGTEXT 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 * );
add_integer( "dshow-audio-output", -1, NULL, AUDIO_OUT_TEXT,
AUDIO_OUT_LONGTEXT, VLC_TRUE );
+ add_integer( "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 );
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 );
for( i = p_sys->i_crossbar_route_depth-1; i >= 0 ; --i )
{
var_Get( p_this, "dshow-video-input", &val );
- if( val.i_int > 0 )
+ if( val.i_int >= 0 )
p_sys->crossbar_routes[i].VideoInputIndex=val.i_int;
var_Get( p_this, "dshow-video-output", &val );
- if( val.i_int > 0 )
+ if( val.i_int >= 0 )
p_sys->crossbar_routes[i].VideoOutputIndex=val.i_int;
var_Get( p_this, "dshow-audio-input", &val );
- if( val.i_int > 0 )
+ if( val.i_int >= 0 )
p_sys->crossbar_routes[i].AudioInputIndex=val.i_int;
var_Get( p_this, "dshow-audio-output", &val );
- if( val.i_int > 0 )
+ if( val.i_int >= 0 )
p_sys->crossbar_routes[i].AudioOutputIndex=val.i_int;
IAMCrossbar *pXbar = p_sys->crossbar_routes[i].pXbar;
{
msg_Err( p_this, "can't use device: %s, unsupported device type",
devicename.c_str() );
+ intf_UserFatal( p_this, VLC_FALSE, _("Capturing failed"),
+ _("VLC cannot use the device \"%s\", because its device "
+ "type is not supported.") );
return VLC_EGENERIC;
}
else {
/* capture device */
msg_Err( p_this, "capture device '%s' does not support required parameters !", devicename.c_str() );
+ intf_UserFatal( p_this, VLC_FALSE, _("Capturing failed"),
+ _("The capture device \"%s\" does not support the "
+ "required parameters."), devicename.c_str() );
p_device_filter->Release();
return VLC_EGENERIC;
}
}
sample.p_sample->GetPointer( &p_data );
- p_access->p_vlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
+ p_access->p_libvlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
sample.p_sample->Release();
/* The caller got what he wanted */
#endif
p_block = block_New( p_demux, i_data_size );
- p_demux->p_vlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
+ p_demux->p_libvlc->pf_memcpy( p_block->p_buffer, p_data, i_data_size );
p_block->i_pts = p_block->i_dts = i_pts;
sample.p_sample->Release();
/* Keep the 2 first entries */
for( i = 2; i < p_item->i_list; i++ )
{
- free( p_item->ppsz_list[i] );
- free( p_item->ppsz_list_text[i] );
+ free( const_cast<char *>(p_item->ppsz_list[i]) );
+ free( const_cast<char *>(p_item->ppsz_list_text[i]) );
}
/* TODO: Remove when no more needed */
p_item->ppsz_list[i] = NULL;
if( !list_devices.size() ) return VLC_SUCCESS;
p_item->ppsz_list =
- (char **)realloc( p_item->ppsz_list,
+ (const char **)realloc( p_item->ppsz_list,
(list_devices.size()+3) * sizeof(char *) );
p_item->ppsz_list_text =
- (char **)realloc( p_item->ppsz_list_text,
+ (const char **)realloc( p_item->ppsz_list_text,
(list_devices.size()+3) * sizeof(char *) );
list<string>::iterator iter;
if( p_device_filter )
{
ShowPropertyPage( p_device_filter );
+ p_device_filter->Release();
}
else
{
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;
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 */
}
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( (AMTunerModeType)i_amtuner_mode );
}
if( i_input == 1 ) p_TV->put_InputType( 0, TunerInputCable );