[media] vivid-capture: add control for reduced frame rate
authorPrashant Laddha <prladdha@cisco.com>
Tue, 22 Sep 2015 14:27:30 +0000 (11:27 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 17 Nov 2015 17:06:00 +0000 (15:06 -0200)
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>
drivers/media/platform/vivid/vivid-core.h
drivers/media/platform/vivid/vivid-ctrls.c

index 55b304a705d52b137d8a4521cdfaf29e4ce6929d..8c7a5ba87c9058e6e680a9db11fa3c979676c3de 100644 (file)
@@ -264,6 +264,7 @@ struct vivid_dev {
        bool                            vflip;
        bool                            vbi_cap_interlaced;
        bool                            loop_video;
+       bool                            reduced_fps;
 
        /* Framebuffer */
        unsigned long                   video_pbase;
index ae88afc0c0ced993be5975dedabe840aaba0571c..4ab7c4b6aaca035d68f417e8ff9dae6c4c73c73c 100644 (file)
@@ -78,6 +78,7 @@
 #define VIVID_CID_TIME_WRAP            (VIVID_CID_VIVID_BASE + 39)
 #define VIVID_CID_MAX_EDID_BLOCKS      (VIVID_CID_VIVID_BASE + 40)
 #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_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;
                tpg_s_vflip(&dev->tpg, dev->sensor_vflip ^ dev->vflip);
                break;
+       case VIVID_CID_REDUCED_FPS:
+               dev->reduced_fps = ctrl->val;
+               vivid_update_format_cap(dev, true);
+               break;
        case VIVID_CID_HAS_CROP_CAP:
                dev->has_crop_cap = ctrl->val;
                vivid_update_format_cap(dev, true);
@@ -601,6 +606,15 @@ static const struct v4l2_ctrl_config vivid_ctrl_vflip = {
        .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 = {
        .ops = &vivid_vid_cap_ctrl_ops,
        .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_insert_sav, 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) {
                        dev->ctrl_has_crop_cap = v4l2_ctrl_new_custom(hdl_vid_cap,
                                &vivid_ctrl_has_crop_cap, NULL);