Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 53660 Details for
Bug 76127
Gyach enhanced is a Yahoo Messenger linux client
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
gyacheupload-v4l_all_1.0.6.patch (update)
gyacheupload-v4l_all_1.0.6.patch (text/plain), 3.02 KB, created by
Natanael Copa
on 2005-03-16 14:51:36 UTC
(
hide
)
Description:
gyacheupload-v4l_all_1.0.6.patch (update)
Filename:
MIME Type:
Creator:
Natanael Copa
Created:
2005-03-16 14:51:36 UTC
Size:
3.02 KB
patch
obsolete
>--- gyach.orig/src/webcam/gyacheupload-v4l.c 2005-03-08 22:17:43.788677392 +0100 >+++ gyach/src/webcam/gyacheupload-v4l.c 2005-03-16 22:25:53.249133184 +0100 >@@ -56,6 +56,8 @@ > struct video_picture grab_pic; > struct video_capability grab_cap; > struct video_mmap grab_buf; >+ static struct video_mbuf mbuf; >+ > int grab_fd, grab_size; > unsigned char *grab_data; > char *pnm_buf=NULL; >@@ -66,7 +68,7 @@ > everybody else can update theirs from the config window */ > > int fix_color=1; >-int hue=47104, contrast=65280, brightness=65280, colour=17152; >+int hue=32767, contrast=32767, brightness=32767, colour=32767; > > unsigned char* grab_one(int *, int *); > int grab_init(); >@@ -106,7 +108,7 @@ > return; > } > >- current_pixbuf=gdk_pixbuf_new_from_data(grabit,GDK_COLORSPACE_RGB,FALSE,8,320,240,320*grab_pic.depth/8,NULL,NULL); >+ current_pixbuf=gdk_pixbuf_new_from_data(grabit,GDK_COLORSPACE_RGB,FALSE,8,x,y,x*grab_pic.depth/8,NULL,NULL); > > gtk_image_set_from_pixbuf(GTK_IMAGE(current_image), current_pixbuf); > gdk_pixbuf_unref(current_pixbuf); >@@ -163,6 +165,10 @@ > if (contrast > -1) grab_pic.contrast=contrast; > if (brightness > -1) grab_pic.brightness=brightness; > if (colour > -1) grab_pic.colour=colour; >+ /* hardcoded... */ >+ grab_pic.depth = 24; >+ grab_pic.palette = VIDEO_PALETTE_RGB24; >+ > if (ioctl(grab_fd, VIDIOCSPICT, &grab_pic) == -1) { > show_error_dialog("An error occurred at 'ioctl VIDIOCSPICT'.\nCould not set camera properties."); > return; >@@ -222,7 +228,27 @@ > grab_buf.width = x; > grab_buf.height = y; > grab_size = x * y * w; >- grab_data = mmap(0,grab_size,PROT_READ|PROT_WRITE,MAP_SHARED,grab_fd,0); >+ set_picture(); >+ >+ if (ioctl (grab_fd, VIDIOCGMBUF, &mbuf) < 0) { >+ show_error_dialog("An error occurred at 'ioctl VIDIOCGMBUF'."); >+ return 0; >+ } >+ printf("frames per capture: %i\n", mbuf.frames); >+ if ((grab_data = mmap(0, mbuf.size, PROT_READ|PROT_WRITE, MAP_SHARED, >+ grab_fd,0)) == MAP_FAILED) { >+ perror("mmap"); >+ show_error_dialog("An error occurred at 'mmap'."); >+ return 0; >+ } >+ >+ /* grab first frame */ >+ if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) { >+ show_error_dialog("An error occurred at 'ioctl VIDIOCMCAPTURE'."); >+ return 0; >+ } >+ if (mbuf.frames > 1) grab_buf.frame = 1 - grab_buf.frame; >+ > return(1); > } > >@@ -239,23 +265,20 @@ > unsigned char* grab_one(int *width, int *height) { > set_picture(); > >- for (;;) { > if (-1 == ioctl(grab_fd,VIDIOCMCAPTURE,&grab_buf)) { > show_error_dialog("An error occurred at 'ioctl VIDIOCMCAPTURE'."); > return NULL; >- } else { >+ } >+ >+ if (mbuf.frames > 1) grab_buf.frame = 1 - grab_buf.frame; > if (-1 == ioctl(grab_fd,VIDIOCSYNC,&grab_buf)) { > show_error_dialog("An error occurred at 'ioctl VIDIOCSYNC'."); > return NULL; >- } else { >- if (fix_color) {fix_colour(grab_data, x, y); } >+ } >+ if (fix_color) {fix_colour(grab_data + mbuf.offsets[grab_buf.frame], x, y); } > *width = grab_buf.width; > *height = grab_buf.height; >- return grab_data; >- } >- } >- >- } >+ return grab_data + mbuf.offsets[grab_buf.frame]; > } > >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 76127
:
51178
|
53246
|
53247
|
53248
|
53659
|
53660
|
54911
|
54914
|
55611
|
55612
|
55613
|
55628
|
55629
|
55630
|
55631
|
55698
|
55699
|
55700
|
55830
|
57052
|
57054
|
57684
|
60349
|
60350
|
60351
|
60353
|
62038