From 9150a149d453da8cffd8bc362d829cebb06ae3df Mon Sep 17 00:00:00 2001 From: hackbard Date: Tue, 26 Aug 2003 02:47:34 +0000 Subject: [PATCH] start of ivac (webcam tests) --- Makefile_new | 17 +++++++++++ dfbapi.c | 38 +++++++++++++++++++++++ dfbapi.h | 10 ++++++ dfbapi.o | Bin 0 -> 960 bytes ivac.c | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++- ivac.h | 41 +++++++++++++++++++++++++ 6 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 Makefile_new create mode 100644 dfbapi.c create mode 100644 dfbapi.h create mode 100644 dfbapi.o create mode 100644 ivac.h 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 0000000000000000000000000000000000000000..c1ce11098cb7b81cb94ea95c49b2b480d7533884 GIT binary patch literal 960 zcma)4L2DCH5T0~b-P#;t+k;@Bdsv}GSZys*Jr&cmNL37RPrAq^*=WGjlDtDbdC2Lp z?0@j+F-P%MBP0iZfM-Dv$;Fc*f%Tis4z4F17{2-5eDh`A+q|mY-7gdhBvBxP{xG8B zjBKZZby}peB2CfLU+RNtEB1=|p<_mVDZXdvqVsi@B#AE1F*3$`j>$&abdm?fxNeTC zA1{DMOPI1^Z^FYE8&@YROKRn~Zbye^+O3zfZc;0~d)jWd$JI9rJbY;D$&YV(5-pwn zT*LI~FJt4q_J(nNbuik|k6{V-q_#Ww(0a?hkNgq#9ZW6l&m!N7Dy!*2D9o%d=9sD@ zf2ODY2y+LO$}M~S;J&wEUw60MO(M7dva5myQ1#~cOsZb^+*RR;BDWQ&fZRsEPj2%? zw;LWQc>QOrLB}i0Ywx1|jFc#4#UaV8->{>tLTy&GuU6cJE#jQmk0K7qUj;a&I*ct5@u-!<=d0gYXA0~JgM};K!vGDK}8oazkrWxGvaZ612Gnj;Q#;t literal 0 HcmV?d00001 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