]> git.pld-linux.org Git - packages/camorama.git/blob - libv4l.patch
- updated to 0.20.7 from linuxtv.org fork
[packages/camorama.git] / libv4l.patch
1 --- camorama-0.19/src/Makefile.am       2007-09-16 14:48:05.000000000 +0200
2 +++ camorama-0.19.new/src/Makefile.am   2009-06-24 15:01:37.000000000 +0200
3 @@ -36,7 +36,7 @@
4         filter.h        \
5         $(BUILT_SOURCES)\
6         $(NULL)
7 -camorama_LDADD = $(PACKAGE_LIBS)
8 +camorama_LDADD = $(PACKAGE_LIBS) -lv4l1
9  
10  DISTCLEANFILES=$(BUILT_SOURCES)
11  
12 --- camorama-0.19/src/Makefile.in       2007-10-06 21:06:28.000000000 +0200
13 +++ camorama-0.19.new/src/Makefile.in   2009-06-24 15:01:50.000000000 +0200
14 @@ -248,7 +248,7 @@
15         $(BUILT_SOURCES)\
16         $(NULL)
17  
18 -camorama_LDADD = $(PACKAGE_LIBS)
19 +camorama_LDADD = $(PACKAGE_LIBS) -lv4l1
20  DISTCLEANFILES = $(BUILT_SOURCES)
21  all: $(BUILT_SOURCES)
22         $(MAKE) $(AM_MAKEFLAGS) all-am
23 --- camorama-0.19/src/callbacks.c       2009-06-24 15:01:55.000000000 +0200
24 +++ camorama-0.19.new/src/callbacks.c   2009-06-24 14:55:42.000000000 +0200
25 @@ -9,6 +9,7 @@
26  #include <libgnomeui/gnome-propertybox.h>
27  #include <libgnomeui/gnome-window-icon.h>
28  #include <pthread.h>
29 +#include <libv4l1.h>
30  
31  extern GtkWidget *main_window, *prefswindow;
32  //extern state func_state;
33 @@ -390,7 +391,7 @@
34  
35      /*
36       * if(cam->read == FALSE) {
37 -     *  cam->pic = mmap(0, cam->vid_buf.size, PROT_READ | PROT_WRITE, MAP_SHARED, cam->dev, 0);
38 +     *  cam->pic = v4l1_mmap(0, cam->vid_buf.size, PROT_READ | PROT_WRITE, MAP_SHARED, cam->dev, 0);
39       *  
40       *  if((unsigned char *) -1 == (unsigned char *) cam->pic) {
41       *   if(cam->debug == TRUE) {
42 @@ -401,7 +402,7 @@
43       *  }
44       *  }else{
45       *   cam->pic_buf = malloc(cam->x * cam->y * cam->depth);
46 -     *   read(cam->dev,cam->pic,(cam->x * cam->y * 3));
47 +     *   v4l1_read(cam->dev,cam->pic,(cam->x * cam->y * 3));
48       *  } 
49       */
50  
51 @@ -427,7 +428,7 @@
52       * if(cam->read == FALSE) {
53       * * for(frame = 0; frame < cam->vid_buf.frames; frame++) {
54       * * cam->vid_map.frame = frame;
55 -     * * if(ioctl(cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
56 +     * * if(v4l1_ioctl(cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
57       * * if(cam->debug == TRUE) {
58       * * fprintf(stderr, "Unable to capture image (VIDIOCMCAPTURE) during resize.\n");
59       * * }
60 @@ -547,7 +548,7 @@
61      int i, count = 0;
62      GdkGC *gc;
63  
64 -    read (cam->dev, cam->pic, (cam->x * cam->y * 3));
65 +    v4l1_read (cam->dev, cam->pic, (cam->x * cam->y * 3));
66      frames2++;
67      /*
68       * update_rec.x = 0;
69 @@ -588,7 +589,7 @@
70  
71      i = -1;
72      while (i < 0) {
73 -        i = ioctl (cam->dev, VIDIOCSYNC, &frame);
74 +        i = v4l1_ioctl (cam->dev, VIDIOCSYNC, &frame);
75  
76          if (i < 0 && errno == EINTR) {
77              if (cam->debug == TRUE) {
78 @@ -630,7 +631,7 @@
79                                  0, cam->x, cam->y);
80  
81      cam->vid_map.frame = frame;
82 -    if (ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
83 +    if (v4l1_ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
84          if (cam->debug == TRUE) {
85              fprintf (stderr, "Unable to capture image (VIDIOCMCAPTURE)\n");
86          }
87 @@ -677,7 +678,7 @@
88  void init_cam (GtkWidget * capture, cam * cam)
89  {
90      cam->pic =
91 -        mmap (0, cam->vid_buf.size, PROT_READ | PROT_WRITE,
92 +        v4l1_mmap (0, cam->vid_buf.size, PROT_READ | PROT_WRITE,
93                MAP_SHARED, cam->dev, 0);
94  
95      if ((unsigned char *) -1 == (unsigned char *) cam->pic) {
96 @@ -692,7 +693,7 @@
97      cam->vid_map.format = cam->vid_pic.palette;
98      for (frame = 0; frame < cam->vid_buf.frames; frame++) {
99          cam->vid_map.frame = frame;
100 -        if (ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
101 +        if (v4l1_ioctl (cam->dev, VIDIOCMCAPTURE, &cam->vid_map) < 0) {
102              if (cam->debug == TRUE) {
103                  fprintf (stderr,
104                           "Unable to capture image (VIDIOCMCAPTURE).\n");
105 --- camorama-0.19/src/main.c    2009-06-24 15:01:55.000000000 +0200
106 +++ camorama-0.19.new/src/main.c        2009-06-24 14:59:35.000000000 +0200
107 @@ -9,6 +9,7 @@
108  #include <gdk-pixbuf-xlib/gdk-pixbuf-xlib.h>
109  #include <gdk-pixbuf-xlib/gdk-pixbuf-xlibrgb.h>
110  #include <locale.h>
111 +#include <libv4l1.h>
112  
113  #include "camorama-display.h"
114  #include "camorama-stock-items.h"
115 @@ -206,7 +207,7 @@
116      gdk_pixbuf_xlib_init (display, 0);
117      cam->desk_depth = xlib_rgb_get_depth ();
118  
119 -    cam->dev = open (cam->video_dev, O_RDWR);
120 +    cam->dev = v4l1_open (cam->video_dev, O_RDWR);
121  
122      camera_cap (cam);
123      get_win_info (cam);
124 @@ -284,5 +285,8 @@
125  
126      gtk_timeout_add (2000, (GSourceFunc) fps, cam->status);
127      gtk_main ();
128 +    v4l1_munmap(cam->pic, cam->vid_buf.size);
129 +    v4l1_close(cam->dev);
130 +    
131      return 0;
132  }
133 --- camorama-0.19/src/v4l.c     2009-06-24 15:01:55.000000000 +0200
134 +++ camorama-0.19.new/src/v4l.c 2009-06-24 14:54:09.000000000 +0200
135 @@ -2,6 +2,7 @@
136  #include<time.h>
137  #include<errno.h>
138  #include<gnome.h>
139 +#include <libv4l1.h>
140  #include "support.h"
141  
142  extern int frame_number;
143 @@ -87,7 +88,7 @@
144  void camera_cap(cam * cam)
145  {
146     char *msg;
147 -   if(ioctl(cam->dev, VIDIOCGCAP, &cam->vid_cap) == -1) {
148 +   if(v4l1_ioctl(cam->dev, VIDIOCGCAP, &cam->vid_cap) == -1) {
149        if(cam->debug == TRUE) {
150           fprintf(stderr, "VIDIOCGCAP  --  could not get camera capabilities, exiting.....\n");
151        }
152 @@ -161,7 +162,7 @@
153         cam->vid_pic.palette = VIDEO_PALETTE_RGB24;
154         cam->vid_pic.depth = 24;
155         //cam->vid_pic.palette = VIDEO_PALETTE_YUV420P;
156 -       if(ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) {
157 +       if(v4l1_ioctl(cam->dev, VIDIOCSPICT, &cam->vid_pic) == -1) {
158                 if(cam->debug) {
159                         g_message("VIDIOCSPICT  --  could not set picture info, exiting....");
160                 }
161 @@ -176,7 +177,7 @@
162  //set_pic_info(cam);
163     char *msg;
164         
165 -   if(ioctl(cam->dev, VIDIOCGPICT, &cam->vid_pic) == -1) {
166 +   if(v4l1_ioctl(cam->dev, VIDIOCGPICT, &cam->vid_pic) == -1) {
167        msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
168        error_dialog(msg);
169        if(cam->debug == TRUE) {
170 @@ -201,7 +202,7 @@
171  void get_win_info(cam * cam)
172  {
173     gchar *msg;
174 -   if(ioctl(cam->dev, VIDIOCGWIN, &cam->vid_win) == -1) {
175 +   if(v4l1_ioctl(cam->dev, VIDIOCGWIN, &cam->vid_win) == -1) {
176        msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
177        error_dialog(msg);
178        if(cam->debug == TRUE) {
179 @@ -222,7 +223,7 @@
180  void set_win_info(cam * cam)
181  {
182     gchar *msg;
183 -   if(ioctl(cam->dev, VIDIOCSWIN, &cam->vid_win) == -1) {
184 +   if(v4l1_ioctl(cam->dev, VIDIOCSWIN, &cam->vid_win) == -1) {
185        msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
186        error_dialog(msg);
187        if(cam->debug == TRUE) {
188 @@ -239,7 +240,7 @@
189  void set_buffer(cam * cam)
190  {
191     char *msg;
192 -   if(ioctl(cam->dev, VIDIOCGMBUF, &cam->vid_buf) == -1) {
193 +   if(v4l1_ioctl(cam->dev, VIDIOCGMBUF, &cam->vid_buf) == -1) {
194        msg = g_strdup_printf(_("Could not connect to video device (%s).\nPlease check connection."), cam->video_dev);
195        error_dialog(msg);
196        if(cam->debug == TRUE) {
This page took 0.102574 seconds and 3 git commands to generate.