[PATCH 2/7] hverkuil/go7007: staging: media: go7007: Add Frameintervals

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Volokh Konstantin <volokh84@xxxxxxxxx>
---
 drivers/staging/media/go7007/go7007-v4l2.c |  123 ++++++++++++++++++++++++++++
 1 files changed, 123 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/media/go7007/go7007-v4l2.c b/drivers/staging/media/go7007/go7007-v4l2.c
index 4ec9b84..96538f6 100644
--- a/drivers/staging/media/go7007/go7007-v4l2.c
+++ b/drivers/staging/media/go7007/go7007-v4l2.c
@@ -703,6 +703,129 @@ static int vidioc_enum_frameintervals(struct file *filp, void *priv,
 {
 	struct go7007 *go = video_drvdata(filp);
 
+	if (go->board_id == GO7007_BOARDID_ADLINK_MPG24) {
+		switch (fival->pixel_format) {
+		case V4L2_PIX_FMT_MJPEG:
+		case V4L2_PIX_FMT_MPEG:
+		case V4L2_PIX_FMT_H263:
+			switch (go->standard) {
+			case GO7007_STD_NTSC:
+				switch (fival->index) {
+				case 0:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*1;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 1:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*2;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 2:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*3;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 3:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*4;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 4:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*5;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 5:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*6;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 6:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*7;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 7:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*10;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 8:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*15;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 9:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*30;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				default:
+					return -EINVAL;
+				}
+				break;
+			case GO7007_STD_PAL:
+				switch (fival->index) {
+				case 0:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*1;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 1:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*2;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 2:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*3;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 3:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*4;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 4:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*5;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 5:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*6;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 6:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*8;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 7:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*13;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				case 8:
+					fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+					fival->discrete.numerator = 1001*25;
+					fival->discrete.denominator = go->sensor_framerate;
+					break;
+				default:
+					return -EINVAL;
+				}
+				break;
+			default:
+				return -EINVAL;
+			}
+			break;
+		default:
+			return -EINVAL;
+		}
+		return 0;
+	}
+
 	if (fival->index > 0)
 		return -EINVAL;
 
-- 
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux