Hi all
I am using XVideo interface to do video post-processing work. The third 
argument of XvPutImage is "Drawable d"(see below):
extern int XvPutImage (Display *display, XvPortID id, Drawable d,......);
If the "Drawable" is a window(Created by XCreateWindow) I will use hardware 
overlay method to display yuv surface, if the "Drawable" is a pixmap(Created by 
XCreatePixmap) I will use textured blit way. But I don't know how to 
distinguish if a "Drawable" is a window or a pixmap. Jackson give me a way 
below(Thank you very much, Jackson):

static int pixmap = 0;
static int pixmap_check(Display *d, void *v) { pixmap = 1; return 0; }
/* ... */
    XWindowAttributes xwa;
    void *old_handler = XSetErrorHandler(dpy, pixmap_check);
    XGetWindowAttributes(dpy, draw, &xwa);
    XSetErrorHandler(dpy, old_handler);
    if (pixmap) /* whatever */

Does anyone have a better way?

Regards
_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to