summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/presentation.c
diff options
context:
space:
mode:
authorChristian König <deathsimple@vodafone.de>2011-04-16 12:57:45 +0200
committerChristian König <deathsimple@vodafone.de>2011-04-16 12:57:45 +0200
commitffcf287aa227cfd1c0f928a3310d98554caf16cd (patch)
tree6e63de5329c3c03598027c693efa891765efe9a2 /src/gallium/state_trackers/vdpau/presentation.c
parentc87b83d4b2b860bb4c9f90897232e661a2b94c07 (diff)
downloadexternal_mesa3d-ffcf287aa227cfd1c0f928a3310d98554caf16cd.zip
external_mesa3d-ffcf287aa227cfd1c0f928a3310d98554caf16cd.tar.gz
external_mesa3d-ffcf287aa227cfd1c0f928a3310d98554caf16cd.tar.bz2
vdpau: implement VDPAU_DUMP option
Diffstat (limited to 'src/gallium/state_trackers/vdpau/presentation.c')
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index fdd0144..063c63f 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -25,6 +25,8 @@
*
**************************************************************************/
+#include <stdio.h>
+
#include "vdpau_private.h"
#include <vdpau/vdpau.h>
#include <util/u_debug.h>
@@ -131,6 +133,8 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
uint32_t clip_height,
VdpTime earliest_presentation_time)
{
+ static int dump_window = -1;
+
vlVdpPresentationQueue *pq;
vlVdpOutputSurface *surf;
struct pipe_surface *drawable_surface;
@@ -160,6 +164,19 @@ vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
vl_contextprivate_get(pq->device->context, drawable_surface)
);
+ if(dump_window == -1) {
+ dump_window = debug_get_num_option("VDPAU_DUMP", 0);
+ }
+
+ if(dump_window) {
+ static unsigned int framenum = 0;
+ char cmd[256];
+
+ sprintf(cmd, "xwd -id %d -out vdpau_frame_%08d.xwd", (int)pq->drawable, ++framenum);
+ if (system(cmd) != 0)
+ _debug_printf("[XvMC] Dumping surface %d failed.\n", surface);
+ }
+
return VDP_STATUS_OK;
}