#include <pipe/p_compiler.h>
#include <pipe/p_video_context.h>
-#include <vl_winsys.h>
+
#include <util/u_memory.h>
#include <util/u_debug.h>
+
+#include <vl_winsys.h>
+
#include "vdpau_private.h"
PUBLIC VdpStatus
vlVdpPresentationQueueTargetCreateX11(VdpDevice device, Drawable drawable,
VdpPresentationQueueTarget *target)
{
- VdpStatus ret;
- vlVdpPresentationQueueTarget *pqt = NULL;
+ vlVdpPresentationQueueTarget *pqt;
+ VdpStatus ret;
debug_printf("[VDPAU] Creating PresentationQueueTarget\n");
return VDP_STATUS_OK;
no_handle:
- FREE(dev);
+ FREE(pqt);
return ret;
}
+VdpStatus
+vlVdpPresentationQueueTargetDestroy(VdpPresentationQueueTarget presentation_queue_target)
+{
+ vlVdpPresentationQueueTarget *pqt;
+
+ debug_printf("[VDPAU] Destroying PresentationQueueTarget\n");
+
+ pqt = vlGetDataHTAB(presentation_queue_target);
+ if (!pqt)
+ return VDP_STATUS_INVALID_HANDLE;
+
+ vlRemoveDataHTAB(presentation_queue_target);
+ FREE(pqt);
+
+ return VDP_STATUS_OK;
+}
+
VdpStatus
vlVdpDeviceDestroy(VdpDevice device)
{
vlVdpDevice *dev = vlGetDataHTAB(device);
if (!dev)
return VDP_STATUS_INVALID_HANDLE;
+
FREE(dev);
vlDestroyHTAB();
return (void*)handle;
#endif
}
+
+void vlRemoveDataHTAB(vlHandle handle)
+{
+#ifdef VL_HANDLES
+ pipe_mutex_lock(htab_lock);
+ if (htab)
+ handle_table_remove(htab, handle);
+ pipe_mutex_unlock(htab_lock);
+#endif
+}
#include <stdio.h>
-#include "vdpau_private.h"
#include <vdpau/vdpau.h>
+
#include <util/u_debug.h>
#include <util/u_memory.h>
-VdpStatus
-vlVdpPresentationQueueTargetDestroy(VdpPresentationQueueTarget presentation_queue_target)
-{
- return VDP_STATUS_NO_IMPLEMENTATION;
-}
+#include "vdpau_private.h"
VdpStatus
vlVdpPresentationQueueCreate(VdpDevice device,
void vlDestroyHTAB(void);
vlHandle vlAddDataHTAB(void *data);
void* vlGetDataHTAB(vlHandle handle);
+void vlRemoveDataHTAB(vlHandle handle);
+
boolean vlGetFuncFTAB(VdpFuncId function_id, void **func);
/* Public functions */