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 <[email protected]>
  • Loading branch information
6by9 committed Mar 11, 2021
1 parent a2dd092 commit 7b7a2f9
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1544,6 +1544,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 7b7a2f9

Please sign in to comment.