vlc_module_begin();
set_shortname( _("Video4Linux") );
set_description( _("Video4Linux input") );
+ set_category( CAT_INPUT );
+ set_subcategory( SUBCAT_INPUT_ACCESS );
add_integer( "v4l-caching", DEFAULT_PTS_DELAY / 1000, NULL,
CACHING_TEXT, CACHING_LONGTEXT, VLC_TRUE );
demux_t *p_demux = (demux_t*)p_this;
demux_sys_t *p_sys;
+ /* Only when selected */
+ if( *p_demux->psz_access == '\0' )
+ return VLC_EGENERIC;
+
/* Set up p_demux */
p_demux->pf_demux = Demux;
p_demux->pf_control = Control;
es_format_Init( &fmt, VIDEO_ES, p_sys->i_fourcc );
fmt.video.i_width = p_sys->i_width;
fmt.video.i_height = p_sys->i_height;
+ fmt.video.i_aspect = 4 * VOUT_ASPECT_FACTOR / 3;
+
+ /* Setup rgb mask for RGB formats */
+ if( p_sys->i_fourcc == VLC_FOURCC('R','V','2','4') )
+ {
+ /* This is in BGR format */
+ fmt.video.i_bmask = 0x00ff0000;
+ fmt.video.i_gmask = 0x0000ff00;
+ fmt.video.i_rmask = 0x000000ff;
+ }
msg_Dbg( p_demux, "added new video es %4.4s %dx%d",
(char*)&fmt.i_codec, fmt.video.i_width, fmt.video.i_height );
*pi64 = (int64_t)var_GetInteger( p_demux, "v4l-caching" ) * 1000;
return VLC_SUCCESS;
+ case DEMUX_GET_TIME:
+ pi64 = (int64_t*)va_arg( args, int64_t * );
+ *pi64 = mdate();
+ return VLC_SUCCESS;
+
/* TODO implement others */
default:
return VLC_EGENERIC;
{
demux_sys_t *p_sys = p_demux->p_sys;
es_out_id_t *p_es = p_sys->p_es_audio;
- block_t *p_block;
+ block_t *p_block = NULL;
/* Try grabbing audio frames first */
if( p_sys->fd_audio < 0 || !( p_block = GrabAudio( p_demux ) ) )
break;
}
}
-
}
else
{
p_sys->i_video_frame_size = 0;
for( i = 0; i < p_sys->pic.i_planes; i++ )
{
- p_sys->i_video_frame_size += p_sys->pic.p[i].i_lines *
+ p_sys->i_video_frame_size += p_sys->pic.p[i].i_visible_lines *
p_sys->pic.p[i].i_visible_pitch;
}