videograb : first step

This commit is contained in:
2019-05-25 16:16:24 +02:00
parent f0f8daa0fb
commit c054054ee5
5 changed files with 355 additions and 9 deletions

View File

@@ -8,10 +8,26 @@
#include <math.h>
#include <string.h>
#include "funcs.h"
#include "floatimg.h"
int verbosity;
/* --------------------------------------------------------------------- */
int essai(char *dev, int k)
{
int vfd, foo;
fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k);
vfd = open_device(dev);
fprintf(stderr, "\topen %s -> %d\n", dev, vfd);
foo = init_device(0);
fprintf(stderr, "\tinit -> %d\n", foo);
return k;
}
/* --------------------------------------------------------------------- */
void help(int k)
{
@@ -23,16 +39,16 @@ puts("\t-v\tincrease verbosity");
exit(0);
}
/* --------------------------------------------------------------------- */
int main(int argc, char *argv[])
{
int foo, opt;
int W = 800, H = 600;
double tb;
char *device = "/dev/video0";
int K = 0;
while ((opt = getopt(argc, argv, "hK:v")) != -1) {
while ((opt = getopt(argc, argv, "d:hK:v")) != -1) {
switch(opt) {
case 'd': device = optarg; break;
case 'h': help(0); break;
case 'K': K = atol(optarg); break;
case 'v': verbosity++; break;
@@ -41,6 +57,9 @@ while ((opt = getopt(argc, argv, "hK:v")) != -1) {
if (verbosity) fimg_print_version(0);
foo = essai(device, K);
fprintf(stderr, "\tessai -> %d\n", foo);
return 0;
}
/* --------------------------------------------------------------------- */