mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-05-24 10:39:52 +00:00
media: subdev: add streams to v4l2_subdev_get_fmt() helper function
Add streams support to v4l2_subdev_get_fmt() helper function. Subdev drivers that do not need to do anything special in their get_fmt op can use this helper directly for v4l2_subdev_pad_ops.get_fmt. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
This commit is contained in:
parent
d00f1a075c
commit
72c5fbcaa3
1 changed files with 7 additions and 3 deletions
|
@ -1406,10 +1406,14 @@ int v4l2_subdev_get_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state,
|
||||||
{
|
{
|
||||||
struct v4l2_mbus_framefmt *fmt;
|
struct v4l2_mbus_framefmt *fmt;
|
||||||
|
|
||||||
if (format->pad >= sd->entity.num_pads)
|
if (sd->flags & V4L2_SUBDEV_FL_STREAMS)
|
||||||
return -EINVAL;
|
fmt = v4l2_subdev_state_get_stream_format(state, format->pad,
|
||||||
|
format->stream);
|
||||||
|
else if (format->pad < sd->entity.num_pads && format->stream == 0)
|
||||||
|
fmt = v4l2_subdev_get_pad_format(sd, state, format->pad);
|
||||||
|
else
|
||||||
|
fmt = NULL;
|
||||||
|
|
||||||
fmt = v4l2_subdev_get_pad_format(sd, state, format->pad);
|
|
||||||
if (!fmt)
|
if (!fmt)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue