Quoting Frank Enderle: > i'm still hacking on my xine provider and try to get hardware acceleration > for scaling and blitting since i now got a mtrox g550. as i understood > from the source it should be possible to blit from one pixelformat to > another, automatically using a available hardware acceleration or falling > back to the generic software thing (which is slow). > > so i thought the following: > > - xine says me that the data is either yv12 or yuy2 and that a frame is > width x height pixels > - so i use createsurface to get a temporary surface of the size and > pixeltype xine told me > - while displaying the frame i copy the data from the xine buffer into my > my surface, which is now just a memcpy since width, height and pixelformat > is the same > - then i wanted to use stretchblit to convert my surface to the targets > pixelformat, width and height > > the problem i have by now is that i can't create a surface using > dfb->CreateSurface in the videoprovider, because i can't get a hand on the > IDirectFB interface. there are functions like dfb_create_surface, but i > don't know how to use them, though i recognized that othe providers only > use such dfb_... functions (which don't need the handle).
dfb_... are the internal functions (core) used by the interfaces (public API). You can use dfb_surface_create() to create a surface. Each time you get a frame from xine, you call dfb_surface_soft_lock() to get a write pointer. Call dfb_surface_unlock() afterwards. If you don't need the surface any longer, call dfb_surface_unref() to have it destroyed. For blitting you need a CardState which has to be initialized via dfb_state_init() first. Call dfb_state_set_source() passing the created surface. The destination is specified via dfb_state_set_destination(). You also have to set a valid clipping region for the state. Just write the desired values into the struct. If you change any value of the state by writing the values manually, you have to set the corresponding flag in state->modified, e.g. SMF_CLIP. Once it's set up, you can call dfb_gfxcard_blit() or dfb_gfxcard_stretchblit() passing source and destination coordinates along with the state. Be aware that rectangles passed to these functions may be modified, so don't pass anything you have to rely on afterwards. During deinitialization you have to call dfb_state_set_source() and dfb_state_set_destination() with NULL to detach the surfaces from the state. Finally, use dfb_state_deinit() to free its resources. -- Best regards, Denis Oliver Kropp .------------------------------------------. | DirectFB - Hardware accelerated graphics | | http://www.directfb.org/ | "------------------------------------------" Convergence GmbH -- Info: To unsubscribe send a mail to [EMAIL PROTECTED] with "unsubscribe directfb-dev" as subject.
