#include <util/u_inlines.h>
#include <util/u_memory.h>
#include <util/u_keymap.h>
+#include <util/u_draw.h>
#include <util/u_sampler.h>
#include <tgsi/tgsi_ureg.h>
#include "vl_csc.h"
#include <util/u_memory.h>
#include <util/u_keymap.h>
#include <util/u_sampler.h>
+#include <util/u_draw.h>
#include <tgsi/tgsi_ureg.h>
#define DEFAULT_BUF_ALIGNMENT 1
presentation.c \
bitmap.c \
mpeg2_bitstream_parser.c \
- output.c
+ output.c \
+ preemption.c \
+ mixer.c
include ../../Makefile.template
vlVdpDecoderDestroy (VdpDecoder decoder
)
{
+ debug_printf("[VDPAU] Destroying decoder\n");
vlVdpDecoder *vldecoder;
vldecoder = (vlVdpDecoder *)vlGetDataHTAB(decoder);
return VDP_STATUS_INVALID_HANDLE;
}
- if (vldecoder->vctx->vscreen)
- vl_screen_destroy(vldecoder->vctx->vscreen);
+ if (vldecoder->vctx)
+ {
+ if (vldecoder->vctx->vscreen)
+ vl_screen_destroy(vldecoder->vctx->vscreen);
+ }
if (vldecoder->vctx)
vl_video_destroy(vldecoder->vctx);
struct pipe_resource tmplt;
struct pipe_resource *surf_tex;
struct pipe_video_context *vpipe;
+
+ debug_printf("[VDPAU] Creating surface\n");
if(!(vldecoder && vlsurf))
return VDP_STATUS_INVALID_POINTER;
struct pipe_mpeg12_macroblock *pipe_macroblocks;
VdpStatus ret;
+ debug_printf("[VDPAU] Decoding MPEG2\n");
vpipe = vldecoder->vctx->vpipe;
t_vdp_surf = vlsurf;
}
vpipe->set_decode_target(vpipe,t_surf);
- vpipe->decode_macroblocks(vpipe, p_surf, f_surf, num_macroblocks, (struct pipe_macroblock *)pipe_macroblocks, NULL);
+ //vpipe->decode_macroblocks(vpipe, p_surf, f_surf, num_macroblocks, (struct pipe_macroblock *)pipe_macroblocks, NULL);
skip_frame:
return ret;
return ret;
}
+
+VdpStatus
+vlVdpGenerateCSCMatrix(
+ VdpProcamp *procamp,
+ VdpColorStandard standard,
+ VdpCSCMatrix *csc_matrix)
+{
+ debug_printf("[VDPAU] Generating CSCMatrix\n");
+ if (!(csc_matrix && procamp))
+ return VDP_STATUS_INVALID_POINTER;
+
+ return VDP_STATUS_OK;
+}
\ No newline at end of file
/**************************************************************************
*
- * 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
*
**************************************************************************/
-#include <vdpau/vdpau_x11.h>
#include <pipe/p_compiler.h>
#include <vl_winsys.h>
#include <util/u_memory.h>
#include <util/u_debug.h>
#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;
ret = VDP_STATUS_ERROR;
goto no_handle;
}
-
+
*get_proc_address = &vlVdpGetProcAddress;
-
debug_printf("[VDPAU] Device created succesfully\n");
return VDP_STATUS_OK;
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;
/**************************************************************************
*
- * Copyright 2010 Younes Manton.
+ * Copyright 2010 Younes Manton & Thomas Balling Sørensen.
* All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
&vlVdpGetErrorString, /* VDP_FUNC_ID_GET_ERROR_STRING */
&vlVdpGetProcAddress, /* VDP_FUNC_ID_GET_PROC_ADDRESS */
&vlVdpGetApiVersion, /* VDP_FUNC_ID_GET_API_VERSION */
- 0,
+ 0x555, /* DUMMY */
&vlVdpGetInformationString, /* VDP_FUNC_ID_GET_INFORMATION_STRING */
&vlVdpDeviceDestroy, /* VDP_FUNC_ID_DEVICE_DESTROY */
- 0, /* VDP_FUNC_ID_GENERATE_CSC_MATRIX */
+ &vlVdpGenerateCSCMatrix, /* VDP_FUNC_ID_GENERATE_CSC_MATRIX */
&vlVdpVideoSurfaceQueryCapabilities, /* VDP_FUNC_ID_VIDEO_SURFACE_QUERY_CAPABILITIES */
&vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities, /* VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES */
&vlVdpVideoSurfaceCreate, /* VDP_FUNC_ID_VIDEO_SURFACE_CREATE */
&vlVdpVideoSurfacePutBitsYCbCr, /* VDP_FUNC_ID_VIDEO_SURFACE_PUT_BITS_Y_CB_CR */
&vlVdpOutputSurfaceQueryCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_CAPABILITIES */
&vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_GET_PUT_BITS_NATIVE_CAPABILITIES */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES */
+ 0x2, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_INDEXED_CAPABILITIES */
&vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities, /* VDP_FUNC_ID_OUTPUT_SURFACE_QUERY_PUT_BITS_Y_CB_CR_CAPABILITIES */
&vlVdpOutputSurfaceCreate, /* VDP_FUNC_ID_OUTPUT_SURFACE_CREATE */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR */
+ 0x3, /* VDP_FUNC_ID_OUTPUT_SURFACE_DESTROY */
+ 0x4, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_PARAMETERS */
+ 0x5, /* VDP_FUNC_ID_OUTPUT_SURFACE_GET_BITS_NATIVE */
+ 0x6, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_NATIVE */
+ 0x7, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_INDEXED */
+ 0x8, /* VDP_FUNC_ID_OUTPUT_SURFACE_PUT_BITS_Y_CB_CR */
&vlVdpBitmapSurfaceQueryCapabilities, /* VDP_FUNC_ID_BITMAP_SURFACE_QUERY_CAPABILITIES */
&vlVdpBitmapSurfaceCreate, /* VDP_FUNC_ID_BITMAP_SURFACE_CREATE */
&vlVdpBitmapSurfaceDestroy, /* VDP_FUNC_ID_BITMAP_SURFACE_DESTROY */
&vlVdpBitmapSurfaceGetParameters, /* VDP_FUNC_ID_BITMAP_SURFACE_GET_PARAMETERS */
&vlVdpBitmapSurfacePutBitsNative, /* VDP_FUNC_ID_BITMAP_SURFACE_PUT_BITS_NATIVE */
- 0,
- 0,
- 0,
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE */
- 0, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA */
+ 0x55, /* DUMMY */
+ 0x55, /* DUMMY */
+ 0x55, /* DUMMY */
+ 0x9, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_OUTPUT_SURFACE */
+ 0x10, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_BITMAP_SURFACE */
+ 0x11, /* VDP_FUNC_ID_OUTPUT_SURFACE_RENDER_VIDEO_SURFACE_LUMA */
&vlVdpDecoderQueryCapabilities, /* VDP_FUNC_ID_DECODER_QUERY_CAPABILITIES */
&vlVdpDecoderCreate, /* VDP_FUNC_ID_DECODER_CREATE */
&vlVdpDecoderDestroy, /* VDP_FUNC_ID_DECODER_DESTROY */
- 0, /* VDP_FUNC_ID_DECODER_GET_PARAMETERS */
+ 0x12, /* VDP_FUNC_ID_DECODER_GET_PARAMETERS */
&vlVdpDecoderRender, /* VDP_FUNC_ID_DECODER_RENDER */
&vlVdpVideoMixerQueryFeatureSupport, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_FEATURE_SUPPORT */
&vlVdpVideoMixerQueryParameterSupport, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_SUPPORT */
&vlVdpVideoMixerQueryAttributeSupport, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_SUPPORT */
&vlVdpVideoMixerQueryParameterValueRange, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_PARAMETER_VALUE_RANGE */
&vlVdpVideoMixerQueryAttributeValueRange, /* VDP_FUNC_ID_VIDEO_MIXER_QUERY_ATTRIBUTE_VALUE_RANGE */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_CREATE */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_DESTROY */
- 0, /* VDP_FUNC_ID_VIDEO_MIXER_RENDER */
+ &vlVdpVideoMixerCreate, /* VDP_FUNC_ID_VIDEO_MIXER_CREATE */
+ &vlVdpVideoMixerSetFeatureEnables, /* VDP_FUNC_ID_VIDEO_MIXER_SET_FEATURE_ENABLES */
+ &vlVdpVideoMixerSetAttributeValues, /* VDP_FUNC_ID_VIDEO_MIXER_SET_ATTRIBUTE_VALUES */
+ 0x16, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_SUPPORT */
+ 0x17, /* VDP_FUNC_ID_VIDEO_MIXER_GET_FEATURE_ENABLES */
+ 0x18, /* VDP_FUNC_ID_VIDEO_MIXER_GET_PARAMETER_VALUES */
+ 0x19, /* VDP_FUNC_ID_VIDEO_MIXER_GET_ATTRIBUTE_VALUES */
+ 0x20, /* VDP_FUNC_ID_VIDEO_MIXER_DESTROY */
+ &vlVdpVideoMixerRender, /* VDP_FUNC_ID_VIDEO_MIXER_RENDER */
&vlVdpPresentationQueueTargetDestroy, /* VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_DESTROY */
&vlVdpPresentationQueueCreate, /* VDP_FUNC_ID_PRESENTATION_QUEUE_CREATE */
&vlVdpPresentationQueueDestroy, /* VDP_FUNC_ID_PRESENTATION_QUEUE_DESTROY */
&vlVdpPresentationQueueSetBackgroundColor, /* VDP_FUNC_ID_PRESENTATION_QUEUE_SET_BACKGROUND_COLOR */
&vlVdpPresentationQueueGetBackgroundColor, /* VDP_FUNC_ID_PRESENTATION_QUEUE_GET_BACKGROUND_COLOR */
- 0,
- 0,
+ 0x55, /* DUMMY */
+ 0x55, /* DUMMY */
&vlVdpPresentationQueueGetTime, /* VDP_FUNC_ID_PRESENTATION_QUEUE_GET_TIME */
&vlVdpPresentationQueueDisplay, /* VDP_FUNC_ID_PRESENTATION_QUEUE_DISPLAY */
&vlVdpPresentationQueueBlockUntilSurfaceIdle, /* VDP_FUNC_ID_PRESENTATION_QUEUE_BLOCK_UNTIL_SURFACE_IDLE */
&vlVdpPresentationQueueQuerySurfaceStatus, /* VDP_FUNC_ID_PRESENTATION_QUEUE_QUERY_SURFACE_STATUS */
- 0 /* VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER */
+ &vlVdpPreemptionCallbackRegister /* VDP_FUNC_ID_PREEMPTION_CALLBACK_REGISTER */
};
static void* ftab_winsys[1] =
{
- 0 /* VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 */
+ &vlVdpPresentationQueueTargetCreateX11 /* VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 */
};
boolean vlGetFuncFTAB(VdpFuncId function_id, void **func)
+/**************************************************************************
+ *
+ * Copyright 2010 Thomas Balling Sørensen.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ #include <vdpau/vdpau.h>
+ #include <util/u_memory.h>
+ #include <util/u_debug.h>
+ #include "vdpau_private.h"
+
+
+ VdpStatus
+ vlVdpVideoMixerCreate (VdpDevice device,
+ uint32_t feature_count,
+ VdpVideoMixerFeature const *features,
+ uint32_t parameter_count,
+ VdpVideoMixerParameter const *parameters,
+ void const *const *parameter_values,
+ VdpVideoMixer *mixer)
+{
+ VdpStatus ret;
+ vlVdpVideoMixer *vmixer = NULL;
+
+ debug_printf("[VDPAU] Creating VideoMixer\n");
+
+ vlVdpDevice *dev = vlGetDataHTAB(device);
+ if (!dev)
+ return VDP_STATUS_INVALID_HANDLE;
+
+ vmixer = CALLOC(1, sizeof(vlVdpVideoMixer));
+ if (!vmixer)
+ return VDP_STATUS_RESOURCES;
+
+ vmixer->device = dev;
+ /*
+ * TODO: Handle features and parameters
+ * */
+
+ *mixer = vlAddDataHTAB(vmixer);
+ if (*mixer == 0) {
+ ret = VDP_STATUS_ERROR;
+ goto no_handle;
+ }
+
+
+ return VDP_STATUS_OK;
+ no_handle:
+ return ret;
+}
+
+VdpStatus
+vlVdpVideoMixerSetFeatureEnables (
+ VdpVideoMixer mixer,
+ uint32_t feature_count,
+ VdpVideoMixerFeature const *features,
+ VdpBool const *feature_enables)
+{
+ debug_printf("[VDPAU] Setting VideoMixer features\n");
+
+ if (!(features && feature_enables))
+ return VDP_STATUS_INVALID_POINTER;
+
+ vlVdpVideoMixer *vmixer = vlGetDataHTAB(mixer);
+ if (!vmixer)
+ return VDP_STATUS_INVALID_HANDLE;
+
+ /*
+ * TODO: Set features
+ * */
+
+
+ return VDP_STATUS_OK;
+}
+
+VdpStatus vlVdpVideoMixerRender (
+ VdpVideoMixer mixer,
+ VdpOutputSurface background_surface,
+ VdpRect const *background_source_rect,
+ VdpVideoMixerPictureStructure current_picture_structure,
+ uint32_t video_surface_past_count,
+ VdpVideoSurface const *video_surface_past,
+ VdpVideoSurface video_surface_current,
+ uint32_t video_surface_future_count,
+ VdpVideoSurface const *video_surface_future,
+ VdpRect const *video_source_rect,
+ VdpOutputSurface destination_surface,
+ VdpRect const *destination_rect,
+ VdpRect const *destination_video_rect,
+ uint32_t layer_count,
+ VdpLayer const *layers)
+{
+ if (!(background_source_rect && video_surface_past && video_surface_future && video_source_rect && destination_rect && destination_video_rect && layers))
+ return VDP_STATUS_INVALID_POINTER;
+
+ return VDP_STATUS_NO_IMPLEMENTATION;
+}
+
+VdpStatus
+vlVdpVideoMixerSetAttributeValues (
+ VdpVideoMixer mixer,
+ uint32_t attribute_count,
+ VdpVideoMixerAttribute const *attributes,
+ void const *const *attribute_values)
+{
+ if (!(attributes && attribute_values))
+ return VDP_STATUS_INVALID_POINTER;
+
+ vlVdpVideoMixer *vmixer = vlGetDataHTAB(mixer);
+ if (!vmixer)
+ return VDP_STATUS_INVALID_HANDLE;
+
+ return VDP_STATUS_OK;
+}
\ No newline at end of file
bool b_header_done = false;
struct vdpMPEG2BitstreamParser parser;
+ debug_printf("[VDPAU] Starting decoding MPEG2 stream");
+
num_macroblocks[0] = 0;
memset(&parser,0,sizeof(parser));
#include "vdpau_private.h"
#include <vdpau/vdpau.h>
#include <util/u_debug.h>
+#include <util/u_memory.h>
VdpStatus
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
+/**************************************************************************
+ *
+ * Copyright 2010 Thomas Balling Sørensen.
+ * All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ **************************************************************************/
+
+ #include <vdpau/vdpau.h>
+
+ void vlVdpPreemptionCallback (VdpDevice device, void *context)
+ {
+ /* TODO: Implement preemption */
+ }
+
+ VdpStatus vlVdpPreemptionCallbackRegister (VdpDevice device, VdpPreemptionCallback callback, void *context)
+ {
+
+ return VDP_STATUS_OK;
+ }
\ No newline at end of file
#include "vdpau_private.h"
#include <vdpau/vdpau.h>
#include <util/u_debug.h>
+#include <util/u_memory.h>
VdpStatus
vlVdpPresentationQueueTargetDestroy (VdpPresentationQueueTarget presentation_queue_target)
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
#include <vdpau/vdpau.h>
+#include <vdpau/vdpau_x11.h>
#include <pipe/p_compiler.h>
#include <pipe/p_video_context.h>
#include <vl_winsys.h>
return -1;
}
+
static enum pipe_format FormatToPipe(VdpYCbCrFormat vdpau_format)
{
switch (vdpau_format) {
return -1;
}
+static enum pipe_format FormatRGBAToPipe(VdpRGBAFormat vdpau_format)
+{
+ switch (vdpau_format) {
+ case VDP_RGBA_FORMAT_A8:
+ return PIPE_FORMAT_A8_UNORM;
+ case VDP_RGBA_FORMAT_B10G10R10A2:
+ return PIPE_FORMAT_B10G10R10A2_UNORM;
+ case VDP_RGBA_FORMAT_B8G8R8A8:
+ return PIPE_FORMAT_B8G8R8A8_UNORM;
+ case VDP_RGBA_FORMAT_R10G10B10A2:
+ return PIPE_FORMAT_R10G10B10A2_UNORM;
+ case VDP_RGBA_FORMAT_R8G8B8A8:
+ return PIPE_FORMAT_R8G8B8A8_UNORM;
+ default:
+ assert(0);
+ }
+
+ return -1;
+}
+
static VdpYCbCrFormat PipeToFormat(enum pipe_format p_format)
{
switch (p_format) {
int screen;
} vlVdpDevice;
+typedef struct
+{
+ vlVdpDevice *device;
+ Drawable drawable;
+} vlVdpPresentationQueueTarget;
+
+typedef struct
+{
+ vlVdpDevice *device;
+ Drawable drawable;
+} vlVdpPresentationQueue;
+
+typedef struct
+{
+ vlVdpDevice *device;
+} vlVdpVideoMixer;
+
typedef struct
{
vlVdpDevice *device;
uint8_t *data;
} vlVdpSurface;
+typedef struct
+{
+ vlVdpDevice *device;
+ uint32_t width;
+ uint32_t height;
+ enum pipe_format format;
+} vlVdpOutputSurface;
+
typedef struct
{
vlVdpDevice *device;
void* vlGetDataHTAB(vlHandle handle);
boolean vlGetFuncFTAB(VdpFuncId function_id, void **func);
+/* Public functions */
+VdpDeviceCreateX11 vdp_imp_device_create_x11;
+VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11;
+
+/* Internal function pointers */
VdpGetErrorString vlVdpGetErrorString;
VdpDeviceDestroy vlVdpDeviceDestroy;
VdpGetProcAddress vlVdpGetProcAddress;
VdpPresentationQueueDisplay vlVdpPresentationQueueDisplay;
VdpPresentationQueueBlockUntilSurfaceIdle vlVdpPresentationQueueBlockUntilSurfaceIdle;
VdpPresentationQueueQuerySurfaceStatus vlVdpPresentationQueueQuerySurfaceStatus;
+VdpPreemptionCallback vlVdpPreemptionCallback;
+VdpPreemptionCallbackRegister vlVdpPreemptionCallbackRegister;
+VdpVideoMixerSetFeatureEnables vlVdpVideoMixerSetFeatureEnables;
+VdpVideoMixerCreate vlVdpVideoMixerCreate;
+VdpVideoMixerRender vlVdpVideoMixerRender;
+VdpVideoMixerSetAttributeValues vlVdpVideoMixerSetAttributeValues;
+VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix;
+
+
#endif // VDPAU_PRIVATE_H