sauvageonnes

This commit is contained in:
2020-03-07 15:24:31 +01:00
parent 7e0f2f87dd
commit 9b8a30f0b7
5 changed files with 71 additions and 4 deletions

View File

@@ -2,8 +2,9 @@
COPT = -Wall -fpic -g -no-pie -DDEBUG_LEVEL=0
DEPS = ../floatimg.h ../libfloatimg.a Makefile
LOBJ = funcs.o v4l2_pr_structs.o
all: grabvidseq t video-infos
all: grabvidseq t video-infos nc-camcontrol
t: t.c Makefile ${DEPS} funcs.o v4l2_pr_structs.o
gcc ${COPT} $< funcs.o v4l2_pr_structs.o ../libfloatimg.a -o $@
@@ -21,8 +22,10 @@ grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o
gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lpnglite -lz -lm -lv4l2 -o $@
video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o
gcc -Wall -g $< funcs.o v4l2_pr_structs.o ../libfloatimg.a -o $@
gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -o $@
nc-camcontrol: nc-camcontrol.c Makefile funcs.o v4l2_pr_structs.o
gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -o $@
# ---------------
# external things

View File

@@ -88,6 +88,10 @@ if (-1 == fd) {
dev_name = strdup(device); /* XXX */
if (verbosity) {
fprintf(stderr, "device '%s' opened as #%d\n", device, fd);
}
return fd;
}
/* --------------------------------------------------------------------- */

55
v4l2/nc-camcontrol.c Normal file
View File

@@ -0,0 +1,55 @@
/*
* tests pour capturer les webcams
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <math.h>
#include <string.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <inttypes.h>
#include <linux/videodev2.h>
#include "../floatimg.h"
#include "v4l2_pr_structs.h"
#include "funcs.h"
int verbosity;
/* --------------------------------------------------------------------- */
void help(int n)
{
puts("camera controls");
puts("\t-d bla\t\tselect video device");
exit(0);
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo, opt;
int etype = 0;
char *device = "/dev/video0";
char *title = NULL;
int K = 0;
while ((opt = getopt(argc, argv, "d:e:hK:lT:v")) != -1) {
switch(opt) {
case 'd': device = optarg; break;
case 'e': etype = atol(optarg); break;
case 'h': help(0); break;
case 'K': K = atol(optarg); break;
// case 'l': liste_des_devices(0); break;
case 'v': verbosity++; break;
}
}
return 0;
}
/* --------------------------------------------------------------------- */