diff options
author | Thomas Balling Sørensen <tball@tball-laptop.(none)> | 2010-10-06 23:30:08 +0200 |
---|---|---|
committer | Thomas Balling Sørensen <tball@tball-laptop.(none)> | 2010-10-06 23:30:08 +0200 |
commit | 65fe0866aec7b5608419f6d184cb1fa4fe1dc45a (patch) | |
tree | eeafc1881af4ff76ffc5bd314706127d81be98e2 /src/gallium/state_trackers/vdpau/presentation.c | |
parent | d0e203f1f00b0f760acc7fab07cd7ce8cca34000 (diff) |
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.c | 34 |
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 8200cf04326..5f545d0bb27 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 |