> I am trying to write an application that uses multiple layers on the via
> Unichrome platform. I've got a test application which creates the two
> layers (and surfaces within them), one YUV, and one RGB, and attempts to
> overlay the RGB ontop of the YUY.

I'm a bit confused by your terminology because you don't create layers
-- they're always present and you just configure and use them.

Assuming you're really talking about the two hardware layers available
(as opposed to blending surfaces by blitting), you'll need to do the
following:

Get an interface for the primary layer
Set a primary layer configuration using the buffer mode of your
choice, DSPF_AiRGB pixel format and the DLOP_ALPHACHANNEL option
Get the primary surface (layer->GetSurface)

Get an interface for the video overlay layer (via EnumDisplayLayers)
Set the overlay layer configuration using the buffer mode of your
choice, DSPF_YV12 or DSPF_YUY2 pixel format
Set the level of the overlay to -1 to position it behind the primary
Get the overlay surface (layer->GetSurface)

However, there are a number of issues:

1. if you're using a release version of DirectFB (e.g. 0.9.24) there
is no acceleration for AiRGB, YV12 or YUY2 which might explain your
high CPU usage
2. even in the latest development version there is only support for
simple blits/draws in these formats (i.e. no blending, no format
conversion)
3. in 0.9.24 the sense of the level parameter is wrong and you'll need
1 instead of -1
4. in 0.9.24 the ALPHACHANNEL option is not supported for the primary
(but setting the level of the overlay still makes use of it)

Your best bet is to get the latest code from CVS.

You'll need to choose your buffering mode carefully according to the
accelerations that are available.  If you end up needing to read from
video memory because you're blitting from a video memory surface using
pixel formats that aren't accelerated, you'll end up with high CPU
usage and poor performance.

Mark

_______________________________________________
directfb-users mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-users

Reply via email to