From: hackbard Date: Tue, 26 Aug 2003 02:47:34 +0000 (+0000) Subject: start of ivac (webcam tests) X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9150a149d453da8cffd8bc362d829cebb06ae3df;p=my-code%2Fivac.git start of ivac (webcam tests) --- diff --git a/Makefile_new b/Makefile_new new file mode 100644 index 0000000..fb312e7 --- /dev/null +++ b/Makefile_new @@ -0,0 +1,17 @@ +INCLUDEDIR = /usr/include +CFLAGS = -O3 -Wall -I/usr/include/directfb +LIBS = -L/usr/lib -ldirectfb + +OBJS = dfbapi.o +OBJS2 = new_ivac + +new_ivac: $(OBJS) + $(CC) $(CFLAGS) -o $@ $(OBJS) $(LIBS) ivac.c + +all: new_ivac + +clean: + rm $(OBJS) $(OBJS2) + +remake: clean all + diff --git a/dfbapi.c b/dfbapi.c new file mode 100644 index 0000000..45960be --- /dev/null +++ b/dfbapi.c @@ -0,0 +1,38 @@ +/* dfb functions + * + * author: hackbard@hackdaworld.dyndns.org + * + */ + +#include +#include +#include "ivac.h" + +int dfb_init(int arg_c,char **arg_v,struct ivac *ivac) { + DFBSurfaceDescription surface_dsc; + DFBFontDescription font_dsc; + + DirectFBInit(&arg_c,&arg_v); + DirectFBCreate(&(ivac->dfb_stuff.dfb)); + ivac->dfb_stuff.dfb->SetCooperativeLevel(ivac->dfb_stuff.dfb,DFSCL_FULLSCREEN); + + surface_dsc.flags=DSDESC_CAPS; + surface_dsc.caps=DSCAPS_PRIMARY|DSCAPS_FLIPPING; + ivac->dfb_stuff.dfb->CreateSurface(ivac->dfb_stuff.dfb,&surface_dsc,&(ivac->dfb_stuff.p_surface)); + ivac->dfb_stuff.p_surface->GetSize(ivac->dfb_stuff.p_surface,&(ivac->dfb_stuff.s_width),&(ivac->dfb_stuff.s_height)); + + font_dsc.flags=DFDESC_HEIGHT; + font_dsc.height=ivac->dfb_stuff.s_height/20; + ivac->dfb_stuff.dfb->CreateVideoProvider(ivac->dfb_stuff.dfb,ivac->video_dev,&(ivac->dfb_stuff.v_provider)); + + return 1; +} + +int dfb_tini(struct ivac *ivac) { + ivac->dfb_stuff.v_provider->Release(ivac->dfb_stuff.v_provider); + ivac->dfb_stuff.p_surface->Release(ivac->dfb_stuff.p_surface); + ivac->dfb_stuff.dfb->Release(ivac->dfb_stuff.dfb); + + return 1; +} + diff --git a/dfbapi.h b/dfbapi.h new file mode 100644 index 0000000..e1f4a20 --- /dev/null +++ b/dfbapi.h @@ -0,0 +1,10 @@ +/* dfbapi.h + * + * author: hackbard@hackdaworld.dyndns.org + * + */ + +/* function prototypes */ +int dfb_init(int arg_c,char **arg_v,struct ivac *ivac); +int dfb_tini(struct ivac *ivac); + diff --git a/dfbapi.o b/dfbapi.o new file mode 100644 index 0000000..c1ce110 Binary files /dev/null and b/dfbapi.o differ diff --git a/ivac.c b/ivac.c index 25822a8..d4e1581 100644 --- a/ivac.c +++ b/ivac.c @@ -5,6 +5,89 @@ */ #include - +#include +#include +#include "ivac.h" +#include "dfbapi.h" // in development + +int usage(void) { + puts("usage: ivac "); + puts("options:"); + puts("-h \t this help"); + puts("-V \t