diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-05-19 19:50:35 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2007-05-19 19:50:35 +0200 |
commit | 29993ba41c50e8096ffd25fe704990479248d061 (patch) | |
tree | 209e48cfa72b02bfa1543f11469855d6a349e76c /linux/drivers/media/video/ivtv/ivtv-ioctl.c | |
parent | e65320dd8af749a0fe8242b59921b56d4eaf8d27 (diff) | |
download | mediapointer-dvb-s2-29993ba41c50e8096ffd25fe704990479248d061.tar.gz mediapointer-dvb-s2-29993ba41c50e8096ffd25fe704990479248d061.tar.bz2 |
Use v4l2_pix_out_fmt instead of v4l2_pix_fmt for video output format
From: Hans Verkuil <hverkuil@xs4all.nl>
Adding top/left fields to v4l2_pix_fmt broke the ABI. To fix this a new
v4l2_pix_out_fmt struct was introduced to specify the video output format.
This new struct *does* have the additional top/left fields.
The V4L2_CAP_VIDEO_OUTPUT_POS capability that was introduced is no longer
needed and is removed.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/ivtv/ivtv-ioctl.c')
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-ioctl.c | 81 |
1 files changed, 27 insertions, 54 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c index 5b799f016..15c2c9f5c 100644 --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c @@ -362,56 +362,46 @@ static int ivtv_get_fmt(struct ivtv *itv, int streamtype, struct v4l2_format *fm case V4L2_BUF_TYPE_VIDEO_OUTPUT: if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) return -EINVAL; -#if 0 - /* Temporarily removed until a better solution is in place that does not - break the ABI */ - fmt->fmt.pix.left = itv->main_rect.left; - fmt->fmt.pix.top = itv->main_rect.top; -#endif - fmt->fmt.pix.width = itv->main_rect.width; - fmt->fmt.pix.height = itv->main_rect.height; - fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; - fmt->fmt.pix.field = V4L2_FIELD_INTERLACED; + fmt->fmt.pix_out.left = itv->main_rect.left; + fmt->fmt.pix_out.top = itv->main_rect.top; + fmt->fmt.pix_out.width = itv->main_rect.width; + fmt->fmt.pix_out.height = itv->main_rect.height; + fmt->fmt.pix_out.colorspace = V4L2_COLORSPACE_SMPTE170M; + fmt->fmt.pix_out.field = V4L2_FIELD_INTERLACED; if (itv->output_mode == OUT_UDMA_YUV) { switch (itv->yuv_info.lace_mode & IVTV_YUV_MODE_MASK) { case IVTV_YUV_MODE_INTERLACED: - fmt->fmt.pix.field = (itv->yuv_info.lace_mode & IVTV_YUV_SYNC_MASK) ? + fmt->fmt.pix_out.field = (itv->yuv_info.lace_mode & IVTV_YUV_SYNC_MASK) ? V4L2_FIELD_INTERLACED_BT : V4L2_FIELD_INTERLACED_TB; break; case IVTV_YUV_MODE_PROGRESSIVE: - fmt->fmt.pix.field = V4L2_FIELD_NONE; + fmt->fmt.pix_out.field = V4L2_FIELD_NONE; break; default: - fmt->fmt.pix.field = V4L2_FIELD_ANY; + fmt->fmt.pix_out.field = V4L2_FIELD_ANY; break; } - fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_HM12; + fmt->fmt.pix_out.pixelformat = V4L2_PIX_FMT_HM12; /* YUV size is (Y=(h*w) + UV=(h*(w/2))) */ - fmt->fmt.pix.sizeimage = + fmt->fmt.pix_out.sizeimage = fmt->fmt.pix.height * fmt->fmt.pix.width + fmt->fmt.pix.height * (fmt->fmt.pix.width / 2); } else if (itv->output_mode == OUT_YUV || streamtype == IVTV_ENC_STREAM_TYPE_YUV || streamtype == IVTV_DEC_STREAM_TYPE_YUV) { - fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_HM12; + fmt->fmt.pix_out.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); + fmt->fmt.pix_out.sizeimage = + fmt->fmt.pix_out.height * fmt->fmt.pix_out.width + + fmt->fmt.pix_out.height * (fmt->fmt.pix_out.width / 2); } else { - fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; - fmt->fmt.pix.sizeimage = 128 * 1024; + fmt->fmt.pix_out.pixelformat = V4L2_PIX_FMT_MPEG; + fmt->fmt.pix_out.sizeimage = 128 * 1024; } break; case V4L2_BUF_TYPE_VIDEO_CAPTURE: -#if 0 - /* Temporarily removed until a better solution is in place that does not - break the ABI */ - fmt->fmt.pix.left = 0; - fmt->fmt.pix.top = 0; -#endif fmt->fmt.pix.width = itv->params.width; fmt->fmt.pix.height = itv->params.height; fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; @@ -505,33 +495,22 @@ static int ivtv_try_or_set_fmt(struct ivtv *itv, int streamtype, if (!(itv->v4l2_cap & V4L2_CAP_VIDEO_OUTPUT)) return -EINVAL; - field = fmt->fmt.pix.field; -#if 0 - /* Temporarily removed until a better solution is in place that does not - break the ABI */ - r.top = fmt->fmt.pix.top; - r.left = fmt->fmt.pix.left; -#else - r.top = 0; - r.left = 0; -#endif - r.width = fmt->fmt.pix.width; - r.height = fmt->fmt.pix.height; + field = fmt->fmt.pix_out.field; + r.top = fmt->fmt.pix_out.top; + r.left = fmt->fmt.pix_out.left; + r.width = fmt->fmt.pix_out.width; + r.height = fmt->fmt.pix_out.height; ivtv_get_fmt(itv, streamtype, fmt); if (itv->output_mode != OUT_UDMA_YUV) { /* TODO: would setting the rect also be valid for this mode? */ -#if 0 - /* Temporarily removed until a better solution is in place that does not - break the ABI */ - fmt->fmt.pix.top = r.top; - fmt->fmt.pix.left = r.left; -#endif - fmt->fmt.pix.width = r.width; - fmt->fmt.pix.height = r.height; + fmt->fmt.pix_out.top = r.top; + fmt->fmt.pix_out.left = r.left; + fmt->fmt.pix_out.width = r.width; + fmt->fmt.pix_out.height = r.height; } if (itv->output_mode == OUT_UDMA_YUV) { /* TODO: add checks for validity */ - fmt->fmt.pix.field = field; + fmt->fmt.pix_out.field = field; } if (set_fmt) { if (itv->output_mode == OUT_UDMA_YUV) { @@ -1172,12 +1151,6 @@ int ivtv_v4l2_ioctls(struct ivtv *itv, struct file *filp, unsigned int cmd, void fb->fmt.pixelformat = itv->osd_pixelformat; fb->fmt.width = itv->osd_rect.width; fb->fmt.height = itv->osd_rect.height; -#if 0 - /* Temporarily removed until a better solution is in place that does not - break the ABI */ - fb->fmt.left = itv->osd_rect.left; - fb->fmt.top = itv->osd_rect.top; -#endif fb->base = (void *)itv->osd_video_pbase; if (itv->osd_global_alpha_state) fb->flags |= V4L2_FBUF_FLAG_GLOBAL_ALPHA; |