#define V4L2_DEFAULT "/dev/video0"
#define CFG_PREFIX "v4l2-"
+#ifdef HAVE_MAEMO
+# define DEFAULT_WIDTH 640
+# define DEFAULT_HEIGHT 492
+#endif
+
+#ifndef DEFAULT_WIDTH
+# define DEFAULT_WIDTH (-1)
+# define DEFAULT_HEIGHT (-1)
+#endif
+
vlc_module_begin ()
set_shortname( N_("Video4Linux2") )
set_description( N_("Video4Linux2 input") )
add_integer( CFG_PREFIX "io", IO_METHOD_AUTO, NULL, IOMETHOD_TEXT,
IOMETHOD_LONGTEXT, true )
change_integer_list( i_iomethod_list, psz_iomethod_list_text, NULL )
- add_integer( CFG_PREFIX "width", -1, NULL, WIDTH_TEXT,
+ add_integer( CFG_PREFIX "width", DEFAULT_WIDTH, NULL, WIDTH_TEXT,
WIDTH_LONGTEXT, true )
- add_integer( CFG_PREFIX "height", -1, NULL, HEIGHT_TEXT,
+ add_integer( CFG_PREFIX "height", DEFAULT_HEIGHT, NULL, HEIGHT_TEXT,
HEIGHT_LONGTEXT, true )
add_string( CFG_PREFIX "aspect-ratio", "4:3", NULL, ASPECT_TEXT,
ASPECT_LONGTEXT, true )
ParseMRL( p_sys, p_demux->psz_path, (vlc_object_t *) p_demux );
#ifdef HAVE_LIBV4L2
- if( !config_GetInt( p_this, CFG_PREFIX "use-libv4l2" ) )
+ if( !var_InheritInteger( p_this, CFG_PREFIX "use-libv4l2" ) )
{
msg_Dbg( p_this, "Trying direct kernel v4l2" );
use_kernel_v4l2( p_sys );
ParseMRL( p_sys, p_access->psz_path, (vlc_object_t *) p_access );
#ifdef HAVE_LIBV4L2
- if( !config_GetInt( p_this, CFG_PREFIX "use-libv4l2" ) )
+ if( !var_InheritInteger( p_this, CFG_PREFIX "use-libv4l2" ) )
{
msg_Dbg( p_this, "Trying direct kernel v4l2" );
use_kernel_v4l2( p_sys );
char psz_fourcc[5];
memset( &psz_fourcc, 0, sizeof( psz_fourcc ) );
vlc_fourcc_to_char( p_sys->i_fourcc, &psz_fourcc );
- msg_Dbg( p_obj, "supported frame intervals for %4s, %dx%d:",
+ msg_Dbg( p_obj, "supported frame intervals for %4.4s, %dx%d:",
psz_fourcc, frmival.width, frmival.height );
switch( frmival.type )
{
es_fmt.video.i_height = p_sys->i_height;
/* Get aspect-ratio */
- es_fmt.video.i_aspect = p_sys->i_aspect;
+ es_fmt.video.i_sar_num = p_sys->i_aspect * es_fmt.video.i_height;
+ es_fmt.video.i_sar_den = VOUT_ASPECT_FACTOR * es_fmt.video.i_width;
demux_t *p_demux = (demux_t *) p_obj;
msg_Dbg( p_demux, "added new video es %4.4s %dx%d",
memset( &psz_fourcc, 0, sizeof( psz_fourcc ) );
vlc_fourcc_to_char( v4l2chroma_to_fourcc[i].i_fourcc,
&psz_fourcc );
- msg_Dbg( p_obj, "device supports chroma %4s [%s, %s]",
+ msg_Dbg( p_obj, "device supports chroma %4.4s [%s, %s]",
psz_fourcc,
p_sys->p_codecs[i_index].description,
psz_fourcc_v4l2 );
if( !b_codec_supported )
{
msg_Dbg( p_obj,
- "device codec %4s (%s) not supported",
+ "device codec %4.4s (%s) not supported",
psz_fourcc_v4l2,
p_sys->p_codecs[i_index].description );
}