From: hackbard Date: Tue, 18 Feb 2003 00:04:11 +0000 (+0000) Subject: - X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00aca7d3f73b593d2b08b0849ca7eb51574de507;p=my-code%2Fivac.git - --- diff --git a/dfb_api.c b/dfb_api.c index 3488f8b..c530831 100644 --- a/dfb_api.c +++ b/dfb_api.c @@ -10,6 +10,8 @@ /* dfb includes */ #include +#include "dfb_api.h" + #define MY_FONT_HEIGHT 18 /* global stuff */ @@ -33,7 +35,11 @@ char text_top[]="Internet Video / Audio Conferencing"; char dfb_image[]="./images/ivac_logo.png"; char dfb_font[]="./fonts/decker.ttf"; -/* small api - directfb usage kinda sux: foo->bar(foo,...) wtf?!?!?! */ +/* variable definitions */ +// struct user_info { + + +/* functions */ int dfb_init(int *argc,char **argv) { DirectFBInit(argc,&argv); @@ -82,7 +88,7 @@ int create_logo_surface(void) { image_provider->Release(image_provider); return 1; } - + int create_video_surface(void) { DFBSurfaceDescription desc; DFBVideoProviderCapabilities caps; @@ -91,7 +97,7 @@ int create_video_surface(void) { video_provider->GetCapabilities(video_provider,&caps); printf("video capabilities: %x\n",caps); dfb->CreateSurface(dfb,&desc,&video); - video_provider->PlayTo(video_provider,video,NULL,NULL,NULL); + video_provider->PlayTo(video_provider,video,NULL,video_callback,NULL); video_provider->Release(video_provider); return 1; } @@ -127,7 +133,9 @@ int blit_logo(void) { int blit_video(void) { int x,y; get_surface_size(video,&x,&y); - blit_surface(video,((screen_width-x)/2),((screen_height-y)/2)); + printf("size of logo width/height: %d/%d\n",x,y); + // blit_surface(video,((screen_width-x)/2),((screen_height-y)/2)); + blit_surface(video,0,0); return 1; } @@ -136,6 +144,12 @@ int flip_it(void) { return 1; } +DVFrameCallback video_callback(void) { + primary->StretchBlit(primary,video,NULL,NULL); + // flip_it; + return DFENUM_OK; +} + /* test api app */ int main (int argc, char **argv) { @@ -145,17 +159,20 @@ int main (int argc, char **argv) { create_primary_surface(); - // create_video_surface(); - create_logo_surface(); + 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); - blit_logo(); + puts("main: blit video"); + blit_video(); + // blit_logo(); - flip_it(); + // puts("main: flip"); + // flip_it(); sleep(10);