-
[my-code/ivac.git] / dfb_api.c
index c530831..6f28b59 100644 (file)
--- a/dfb_api.c
+++ b/dfb_api.c
@@ -90,10 +90,15 @@ int create_logo_surface(void) {
 }
 
 int create_video_surface(void) {
+ float q;
  DFBSurfaceDescription desc;
  DFBVideoProviderCapabilities caps;
  dfb->CreateVideoProvider(dfb,dfb_video_dev,&video_provider);
  video_provider->GetSurfaceDescription(video_provider,&desc);
+ q=(((float)screen_height/desc.height>=(float)screen_width/desc.width)?
+  (float)screen_height/desc.height:(float)screen_width/desc.width);
+ desc.width=(int)(screen_width/q);
+ desc.height=(int)(screen_height/q);
  video_provider->GetCapabilities(video_provider,&caps);
  printf("video capabilities: %x\n",caps);
  dfb->CreateSurface(dfb,&desc,&video);
@@ -145,8 +150,8 @@ int flip_it(void) {
 }
 
 DVFrameCallback video_callback(void) {
- primary->StretchBlit(primary,video,NULL,NULL);
// flip_it;
+ puts("callback flip");
+ flip_it;
  return DFENUM_OK;
 }
 
@@ -159,8 +164,8 @@ 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);
@@ -168,11 +173,11 @@ int main (int argc, char **argv) {
  clear_screen(primary);
 
  puts("main: blit video");
- blit_video();
// blit_logo();
// blit_video();
+ blit_logo();
 
  // puts("main: flip");
// flip_it();
+ flip_it();
 
  sleep(10);