summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg
diff options
context:
space:
mode:
authorChristian König <[email protected]>2010-11-25 21:23:48 +0100
committerChristian König <[email protected]>2010-11-25 21:23:48 +0100
commit9cff90534389c2aad9b58ff04b1a5d624e3d0bdb (patch)
treed2f03e4db61c21c28974f2379bc9ff5ba57fcde9 /src/gallium/state_trackers/xorg
parented8b767a8e09cff4d98a44cdc07b08f1b322c4d3 (diff)
[g3dvl] add dump option to xvmc
Diffstat (limited to 'src/gallium/state_trackers/xorg')
-rw-r--r--src/gallium/state_trackers/xorg/xvmc/surface.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c
index 0a236e26429..209dffd2c58 100644
--- a/src/gallium/state_trackers/xorg/xvmc/surface.c
+++ b/src/gallium/state_trackers/xorg/xvmc/surface.c
@@ -26,6 +26,7 @@
**************************************************************************/
#include <assert.h>
+#include <stdio.h>
#include <X11/Xlibint.h>
#include <vl_winsys.h>
#include <pipe/p_video_context.h>
@@ -373,6 +374,8 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
short destx, short desty, unsigned short destw, unsigned short desth,
int flags)
{
+ static int dump_window = -1;
+
struct pipe_video_context *vpipe;
XvMCSurfacePrivate *surface_priv;
XvMCContextPrivate *context_priv;
@@ -451,6 +454,17 @@ Status XvMCPutSurface(Display *dpy, XvMCSurface *surface, Drawable drawable,
pipe_surface_reference(&drawable_surface, NULL);
+ if(dump_window == -1) {
+ dump_window = debug_get_num_option("XVMC_DUMP", 0);
+ }
+
+ if(dump_window) {
+ static unsigned int framenum = 0;
+ char cmd[256];
+ sprintf(cmd, "xwd -id %d -out xvmc_frame_%08d.xwd", (int)drawable, ++framenum);
+ system(cmd);
+ }
+
XVMC_MSG(XVMC_TRACE, "[XvMC] Pushed surface %p to front buffer.\n", surface);
return Success;