1 /* internet audio/video conferencing
16 puts("usage: ivac <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");
25 int video_callback(void *ctx) {
27 IDirectFBSurface *surf;
28 DFBSurfaceDescription desc;
31 puts("debug: callback!");
32 ivac->dfb_stuff.v_provider->GetSurfaceDescription(ivac->dfb_stuff.v_provider,&desc);
33 printf("debug: w: %d -- h: %d\n",desc.width,desc.height);
34 ivac->dfb_stuff.dfb->CreateSurface(ivac->dfb_stuff.dfb,&desc,&surf);
35 ivac->dfb_stuff.p_surface->Blit(ivac->dfb_stuff.p_surface,surf,NULL,0,0);
36 ivac->dfb_stuff.p_surface->Flip(ivac->dfb_stuff.p_surface,NULL,DSFLIP_WAITFORSYNC);
37 ivac->dfb_stuff.count+=1;
38 if(ivac->dfb_stuff.count==5000)
39 ivac->dfb_stuff.v_provider->Stop(ivac->dfb_stuff.v_provider);
43 int main(int argc, char **argv) {
48 strcpy(ivac.video_dev,VIDEO_DEV);
49 strcpy(ivac.audio_dev,AUDIO_DEV);
58 strcpy(ivac.video_dev,argv[++i]);
61 strcpy(ivac.audio_dev,argv[++i]);
64 ivac.flags|=VERBOSE_FLAG;
73 if(dfb_init(argc,argv,&ivac)<0) {
74 puts("dfb init failed");
78 puts("debug: dfb init done!!");
80 ivac.dfb_stuff.count=0;
81 ivac.dfb_stuff.rect.x=5;
82 ivac.dfb_stuff.rect.y=5;
83 ivac.dfb_stuff.rect.w=500;
84 ivac.dfb_stuff.rect.h=400;
85 ivac.dfb_stuff.v_provider->PlayTo(ivac.dfb_stuff.v_provider,ivac.dfb_stuff.p_surface,&(ivac.dfb_stuff.rect),video_callback,(void *)&ivac);
90 puts("debug: dfb tini done!!");