Commit 6d96102a authored by Antoine Cellerier's avatar Antoine Cellerier

Don't fail launching the video device if a video control failed. Update the...

Don't fail launching the video device if a video control failed. Update the hue/saturation/brightness/contrast values in the callback before issue the video control. (I haven't been able to test yet due to lack of hardware)
parent 599cf098
...@@ -1529,14 +1529,13 @@ int OpenVideoDev( demux_t *p_demux, char *psz_device ) ...@@ -1529,14 +1529,13 @@ int OpenVideoDev( demux_t *p_demux, char *psz_device )
VideoControlList( p_demux, i_fd ); VideoControlList( p_demux, i_fd );
if( VideoControl( p_demux, i_fd, VideoControl( p_demux, i_fd,
"brightness", V4L2_CID_BRIGHTNESS, p_sys->i_brightness ) "brightness", V4L2_CID_BRIGHTNESS, p_sys->i_brightness );
|| VideoControl( p_demux, i_fd, VideoControl( p_demux, i_fd,
"contrast", V4L2_CID_CONTRAST, p_sys->i_contrast ) "contrast", V4L2_CID_CONTRAST, p_sys->i_contrast );
|| VideoControl( p_demux, i_fd, VideoControl( p_demux, i_fd,
"saturation", V4L2_CID_SATURATION, p_sys->i_saturation ) "saturation", V4L2_CID_SATURATION, p_sys->i_saturation );
|| VideoControl( p_demux, i_fd, "hue", V4L2_CID_HUE, p_sys->i_hue ) ) VideoControl( p_demux, i_fd, "hue", V4L2_CID_HUE, p_sys->i_hue );
goto open_failed;
/* Init vout Picture */ /* Init vout Picture */
vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic, p_sys->i_fourcc, vout_InitPicture( VLC_OBJECT(p_demux), &p_sys->pic, p_sys->i_fourcc,
...@@ -2422,17 +2421,29 @@ static int VideoControlCallback( vlc_object_t *p_this, ...@@ -2422,17 +2421,29 @@ static int VideoControlCallback( vlc_object_t *p_this,
return VLC_EGENERIC; return VLC_EGENERIC;
if( !strcmp( psz_var, "brightness" ) ) if( !strcmp( psz_var, "brightness" ) )
{
p_sys->i_brightness = newval.i_int;
return VideoControl( p_demux, i_fd, return VideoControl( p_demux, i_fd,
"brightness", V4L2_CID_BRIGHTNESS, p_sys->i_brightness ); "brightness", V4L2_CID_BRIGHTNESS, p_sys->i_brightness );
}
else if( !strcmp( psz_var, "contrast" ) ) else if( !strcmp( psz_var, "contrast" ) )
{
p_sys->i_contrast = newval.i_int;
return VideoControl( p_demux, i_fd, return VideoControl( p_demux, i_fd,
"contrast", V4L2_CID_CONTRAST, p_sys->i_contrast ); "contrast", V4L2_CID_CONTRAST, p_sys->i_contrast );
}
else if( !strcmp( psz_var, "saturation" ) ) else if( !strcmp( psz_var, "saturation" ) )
{
p_sys->i_saturation = newval.i_int;
return VideoControl( p_demux, i_fd, return VideoControl( p_demux, i_fd,
"saturation", V4L2_CID_SATURATION, p_sys->i_saturation ); "saturation", V4L2_CID_SATURATION, p_sys->i_saturation );
}
else if( !strcmp( psz_var, "hue" ) ) else if( !strcmp( psz_var, "hue" ) )
{
p_sys->i_hue = newval.i_int;
return VideoControl( p_demux, i_fd, return VideoControl( p_demux, i_fd,
"hue", V4L2_CID_HUE, p_sys->i_hue ); "hue", V4L2_CID_HUE, p_sys->i_hue );
}
else else
return VLC_EGENERIC; return VLC_EGENERIC;
return VLC_SUCCESS; return VLC_SUCCESS;
......
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