--- a/src/gallium/state_trackers/vdpau/surface.c +++ b/src/gallium/state_trackers/vdpau/surface.c @@ -310,6 +306,7 @@ vlVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface, struct pipe_sampler_view **sampler_views; enum getbits_conversion conversion = CONVERSION_NONE; unsigned i, j; + static int dumped = 0; vlsurface = vlGetDataHTAB(surface); if (!vlsurface) @@ -374,6 +371,18 @@ vlVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface, return VDP_STATUS_RESOURCES; } + if (!dumped) { + FILE *fp; + char fn[255]; + + sprintf(fn, "sv%d-texture%d", i, j); + fp = fopen(fn, "wb"); + if (!fp) + abort(); + fwrite(map, 1, box.width*box.height,fp); + fclose(fp); + } + if (conversion == CONVERSION_NV12_TO_YV12 && i == 1) { #if 0 util_copy_rect(destination_data[i] + destination_pitches[i] * j, sv->texture->format, @@ -403,6 +412,9 @@ vlVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface, } pipe_mutex_unlock(vlsurface->device->mutex); + if (!dumped) + dumped = 1; + return VDP_STATUS_OK; }