[media] vivid-capture: add control for reduced frame rate

A boolean control Reduced Framerate is added to vivid controls for
controlling the reduced fps option for vivid capture from gui.

Signed-off-by: Prashant Laddha <prladdha@cisco.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
Prashant Laddha 2015-09-22 11:27:30 -03:00 committed by Mauro Carvalho Chehab
parent b883ba75e9
commit c79aa6aead
2 changed files with 16 additions and 0 deletions

View File

@ -264,6 +264,7 @@ struct vivid_dev {
bool vflip; bool vflip;
bool vbi_cap_interlaced; bool vbi_cap_interlaced;
bool loop_video; bool loop_video;
bool reduced_fps;
/* Framebuffer */ /* Framebuffer */
unsigned long video_pbase; unsigned long video_pbase;

View File

@ -78,6 +78,7 @@
#define VIVID_CID_TIME_WRAP (VIVID_CID_VIVID_BASE + 39) #define VIVID_CID_TIME_WRAP (VIVID_CID_VIVID_BASE + 39)
#define VIVID_CID_MAX_EDID_BLOCKS (VIVID_CID_VIVID_BASE + 40) #define VIVID_CID_MAX_EDID_BLOCKS (VIVID_CID_VIVID_BASE + 40)
#define VIVID_CID_PERCENTAGE_FILL (VIVID_CID_VIVID_BASE + 41) #define VIVID_CID_PERCENTAGE_FILL (VIVID_CID_VIVID_BASE + 41)
#define VIVID_CID_REDUCED_FPS (VIVID_CID_VIVID_BASE + 42)
#define VIVID_CID_STD_SIGNAL_MODE (VIVID_CID_VIVID_BASE + 60) #define VIVID_CID_STD_SIGNAL_MODE (VIVID_CID_VIVID_BASE + 60)
#define VIVID_CID_STANDARD (VIVID_CID_VIVID_BASE + 61) #define VIVID_CID_STANDARD (VIVID_CID_VIVID_BASE + 61)
@ -424,6 +425,10 @@ static int vivid_vid_cap_s_ctrl(struct v4l2_ctrl *ctrl)
dev->sensor_vflip = ctrl->val; dev->sensor_vflip = ctrl->val;
tpg_s_vflip(&dev->tpg, dev->sensor_vflip ^ dev->vflip); tpg_s_vflip(&dev->tpg, dev->sensor_vflip ^ dev->vflip);
break; break;
case VIVID_CID_REDUCED_FPS:
dev->reduced_fps = ctrl->val;
vivid_update_format_cap(dev, true);
break;
case VIVID_CID_HAS_CROP_CAP: case VIVID_CID_HAS_CROP_CAP:
dev->has_crop_cap = ctrl->val; dev->has_crop_cap = ctrl->val;
vivid_update_format_cap(dev, true); vivid_update_format_cap(dev, true);
@ -601,6 +606,15 @@ static const struct v4l2_ctrl_config vivid_ctrl_vflip = {
.step = 1, .step = 1,
}; };
static const struct v4l2_ctrl_config vivid_ctrl_reduced_fps = {
.ops = &vivid_vid_cap_ctrl_ops,
.id = VIVID_CID_REDUCED_FPS,
.name = "Reduced Framerate",
.type = V4L2_CTRL_TYPE_BOOLEAN,
.max = 1,
.step = 1,
};
static const struct v4l2_ctrl_config vivid_ctrl_has_crop_cap = { static const struct v4l2_ctrl_config vivid_ctrl_has_crop_cap = {
.ops = &vivid_vid_cap_ctrl_ops, .ops = &vivid_vid_cap_ctrl_ops,
.id = VIVID_CID_HAS_CROP_CAP, .id = VIVID_CID_HAS_CROP_CAP,
@ -1416,6 +1430,7 @@ int vivid_create_controls(struct vivid_dev *dev, bool show_ccs_cap,
v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_vflip, NULL); v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_vflip, NULL);
v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_sav, NULL); v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_sav, NULL);
v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_eav, NULL); v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_insert_eav, NULL);
v4l2_ctrl_new_custom(hdl_vid_cap, &vivid_ctrl_reduced_fps, NULL);
if (show_ccs_cap) { if (show_ccs_cap) {
dev->ctrl_has_crop_cap = v4l2_ctrl_new_custom(hdl_vid_cap, dev->ctrl_has_crop_cap = v4l2_ctrl_new_custom(hdl_vid_cap,
&vivid_ctrl_has_crop_cap, NULL); &vivid_ctrl_has_crop_cap, NULL);