summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2006-09-02 08:56:35 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2006-09-02 08:56:35 -0300
commitb2f8e95b7447058a7d2911c4adefeccd19daa036 (patch)
tree6aee52907389fa6243df72133e47ed0bc7ac7c70
parent22cae52e1c559233a22ba0d3c26b72678563e0cf (diff)
parent8f0e83410026fe17e678322dae788d75fb6cc03d (diff)
downloadmediapointer-dvb-s2-b2f8e95b7447058a7d2911c4adefeccd19daa036.tar.gz
mediapointer-dvb-s2-b2f8e95b7447058a7d2911c4adefeccd19daa036.tar.bz2
merge: http://linuxtv.org/hg/~tap/v4l-dvb
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c14
-rw-r--r--linux/drivers/media/video/saa7115.c6
-rw-r--r--linux/include/linux/videodev2.h2
-rw-r--r--linux/include/media/v4l2-common.h2
-rw-r--r--v4l2-apps/Makefile2
-rw-r--r--v4l2-apps/test/ioctl-test.c6
-rw-r--r--v4l2-apps/test/v4lgrab.c4
-rw-r--r--v4l2-apps/test/vbi-test.c6
-rw-r--r--v4l2-apps/util/v4l2-ctl.cpp177
9 files changed, 153 insertions, 66 deletions
diff --git a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
index 1e4be1e4e..3d3967d56 100644
--- a/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
+++ b/linux/drivers/media/video/pvrusb2/pvrusb2-v4l2.c
@@ -484,18 +484,18 @@ static int pvr2_v4l2_do_ioctl(struct inode *inode, struct file *file,
lmin = pvr2_ctrl_get_min(hcp);
lmax = pvr2_ctrl_get_max(hcp);
- if (h < lmin) {
- h = lmin;
- } else if (h > lmax) {
- h = lmax;
- }
- lmin = pvr2_ctrl_get_min(vcp);
- lmax = pvr2_ctrl_get_max(vcp);
if (w < lmin) {
w = lmin;
} else if (w > lmax) {
w = lmax;
}
+ lmin = pvr2_ctrl_get_min(vcp);
+ lmax = pvr2_ctrl_get_max(vcp);
+ if (h < lmin) {
+ h = lmin;
+ } else if (h > lmax) {
+ h = lmax;
+ }
memcpy(vf, &pvr_format[PVR_FORMAT_PIX],
sizeof(struct v4l2_format));
diff --git a/linux/drivers/media/video/saa7115.c b/linux/drivers/media/video/saa7115.c
index 31d9ee396..461b2fd68 100644
--- a/linux/drivers/media/video/saa7115.c
+++ b/linux/drivers/media/video/saa7115.c
@@ -1495,11 +1495,7 @@ static int saa711x_attach(struct i2c_adapter *adapter, int address, int kind)
saa711x_write(client, 0, 5);
chip_id = saa711x_read(client, 0) & 0x0f;
- if (chip_id < 3 && chip_id > 5) {
- v4l_dbg(1, debug, client, "saa7115 not found\n");
- kfree(client);
- return 0;
- }
+
snprintf(client->name, sizeof(client->name) - 1, "saa711%d",chip_id);
v4l_info(client, "saa711%d found (%s) @ 0x%x (%s)\n", chip_id, name, address << 1, adapter->name);
diff --git a/linux/include/linux/videodev2.h b/linux/include/linux/videodev2.h
index a2c663daf..906761fe2 100644
--- a/linux/include/linux/videodev2.h
+++ b/linux/include/linux/videodev2.h
@@ -1311,7 +1311,7 @@ struct v4l2_streamparm
#define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority)
#define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority)
#if 1 /*KEEP*/
-#define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap)
+#define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap)
#endif
#define VIDIOC_LOG_STATUS _IO ('V', 70)
#define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls)
diff --git a/linux/include/media/v4l2-common.h b/linux/include/media/v4l2-common.h
index b551f43cb..ce7df478d 100644
--- a/linux/include/media/v4l2-common.h
+++ b/linux/include/media/v4l2-common.h
@@ -179,7 +179,7 @@ enum v4l2_chip_ident {
#define VIDIOC_INT_S_STANDBY _IOW('d', 94, u32)
/* only implemented if CONFIG_VIDEO_ADV_DEBUG is defined */
-#define VIDIOC_INT_S_REGISTER _IOR ('d', 100, struct v4l2_register)
+#define VIDIOC_INT_S_REGISTER _IOW ('d', 100, struct v4l2_register)
#define VIDIOC_INT_G_REGISTER _IOWR('d', 101, struct v4l2_register)
/* Generic reset command. The argument selects which subsystems to reset.
diff --git a/v4l2-apps/Makefile b/v4l2-apps/Makefile
index fc7d21650..cd5a18ff4 100644
--- a/v4l2-apps/Makefile
+++ b/v4l2-apps/Makefile
@@ -4,5 +4,5 @@
all clean install:
$(MAKE) -C lib $@
- $(MAKE) -C test $@
$(MAKE) -C util $@
+ $(MAKE) -C test $@
diff --git a/v4l2-apps/test/ioctl-test.c b/v4l2-apps/test/ioctl-test.c
index 61659dc78..6d78ad0f8 100644
--- a/v4l2-apps/test/ioctl-test.c
+++ b/v4l2-apps/test/ioctl-test.c
@@ -54,6 +54,7 @@ union v4l_parms {
unsigned long l;
u32 u_32;
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* V4L1 structs */
struct vbi_format p_vbi_format;
struct video_audio p_video_audio;
@@ -71,6 +72,7 @@ union v4l_parms {
struct video_tuner p_video_tuner;
struct video_unit p_video_unit;
struct video_window p_video_window;
+#endif
/* V4L2 structs */
struct v4l2_audioout p_v4l2_audioout;
@@ -106,8 +108,8 @@ union v4l_parms {
/* All defined ioctls */
int ioctls[] = {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* V4L ioctls */
-
VIDIOCCAPTURE,/* int */
VIDIOCGAUDIO,/* struct video_audio */
VIDIOCGCAP,/* struct video_capability */
@@ -137,7 +139,7 @@ int ioctls[] = {
VIDIOCSWIN,/* struct video_window */
VIDIOCSWRITEMODE,/* int */
VIDIOCSYNC,/* int */
-
+#endif
/* V4L2 ioctls */
VIDIOC_CROPCAP,/* struct v4l2_cropcap */
diff --git a/v4l2-apps/test/v4lgrab.c b/v4l2-apps/test/v4lgrab.c
index c8d433c1d..07c50ef89 100644
--- a/v4l2-apps/test/v4lgrab.c
+++ b/v4l2-apps/test/v4lgrab.c
@@ -91,6 +91,7 @@ int get_brightness_adj(unsigned char *image, long size, int *brightness)
int main(int argc, char **argv)
{
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
int fd = open(FILE, O_RDONLY), f;
struct video_capability cap;
struct video_window win;
@@ -190,5 +191,8 @@ int main(int argc, char **argv)
}
close(fd);
+#else
+ fprintf(stderr, "V4L1 API is not configured!\n");
+#endif
return 0;
}
diff --git a/v4l2-apps/test/vbi-test.c b/v4l2-apps/test/vbi-test.c
index c1a141bff..febd86d43 100644
--- a/v4l2-apps/test/vbi-test.c
+++ b/v4l2-apps/test/vbi-test.c
@@ -29,8 +29,10 @@
/* All possible parameters used on v4l ioctls */
union v4l_parms {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* V4L1 structs */
struct vbi_format v1;
+#endif
/* V4L2 structs */
struct v4l2_format v2;
@@ -38,9 +40,11 @@ union v4l_parms {
/* All defined ioctls */
int ioctls[] = {
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* V4L ioctls */
VIDIOCGVBIFMT,/* struct vbi_format */
+#endif
/* V4L2 ioctls */
@@ -61,6 +65,7 @@ int main (void)
}
+#ifdef CONFIG_VIDEO_V4L1_COMPAT
/* V4L1 call */
memset(&p,0,sizeof(p));
ret=ioctl(fd,VIDIOCGVBIFMT, (void *) &p);
@@ -69,6 +74,7 @@ int main (void)
"sample_format=%d, start=%d/%d, count=%d/%d, flags=%d\n", ret,
p.v1.sampling_rate,p.v1.samples_per_line, p.v1.sample_format,
p.v1.start[0],p.v1.start[1],p.v1.count[0],p.v1.count[1],p.v1.flags);
+#endif
/* V4L2 call */
diff --git a/v4l2-apps/util/v4l2-ctl.cpp b/v4l2-apps/util/v4l2-ctl.cpp
index bb7b4bd81..df886581d 100644
--- a/v4l2-apps/util/v4l2-ctl.cpp
+++ b/v4l2-apps/util/v4l2-ctl.cpp
@@ -99,6 +99,8 @@ enum Option {
OptSetVideoOutFormat,
OptGetSlicedVbiCap,
OptGetSlicedVbiOutCap,
+ OptGetVideoCrop,
+ OptSetVideoCrop,
OptLast = 256
};
@@ -136,6 +138,12 @@ static const flag_def service_def[] = {
#define FMTWidth (1L<<0)
#define FMTHeight (1L<<1)
+/* crop specified */
+#define CropWidth (1L<<0)
+#define CropHeight (1L<<1)
+#define CropLeft (1L<<2)
+#define CropTop (1L<<3)
+
static struct option long_options[] = {
{"list-audio-inputs", no_argument, 0, OptListAudioInputs},
{"list-audio-outputs", no_argument, 0, OptListAudioOutputs},
@@ -181,6 +189,8 @@ static struct option long_options[] = {
{"get-fmt-vbi-out", no_argument, 0, OptGetVbiOutFormat},
{"get-sliced-vbi-cap", no_argument, 0, OptGetSlicedVbiCap},
{"get-sliced-vbi-out-cap", no_argument, 0, OptGetSlicedVbiOutCap},
+ {"get-crop-video", no_argument, 0, OptGetVideoCrop},
+ {"set-crop-video", required_argument, 0, OptSetVideoCrop},
{0, 0, 0, 0}
};
@@ -245,12 +255,16 @@ static void usage(void)
printf(" set the video output format [VIDIOC_S_FMT]\n");
printf(" --get-fmt-overlay\n");
printf(" query the video overlay format [VIDIOC_G_FMT]\n");
+ printf(" --get-crop-video\n");
+ printf(" query the video capture crop window [VIDIOC_G_CROP]\n");
+ printf(" --set-crop-video=top=<x>,left=<y>,width=<w>,height=<h>\n");
+ printf(" set the video capture crop window [VIDIOC_S_CROP]\n");
printf(" --get-sliced-vbi-cap\n");
- printf(" query the sliced VBI capture capabilities [VIDIOC_G_SLICED_VBI_CAP]\n");
+ printf(" query the sliced VBI capture capabilities [VIDIOC_G_SLICED_VBI_CAP]\n");
printf(" --get-sliced-vbi-out-cap\n");
- printf(" query the sliced VBI output capabilities [VIDIOC_G_SLICED_VBI_CAP]\n");
+ printf(" query the sliced VBI output capabilities [VIDIOC_G_SLICED_VBI_CAP]\n");
printf(" --get-fmt-sliced-vbi\n");
- printf(" query the sliced VBI capture format [VIDIOC_G_FMT]\n");
+ printf(" query the sliced VBI capture format [VIDIOC_G_FMT]\n");
printf(" --set-fmt-sliced-vbi=<mode>\n");
printf(" set the sliced VBI capture format to <mode> [VIDIOC_S_FMT]\n");
printf(" <mode> is a comma separated list of:\n");
@@ -260,7 +274,7 @@ static void usage(void)
printf(" wss: widescreen signal (PAL/SECAM)\n");
printf(" vps: VPS (PAL/SECAM)\n");
printf(" --get-fmt-sliced-vbi-out\n");
- printf(" query the sliced VBI output format [VIDIOC_G_FMT]\n");
+ printf(" query the sliced VBI output format [VIDIOC_G_FMT]\n");
printf(" --set-fmt-sliced-vbi-out=<mode>\n");
printf(" set the sliced VBI output format to <mode> [VIDIOC_S_FMT]\n");
printf(" <mode> is a comma separated list of:\n");
@@ -388,7 +402,7 @@ static std::string flags2s(unsigned val, const flag_def *def)
static void print_sliced_vbi_cap(struct v4l2_sliced_vbi_cap &cap)
{
// printf("\tType : %s\n", buftype2s(vfmt.type).c_str());
- printf("\tService Set : %s\n",
+ printf("\tService Set : %s\n",
flags2s(cap.service_set, service_def).c_str());
for (int i = 0; i < 24; i++) {
printf("\tService Line %2d: %8s / %-8s\n", i,
@@ -550,6 +564,12 @@ static void find_controls(int fd)
}
}
+static void printcrop(const struct v4l2_crop &crop)
+{
+ printf("Crop: Left %d, Top %d, Width %d, Height %d\n",
+ crop.c.left, crop.c.top, crop.c.width, crop.c.height);
+}
+
static int printfmt(struct v4l2_format vfmt)
{
const flag_def vbi_def[] = {
@@ -575,9 +595,9 @@ static int printfmt(struct v4l2_format vfmt)
case V4L2_BUF_TYPE_VIDEO_OVERLAY:
printf("\tType : %s\n", buftype2s(vfmt.type).c_str());
printf("\tLeft/Top : %d/%d\n",
- vfmt.fmt.win.w.left, vfmt.fmt.win.w.top);
+ vfmt.fmt.win.w.left, vfmt.fmt.win.w.top);
printf("\tWidth/Height: %d/%d\n",
- vfmt.fmt.win.w.width, vfmt.fmt.win.w.height);
+ vfmt.fmt.win.w.width, vfmt.fmt.win.w.height);
printf("\tField : %s\n", field2s(vfmt.fmt.win.field).c_str());
// TODO: check G_FBUF capabilities
printf("\tChroma Key : %08x\n", vfmt.fmt.win.chromakey);
@@ -588,8 +608,8 @@ static int printfmt(struct v4l2_format vfmt)
printf("\tType : %s\n", buftype2s(vfmt.type).c_str());
printf("\tSampling Rate : %u Hz\n", vfmt.fmt.vbi.sampling_rate);
printf("\tOffset : %u samples (%g secs after leading edge)\n",
- vfmt.fmt.vbi.offset,
- (double)vfmt.fmt.vbi.offset / (double)vfmt.fmt.vbi.sampling_rate);
+ vfmt.fmt.vbi.offset,
+ (double)vfmt.fmt.vbi.offset / (double)vfmt.fmt.vbi.sampling_rate);
printf("\tSamples per Line: %u\n", vfmt.fmt.vbi.samples_per_line);
printf("\tSample Format : %s\n", fcc2s(vfmt.fmt.vbi.sample_format).c_str());
printf("\tStart 1st Field : %u\n", vfmt.fmt.vbi.start[0]);
@@ -602,7 +622,7 @@ static int printfmt(struct v4l2_format vfmt)
case V4L2_BUF_TYPE_SLICED_VBI_CAPTURE:
case V4L2_BUF_TYPE_SLICED_VBI_OUTPUT:
printf("\tType : %s\n", buftype2s(vfmt.type).c_str());
- printf("\tService Set : %s\n",
+ printf("\tService Set : %s\n",
flags2s(vfmt.fmt.sliced.service_set, service_def).c_str());
for (int i = 0; i < 24; i++) {
printf("\tService Line %2d: %8s / %-8s\n", i,
@@ -890,6 +910,7 @@ int main(int argc, char **argv)
/* bitfield for fmts */
unsigned int set_fmts = 0;
unsigned int set_fmts_out = 0;
+ unsigned int set_crop = 0;
int mode = V4L2_TUNER_MODE_STEREO; /* set audio mode */
@@ -908,6 +929,7 @@ int main(int argc, char **argv)
struct v4l2_output vout; /* list_outputs */
struct v4l2_audio vaudio; /* list audio inputs */
struct v4l2_audioout vaudout; /* audio outputs */
+ struct v4l2_rect vcrop; /* crop rect */
int input; /* set_input/get_input */
int output; /* set_output/get_output */
v4l2_std_id std; /* get_std/set_std */
@@ -929,6 +951,7 @@ int main(int argc, char **argv)
memset(&vout, 0, sizeof(vout));
memset(&vaudio, 0, sizeof(vaudio));
memset(&vaudout, 0, sizeof(vaudout));
+ memset(&vcrop, 0, sizeof(vcrop));
memset(&vf, 0, sizeof(vf));
memset(&vs, 0, sizeof(vs));
@@ -1007,6 +1030,37 @@ int main(int argc, char **argv)
}
}
break;
+ case OptSetVideoCrop:
+ subs = optarg;
+ while (*subs != '\0') {
+ static char *const subopts[] = {
+ "left",
+ "top",
+ "width",
+ "height",
+ NULL
+ };
+
+ switch (parse_subopt(&subs, subopts, &value)) {
+ case 0:
+ vcrop.left = strtol(value, 0L, 0);
+ set_crop |= CropLeft;
+ break;
+ case 1:
+ vcrop.top = strtol(value, 0L, 0);
+ set_crop |= CropTop;
+ break;
+ case 2:
+ vcrop.width = strtol(value, 0L, 0);
+ set_crop |= CropWidth;
+ break;
+ case 3:
+ vcrop.height = strtol(value, 0L, 0);
+ set_crop |= CropHeight;
+ break;
+ }
+ }
+ break;
case OptSetInput:
input = strtol(optarg, 0L, 0);
break;
@@ -1182,6 +1236,7 @@ int main(int argc, char **argv)
if (options[OptAll]) {
options[OptGetVideoFormat] = 1;
+ options[OptGetVideoCrop] = 1;
options[OptGetVideoOutFormat] = 1;
options[OptGetDriverInfo] = 1;
options[OptGetInput] = 1;
@@ -1267,7 +1322,7 @@ int main(int argc, char **argv)
if (doioctl(fd, VIDIOC_S_AUDOUT, &vaudout, "VIDIOC_S_AUDOUT") == 0)
printf("Audio output set to %d\n", vaudout.index);
}
-
+
if (options[OptSetTuner]) {
struct v4l2_tuner vt;
@@ -1293,9 +1348,6 @@ int main(int argc, char **argv)
in_vfmt.fmt.pix.height = vfmt.fmt.pix.height;
if (ioctl(fd, VIDIOC_S_FMT, &in_vfmt) < 0)
fprintf(stderr, "ioctl: VIDIOC_S_FMT failed\n");
- vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
- if (ioctl(fd, VIDIOC_G_FMT, &vfmt) < 0)
- fprintf(stderr, "ioctl: VIDIOC_G_FMT failed\n");
}
}
@@ -1312,34 +1364,51 @@ int main(int argc, char **argv)
in_vfmt.fmt.pix.height = vfmt.fmt.pix.height;
if (ioctl(fd, VIDIOC_S_FMT, &in_vfmt) < 0)
fprintf(stderr, "ioctl: VIDIOC_S_FMT failed\n");
- vfmt_out.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
- if (ioctl(fd, VIDIOC_G_FMT, &vfmt_out) < 0)
- fprintf(stderr, "ioctl: VIDIOC_G_FMT failed\n");
}
}
-
+
if (options[OptSetSlicedVbiFormat]) {
- if (vbi_fmt.fmt.sliced.service_set == 0) {
- // switch to raw mode
- vbi_fmt.type = V4L2_BUF_TYPE_VBI_CAPTURE;
- if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt, "VIDIOC_G_FMT") == 0)
- doioctl(fd, VIDIOC_S_FMT, &vbi_fmt, "VIDIOC_S_FMT");
- } else {
- vbi_fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
- doioctl(fd, VIDIOC_S_FMT, &vbi_fmt, "VIDIOC_S_FMT");
- }
- }
-
+ if (vbi_fmt.fmt.sliced.service_set == 0) {
+ // switch to raw mode
+ vbi_fmt.type = V4L2_BUF_TYPE_VBI_CAPTURE;
+ if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt, "VIDIOC_G_FMT") == 0)
+ doioctl(fd, VIDIOC_S_FMT, &vbi_fmt, "VIDIOC_S_FMT");
+ } else {
+ vbi_fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
+ doioctl(fd, VIDIOC_S_FMT, &vbi_fmt, "VIDIOC_S_FMT");
+ }
+ }
+
if (options[OptSetSlicedVbiOutFormat]) {
- if (vbi_fmt_out.fmt.sliced.service_set == 0) {
- // switch to raw mode
- vbi_fmt_out.type = V4L2_BUF_TYPE_VBI_OUTPUT;
- if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt_out, "VIDIOC_G_FMT") == 0)
- doioctl(fd, VIDIOC_S_FMT, &vbi_fmt_out, "VIDIOC_S_FMT");
- } else {
- vbi_fmt_out.type = V4L2_BUF_TYPE_SLICED_VBI_OUTPUT;
- doioctl(fd, VIDIOC_S_FMT, &vbi_fmt_out, "VIDIOC_S_FMT");
- }
+ if (vbi_fmt_out.fmt.sliced.service_set == 0) {
+ // switch to raw mode
+ vbi_fmt_out.type = V4L2_BUF_TYPE_VBI_OUTPUT;
+ if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt_out, "VIDIOC_G_FMT") == 0)
+ doioctl(fd, VIDIOC_S_FMT, &vbi_fmt_out, "VIDIOC_S_FMT");
+ } else {
+ vbi_fmt_out.type = V4L2_BUF_TYPE_SLICED_VBI_OUTPUT;
+ doioctl(fd, VIDIOC_S_FMT, &vbi_fmt_out, "VIDIOC_S_FMT");
+ }
+ }
+
+ if (options[OptSetVideoCrop]) {
+ struct v4l2_crop in_crop;
+ printf("ioctl: VIDIOC_S_CROP\n");
+ in_crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (ioctl(fd, VIDIOC_G_CROP, &in_crop) < 0)
+ fprintf(stderr, "ioctl: VIDIOC_G_CROP failed\n");
+ else {
+ if (set_crop & CropWidth)
+ in_crop.c.width = vcrop.width;
+ if (set_crop & CropHeight)
+ in_crop.c.height = vcrop.height;
+ if (set_crop & CropLeft)
+ in_crop.c.left = vcrop.left;
+ if (set_crop & CropTop)
+ in_crop.c.top = vcrop.top;
+ if (ioctl(fd, VIDIOC_S_CROP, &in_crop) < 0)
+ fprintf(stderr, "ioctl: VIDIOC_S_CROP failed\n");
+ }
}
if (options[OptSetCtrl] && !set_ctrls.empty()) {
@@ -1384,7 +1453,7 @@ int main(int argc, char **argv)
}
}
}
-
+
/* Get options */
if (options[OptGetVideoFormat]) {
@@ -1411,17 +1480,17 @@ int main(int argc, char **argv)
}
if (options[OptGetSlicedVbiFormat]) {
- vbi_fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
- if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt,
+ vbi_fmt.type = V4L2_BUF_TYPE_SLICED_VBI_CAPTURE;
+ if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt,
"VIDIOC_G_FMT") == 0)
if (printfmt(vbi_fmt) != 0)
fprintf(stderr,
"error printing result\n");
}
-
+
if (options[OptGetSlicedVbiOutFormat]) {
- vbi_fmt_out.type = V4L2_BUF_TYPE_SLICED_VBI_OUTPUT;
- if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt_out,
+ vbi_fmt_out.type = V4L2_BUF_TYPE_SLICED_VBI_OUTPUT;
+ if (doioctl(fd, VIDIOC_G_FMT, &vbi_fmt_out,
"VIDIOC_G_FMT") == 0)
if (printfmt(vbi_fmt_out) != 0)
fprintf(stderr,
@@ -1429,23 +1498,31 @@ int main(int argc, char **argv)
}
if (options[OptGetVbiFormat]) {
- raw_fmt.type = V4L2_BUF_TYPE_VBI_CAPTURE;
- if (doioctl(fd, VIDIOC_G_FMT, &raw_fmt,
+ raw_fmt.type = V4L2_BUF_TYPE_VBI_CAPTURE;
+ if (doioctl(fd, VIDIOC_G_FMT, &raw_fmt,
"VIDIOC_G_FMT") == 0)
if (printfmt(raw_fmt) != 0)
fprintf(stderr,
"error printing result\n");
}
-
+
if (options[OptGetVbiOutFormat]) {
- raw_fmt_out.type = V4L2_BUF_TYPE_VBI_OUTPUT;
- if (doioctl(fd, VIDIOC_G_FMT, &raw_fmt_out,
+ raw_fmt_out.type = V4L2_BUF_TYPE_VBI_OUTPUT;
+ if (doioctl(fd, VIDIOC_G_FMT, &raw_fmt_out,
"VIDIOC_G_FMT") == 0)
if (printfmt(raw_fmt_out) != 0)
fprintf(stderr,
"error printing result\n");
}
+ if (options[OptGetVideoCrop]) {
+ struct v4l2_crop crop;
+
+ crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ if (doioctl(fd, VIDIOC_G_CROP, &crop, "VIDIOC_G_CROP") == 0)
+ printcrop(crop);
+ }
+
if (options[OptGetInput]) {
if (doioctl(fd, VIDIOC_G_INPUT, &input, "VIDIOC_G_INPUT") == 0) {
printf("Video input : %d", input);
@@ -1700,6 +1777,7 @@ int main(int argc, char **argv)
if (options[OptGetSlicedVbiCap]) {
struct v4l2_sliced_vbi_cap cap;
+ cap.type = V4L2_BUF_TYPE_VBI_CAPTURE;
if (doioctl(fd, VIDIOC_G_SLICED_VBI_CAP, &cap, "VIDIOC_G_SLICED_VBI_CAP") == 0) {
print_sliced_vbi_cap(cap);
}
@@ -1708,6 +1786,7 @@ int main(int argc, char **argv)
if (options[OptGetSlicedVbiOutCap]) {
struct v4l2_sliced_vbi_cap cap;
+ cap.type = V4L2_BUF_TYPE_VBI_OUTPUT;
if (doioctl(fd, VIDIOC_G_SLICED_VBI_CAP, &cap, "VIDIOC_G_SLICED_VBI_CAP") == 0) {
print_sliced_vbi_cap(cap);
}