-/*****************************************************************************
- * ConfigureIVTV: set up codec parameters using the old ivtv api
- *****************************************************************************/
-static int ConfigureIVTV( access_t * p_access )
-{
- access_sys_t *p_sys = (access_sys_t *) p_access->p_sys;
- struct ivtv_ioctl_codec codec;
- int result;
-
- memset( &codec, 0, sizeof(struct ivtv_ioctl_codec) );
-
- result = ioctl( p_sys->i_fd, IVTV_IOC_G_CODEC, &codec );
- if( result < 0 )
- {
- msg_Err( p_access, "Failed to read current capture card settings." );
- return VLC_EGENERIC;
- }
-
- if( p_sys->i_framerate != -1 )
- {
- switch( p_sys->i_framerate )
- {
- case 30:
- codec.framerate = 0;
- break;
-
- case 25:
- codec.framerate = 1;
- break;
-
- default:
- msg_Warn( p_access, "Invalid framerate, reverting to 25." );
- codec.framerate = 1;
- break;
- }
- }
-
- if( p_sys->i_bitrate != -1 )
- {
- codec.bitrate = p_sys->i_bitrate;
- }
-
- if( p_sys->i_bitrate_peak != -1 )
- {
- codec.bitrate_peak = p_sys->i_bitrate_peak;
- }
-
- if( p_sys->i_bitrate_mode != -1 )
- {
- codec.bitrate_mode = p_sys->i_bitrate_mode;
- }
-
- if( p_sys->i_audio_bitmask != -1 )
- {
- codec.audio_bitmask = p_sys->i_audio_bitmask;
- }
-
- if( p_sys->i_keyint != -1 )
- {
- codec.framespergop = p_sys->i_keyint;
- }
-
- if( p_sys->i_bframes != -1 )
- {
- codec.bframes = p_sys->i_bframes;
- }
-
- result = ioctl( p_sys->i_fd, IVTV_IOC_S_CODEC, &codec );
- if( result < 0 )
- {
- msg_Err( p_access, "Failed to write new capture card settings." );
- return VLC_EGENERIC;
- }
-
- msg_Dbg( p_access, "Setting codec parameters to: framerate: "
- "%d, bitrate: %d/%d/%d",
- codec.framerate, codec.bitrate,
- codec.bitrate_peak, codec.bitrate_mode );
- return VLC_SUCCESS;
-}
-
-#ifdef HAVE_NEW_LINUX_VIDEODEV2_H