|
Lines 39-44
Link Here
|
| 39 |
#include <X11/extensions/XShm.h> |
39 |
#include <X11/extensions/XShm.h> |
| 40 |
#include <inttypes.h> |
40 |
#include <inttypes.h> |
| 41 |
#include <sys/time.h> |
41 |
#include <sys/time.h> |
|
|
42 |
#include <png.h> |
| 43 |
#include <setjmp.h> |
| 42 |
|
44 |
|
| 43 |
#include "vroot.h" |
45 |
#include "vroot.h" |
| 44 |
#include <sys/types.h> |
46 |
#include <sys/types.h> |
|
Lines 124-131
Link Here
|
| 124 |
tv_rate = tv_end; |
126 |
tv_rate = tv_end; |
| 125 |
} |
127 |
} |
| 126 |
|
128 |
|
| 127 |
#include <png.h> |
|
|
| 128 |
|
| 129 |
static char *overlay_luma = NULL; |
129 |
static char *overlay_luma = NULL; |
| 130 |
static char *overlay_alpha = NULL; |
130 |
static char *overlay_alpha = NULL; |
| 131 |
static int overlay_width; |
131 |
static int overlay_width; |
|
Lines 165-171
Link Here
|
| 165 |
unsigned char sig_buf [SIG_CHECK_SIZE]; |
165 |
unsigned char sig_buf [SIG_CHECK_SIZE]; |
| 166 |
png_struct *png_ptr; |
166 |
png_struct *png_ptr; |
| 167 |
png_info *info_ptr; |
167 |
png_info *info_ptr; |
| 168 |
png_byte **png_image; |
168 |
png_byte **png_image = NULL; |
| 169 |
int linesize, x, y; |
169 |
int linesize, x, y; |
| 170 |
unsigned char *p, *q; |
170 |
unsigned char *p, *q; |
| 171 |
|
171 |
|
|
Lines 183-188
Link Here
|
| 183 |
fprintf (stderr, "cannot allocate LIBPNG structure\n"); |
183 |
fprintf (stderr, "cannot allocate LIBPNG structure\n"); |
| 184 |
return; |
184 |
return; |
| 185 |
} |
185 |
} |
|
|
186 |
if (setjmp(png_jmpbuf(png_ptr))) { |
| 187 |
if (png_image) { |
| 188 |
for (y = 0 ; y < info_ptr->height ; y++) |
| 189 |
free (png_image[y]); |
| 190 |
free (png_image); |
| 191 |
} |
| 192 |
png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); |
| 193 |
perror("reading file"); |
| 194 |
return; |
| 195 |
} |
| 186 |
info_ptr = png_create_info_struct (png_ptr); |
196 |
info_ptr = png_create_info_struct (png_ptr); |
| 187 |
if (info_ptr == NULL) { |
197 |
if (info_ptr == NULL) { |
| 188 |
png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL); |
198 |
png_destroy_read_struct (&png_ptr, (png_infopp)NULL, (png_infopp)NULL); |
|
Lines 271-280
Link Here
|
| 271 |
for (y = 0 ; y < info_ptr->height ; y++) |
281 |
for (y = 0 ; y < info_ptr->height ; y++) |
| 272 |
free (png_image[y]); |
282 |
free (png_image[y]); |
| 273 |
free (png_image); |
283 |
free (png_image); |
| 274 |
png_read_destroy (png_ptr, info_ptr, (png_info *)0); |
284 |
png_destroy_read_struct (&png_ptr, &info_ptr, (png_infopp)NULL); |
| 275 |
free (png_ptr); |
|
|
| 276 |
free (info_ptr); |
| 277 |
|
| 278 |
} |
285 |
} |
| 279 |
|
286 |
|
| 280 |
static void overlay_read_ppm(FILE *fin) |
287 |
static void overlay_read_ppm(FILE *fin) |
|
Lines 535-540
Link Here
|
| 535 |
instance->corner_x = (w - instance->width)/2; |
542 |
instance->corner_x = (w - instance->width)/2; |
| 536 |
instance->corner_y = (h - instance->height)/2; |
543 |
instance->corner_y = (h - instance->height)/2; |
| 537 |
} else if (window_id == -1) { |
544 |
} else if (window_id == -1) { |
|
|
545 |
XTextProperty xname; |
| 546 |
char *nm = "Electric Sheep"; |
| 538 |
/* create a window the same size as the video */ |
547 |
/* create a window the same size as the video */ |
| 539 |
instance->window = |
548 |
instance->window = |
| 540 |
XCreateWindow (instance->display, |
549 |
XCreateWindow (instance->display, |
|
Lines 544-549
Link Here
|
| 544 |
InputOutput, instance->vinfo.visual, |
553 |
InputOutput, instance->vinfo.visual, |
| 545 |
(CWBackPixmap | CWBackingStore | CWBorderPixel | |
554 |
(CWBackPixmap | CWBackingStore | CWBorderPixel | |
| 546 |
CWEventMask | CWColormap), &attr); |
555 |
CWEventMask | CWColormap), &attr); |
|
|
556 |
XStringListToTextProperty(&nm, 1, &xname); |
| 557 |
XSetWMName(instance->display, instance->window, &xname); |
| 547 |
} else { |
558 |
} else { |
| 548 |
/* zoomed to fit the window specified on the command line */ |
559 |
/* zoomed to fit the window specified on the command line */ |
| 549 |
XWindowAttributes xgwa; |
560 |
XWindowAttributes xgwa; |