This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/v4l-utils.git tree:

Subject: v4lgrab/vbi-test: remove these utilities
Author:  Hans Verkuil <[email protected]>
Date:    Mon Jun 23 09:32:06 2014 +0200

v4lgrab doesn't work anymore since the v4l1 compat layer has been
removed a long time ago.

vbi-test has been replaced by v4l2-ctl --get-fmt-vbi and serves no good
purpose anymore.

Signed-off-by: Hans Verkuil <[email protected]>

 contrib/test/.gitignore  |    2 -
 contrib/test/Makefile.am |    6 --
 contrib/test/v4lgrab.c   |  203 ----------------------------------------------
 contrib/test/vbi-test.c  |   98 ----------------------
 4 files changed, 0 insertions(+), 309 deletions(-)

---

http://git.linuxtv.org/v4l-utils.git?a=commitdiff;h=c8109436804a721411a39452dd47b29115c1c507

diff --git a/contrib/test/.gitignore b/contrib/test/.gitignore
index 8c3f834..2e68b9e 100644
--- a/contrib/test/.gitignore
+++ b/contrib/test/.gitignore
@@ -7,5 +7,3 @@ sliced-vbi-test
 stress-buffer
 v4l2gl
 v4l2grab
-v4lgrab
-vbi-test
diff --git a/contrib/test/Makefile.am b/contrib/test/Makefile.am
index 80c7665..4ccb5ed 100644
--- a/contrib/test/Makefile.am
+++ b/contrib/test/Makefile.am
@@ -2,8 +2,6 @@ noinst_PROGRAMS = \
        ioctl-test              \
        sliced-vbi-test         \
        sliced-vbi-detect       \
-       vbi-test                \
-       v4lgrab                 \
        v4l2grab                \
        driver-test             \
        stress-buffer           \
@@ -37,10 +35,6 @@ sliced_vbi_test_SOURCES = sliced-vbi-test.c
 
 sliced_vbi_detect_SOURCES = sliced-vbi-detect.c
 
-vbi_test_SOURCES = vbi-test.c
-
-v4lgrab_SOURCES = v4lgrab.c
-
 stress_buffer_SOURCES = stress-buffer.c
 
 capture_example_SOURCES = capture-example.c
