Compare commits
No commits in common. "c74695d07e8f9c49f4882877f4e2a227e8f789e6" and "2e577897bc20a284bcf127b50c4bad7ae3063a38" have entirely different histories.
c74695d07e
...
2e577897bc
2
v4l2/t.c
2
v4l2/t.c
@ -8,7 +8,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
#include <inttypes.h>
|
|
||||||
#include <linux/videodev2.h>
|
#include <linux/videodev2.h>
|
||||||
|
|
||||||
#include "funcs.h"
|
#include "funcs.h"
|
||||||
|
@ -70,19 +70,6 @@ fprintf(FP, " capabilities 0x%X\n", ptr->capabilities);
|
|||||||
pr_capabilities(ptr->capabilities);
|
pr_capabilities(ptr->capabilities);
|
||||||
fprintf(FP, " device caps 0x%X\n", ptr->device_caps);
|
fprintf(FP, " device caps 0x%X\n", ptr->device_caps);
|
||||||
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
int pr_v4l2_fmtdesc(char *txt, struct v4l2_fmtdesc *ptr)
|
|
||||||
{
|
|
||||||
fprintf(FP, "-- v4l2_fmtdesc, %-15s %p\n", txt, ptr);
|
|
||||||
|
|
||||||
fprintf(FP, " index %d\n", ptr->index);
|
|
||||||
fprintf(FP, " type %d\n", ptr->type); /* enum v4l2_buf_type */
|
|
||||||
fprintf(FP, " flags 0x%X\n", ptr->flags);
|
|
||||||
fprintf(FP, " description %s\n", ptr->description);
|
|
||||||
fprintf(FP, " pixel format 0x%X\n", ptr->pixelformat); /* FOURCC */
|
|
||||||
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
|
@ -9,7 +9,6 @@ int pr_v4l2_capability(char *txt, struct v4l2_capability *ptr);
|
|||||||
int pr_v4l2_input(char *txt, struct v4l2_input *ptr);
|
int pr_v4l2_input(char *txt, struct v4l2_input *ptr);
|
||||||
int pr_v4l2_format(char *txt, struct v4l2_format *ptr);
|
int pr_v4l2_format(char *txt, struct v4l2_format *ptr);
|
||||||
int pr_v4l2_requestbuffers(char *txt, struct v4l2_requestbuffers *ptr);
|
int pr_v4l2_requestbuffers(char *txt, struct v4l2_requestbuffers *ptr);
|
||||||
int pr_v4l2_fmtdesc(char *txt, struct v4l2_fmtdesc *ptr);
|
|
||||||
|
|
||||||
char *str_input_type(int t);
|
char *str_input_type(int t);
|
||||||
char *str_ctrl_type(int type);
|
char *str_ctrl_type(int type);
|
||||||
|
@ -19,37 +19,6 @@
|
|||||||
|
|
||||||
int verbosity;
|
int verbosity;
|
||||||
|
|
||||||
/* --------------------------------------------------------------------- */
|
|
||||||
int enum_image_formats(int fd, char *txt, int k)
|
|
||||||
{
|
|
||||||
int foo, idx;
|
|
||||||
struct v4l2_fmtdesc fmtd;
|
|
||||||
|
|
||||||
printf("-- image formats enumeration (%s)\n", txt);
|
|
||||||
|
|
||||||
idx = 0;
|
|
||||||
for (;;) {
|
|
||||||
memset(&fmtd, 0, sizeof(fmtd));
|
|
||||||
fmtd.index = idx;
|
|
||||||
fmtd.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
|
||||||
|
|
||||||
foo = ioctl(fd, VIDIOC_ENUM_FMT, &fmtd);
|
|
||||||
// fprintf(stderr, "B idx=%d, foo=%d, errno=%d\n", idx, foo, errno);
|
|
||||||
if (foo) {
|
|
||||||
if (EINVAL==errno) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
perror(__func__);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pr_v4l2_fmtdesc(__func__, &fmtd);
|
|
||||||
|
|
||||||
idx++;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
static int enum_inputs(int fd, char *txt, int k)
|
static int enum_inputs(int fd, char *txt, int k)
|
||||||
{
|
{
|
||||||
@ -134,7 +103,7 @@ int enum_extended_controls(int fd, char *txt, int k)
|
|||||||
struct v4l2_queryctrl qctrl;
|
struct v4l2_queryctrl qctrl;
|
||||||
int idx;
|
int idx;
|
||||||
|
|
||||||
printf("-- extended controls enumeration '%s'\n", txt);
|
printf("-- controls enumeration '%s'\n", txt);
|
||||||
|
|
||||||
memset(&qctrl, 0, sizeof(qctrl));
|
memset(&qctrl, 0, sizeof(qctrl));
|
||||||
qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
|
qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
|
||||||
@ -155,7 +124,7 @@ while (0 == ioctl (fd, VIDIOC_QUERYCTRL, &qctrl)) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
/* --------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------- */
|
||||||
int show_webcam_infos(char *devname, char *title, int k)
|
int show_webcam_infos(char *devname, int k)
|
||||||
{
|
{
|
||||||
int vfd, foo;
|
int vfd, foo;
|
||||||
|
|
||||||
@ -193,9 +162,8 @@ if (-1 == ioctl(vfd, VIDIOC_ENUMINPUT, &input)) {
|
|||||||
}
|
}
|
||||||
pr_v4l2_input("input 0", &input);
|
pr_v4l2_input("input 0", &input);
|
||||||
|
|
||||||
foo = enum_inputs(vfd, "on peut voir quoi ?", 0);
|
foo = enum_inputs(vfd, "is that working ?", 0);
|
||||||
|
|
||||||
foo = enum_image_formats(vfd, "Experimental", 0);
|
|
||||||
|
|
||||||
fputs("--\n", stderr);
|
fputs("--\n", stderr);
|
||||||
foo = enum_controls(vfd, "is that working ?", 0);
|
foo = enum_controls(vfd, "is that working ?", 0);
|
||||||
@ -248,7 +216,7 @@ while ((opt = getopt(argc, argv, "d:hK:lv")) != -1) {
|
|||||||
|
|
||||||
if (verbosity) fimg_print_version(0);
|
if (verbosity) fimg_print_version(0);
|
||||||
|
|
||||||
foo = show_webcam_infos(device, "", K);
|
foo = show_webcam_infos(device, K);
|
||||||
fprintf(stderr, "\n\tshow_webcam_infos -> %d\n", foo);
|
fprintf(stderr, "\n\tshow_webcam_infos -> %d\n", foo);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user