INCLUDEDIR = /usr/include
-CFLAGS = -DDEBUG -O3 -Wall -I/usr/X11/include -I/usr/include/directfb -DVIDEO_DEV=\"/dev/video\"
+CFLAGS = -DDEBUG -O3 -Wall -I/usr/X11/include -I/usr/include/directfb -DVIDEO_DEV=\"/dev/v4l/video0\"
LIBS = -L/usr/X11/lib -L/usr/lib/directfb-0.9.15 -lX11 -lXext -ldirectfb
OBJS = minirgb.o webcam.o
int screen_width = 0;
int screen_height = 0;
-char dfb_video_dev[]="/dev/v4l/video0";
+char dfb_video_dev[]=VIDEO_DEV;
char text_top[]="Internet Video / Audio Conferencing";
char dfb_image[]="./images/ivac_logo.png";
char dfb_font[]="./fonts/decker.ttf";
return 1;
}
+int blit_surface(IDirectFBSurface *source,int x,int y) {
+ primary->Blit(primary,source,NULL,x,y);
+ return 1;
+}
+
+int blit_logo(void) {
+ int x,y;
+ get_surface_size(logo,&x,&y);
+ printf("size of logo width/height: %d/%d\n",x,y);
+ blit_surface(logo,((screen_width-x)/2),((screen_height-y)/2));
+ return 1;
+}
+
+int blit_video(void) {
+ int x,y;
+ get_surface_size(video,&x,&y);
+ blit_surface(video,((screen_width-x)/2),((screen_height-y)/2));
+ return 1;
+}
+
+int flip_it(void) {
+ primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
+ return 1;
+}
/* test api app */
int main (int argc, char **argv) {
check_accel();
create_primary_surface();
- printf("primary surface created\n");
// create_video_surface();
create_logo_surface();
get_primary_surface_size();
+ printf("primary surface width/height: %d/%d\n",screen_width,screen_height);
clear_screen(primary);
- // primary->Flip(primary,NULL,DSFLIP_WAITFORSYNC);
+ blit_logo();
- sleep(5);
+ flip_it();
+
+ sleep(10);
+
+ release_surface(logo);
release_surface(primary);
+ release_dfb();
+
return 1;
}