On Freitag 12 Mai 2006 22:58, Stefan Lucke wrote:
> On Freitag 12 Mai 2006 07:30, Denis Oliver Kropp wrote:
> > Stefan Lucke wrote:
> > > On Dienstag 15 November 2005 21:34, Mark Adams wrote:
> > >>> I guess that the changes to unichrome/uc_overlay.c will break
> > >>> softdevice. For VIA I have currently the following special code:
> > >>>
> > >>>          if (isVIAUnichrome)
> > >>>            videoLayer->SetLevel(1);
> > >> You could be right.  I assume softdevice wants the primary layer on top?
> > >>
> > >> Unfortunately, the existing implementation of levels was broken
> > >> because it had a positive value as being below the primary.  The
> > >> documentation for SetLevel is clear that it should be the other way
> > >> around.
> > >>
> > >> You'll now need videoLayer->SetLevel(-1).
> > >>
> > >> You'll also need to set DLOP_ALPHACHANNEL on the primary layer to get
> > >> the behaviour you want.  This is necessary in order to support OPACITY
> > >> as an alternative.  These options will fail on earlier versions
> > >> (assuming you weren't setting DFB_CLE266_UNDERLAY) so you will need to
> > >> check the primary's capabilities for DLCAPS_ALPHACHANNEL.
> > > 
> > > It doesn't work for me. Tried it for two days without success.
> > > 
> > >             if (osdLayerDescription.caps & DLCAPS_ALPHACHANNEL)
> > >             {
> > >                 DFBDisplayLayerConfig osdLayerConfiguration;
> > > 
> > >               osdLayer->GetConfiguration(&osdLayerConfiguration);
> > > fprintf(stderr," -- options: %08x\n",osdLayerConfiguration.options);
> > >               osdLayerConfiguration.flags = DLCONF_OPTIONS;
> > >               osdLayerConfiguration.options = DLOP_ALPHACHANNEL;
> > >               osdLayer->SetConfiguration(osdLayerConfiguration);
> > >               videoLayer->SetLevel(-1);
> > > fprintf(stderr, " -- with alpha channel --\n");
> > >             }
> > >             else
> > >             {
> > > fprintf(stderr, " -- without !! alpha channel --\n");
> > >               videoLayer->SetLevel(1);
> > >             }
> > > 
> > > The only result is OSD only with videoLayer->SetLevel(-1) or
> > > video only when called with +1 ("-- with alpha .." is printed).
> > 
> > Which pixelformat is your OSD? It should have an alpha channel :)
> 
> osdLayer is set by:     osdLayer=dfb->GetDisplayLayer(DLID_PRIMARY);
> and it has a alpha layer, as with DirectFB from 2005-09-14 I get
> a normal/full alpha blended OSD ;-)  (nearly the same code).

 old TestRegion ret = 0
 old TestRegion ret = 0
uc_ovl_set_level: level   = -1
uc_ovl_set_level: op_prim = 0

I added some printfs and when setting the level 
static DFBResult
uc_ovl_set_level(CoreLayer    *layer,
                 void         *driver_data,
                 void         *layer_data,
                 int          level)
{
    UcOverlayData* ucovl = (UcOverlayData*) layer_data;
    UcDriverData*  ucdrv = (UcDriverData*) driver_data;
fprintf(stderr,"uc_ovl_set_level: level   = %d\n",level);
fprintf(stderr,"uc_ovl_set_level: op_prim = %d\n",ucovl->opacity_primary);
    if (level == 0) return DFB_INVARG;

    if (level < 0) {
        // Enable underlay mode.
        VIDEO_OUT(ucdrv->hwregs, V_ALPHA_CONTROL,
            //uc_ovl_map_alpha(ucovl->opacity_primary));
            uc_ovl_map_alpha(-1));
          VIDEO_OUT(ucdrv->hwregs, V_COMPOSE_MODE,
               //VIDEO_IN(ucdrv->hwregs, V_COMPOSE_MODE) | V1_COMMAND_FIRE);
               V1_COMMAND_FIRE);

    }

>From other printfs I see SetRegion is only called once (at startup).

But even with above code, I failed to get video with alpha blended OSD
(OSD only). Perhaps there are some problems with bool typed variables.

-- 
Stefan Lucke

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

Reply via email to