]> hackdaworld.org Git - my-code/ivac.git/commitdiff
-
authorhackbard <hackbard>
Tue, 18 Feb 2003 00:04:11 +0000 (00:04 +0000)
committerhackbard <hackbard>
Tue, 18 Feb 2003 00:04:11 +0000 (00:04 +0000)
dfb_api.c

index 3488f8b252b1504a6ec807b7c0c53dcb747c90ff..c530831a7b63115d54f9ec8e7ed9acb583a6a10d 100644 (file)
--- a/dfb_api.c
+++ b/dfb_api.c
@@ -10,6 +10,8 @@
 /* dfb includes */
 #include <directfb.h>
 
+#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);