summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/vdpau/presentation.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/presentation.c
parentd0e203f1f00b0f760acc7fab07cd7ce8cca34000 (diff)
downloadexternal_mesa3d-65fe0866aec7b5608419f6d184cb1fa4fe1dc45a.zip
external_mesa3d-65fe0866aec7b5608419f6d184cb1fa4fe1dc45a.tar.gz
external_mesa3d-65fe0866aec7b5608419f6d184cb1fa4fe1dc45a.tar.bz2
vl: implemented a few functions and made stubs to get mplayer running
Diffstat (limited to 'src/gallium/state_trackers/vdpau/presentation.c')
-rw-r--r--src/gallium/state_trackers/vdpau/presentation.c34
1 files changed, 31 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/vdpau/presentation.c b/src/gallium/state_trackers/vdpau/presentation.c
index 8200cf0..5f545d0 100644
--- a/src/gallium/state_trackers/vdpau/presentation.c
+++ b/src/gallium/state_trackers/vdpau/presentation.c
@@ -28,6 +28,7 @@
#include "vdpau_private.h"
#include <vdpau/vdpau.h>
#include <util/u_debug.h>
+#include <util/u_memory.h>
VdpStatus
vlVdpPresentationQueueTargetDestroy (VdpPresentationQueueTarget presentation_queue_target)
@@ -41,12 +42,39 @@ vlVdpPresentationQueueCreate ( VdpDevice device,
VdpPresentationQueueTarget presentation_queue_target,
VdpPresentationQueue *presentation_queue)
{
- debug_printf("[VDPAU] Creating presentation queue\n");
+ debug_printf("[VDPAU] Creating PresentationQueue\n");
+ VdpStatus ret;
+ vlVdpPresentationQueue *pq = NULL;
if (!presentation_queue)
return VDP_STATUS_INVALID_POINTER;
-
- return VDP_STATUS_NO_IMPLEMENTATION;
+
+ vlVdpDevice *dev = vlGetDataHTAB(device);
+ if (!dev)
+ return VDP_STATUS_INVALID_HANDLE;
+
+ vlVdpPresentationQueueTarget *pqt = vlGetDataHTAB(presentation_queue_target);
+ if (!pqt)
+ return VDP_STATUS_INVALID_HANDLE;
+
+ if (dev != pqt->device)
+ return VDP_STATUS_HANDLE_DEVICE_MISMATCH;
+
+ pq = CALLOC(1, sizeof(vlVdpPresentationQueue));
+ if (!pq)
+ return VDP_STATUS_RESOURCES;
+
+ *presentation_queue = vlAddDataHTAB(pq);
+ if (*presentation_queue == 0) {
+ ret = VDP_STATUS_ERROR;
+ goto no_handle;
+ }
+
+
+ return VDP_STATUS_OK;
+ no_handle:
+ FREE(pq);
+ return ret;
}
VdpStatus