From 334cffce6055a1e4b4583240d3eea85889db6357 Mon Sep 17 00:00:00 2001 From: tth Date: Fri, 24 Jul 2020 14:04:54 +0200 Subject: [PATCH] added FITS support to grabvidseq --- .gitignore | 1 + v4l2/Makefile | 3 ++- v4l2/grabvidseq.c | 7 +++++-- v4l2/t.c | 4 ++-- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 8c9c9e9..548dcdd 100644 --- a/.gitignore +++ b/.gitignore @@ -40,6 +40,7 @@ v4l2/grabvidseq v4l2/*.o v4l2/*.ppm v4l2/*.png +v4l2/*.fits v4l2/video-infos v4l2/nc-camcontrol diff --git a/v4l2/Makefile b/v4l2/Makefile index 587d0cf..4cdfa28 100644 --- a/v4l2/Makefile +++ b/v4l2/Makefile @@ -19,7 +19,8 @@ v4l2_pr_structs.o: v4l2_pr_structs.c v4l2_pr_structs.h Makefile gcc ${COPT} -c $< grabvidseq: grabvidseq.c ${DEPS} rgb2fimg.o - gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lpnglite -lz -lm -lv4l2 -o $@ + gcc ${COPT} $< rgb2fimg.o ../libfloatimg.a -lpnglite -lz -lm \ + -lcfitsio -lv4l2 -o $@ video-infos: video-infos.c Makefile funcs.o v4l2_pr_structs.o gcc -Wall -g $< ${LOBJ} ../libfloatimg.a -o $@ diff --git a/v4l2/grabvidseq.c b/v4l2/grabvidseq.c index 98d9492..b8e334a 100644 --- a/v4l2/grabvidseq.c +++ b/v4l2/grabvidseq.c @@ -51,9 +51,9 @@ int verbosity; static void xioctl(int fh, int request, void *arg) { -int r; +int r; -do { +do { r = v4l2_ioctl(fh, request, arg); } while (r == -1 && ((errno == EINTR) || (errno == EAGAIN))); @@ -393,6 +393,9 @@ switch (foo) { case FILE_TYPE_PNG: foo = fimg_save_as_png(to_save, outfile, 0); break; + case FILE_TYPE_FITS: + foo = fimg_save_R_as_fits(to_save, outfile, 0); + break; default: fprintf(stderr, "can't save as %s\n", outfile); break; diff --git a/v4l2/t.c b/v4l2/t.c index 2edc5a6..ccb6349 100644 --- a/v4l2/t.c +++ b/v4l2/t.c @@ -22,9 +22,9 @@ int verbosity; /* --------------------------------------------------------------------- */ int essai_get_fmt(char *dev, int k) { -int vfd, idx, foo; +int vfd, foo; struct v4l2_format fmt; -struct v4l2_requestbuffers reqbuf; +// struct v4l2_requestbuffers reqbuf; fprintf(stderr, ">>> %s ( '%s' %d )\n", __func__, dev, k);