mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
media: soc_camera: ov9750 add enum_frame_size support
users can get available frame size to fix cheese/obs-studio player crush bug. Change-Id: Ia5f12d6289d431195def181819777ca9a0968498 Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
This commit is contained in:
@@ -953,6 +953,7 @@ static struct v4l2_subdev_pad_ops ov9750_camera_module_pad_ops = {
|
||||
.enum_frame_interval = ov_camera_module_enum_frameintervals,
|
||||
.get_fmt = ov_camera_module_g_fmt,
|
||||
.set_fmt = ov_camera_module_s_fmt,
|
||||
.enum_frame_size = ov_camera_module_enum_frame_size,
|
||||
};
|
||||
|
||||
static struct v4l2_subdev_ops ov9750_camera_module_ops = {
|
||||
|
||||
@@ -339,6 +339,30 @@ int ov_camera_module_g_fmt(struct v4l2_subdev *sd,
|
||||
|
||||
/* ======================================================================== */
|
||||
|
||||
int ov_camera_module_enum_frame_size(
|
||||
struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_pad_config *cfg,
|
||||
struct v4l2_subdev_frame_size_enum *fse)
|
||||
{
|
||||
struct ov_camera_module *cam_mod = to_ov_camera_module(sd);
|
||||
|
||||
if (fse->index >= cam_mod->custom.num_configs)
|
||||
return -EINVAL;
|
||||
|
||||
fse->code =
|
||||
cam_mod->custom.configs[fse->index].frm_fmt.code;
|
||||
fse->max_width =
|
||||
cam_mod->custom.configs[fse->index].frm_fmt.width;
|
||||
fse->max_height =
|
||||
cam_mod->custom.configs[fse->index].frm_fmt.height;
|
||||
|
||||
pltfrm_camera_module_pr_debug(&cam_mod->sd, "%dx%d",
|
||||
fse->max_width, fse->max_height);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* ======================================================================== */
|
||||
|
||||
int ov_camera_module_s_frame_interval(
|
||||
struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_frame_interval *interval)
|
||||
|
||||
@@ -276,6 +276,11 @@ int ov_camera_module_s_ext_ctrls(
|
||||
struct v4l2_subdev *sd,
|
||||
struct v4l2_ext_controls *ctrls);
|
||||
|
||||
int ov_camera_module_enum_frame_size(
|
||||
struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_pad_config *cfg,
|
||||
struct v4l2_subdev_frame_size_enum *fse);
|
||||
|
||||
int ov_camera_module_enum_frameintervals(
|
||||
struct v4l2_subdev *sd,
|
||||
struct v4l2_subdev_pad_config *cfg,
|
||||
|
||||
Reference in New Issue
Block a user