aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/output.c
diff options
context:
space:
mode:
authorThomas Balling Sørensen <tball@tball-laptop.(none)>2010-10-06 23:30:08 +0200
committerThomas Balling Sørensen <tball@tball-laptop.(none)>2010-10-06 23:30:08 +0200
commit65fe0866aec7b5608419f6d184cb1fa4fe1dc45a (patch)
treeeeafc1881af4ff76ffc5bd314706127d81be98e2 /src/gallium/state_trackers/vdpau/output.c
parentd0e203f1f00b0f760acc7fab07cd7ce8cca34000 (diff)
vl: implemented a few functions and made stubs to get mplayer running
Diffstat (limited to 'src/gallium/state_trackers/vdpau/output.c')
-rw-r--r--src/gallium/state_trackers/vdpau/output.c23
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