From 65fe0866aec7b5608419f6d184cb1fa4fe1dc45a Mon Sep 17 00:00:00 2001 From: Thomas Balling Sørensen Date: Wed, 6 Oct 2010 23:30:08 +0200 Subject: vl: implemented a few functions and made stubs to get mplayer running --- src/gallium/state_trackers/vdpau/device.c | 45 ++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 6 deletions(-) (limited to 'src/gallium/state_trackers/vdpau/device.c') diff --git a/src/gallium/state_trackers/vdpau/device.c b/src/gallium/state_trackers/vdpau/device.c index d370d1c6610..4ca198e874d 100644 --- a/src/gallium/state_trackers/vdpau/device.c +++ b/src/gallium/state_trackers/vdpau/device.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2010 Younes Manton. + * Copyright 2010 Younes Manton og Thomas Balling Sørensen. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -25,21 +25,18 @@ * **************************************************************************/ -#include #include #include #include #include #include "vdpau_private.h" -VdpDeviceCreateX11 vdp_imp_device_create_x11; PUBLIC VdpStatus vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device, VdpGetProcAddress **get_proc_address) { VdpStatus ret; vlVdpDevice *dev = NULL; - struct vl_screen *vlscreen = NULL; if (!(display && device && get_proc_address)) return VDP_STATUS_INVALID_POINTER; @@ -62,9 +59,8 @@ vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device, VdpGe ret = VDP_STATUS_ERROR; goto no_handle; } - + *get_proc_address = &vlVdpGetProcAddress; - debug_printf("[VDPAU] Device created succesfully\n"); return VDP_STATUS_OK; @@ -77,9 +73,46 @@ no_htab: return ret; } +PUBLIC VdpStatus +vlVdpPresentationQueueTargetCreateX11(VdpDevice device, Drawable drawable,VdpPresentationQueueTarget *target) +{ + VdpStatus ret; + vlVdpPresentationQueueTarget *pqt = NULL; + + debug_printf("[VDPAU] Creating PresentationQueueTarget\n"); + + if (!drawable) + return VDP_STATUS_INVALID_HANDLE; + + vlVdpDevice *dev = vlGetDataHTAB(device); + if (!dev) + return VDP_STATUS_INVALID_HANDLE; + + pqt = CALLOC(1, sizeof(vlVdpPresentationQueue)); + if (!pqt) + return VDP_STATUS_RESOURCES; + + pqt->device = dev; + pqt->drawable = drawable; + + *target = vlAddDataHTAB(pqt); + if (*target == 0) { + ret = VDP_STATUS_ERROR; + goto no_handle; + } + + + return VDP_STATUS_OK; + no_handle: + FREE(dev); + return ret; +} + VdpStatus vlVdpDeviceDestroy(VdpDevice device) { + debug_printf("[VDPAU] Destroying destroy\n"); + vlVdpDevice *dev = vlGetDataHTAB(device); if (!dev) return VDP_STATUS_INVALID_HANDLE; -- cgit v1.2.3