/* Configures the decoder to use the input parameters, if possible. If not possible, returns the appropriate error code.  */
static int tvp514x_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
/* Configures the decoder to use the input parameters, if possible. If not possible, returns the appropriate error code.  */
static int tvp514x_s_parm(struct v4l2_subdev *sd, struct v4l2_streamparm *a)
{
	struct tvp514x_decoder *decoder = to_decoder(sd);
	struct v4l2_fract *timeperframe;
	enum tvp514x_std current_std;
	if (a == NULL)
		return -EINVAL;
	if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
		return -EINVAL;
	timeperframe = &a->parm.capture.timeperframe;
	current_std = tvp514x_get_current_std(sd);
	if (current_std == STD_INVALID)
		return -EINVAL;
	decoder->current_std = current_std;
	*timeperframe =
	    decoder->std_list[current_std].standard.frameperiod;
	return 0;
}