vdpau: implement OutputSurfaceDestroy
authorChristian König <deathsimple@vodafone.de>
Tue, 26 Apr 2011 09:49:14 +0000 (11:49 +0200)
committerChristian König <deathsimple@vodafone.de>
Tue, 26 Apr 2011 09:49:31 +0000 (11:49 +0200)
src/gallium/state_trackers/vdpau/output.c

index 8b85592..35b75ab 100644 (file)
@@ -108,7 +108,21 @@ vlVdpOutputSurfaceCreate(VdpDevice device,
 VdpStatus
 vlVdpOutputSurfaceDestroy(VdpOutputSurface surface)
 {
-   return VDP_STATUS_NO_IMPLEMENTATION;
+   vlVdpOutputSurface *vlsurface;
+
+   debug_printf("[VDPAU] Destroying output surface\n");
+
+   vlsurface = vlGetDataHTAB(surface);
+   if (!vlsurface)
+      return VDP_STATUS_INVALID_HANDLE;
+
+   pipe_surface_reference(&vlsurface->surface, NULL);
+   pipe_sampler_view_reference(&vlsurface->sampler_view, NULL);
+
+   vlRemoveDataHTAB(surface);
+   FREE(vlsurface);
+
+   return VDP_STATUS_OK;
 }
 
 VdpStatus