]> www.hackdaworld.org Git - my-code/ivac.git/blob - old/ivac.c
introduced special network return codes, added {de,}select, connect, close, set functions
[my-code/ivac.git] / old / ivac.c
1 /* internet audio/video conferencing
2  *
3  * author: hackbard
4  *
5  */
6
7 #include <stdio.h>
8 #include <string.h>
9 #include <unistd.h>
10 #include "ivac.h"
11 #include "dfbapi.h"
12
13 // in development
14
15 int usage(void) {
16         puts("usage: ivac <options>");
17         puts("options:");
18         puts("-h \t this help");
19         puts("-V \t <video device>"); 
20         puts("-A \t <audio device>");
21         puts("-v \t verbose debug output");
22         return 1;
23 }
24
25 int main(int argc, char **argv) {
26         int i;
27         struct ivac ivac;
28         DFBInputDeviceKeyState quit;
29
30         quit=DIKS_UP;
31
32         /* default */
33         strcpy(ivac.video_dev,VIDEO_DEV);
34         strcpy(ivac.audio_dev,AUDIO_DEV);
35         
36         for(i=1;i<argc;i++) {
37                 if(argv[i][0]=='-') {
38                         switch(argv[i][1]) {
39                                 case 'h':
40                                         usage();
41                                         break;
42                                 case 'V':
43                                         strcpy(ivac.video_dev,argv[++i]);
44                                         break;
45                                 case 'A':
46                                         strcpy(ivac.audio_dev,argv[++i]);
47                                         break;
48                                 case 'v':
49                                         ivac.flags|=VERBOSE_FLAG;
50                                         break;
51                                 default:
52                                         usage();
53                                         break;
54                         }
55                 } else usage();
56         }
57         
58         if(dfb_init(argc,argv,&ivac)<0) {
59                 puts("dfb init failed");
60                 return -1;
61         }
62
63         if(dfb_play_video(&ivac)<0) {
64                 puts("dfb play video failed");
65                 return -1;
66         };
67
68         puts("pess button ...");
69         getchar();
70
71         dfb_tini(&ivac);
72
73         return 1;
74 }