diff --git a/contrib/test/v4lgrab.c b/contrib/test/v4lgrab.c
deleted file mode 100644
index 43f2216..0000000
--- a/contrib/test/v4lgrab.c
+++ /dev/null
@@ -1,203 +0,0 @@
-/* Simple Video4Linux image grabber. */
-/*
- *     Video4Linux Driver Test/Example Framegrabbing Program
- *
- *     Compile with:
- *             gcc -s -Wall -Wstrict-prototypes v4lgrab.c -o v4lgrab
- *      Use as:
- *              v4lgrab >image.ppm
- *
- *     Copyright (C) 1998-05-03, Phil Blundell <[email protected]>
- *      Copied from http://www.tazenda.demon.co.uk/phil/vgrabber.c
- *      with minor modifications (Dave Forrest, [email protected]).
- *
- * NOTE: This utility uses the old, discontinued V4L version 1 API.
- * It is kept here solely for the purposes of testing the libv4l1
- * compatibility layer, as the V4L1 API were removed on kernel 2.6.39.
- */
-
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <sys/ioctl.h>
-#include <stdlib.h>
-
-#include <linux/types.h>
-#include "../../lib/include/libv4l1-videodev.h"
-
-#define FILE "/dev/video0"
-
-/* Stole this from tvset.c */
-
-#define READ_VIDEO_PIXEL(buf, format, depth, r, g, b)                   \
-{                                                                       \
-       switch (format)                                                 \
-       {                                                               \
-               case VIDEO_PALETTE_GREY:                                \
-                       switch (depth)                                  \
-                       {                                               \
-                               case 4:                                 \
-                               case 6:                                 \
-                               case 8:                                 \
-                                       (r) = (g) = (b) = (*buf++ << 8);\
-                                       break;                          \
-                                                                       \
-                               case 16:                                \
-                                       (r) = (g) = (b) =               \
-                                       *((unsigned short *) buf);      \
-                                       buf += 2;                       \
-                                       break;                          \
-                       }                                               \
-                       break;                                          \
-                                                                       \
-                                                                       \
-               case VIDEO_PALETTE_RGB565:                              \
-               {                                                       \
-                       unsigned short tmp = *(unsigned short *)buf;    \
-                       (r) = tmp&0xF800;                               \
-                       (g) = (tmp<<5)&0xFC00;                          \
-                       (b) = (tmp<<11)&0xF800;                         \
-                       buf += 2;                                       \
-               }                                                       \
-               break;                                                  \
-                                                                       \
-               case VIDEO_PALETTE_RGB555:                              \
-                       (r) = (buf[0]&0xF8)<<8;                         \
-                       (g) = ((buf[0] << 5 | buf[1] >> 3)&0xF8)<<8;    \
-                       (b) = ((buf[1] << 2 ) & 0xF8)<<8;               \
-                       buf += 2;                                       \
-                       break;                                          \
-                                                                       \
-               case VIDEO_PALETTE_RGB24:                               \
-                       (r) = buf[0] << 8; (g) = buf[1] << 8;           \
-                       (b) = buf[2] << 8;                              \
-                       buf += 3;                                       \
-                       break;                                          \
-                                                                       \
-               default:                                                \
-                       fprintf(stderr,                                 \
-                               "Format %d not yet supported\n",        \
-                               format);                                \
-       }                                                               \
-}
-
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-static int get_brightness_adj(unsigned char *image, long size, int *brightness)
-{
-       long i, tot = 0;
-       for (i=0;i<size*3;i++)
-               tot += image[i];
-       *brightness = (128 - tot/(size*3))/3;
-       return !((tot/(size*3)) >= 126 && (tot/(size*3)) <= 130);
-}
-#endif
-
-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;
-       struct video_picture vpic;
-
-       unsigned char *buffer, *src;
-       int bpp = 24, r, g, b;
-       unsigned int i, src_depth;
-
-       if (fd < 0) {
-               perror(FILE);
-               exit(1);
-       }
-
-       if (ioctl(fd, VIDIOCGCAP, &cap) < 0) {
-               perror("VIDIOGCAP");
-               fprintf(stderr, "(" FILE " not a video4linux device?)\n");
-               close(fd);
-               exit(1);
-       }
-
-       if (ioctl(fd, VIDIOCGWIN, &win) < 0) {
-               perror("VIDIOCGWIN");
-               close(fd);
-               exit(1);
-       }
-
-       if (ioctl(fd, VIDIOCGPICT, &vpic) < 0) {
-               perror("VIDIOCGPICT");
-               close(fd);
-               exit(1);
-       }
-
-       if (cap.type & VID_TYPE_MONOCHROME) {
-               vpic.depth=8;
-               vpic.palette=VIDEO_PALETTE_GREY;    /* 8bit grey */
-               if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
-                       vpic.depth=6;
-                       if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
-                               vpic.depth=4;
-                               if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
-                                       fprintf(stderr, "Unable to find a 
supported capture format.\n");
-                                       close(fd);
-                                       exit(1);
-                               }
-                       }
-               }
-       }
-       else {
-               vpic.depth=24;
-               vpic.palette=VIDEO_PALETTE_RGB24;
-
-               if(ioctl(fd, VIDIOCSPICT, &vpic) < 0) {
-                       vpic.palette=VIDEO_PALETTE_RGB565;
-                       vpic.depth=16;
-
-                       if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
-                               vpic.palette=VIDEO_PALETTE_RGB555;
-                               vpic.depth=15;
-
-                               if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
-                                       fprintf(stderr, "Unable to find a 
supported capture format.\n");
-                                       return -1;
-                               }
-                       }
-               }
-       }
-
-       buffer = malloc(win.width * win.height * bpp);
-       if (!buffer) {
-               fprintf(stderr, "Out of memory.\n");
-               exit(1);
-       }
-
-       do {
-               int newbright;
-               read(fd, buffer, win.width * win.height * bpp);
-               f = get_brightness_adj(buffer, win.width * win.height, 
&newbright);
-               if (f) {
-                       vpic.brightness += (newbright << 8);
-                       if(ioctl(fd, VIDIOCSPICT, &vpic)==-1) {
-                               perror("VIDIOSPICT");
-                               break;
-                       }
-               }
-       } while (f);
-
-       fprintf(stdout, "P6\n%d %d 255\n", win.width, win.height);
-
-       src = buffer;
-
-       for (i = 0; i < win.width * win.height; i++) {
-               READ_VIDEO_PIXEL(src, vpic.palette, src_depth, r, g, b);
-               fputc(r>>8, stdout);
-               fputc(g>>8, stdout);
-               fputc(b>>8, stdout);
-       }
-
-       close(fd);
-#else
-       fprintf(stderr, "V4L1 API is not configured!\n");
-#endif
-       return 0;
-}
diff --git a/contrib/test/vbi-test.c b/contrib/test/vbi-test.c
deleted file mode 100644
index 0fa2a6d..0000000
--- a/contrib/test/vbi-test.c
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
-   v4l-ioctl-test - This small utility checks VBI format
-
-   Copyright (C) 2006 Mauro Carvalho Chehab <[email protected]>
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 2 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program; if not, write to the Free Software
-   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <fcntl.h>
-#include <linux/videodev2.h>
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-#include "../../lib/include/libv4l1-videodev.h"
-#endif
-
-/* 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;
-};
-
-/* All defined ioctls */
-int ioctls[] = {
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-       /* V4L ioctls */
-
-       VIDIOCGVBIFMT,/* struct vbi_format */
-#endif
-
-       /* V4L2 ioctls */
-
-       VIDIOC_G_FMT,/* struct v4l2_format */
-};
-#define S_IOCTLS sizeof(ioctls)/sizeof(ioctls[0])
-
-/********************************************************************/
-int main (void)
-{
-       int fd=0, ret=0;
-       char *device="/dev/video0";
-       union v4l_parms p;
-
-       if ((fd = open(device, O_RDONLY)) < 0) {
-               perror("Couldn't open video0");
-               return(-1);
-       }
-
-
-#ifdef CONFIG_VIDEO_V4L1_COMPAT
-       /* V4L1 call */
-       memset(&p,0,sizeof(p));
-       ret=ioctl(fd,VIDIOCGVBIFMT, (void *) &p);
-
-       printf ("V4L1 call: ret=%i: sampling_rate=%d, samples_per_line=%d, "
-               "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 */
-       memset(&p,0,sizeof(p));
-       p.v2.type=V4L2_BUF_TYPE_VBI_CAPTURE;
-       ret=ioctl(fd,VIDIOC_G_FMT, (void *) &p);
-
-       printf ("V4L2 call: ret=%i: sampling_rate=%d, samples_per_line=%d, "
-               "sample_format=%d, offset=%d, start=%d/%d, count=%d/%d\n", ret,
-               p.v2.fmt.vbi.sampling_rate,p.v2.fmt.vbi.samples_per_line,
-               p.v2.fmt.vbi.sample_format,p.v2.fmt.vbi.offset,
-               p.v2.fmt.vbi.start[0],p.v2.fmt.vbi.start[1],
-               p.v2.fmt.vbi.count[0],p.v2.fmt.vbi.count[1]);
-
-       close (fd);
-
-       return (0);
-}

_______________________________________________
linuxtv-commits mailing list
[email protected]
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to