On Dienstag, 22. Juni 2004 21:24, Ville Syrj�l� wrote:
> On Tue, Jun 22, 2004 at 09:36:48AM +0200, Denis Oliver Kropp wrote:
> > Quoting Ville Syrj�l�:
> > > The attached patch implements IDirectFBScreen::SetSourceLocation() and
> > > includes the relevant changes to mach64 (lightly tested) and matrox
> > > (untested) drivers.
> > >
> > > I made it use ints instead of floats. That means that the source
> > > rectangle needs to be reset when surface size changes. Using floats would
> > > allow it to be recalculated. I'm not sure which is better.
> > >
> > > Also I'm not sure about the method name. Set<something> would be
> > > consistent with the other names. SetSourceLocation() isn't maybe the best
> > > choice with int arguments (wrt. DFBLocation). So maybe it should be
> > > SetSourceRectangle()?
> >
> > SetSourceRectangle() sounds best so far. Would you like to commit that?
>
> Done. Matrox changes are still untested but I'm fairly sure they're
> fine ;)
>
Tried that with my matorx G550 and I get segfault 6: SetScreenLocation
works still.
>From message log:
----
(*) DirectFB/Core: Single Application Core. (with MMX support) (2004-07-21 18:47)
(*) Direct/Memcpy: Using MMXEXT optimized memcpy()
(*) Direct/Thread: Running 'VT Switcher' (CRITICAL, 4224)...
(*) Direct/Thread: Running 'PS/2 Input' (INPUT, 4226)...
(*) DirectFB/Input: IMPS/2 Mouse (1) 0.9 (convergence integrated media GmbH)
(*) Direct/Thread: Running 'PS/2 Input' (INPUT, 4227)...
(*) DirectFB/Input: IMPS/2 Mouse (2) 0.9 (convergence integrated media GmbH)
(*) Direct/Thread: Running 'Keyboard Input' (INPUT, 4228)...
(*) DirectFB/Input: Keyboard 0.9 (convergence integrated media GmbH)
(*) DirectFB/Genefx: MMX detected and enabled
(*) DirectFB/Graphics: Matrox G550 0.7 (convergence integrated media GmbH)
(*) DirectFB/WM: Default 0.1 (Convergence GmbH)
(!!!) *** WARNING [no video mode set yet] *** [layers.c:536 in
dfb_screen_rectangle()]
(!!!) *** WARNING [no video mode set yet] *** [layers.c:536 in
dfb_screen_rectangle()]
[dfb] RAM: 16773120 bytes
[dfb] Accellerated Functions: FillRectange DrawRectange DrawLine FillTriangle Blit
StretchBlit All
[dfb] Drawing Flags: Blend
[dfb] Surface Blitting Flags: BlendAlpha BlendColorAlpha Colorize SrcColorkey
Deinterlace
[dfb] Supported video Modes are: [EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
[EMAIL PROTECTED] [EMAIL PROTECTED] [EMAIL PROTECTED]
[dfb] Enumeratig display Layers
Layer 0 FBDev Primary Layer Type: graphics
Caps: brightness contrast saturation surface
Layer 1 Matrox Backend Scaler Type: graphics picture video
Caps: brightness contrast deinterlacing dst_colorkey screen_location surface
This is our videoLayer
(!!!) *** WARNING [no video mode set yet] *** [layers.c:536 in
dfb_screen_rectangle()]
[dfb] width = 1280, height = 1024
[dfb] got fmt = 0x00418c04 bpp = 32
[dfb] Using this layer for OSD: (FBDev Primary Layer - [768x576])
osdSurface::
- videoonly
- flipping
videoSurface::
- videoonly
[dfb] Configuring CooperativeLevel for Overlay
[dfb] Configuring ColorKeying
[dfb] Configuring CooperativeLevel for OSD
[dfb] Using this layer for OSD: FBDev Primary Layer
[dfb] Using this layer for Video out: Matrox Backend Scaler
[dfb] (re)configuring Videolayer to 720 x 576 (720x576)
[dfb] creating new surface
[dfb] (re)configured 0x00200806
[softdevice] Video Out seems to be OK
[softdevice] Initializing Audio Out
[softdevice] Audio out seems to be OK
[softdevice] A/V devices initialized, now initializing MPEG2 Decoder
cSoftDevice::MakePrimaryDevice
[softdevice] should set volume to 215
[dfb] (re)configuring Videolayer to 720 x 576 (720x576)
[dfb] creating new surface
[dfb] (re)configured 0x00200806
[dfb] (re)configuring Videolayer to 720 x 576 (720x576)
(!) [ 4233: 0.000] --> Caught signal 6 (sent by pid 4233, uid 0) <--
----
Sample from my code :
----
useStretchBlit = false;
if (setupStore.pixelFormat == 0)
dlc.pixelformat = DSPF_I420;
else if (setupStore.pixelFormat == 1)
dlc.pixelformat = DSPF_YV12;
else if (setupStore.pixelFormat == 2)
{
dlc.pixelformat = DSPF_YUY2;
useStretchBlit = true;
}
#if HAVE_SetSourceLocation
/* ----------------------------------------------------------------------
* this should be the settings if SetSourceLocation is working for
* all drivers.
*/
dlc.width = fwidth;
dlc.height = fheight;
if (!useStretchBlit)
{
videoLayer->SetSourceRectangle (sxoff, syoff, swidth, sheight);
}
#else
/* ----------------------------------------------------------------------
* for now we have to do another trick
*/
if (useStretchBlit)
{
dlc.width = fwidth;
dlc.height = fheight;
}
else
{
dlc.width = swidth;
dlc.height = sheight;
}
#endif
vidDsc.flags = (DFBSurfaceDescriptionFlags) (DSDESC_CAPS |
DSDESC_WIDTH |
DSDESC_HEIGHT |
DSDESC_PIXELFORMAT);
vidDsc.caps = DSCAPS_VIDEOONLY;
vidDsc.width = dlc.width;
vidDsc.height = dlc.height;
vidDsc.pixelformat = dlc.pixelformat;
currentPixelFormat = setupStore.pixelFormat;
pixelformat = dlc.pixelformat;
if (!useStretchBlit)
{
desc = videoLayer->GetDescription();
if (videoSurface)
videoSurface->Release();
videoSurface = NULL;
if (desc.caps & DLCAPS_SCREEN_LOCATION)
{
videoLayer->SetScreenLocation((float) lxoff / (float) dwidth,
(float) lyoff / (float) dheight,
(float) lwidth / (float) dwidth,
(float) lheight / (float) dheight);
}
else
----
Stefan Lucke