aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-21 08:22:19 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:11:05 -0400
commit0b5a30e90ddcb0095a1bfc4b44eb3fd1e8ee9f3c (patch)
tree67c01f0ff03bb2e3cd2f985e142bc4296932dae3 /drivers/media/video
parente27bf207db4fc6dd500eb82611f102da85cfe7d0 (diff)
V4L/DVB (8087): cx18: make sure all v4l2_format fields are filled in
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video')
-rw-r--r--drivers/media/video/cx18/cx18-ioctl.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c
index f66ca0b39520..19618bdcdde1 100644
--- a/drivers/media/video/cx18/cx18-ioctl.c
+++ b/drivers/media/video/cx18/cx18-ioctl.c
@@ -137,22 +137,24 @@ static int cx18_g_fmt_vid_cap(struct file *file, void *fh,
137{ 137{
138 struct cx18_open_id *id = fh; 138 struct cx18_open_id *id = fh;
139 struct cx18 *cx = id->cx; 139 struct cx18 *cx = id->cx;
140 struct v4l2_pix_format *pixfmt = &fmt->fmt.pix;
140 141
141 CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n"); 142 pixfmt->width = cx->params.width;
142 143 pixfmt->height = cx->params.height;
143 fmt->fmt.pix.width = cx->params.width; 144 pixfmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
144 fmt->fmt.pix.height = cx->params.height; 145 pixfmt->field = V4L2_FIELD_INTERLACED;
145 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; 146 pixfmt->priv = 0;
146 fmt->fmt.pix.field = V4L2_FIELD_INTERLACED;
147 if (id->type == CX18_ENC_STREAM_TYPE_YUV) { 147 if (id->type == CX18_ENC_STREAM_TYPE_YUV) {
148 fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_HM12; 148 pixfmt->pixelformat = V4L2_PIX_FMT_HM12;
149 /* YUV size is (Y=(h*w) + UV=(h*(w/2))) */ 149 /* YUV size is (Y=(h*w) + UV=(h*(w/2))) */
150 fmt->fmt.pix.sizeimage = 150 pixfmt->sizeimage =
151 fmt->fmt.pix.height * fmt->fmt.pix.width + 151 pixfmt->height * pixfmt->width +
152 fmt->fmt.pix.height * (fmt->fmt.pix.width / 2); 152 pixfmt->height * (pixfmt->width / 2);
153 pixfmt->bytesperline = 720;
153 } else { 154 } else {
154 fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; 155 pixfmt->pixelformat = V4L2_PIX_FMT_MPEG;
155 fmt->fmt.pix.sizeimage = 128 * 1024; 156 pixfmt->sizeimage = 128 * 1024;
157 pixfmt->bytesperline = 0;
156 } 158 }
157 return 0; 159 return 0;
158} 160}
@@ -161,16 +163,20 @@ static int cx18_g_fmt_vbi_cap(struct file *file, void *fh,
161 struct v4l2_format *fmt) 163 struct v4l2_format *fmt)
162{ 164{
163 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx; 165 struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
166 struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi;
164 167
165 CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n"); 168 CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");
166 169
167 fmt->fmt.vbi.sampling_rate = 27000000; 170 vbifmt->sampling_rate = 27000000;
168 fmt->fmt.vbi.offset = 248; 171 vbifmt->offset = 248;
169 fmt->fmt.vbi.samples_per_line = cx->vbi.raw_decoder_line_size - 4; 172 vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4;
170 fmt->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY; 173 vbifmt->sample_format = V4L2_PIX_FMT_GREY;
171 fmt->fmt.vbi.start[0] = cx->vbi.start[0]; 174 vbifmt->start[0] = cx->vbi.start[0];
172 fmt->fmt.vbi.start[1] = cx->vbi.start[1]; 175 vbifmt->start[1] = cx->vbi.start[1];
173 fmt->fmt.vbi.count[0] = fmt->fmt.vbi.count[1] = cx->vbi.count; 176 vbifmt->count[0] = vbifmt->count[1] = cx->vbi.count;
177 vbifmt->flags = 0;
178 vbifmt->reserved[0] = 0;
179 vbifmt->reserved[1] = 0;
174 return 0; 180 return 0;
175} 181}
176 182