I think Xv is meant to also work for overlays, which obviously won't work on a pixmap. Maybe it's a safety so application developers don't do anything stupid.
Maarten. On Fri, Apr 10, 2009 at 11:30 AM, Yuan Austin <shengquan.y...@gmail.com> wrote: > On Thu, Apr 2, 2009 at 3:59 PM, Shengquan Yuan <shengquan.y...@gmail.com> > wrote: >> Hi, >> >> I tried to use XvPutImage to draw into a pixmap, but it always returns >> error. After tracing into Xserver, I found function >> hw/xfree86/common/xf86xv.c:xf86XVPutImage checks whether the drawable >> is WINDOW, if not, it returns BadAlloc directly, see bellow code: >> >>> static int >>> xf86XVPutImage( >>> ClientPtr client, >>> DrawablePtr pDraw, >>> XvPortPtr pPort, >>> GCPtr pGC, >>> INT16 src_x, INT16 src_y, >>> CARD16 src_w, CARD16 src_h, >>> INT16 drw_x, INT16 drw_y, >>> CARD16 drw_w, CARD16 drw_h, >>> XvImagePtr format, >>> unsigned char* data, >>> Bool sync, >>> CARD16 width, CARD16 height >>> ){ >>> XvPortRecPrivatePtr portPriv = (XvPortRecPrivatePtr)(pPort->devPriv.ptr); >>> ScreenPtr pScreen; >>> RegionRec WinRegion; >>> RegionRec ClipRegion; >>> BoxRec WinBox; >>> int ret = Success; >>> Bool clippedAway = FALSE; >>> >>> if (pDraw->type != DRAWABLE_WINDOW) >>> => return BadAlloc; > > I tried to comment above two lines, then XvPutImage can draw into a > pixmap. I am not sure if it has side effect. > > I also tried intel driver on a 945G platform, since intel driver is > using UXA architecture, and bellow "exaMoveInPixmap" won't be called, > this hacking doesn't work. > >> >> I also looked at Xvideo implementation in Xserver video driver, and it >> looks like texture video supports rendering into a pixmap: >> >>> if (pDraw->type == DRAWABLE_WINDOW) >>> pPriv->pPixmap = (*pScreen->GetWindowPixmap)((WindowPtr)pDraw); >>> else >>> pPriv->pPixmap = (PixmapPtr)pDraw; >>> >>> #ifdef USE_EXA >>> if (info->useEXA) { >>> /* Force the pixmap into framebuffer so we can draw to it. */ >>> exaMoveInPixmap(pPriv->pPixmap); >>> } >>> #endif >>> >> >> I am wondering what's the reason that Xserver returns failure directly >> when XvPutImage drawing into a pixmap? >> >> Thanks >> Austin >> > _______________________________________________ > xorg mailing list > xorg@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/xorg > _______________________________________________ xorg mailing list xorg@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/xorg