Skip to content

Commit

Permalink
staging/bcm2835-codec: Implement additional g_selection calls for decode
Browse files Browse the repository at this point in the history
v4l_cropcap calls our vidioc_g_pixelaspect function to get the pixel
aspect ratio, but also calls g_selection for V4L2_SEL_TGT_CROP_BOUNDS
and V4L2_SEL_TGT_CROP_DEFAULT. Whilst it allows for vidioc_g_pixelaspect
not to be implemented, it doesn't allow for either of the other two.

Add in support for the additional selection targets.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
  • Loading branch information
6by9 authored and popcornmix committed May 7, 2021
1 parent f916fc5 commit 5922664
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,14 @@ static int vidioc_g_selection(struct file *file, void *priv,
s->r.width = q_data->crop_width;
s->r.height = q_data->crop_height;
break;
case V4L2_SEL_TGT_CROP_BOUNDS:
case V4L2_SEL_TGT_CROP_DEFAULT:
s->r.left = 0;
s->r.top = 0;
s->r.width = (q_data->bytesperline << 3) /
q_data->fmt->depth;
s->r.height = q_data->height;
break;
default:
return -EINVAL;
}
Expand Down

0 comments on commit 5922664

Please sign in to comment.