st/vdpau: implement BitmapSurfaceGetParameters
authorChristian König <deathsimple@vodafone.de>
Sat, 25 Feb 2012 23:34:11 +0000 (00:34 +0100)
committerChristian König <deathsimple@vodafone.de>
Fri, 2 Mar 2012 12:14:22 +0000 (13:14 +0100)
Signed-off-by: Christian König <deathsimple@vodafone.de>
src/gallium/state_trackers/vdpau/bitmap.c

index c2c8a44..0b885c8 100644 (file)
@@ -136,10 +136,23 @@ vlVdpBitmapSurfaceGetParameters(VdpBitmapSurface surface,
                                 uint32_t *width, uint32_t *height,
                                 VdpBool *frequently_accessed)
 {
+   vlVdpBitmapSurface *vlsurface;
+   struct pipe_resource *res;
+
+   vlsurface = vlGetDataHTAB(surface);
+   if (!vlsurface)
+      return VDP_STATUS_INVALID_HANDLE;
+
    if (!(rgba_format && width && height && frequently_accessed))
       return VDP_STATUS_INVALID_POINTER;
 
-   return VDP_STATUS_NO_IMPLEMENTATION;
+   res = vlsurface->sampler_view->texture;
+   *rgba_format = PipeToFormatRGBA(res->format);
+   *width = res->width0;
+   *height = res->height0;
+   *frequently_accessed = res->usage == PIPE_USAGE_DYNAMIC;
+
+   return VDP_STATUS_OK;
 }
 
 /**