diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2007-05-21 12:44:02 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2007-05-21 12:44:02 +0200 |
commit | c5fbb8e80c9235232c11a933d7f0aef6b5734258 (patch) | |
tree | 786b839f0f8f31fe51969a6682334530e30d7571 | |
parent | 29993ba41c50e8096ffd25fe704990479248d061 (diff) | |
download | mediapointer-dvb-s2-c5fbb8e80c9235232c11a933d7f0aef6b5734258.tar.gz mediapointer-dvb-s2-c5fbb8e80c9235232c11a933d7f0aef6b5734258.tar.bz2 |
Backed out changeset c7cb1aaec112a3ee7d6483b54d03d6a093754f10
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-cards.h | 2 | ||||
-rw-r--r-- | linux/drivers/media/video/ivtv/ivtv-ioctl.c | 81 | ||||
-rw-r--r-- | linux/drivers/media/video/zoran_driver.c | 6 | ||||
-rw-r--r-- | linux/include/linux/videodev2.h | 21 | ||||
-rw-r--r-- | v4l2-apps/util/v4l2-ctl.cpp | 45 | ||||
-rw-r--r-- | v4l2-apps/util/v4l2-dbg.cpp | 2 |
6 files changed, 85 insertions, 72 deletions
diff --git a/linux/drivers/media/video/ivtv/ivtv-cards.h b/linux/drivers/media/video/ivtv/ivtv-cards.h index 91e9e90c1..15012f88b 100644 --- a/linux/drivers/media/video/ivtv/ivtv-cards.h +++ b/linux/drivers/media/video/ivtv/ivtv-cards.h @@ -86,7 +86,7 @@ V4L2_CAP_AUDIO | V4L2_CAP_READWRITE | V4L2_CAP_VBI_CAPTURE | \ V4L2_CAP_SLICED_VBI_CAPTURE) #define IVTV_CAP_DECODER (V4L2_CAP_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT | \ - V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_OVERLAY) + V4L2_CAP_SLICED_VBI_OUTPUT | V4L2_CAP_VIDEO_OUTPUT_OVERLAY | V4L2_CAP_VIDEO_OUTPUT_POS) struct ivtv_card_video_input { u8 video_type; /* video input type */ diff --git a/linux/drivers/media/video/ivtv/ivtv-ioctl.c b/linux/drivers/media/video/ivtv/ivtv-ioctl.c index 15c2c9f5c..5b799f016 100644 --- a/linux/drivers/media/video/ivtv/ivtv-ioctl.c +++ b/linux/drivers/media/video/ivtv/ivtv-ioctl.c @@ -362,46 +362,56 @@ 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; - 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 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; 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_out.field = (itv->yuv_info.lace_mode & IVTV_YUV_SYNC_MASK) ? + fmt->fmt.pix.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_out.field = V4L2_FIELD_NONE; + fmt->fmt.pix.field = V4L2_FIELD_NONE; break; default: - fmt->fmt.pix_out.field = V4L2_FIELD_ANY; + fmt->fmt.pix.field = V4L2_FIELD_ANY; break; } - fmt->fmt.pix_out.pixelformat = V4L2_PIX_FMT_HM12; + fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_HM12; /* YUV size is (Y=(h*w) + UV=(h*(w/2))) */ - fmt->fmt.pix_out.sizeimage = + fmt->fmt.pix.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_out.pixelformat = V4L2_PIX_FMT_HM12; + fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_HM12; /* YUV size is (Y=(h*w) + UV=(h*(w/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); + fmt->fmt.pix.sizeimage = + fmt->fmt.pix.height * fmt->fmt.pix.width + + fmt->fmt.pix.height * (fmt->fmt.pix.width / 2); } else { - fmt->fmt.pix_out.pixelformat = V4L2_PIX_FMT_MPEG; - fmt->fmt.pix_out.sizeimage = 128 * 1024; + fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MPEG; + fmt->fmt.pix.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; @@ -495,22 +505,33 @@ 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_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; + 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; ivtv_get_fmt(itv, streamtype, fmt); if (itv->output_mode != OUT_UDMA_YUV) { /* TODO: would setting the rect also be valid for this mode? */ - 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 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; } if (itv->output_mode == OUT_UDMA_YUV) { /* TODO: add checks for validity */ - fmt->fmt.pix_out.field = field; + fmt->fmt.pix.field = field; } if (set_fmt) { if (itv->output_mode == OUT_UDMA_YUV) { @@ -1151,6 +1172,12 @@ 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; diff --git a/linux/drivers/media/video/zoran_driver.c b/linux/drivers/media/video/zoran_driver.c index 38c1c5978..de85abc45 100644 --- a/linux/drivers/media/video/zoran_driver.c +++ b/linux/drivers/media/video/zoran_driver.c @@ -2894,12 +2894,8 @@ zoran_do_ioctl (struct inode *inode, return res; break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - /* Clear v4l2_pix_out_format fields, the position is always 0. */ - fmt->fmt.pix_out.top = 0; - fmt->fmt.pix_out.left = 0; - /* fall through */ case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: printformat = __cpu_to_le32(fmt->fmt.pix.pixelformat); diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h index 3d92c6b69..8e46a2029 100644 --- a/linux/include/linux/videodev2.h +++ b/linux/include/linux/videodev2.h @@ -243,7 +243,8 @@ struct v4l2_capability #define V4L2_CAP_SLICED_VBI_CAPTURE 0x00000040 /* Is a sliced VBI capture device */ #define V4L2_CAP_SLICED_VBI_OUTPUT 0x00000080 /* Is a sliced VBI output device */ #define V4L2_CAP_RDS_CAPTURE 0x00000100 /* RDS data capture */ -#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000200 /* Can do video output overlay */ +#define V4L2_CAP_VIDEO_OUTPUT_POS 0x00000200 /* Video output can have x,y coords */ +#define V4L2_CAP_VIDEO_OUTPUT_OVERLAY 0x00000400 /* Can do video output overlay */ #define V4L2_CAP_TUNER 0x00010000 /* has a tuner */ #define V4L2_CAP_AUDIO 0x00020000 /* has audio support */ @@ -1273,23 +1274,6 @@ struct v4l2_encoder_cmd { * Data services API by Michael Schimek */ -/* Video output format */ -/* The first part of this structure is identical to the v4l2_pix_format - structure, the fields after 'priv' are specific to the video output format. */ -struct v4l2_pix_out_format -{ - __u32 width; - __u32 height; - __u32 pixelformat; - enum v4l2_field field; - __u32 bytesperline; /* for padding, zero if unused */ - __u32 sizeimage; - enum v4l2_colorspace colorspace; - __u32 priv; /* private data, depends on pixelformat */ - __u32 top; - __u32 left; -}; - /* Raw VBI */ struct v4l2_vbi_format { @@ -1372,7 +1356,6 @@ struct v4l2_format union { struct v4l2_pix_format pix; // V4L2_BUF_TYPE_VIDEO_CAPTURE - struct v4l2_pix_out_format pix_out; // V4L2_BUF_TYPE_VIDEO_OUTPUT struct v4l2_window win; // V4L2_BUF_TYPE_VIDEO_OVERLAY struct v4l2_vbi_format vbi; // V4L2_BUF_TYPE_VBI_CAPTURE struct v4l2_sliced_vbi_format sliced; // V4L2_BUF_TYPE_SLICED_VBI_CAPTURE diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp index 0ce63bb1a..35d9f466b 100644 --- a/v4l2-apps/util/v4l2-ctl.cpp +++ b/v4l2-apps/util/v4l2-ctl.cpp @@ -678,6 +678,7 @@ static int printfmt(struct v4l2_format vfmt) switch (vfmt.type) { case V4L2_BUF_TYPE_VIDEO_CAPTURE: + case V4L2_BUF_TYPE_VIDEO_OUTPUT: printf("\tType : %s\n", buftype2s(vfmt.type).c_str()); printf("\tWidth/Height : %u/%u\n", vfmt.fmt.pix.width, vfmt.fmt.pix.height); printf("\tPixel Format : %s\n", fcc2s(vfmt.fmt.pix.pixelformat).c_str()); @@ -685,21 +686,17 @@ static int printfmt(struct v4l2_format vfmt) printf("\tBytes per Line: %u\n", vfmt.fmt.pix.bytesperline); printf("\tSize Image : %u\n", vfmt.fmt.pix.sizeimage); printf("\tColorspace : %s\n", colorspace2s(vfmt.fmt.pix.colorspace).c_str()); +#if 0 + /* Comment out until ABI breakage is resolved */ + if (vfmt.type == V4L2_BUF_TYPE_VIDEO_OUTPUT && + (capabilities & V4L2_CAP_VIDEO_OUTPUT_POS)) { + printf("\tLeft/Top : %d/%d\n", + vfmt.fmt.pix.left, vfmt.fmt.pix.top); + } +#endif if (vfmt.fmt.pix.priv) printf("\tCustom Info : %08x\n", vfmt.fmt.pix.priv); break; - case V4L2_BUF_TYPE_VIDEO_OUTPUT: - printf("\tType : %s\n", buftype2s(vfmt.type).c_str()); - printf("\tWidth/Height : %u/%u\n", vfmt.fmt.pix_out.width, vfmt.fmt.pix_out.height); - printf("\tPixel Format : %s\n", fcc2s(vfmt.fmt.pix_out.pixelformat).c_str()); - printf("\tField : %s\n", field2s(vfmt.fmt.pix_out.field).c_str()); - printf("\tBytes per Line: %u\n", vfmt.fmt.pix_out.bytesperline); - printf("\tSize Image : %u\n", vfmt.fmt.pix_out.sizeimage); - printf("\tColorspace : %s\n", colorspace2s(vfmt.fmt.pix_out.colorspace).c_str()); - printf("\tLeft/Top : %d/%d\n", vfmt.fmt.pix_out.left, vfmt.fmt.pix_out.top); - if (vfmt.fmt.pix_out.priv) - printf("\tCustom Info : %08x\n", vfmt.fmt.pix_out.priv); - break; case V4L2_BUF_TYPE_VIDEO_OUTPUT_OVERLAY: case V4L2_BUF_TYPE_VIDEO_OVERLAY: printf("\tType : %s\n", buftype2s(vfmt.type).c_str()); @@ -863,6 +860,8 @@ static std::string cap2s(unsigned cap) s += "\t\tSliced VBI Output\n"; if (cap & V4L2_CAP_RDS_CAPTURE) s += "\t\tRDS Capture\n"; + if (cap & V4L2_CAP_VIDEO_OUTPUT_POS) + s += "\t\tVideo Output Position\n"; if (cap & V4L2_CAP_TUNER) s += "\t\tTuner\n"; if (cap & V4L2_CAP_AUDIO) @@ -1159,20 +1158,23 @@ int main(int argc, char **argv) }; switch (parse_subopt(&subs, subopts, &value)) { +#if 0 + /* Comment out until ABI breakage is resolved */ case 0: - vfmt_out.fmt.pix_out.top = strtol(value, 0L, 0); + vfmt_out.fmt.pix.top = strtol(value, 0L, 0); set_fmts_out |= FmtTop; break; case 1: - vfmt_out.fmt.pix_out.left = strtol(value, 0L, 0); + vfmt_out.fmt.pix.left = strtol(value, 0L, 0); set_fmts_out |= FmtLeft; break; +#endif case 2: - vfmt_out.fmt.pix_out.width = strtol(value, 0L, 0); + vfmt_out.fmt.pix.width = strtol(value, 0L, 0); set_fmts_out |= FmtWidth; break; case 3: - vfmt_out.fmt.pix_out.height = strtol(value, 0L, 0); + vfmt_out.fmt.pix.height = strtol(value, 0L, 0); set_fmts_out |= FmtHeight; break; } @@ -1556,14 +1558,17 @@ int main(int argc, char **argv) if (ioctl(fd, VIDIOC_G_FMT, &in_vfmt) < 0) fprintf(stderr, "ioctl: VIDIOC_G_FMT failed\n"); else { +#if 0 + /* Comment out until ABI breakage is resolved */ if (set_fmts_out & FmtTop) - in_vfmt.fmt.pix_out.top = vfmt_out.fmt.pix_out.top; + in_vfmt.fmt.pix.top = vfmt_out.fmt.pix.top; if (set_fmts_out & FmtLeft) - in_vfmt.fmt.pix_out.left = vfmt_out.fmt.pix_out.left; + in_vfmt.fmt.pix.left = vfmt_out.fmt.pix.left; +#endif if (set_fmts_out & FmtWidth) - in_vfmt.fmt.pix_out.width = vfmt_out.fmt.pix_out.width; + in_vfmt.fmt.pix.width = vfmt_out.fmt.pix.width; if (set_fmts_out & FmtHeight) - in_vfmt.fmt.pix_out.height = vfmt_out.fmt.pix_out.height; + in_vfmt.fmt.pix.height = vfmt_out.fmt.pix.height; if (ioctl(fd, VIDIOC_S_FMT, &in_vfmt) < 0) fprintf(stderr, "ioctl: VIDIOC_S_FMT failed\n"); } diff --git a/v4l2-apps/util/v4l2-dbg.cpp b/v4l2-apps/util/v4l2-dbg.cpp index 10c9a8927..6f373281e 100644 --- a/v4l2-apps/util/v4l2-dbg.cpp +++ b/v4l2-apps/util/v4l2-dbg.cpp @@ -160,6 +160,8 @@ static std::string cap2s(unsigned cap) s += "\t\tSliced VBI Output\n"; if (cap & V4L2_CAP_RDS_CAPTURE) s += "\t\tRDS Capture\n"; + if (cap & V4L2_CAP_VIDEO_OUTPUT_POS) + s += "\t\tVideo Output Position\n"; if (cap & V4L2_CAP_TUNER) s += "\t\tTuner\n"; if (cap & V4L2_CAP_AUDIO) |