Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 103849
b: refs/heads/master
c: 0b5a30e
h: refs/heads/master
i:
  103847: 8abc0a9
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Jul 20, 2008
1 parent 7b21308 commit a794b6c
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e27bf207db4fc6dd500eb82611f102da85cfe7d0
refs/heads/master: 0b5a30e90ddcb0095a1bfc4b44eb3fd1e8ee9f3c
44 changes: 25 additions & 19 deletions trunk/drivers/media/video/cx18/cx18-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,22 +137,24 @@ static int cx18_g_fmt_vid_cap(struct file *file, void *fh,
{
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
struct v4l2_pix_format *pixfmt = &fmt->fmt.pix;

CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VIDEO_CAPTURE\n");

fmt->fmt.pix.width = cx->params.width;
fmt->fmt.pix.height = cx->params.height;
fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
fmt->fmt.pix.field = V4L2_FIELD_INTERLACED;
pixfmt->width = cx->params.width;
pixfmt->height = cx->params.height;
pixfmt->colorspace = V4L2_COLORSPACE_SMPTE170M;
pixfmt->field = V4L2_FIELD_INTERLACED;
pixfmt->priv = 0;
if (id->type == CX18_ENC_STREAM_TYPE_YUV) {
fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_HM12;
pixfmt->pixelformat = V4L2_PIX_FMT_HM12;
/* YUV size is (Y=(h*w) + UV=(h*(w/2))) */
fmt->fmt.pix.sizeimage =
fmt->fmt.pix.height * fmt->fmt.pix.width +
fmt->fmt.pix.height * (fmt->fmt.pix.width / 2);
pixfmt->sizeimage =
pixfmt->height * pixfmt->width +
pixfmt->height * (pixfmt->width / 2);
pixfmt->bytesperline = 720;
} else {
fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG;
fmt->fmt.pix.sizeimage = 128 * 1024;
pixfmt->pixelformat = V4L2_PIX_FMT_MPEG;
pixfmt->sizeimage = 128 * 1024;
pixfmt->bytesperline = 0;
}
return 0;
}
Expand All @@ -161,16 +163,20 @@ static int cx18_g_fmt_vbi_cap(struct file *file, void *fh,
struct v4l2_format *fmt)
{
struct cx18 *cx = ((struct cx18_open_id *)fh)->cx;
struct v4l2_vbi_format *vbifmt = &fmt->fmt.vbi;

CX18_DEBUG_IOCTL("VIDIOC_G_FMT: V4L2_BUF_TYPE_VBI_CAPTURE\n");

fmt->fmt.vbi.sampling_rate = 27000000;
fmt->fmt.vbi.offset = 248;
fmt->fmt.vbi.samples_per_line = cx->vbi.raw_decoder_line_size - 4;
fmt->fmt.vbi.sample_format = V4L2_PIX_FMT_GREY;
fmt->fmt.vbi.start[0] = cx->vbi.start[0];
fmt->fmt.vbi.start[1] = cx->vbi.start[1];
fmt->fmt.vbi.count[0] = fmt->fmt.vbi.count[1] = cx->vbi.count;
vbifmt->sampling_rate = 27000000;
vbifmt->offset = 248;
vbifmt->samples_per_line = cx->vbi.raw_decoder_line_size - 4;
vbifmt->sample_format = V4L2_PIX_FMT_GREY;
vbifmt->start[0] = cx->vbi.start[0];
vbifmt->start[1] = cx->vbi.start[1];
vbifmt->count[0] = vbifmt->count[1] = cx->vbi.count;
vbifmt->flags = 0;
vbifmt->reserved[0] = 0;
vbifmt->reserved[1] = 0;
return 0;
}

Expand Down

0 comments on commit a794b6c

Please sign in to comment.