Stefan Lucke wrote:
Hi,
I'm trying to blend and osd with alpha over an yuy2 video source. Drawing is done with this: fprintf (stderr, "now stretch\n"); //screen->Clear(0,0,0,0xff); //screen->SetBlittingFlags(DSBLIT_BLEND_ALPHACHANNEL); screen->SetBlittingFlags(DSBLIT_NOFX); screen->StretchBlit(videoSurface, &src, &dst);
// if (osdActive) { fprintf (stderr, "now osd blit\n"); //screen->SetBlittingFlags(DSBLIT_NOFX); screen->SetBlittingFlags(DSBLIT_BLEND_ALPHACHANNEL); //screen->SetBlittingFlags(DSBLIT_BLEND_COLORALPHA); screen->Blit(osdSurface, NULL, 0, 0);//&src, &dst); }
fprintf (stderr, "now flip\n"); screen->Flip(); fprintf (stderr, "now done\n");
Surfaces are allocated by: dsc.flags = (DFBSurfaceDescriptionFlags) (DSDESC_CAPS | DSDESC_PIXELFORMAT); dsc.caps = DSCAPS_NONE; DFB_ADD_SURFACE_CAPS(dsc.caps, DSCAPS_FLIPPING); DFB_ADD_SURFACE_CAPS(dsc.caps, DSCAPS_PRIMARY); DFB_ADD_SURFACE_CAPS(dsc.caps, DSCAPS_VIDEOONLY); dsc.pixelformat = DSPF_ARGB;
osdSurface = dfb->CreateSurface (dsc); screen = dfb->CreateSurface (dsc);
The problem is that the screen gets only updated once for a while when the osd is refreshed, and only the area that is half transpararent is redrawn. Graphic card is G550. DirectFB is v0.9.21.
-- Stefan Lucke
I assume that your program is written in C++ and you are using DFB++.
Do you flip the osd surface after drawing to it ? Have you tried using C and DirectFB ?
Regards, Claudio
