doorbell

diff doorbelld/src/main.c @ 7:dc4018af3a40

video broadcast with UDP. retarded amount of data, unusable.
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 16 Mar 2016 02:50:30 +0200
parents f21ae31ef0e7
children
line diff
     1.1 --- a/doorbelld/src/main.c	Wed Mar 16 00:00:06 2016 +0200
     1.2 +++ b/doorbelld/src/main.c	Wed Mar 16 02:50:30 2016 +0200
     1.3 @@ -15,9 +15,9 @@
     1.4  const char *devfile = "/dev/video0";
     1.5  int fd = -1;
     1.6  int port = 2828;
     1.7 -int width = 640;
     1.8 -int height = 480;
     1.9 -int framerate = 30;
    1.10 +int width = 320;
    1.11 +int height = 240;
    1.12 +int framerate = 15;
    1.13  unsigned char *frame;
    1.14  int done;
    1.15  int frame_available;
    1.16 @@ -83,12 +83,10 @@
    1.17  		if(fd != -1) {
    1.18  			if(fd > maxfd) maxfd = fd;
    1.19  			FD_SET(fd, &rdset);
    1.20 -			printf("select on socket: %d (video)\n", fd);
    1.21  		}
    1.22  
    1.23  		for(i=0; i<num_sockets; i++) {
    1.24  			FD_SET(sock[i], &rdset);
    1.25 -			printf("select on socket: %d\n", sock[i]);
    1.26  		}
    1.27  
    1.28  		while((res = select(maxfd + 1, &rdset, 0, 0, 0)) == -1 &&
    1.29 @@ -98,7 +96,6 @@
    1.30  			fprintf(stderr, "unexpected failure while waiting for I/O\n");
    1.31  			break;
    1.32  		}
    1.33 -		printf("res: %d\n", res);
    1.34  
    1.35  		if(fd != -1 && FD_ISSET(fd, &rdset)) {
    1.36  			wcam_wait(fd);