[MPlayer-dev-eng] [PATCH]Add vo vdpau
compn
tempn at twmi.rr.com
Mon Jan 5 03:20:00 CET 2009
On Mon, 5 Jan 2009 04:28:52 +0100 (CET), Carl Eugen Hoyos wrote:
nice!
i assume docs patch will show up later.
will you be working on va-api patches as well?
>+ * VDPAU Renderer for MPlayer.
>+ * vo_vdpau.c - VDPAU with X11 interface.
>+ *
>+ * Copyright (C) 2008 NVIDIA.
might want to add the nvidia vdpau doc/spec/api link here?
>+#ifdef HAVE_NEW_GUI
>+ if (use_gui)
>+ guiGetEvent(guiSetShVideo, 0); // let the GUI to setup/resize our window
>+ else
>+#endif
>+ {
>+#ifdef HAVE_XF86VM
>+ if (vm)
>+ {
>+ if ((d_width == 0) && (d_height == 0))
>+ {
>+ vm_width = width;
>+ vm_height = height;
>+ } else
>+ {
>+ vm_width = d_width;
>+ vm_height = d_height;
>+ }
>+ vo_vm_switch(vm_width, vm_height, &modeline_width,
>+ &modeline_height);
>+ aspect_save_screenres(modeline_width, modeline_height);
>+ } else
>+#endif
>+ XGetWindowAttributes(mDisplay, DefaultRootWindow(mDisplay),
>+ &attribs);
>+ depth = attribs.depth;
>+ if (depth != 15 && depth != 16 && depth != 24 && depth != 32)
>+ depth = 24;
>+ XMatchVisualInfo(mDisplay, mScreen, depth, TrueColor, &vinfo);
>+
>+ xswa.background_pixel = 0;
>+ xswa.border_pixel = 0;
>+ xswamask = CWBackPixel | CWBorderPixel;
>+
>+ if (WinID >= 0)
>+ {
>+ vo_window = WinID ? ((Window) WinID) : mRootWin;
>+ if (WinID)
>+ {
>+ XUnmapWindow(mDisplay, vo_window);
>+ XChangeWindowAttributes(mDisplay, vo_window, xswamask,
>+ &xswa);
>+ vo_x11_selectinput_witherr(mDisplay, vo_window,
>+ StructureNotifyMask |
>+ KeyPressMask |
>+ PropertyChangeMask |
>+ PointerMotionMask |
>+ ButtonPressMask |
>+ ButtonReleaseMask |
>+ ExposureMask);
>+ XMapWindow(mDisplay, vo_window);
>+ XGetGeometry(mDisplay, vo_window, &mRoot,
>+ &drwX, &drwY, &vo_dwidth, &vo_dheight,
>+ &drwBorderWidth, &drwDepth);
>+ if (vo_dwidth <= 0) vo_dwidth = d_width;
>+ if (vo_dheight <= 0) vo_dheight = d_height;
>+ aspect_save_prescale(vo_dwidth, vo_dheight);
>+ }
>+ } else
>+ {
>+ vo_x11_create_vo_window(&vinfo, vo_dx, vo_dy, d_width, d_height,
>+ flags, CopyFromParent, "x11", title);
>+ XChangeWindowAttributes(mDisplay, vo_window, xswamask, &xswa);
>+ }
>+
>+ XSync(mDisplay, False);
>+
>+#ifdef HAVE_XF86VM
>+ if (vm)
>+ {
>+ /* Grab the mouse pointer in our window */
>+ if (vo_grabpointer)
>+ XGrabPointer(mDisplay, vo_window, True, 0,
>+ GrabModeAsync, GrabModeAsync,
>+ vo_window, None, CurrentTime);
>+ XSetInputFocus(mDisplay, vo_window, RevertToNone, CurrentTime);
>+ }
>+#endif
this is duplicated in x11/xv/xvmc.
not sure if it should be factorized, just pointing it out.
-compn
More information about the MPlayer-dev-eng
mailing list