3 * author: hackbard@hackdaworld.dyndns.org
11 int flip_blit_callback(void *ctx) {
12 struct ivac *ivac=ctx;
14 ivac->dfb_stuff.v_surface->Flip(ivac->dfb_stuff.v_surface,NULL,0);
19 int dfb_play_video(struct ivac *ivac) {
21 ivac->dfb_stuff.v_provider->PlayTo(ivac->dfb_stuff.v_provider,ivac->dfb_stuff.v_surface,NULL,flip_blit_callback,(void *)ivac);
26 int dfb_stop_video(struct ivac *ivac) {
28 ivac->dfb_stuff.v_provider->Stop(ivac->dfb_stuff.v_provider);
33 int dfb_init(int arg_c,char **arg_v,struct ivac *ivac) {
34 DFBSurfaceDescription sdsc;
35 // DFBFontDescription fdsc;
36 DFBWindowDescription wdsc;
39 DirectFBInit(&arg_c,&arg_v);
40 DirectFBCreate(&(ivac->dfb_stuff.dfb));
42 /* input devices and event stuff */
43 ivac->dfb_stuff.dfb->GetInputDevice(ivac->dfb_stuff.dfb,DIDID_MOUSE,&(ivac->dfb_stuff.mouse));
44 ivac->dfb_stuff.dfb->GetInputDevice(ivac->dfb_stuff.dfb,DIDID_KEYBOARD,&(ivac->dfb_stuff.keyboard));
45 ivac->dfb_stuff.mouse->CreateEventBuffer(ivac->dfb_stuff.mouse,&(ivac->dfb_stuff.buffer));
47 /* first window -- video window */
48 ivac->dfb_stuff.dfb->GetDisplayLayer(ivac->dfb_stuff.dfb,DLID_PRIMARY,&(ivac->dfb_stuff.layer));
49 ivac->dfb_stuff.dfb->CreateVideoProvider(ivac->dfb_stuff.dfb,ivac->video_dev,&(ivac->dfb_stuff.v_provider));
50 ivac->dfb_stuff.v_provider->GetSurfaceDescription(ivac->dfb_stuff.v_provider,&sdsc);
52 wdsc.flags=DWDESC_POSX|DWDESC_POSY|DWDESC_WIDTH|DWDESC_HEIGHT;
55 wdsc.width=sdsc.width;
56 wdsc.height=sdsc.height;
58 ivac->dfb_stuff.layer->CreateWindow(ivac->dfb_stuff.layer,&wdsc,&(ivac->dfb_stuff.v_window));
59 ivac->dfb_stuff.v_window->GetSurface(ivac->dfb_stuff.v_window,&(ivac->dfb_stuff.v_surface));
60 ivac->dfb_stuff.v_window->SetOpacity(ivac->dfb_stuff.v_window,0xff);
65 int dfb_tini(struct ivac *ivac) {
66 ivac->dfb_stuff.v_provider->Release(ivac->dfb_stuff.v_provider);
67 ivac->dfb_stuff.v_window->Release(ivac->dfb_stuff.v_window);
68 ivac->dfb_stuff.layer->Release(ivac->dfb_stuff.layer);
69 ivac->dfb_stuff.dfb->Release(ivac->dfb_stuff.dfb);