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 8b85592b4e439ab863dd00bfff531425e1df3cfb..35b75ab3aa764077b9e0ff7e99a9fd319ca94555 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