dprintk(DBGLVL_ENC, "%s()\n", __func__);
- gs.ucRefFrameDist = SAA7164_ENCODER_DEFAULT_GOP_DIST;
+ gs.ucRefFrameDist = port->encoder_params.refdist;
gs.ucGOPSize = SAA7164_ENCODER_DEFAULT_GOP_SIZE;
ret = saa7164_cmd_send(port->dev, port->hwcfg.sourceid, SET_CUR,
EU_VIDEO_GOP_STRUCTURE_CONTROL,
V4L2_CID_MPEG_AUDIO_MUTE,
V4L2_CID_MPEG_VIDEO_BITRATE_MODE,
V4L2_CID_MPEG_VIDEO_BITRATE,
+ V4L2_CID_MPEG_VIDEO_B_FRAMES,
0
};
case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
ctrl->value = params->bitrate_mode;
break;
+ case V4L2_CID_MPEG_VIDEO_B_FRAMES:
+ ctrl->value = params->refdist;
+ break;
default:
return -EINVAL;
}
(ctrl->value == V4L2_MPEG_VIDEO_BITRATE_MODE_CBR))
ret = 0;
break;
+ case V4L2_CID_MPEG_VIDEO_B_FRAMES:
+ if ((ctrl->value >= 1) &&
+ (ctrl->value <= 3))
+ ret = 0;
+ break;
default:
ret = -EINVAL;
}
case V4L2_CID_MPEG_VIDEO_BITRATE_MODE:
params->bitrate_mode = ctrl->value;
break;
+ case V4L2_CID_MPEG_VIDEO_B_FRAMES:
+ params->refdist = ctrl->value;
+ break;
default:
return -EINVAL;
}
return v4l2_ctrl_query_fill(c,
V4L2_MPEG_VIDEO_BITRATE_MODE_VBR, V4L2_MPEG_VIDEO_BITRATE_MODE_CBR,
1, V4L2_MPEG_VIDEO_BITRATE_MODE_VBR);
+ case V4L2_CID_MPEG_VIDEO_B_FRAMES:
+ return v4l2_ctrl_query_fill(c,
+ 1, 3, 1, 1);
default:
return -EINVAL;
}
port->encoder_params.stream_type = V4L2_MPEG_STREAM_TYPE_MPEG2_PS;
port->encoder_params.ctl_mute = 0;
port->encoder_params.ctl_aspect = V4L2_MPEG_VIDEO_ASPECT_4x3;
+ port->encoder_params.refdist = 1;
if (port->encodernorm.id & V4L2_STD_525_60)
port->height = 480;