INCLUDEDIR = /usr/include
-CFLAGS = -DDEBUG -O3 -Wall -I/usr/X11/include -DVIDEO_DEV=\"/dev/video\"
-LIBS = -L/usr/X11/lib -lX11 -lXext
+CFLAGS = -DDEBUG -O3 -Wall -I/usr/X11/include -I/usr/include/directfb -DVIDEO_DEV=\"/dev/video\"
+LIBS = -L/usr/X11/lib -L/usr/lib/directfb-0.9.15 -lX11 -lXext -ldirectfb
OBJS = minirgb.o webcam.o
OBJS2 = stream receive datagram dgramrcv
+OBJS3 = dfb_api.o
webcam: $(OBJS)
$(CC) -o $@ $(OBJS) $(LIBS)
-
netstuff: $(OBJS2)
-
+ivac: $(OBJS3)
+ $(CC) -o $@ $(OBJS3) $(LIBS)
all: webcam netstuff
clean:
--- /dev/null
+/*
+ * dfb_api.c - api to dfb interface
+ */
+
+/* std includes */
+#include <stdio.h>
+#include <unistd.h>
+
+/* dfb includes */
+#include <directfb.h>
+
+/* global stuff */
+
+/* well ... */
+static IDirectFB *dfb = NULL;
+/* surface */
+static IDirectFBSurface *primary = NULL;
+static int screen_width = 0;
+static int screen_height = 0;
+static IDirectFBSurface *logo = NULL;
+/* image to load */
+char dfb_image[]="./images/ivac_logo.png";
+
+int main (int argc, char **argv) {
+ int i;
+ DFBSurfaceDescription dsc;
+ /* image provider */
+ IDirectFBImageProvider *provider;
+
+ /* init */
+ DirectFBInit (&argc, &argv);
+ DirectFBCreate (&dfb);
+ dfb->SetCooperativeLevel (dfb, DFSCL_FULLSCREEN);
+ dsc.flags=DSDESC_CAPS;
+ dsc.caps=DSCAPS_PRIMARY | DSCAPS_FLIPPING;
+ dfb->CreateSurface(dfb,&dsc,&primary);
+ primary->GetSize(primary,&screen_width,&screen_height);
+ printf("debug: w/h = %d / %d\n",screen_width,screen_height);
+
+ /* create the imag provider */
+ dfb->CreateImageProvider(dfb,dfb_image,&provider);
+ /* get image/provider description */
+ provider->GetSurfaceDescription(provider,&dsc);
+ printf("debug: w/h %d / %d\n",dsc.width,dsc.height);
+ /* create apropriate surface */
+ dfb->CreateSurface(dfb,&dsc,&logo);
+ /* render image */
+ provider->RenderTo(provider,logo,NULL);
+
+ provider->Release(provider);
+
+ /* slide logo */
+ for(i = -dsc.width; i < screen_width; i++) {
+ /* clear screen */
+ primary->FillRectangle(primary,0,0,screen_width,screen_height);
+
+ /* blit image */
+ primary->Blit(primary,logo,NULL,i,(screen_height-dsc.height)/2);
+
+ /* flip */
+ primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
+ }
+
+ /* release image */
+ logo->Release(logo);
+
+ primary->Release(primary);
+ dfb->Release(dfb);
+
+ return 23;
+}
+