From ffcf287aa227cfd1c0f928a3310d98554caf16cd Mon Sep 17 00:00:00 2001 From: Christian König Date: Sat, 16 Apr 2011 12:57:45 +0200 Subject: vdpau: implement VDPAU_DUMP option --- src/gallium/state_trackers/vdpau/presentation.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c index fdd0144fe22..063c63fb4ee 100644 --- a/src/gallium/state_trackers/vdpau/presentation.c +++ b/src/gallium/state_trackers/vdpau/presentation.c @@ -25,6 +25,8 @@ * **************************************************************************/ +#include + #include "vdpau_private.h" #include #include @@ -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; } -- cgit v1.2.3