diff options
Diffstat (limited to 'src/gallium/state_trackers/vdpau/output.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/output.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c index c5f06896c58..20097eaf98c 100644 --- a/src/gallium/state_trackers/vdpau/output.c +++ b/src/gallium/state_trackers/vdpau/output.c @@ -28,6 +28,7 @@ #include "vdpau_private.h" #include <vdpau/vdpau.h> #include <util/u_debug.h> +#include <util/u_memory.h> VdpStatus vlVdpOutputSurfaceCreate ( VdpDevice device, @@ -35,9 +36,29 @@ vlVdpOutputSurfaceCreate ( VdpDevice device, uint32_t width, uint32_t height, VdpOutputSurface *surface) { + vlVdpOutputSurface *vlsurface = NULL; + debug_printf("[VDPAU] Creating output surface\n"); if (!(width && height)) return VDP_STATUS_INVALID_SIZE; + + vlVdpDevice *dev = vlGetDataHTAB(device); + if (!dev) + return VDP_STATUS_INVALID_HANDLE; + + vlsurface = CALLOC(1, sizeof(vlVdpOutputSurface)); + if (!vlsurface) + return VDP_STATUS_RESOURCES; + + vlsurface->width = width; + vlsurface->height = height; + vlsurface->format = FormatRGBAToPipe(rgba_format); + + *surface = vlAddDataHTAB(vlsurface); + if (*surface == 0) { + FREE(dev); + return VDP_STATUS_ERROR; + } - return VDP_STATUS_NO_IMPLEMENTATION; + return VDP_STATUS_OK; }
\ No newline at end of file |