Commit bc603309 authored by Jernej Skrabec's avatar Jernej Skrabec Committed by Hans Verkuil
Browse files

media: cedrus: use helper to set default formats



Now that set output format helper is available, let's use that for
setting default values. Advantage of this is that values will be always
valid. Current code produced invalid default values for V3s SoC, which
doesn't support MPEG2 decoding.

Signed-off-by: default avatarJernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
parent b13ffeaf
Loading
Loading
Loading
Loading
+2 −10
Original line number Diff line number Diff line
@@ -361,16 +361,8 @@ static int cedrus_open(struct file *file)
		ret = PTR_ERR(ctx->fh.m2m_ctx);
		goto err_ctrls;
	}
	ctx->dst_fmt.pixelformat = V4L2_PIX_FMT_NV12_32L32;
	cedrus_prepare_format(&ctx->dst_fmt);
	ctx->src_fmt.pixelformat = V4L2_PIX_FMT_MPEG2_SLICE;
	/*
	 * TILED_NV12 has more strict requirements, so copy the width and
	 * height to src_fmt to ensure that is matches the dst_fmt resolution.
	 */
	ctx->src_fmt.width = ctx->dst_fmt.width;
	ctx->src_fmt.height = ctx->dst_fmt.height;
	cedrus_prepare_format(&ctx->src_fmt);

	cedrus_reset_out_format(ctx);

	v4l2_fh_add(&ctx->fh);