#include "vdpau_private.h"
+/**
+ * Create a VdpBitmapSurface.
+ */
VdpStatus
vlVdpBitmapSurfaceCreate(VdpDevice device,
VdpRGBAFormat rgba_format,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Destroy a VdpBitmapSurface.
+ */
VdpStatus
vlVdpBitmapSurfaceDestroy(VdpBitmapSurface surface)
{
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Retrieve the parameters used to create a VdpBitmapSurface.
+ */
VdpStatus
vlVdpBitmapSurfaceGetParameters(VdpBitmapSurface surface,
VdpRGBAFormat *rgba_format,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Copy image data from application memory in the surface's native format to
+ * a VdpBitmapSurface.
+ */
VdpStatus
vlVdpBitmapSurfacePutBitsNative(VdpBitmapSurface surface,
void const *const *source_data,
#include "vdpau_private.h"
+/**
+ * Create a VdpDecoder.
+ */
VdpStatus
vlVdpDecoderCreate(VdpDevice device,
VdpDecoderProfile profile,
return ret;
}
+/**
+ * Destroy a VdpDecoder.
+ */
VdpStatus
vlVdpDecoderDestroy(VdpDecoder decoder)
{
return VDP_STATUS_OK;
}
+/**
+ * Retrieve the parameters used to create a VdpBitmapSurface.
+ */
VdpStatus
vlVdpDecoderGetParameters(VdpDecoder decoder,
VdpDecoderProfile *profile,
{
vlVdpDecoder *vldecoder;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] decoder get parameters called\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoder get parameters called\n");
vldecoder = (vlVdpDecoder *)vlGetDataHTAB(decoder);
if (!vldecoder)
return VDP_STATUS_OK;
}
+/**
+ * Decode a mpeg 1/2 video.
+ */
static VdpStatus
vlVdpDecoderRenderMpeg12(struct pipe_video_decoder *decoder,
VdpPictureInfoMPEG1Or2 *picture_info,
struct pipe_video_buffer *ref_frames[2];
unsigned i;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoding MPEG2\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Decoding MPEG12\n");
i = 0;
return VDP_STATUS_OK;
}
+/**
+ * Decode a compressed field/frame and render the result into a VdpVideoSurface.
+ */
VdpStatus
vlVdpDecoderRender(VdpDecoder decoder,
VdpVideoSurface target,
// TODO: Recreate decoder with correct chroma
return VDP_STATUS_INVALID_CHROMA_TYPE;
- // TODO: Right now only mpeg 1 & 2 is supported.
+ // TODO: Right now only mpeg 1 & 2 videos are supported.
switch (vldecoder->decoder->profile) {
case PIPE_VIDEO_PROFILE_MPEG1:
case PIPE_VIDEO_PROFILE_MPEG2_SIMPLE:
#include "vdpau_private.h"
+/**
+ * Create a VdpDevice object for use with X11.
+ */
PUBLIC VdpStatus
vdp_imp_device_create_x11(Display *display, int screen, VdpDevice *device,
VdpGetProcAddress **get_proc_address)
return ret;
}
+/**
+ * Create a VdpPresentationQueueTarget for use with X11.
+ */
PUBLIC VdpStatus
vlVdpPresentationQueueTargetCreateX11(VdpDevice device, Drawable drawable,
VdpPresentationQueueTarget *target)
return ret;
}
+/**
+ * Destroy a VdpPresentationQueueTarget.
+ */
VdpStatus
vlVdpPresentationQueueTargetDestroy(VdpPresentationQueueTarget presentation_queue_target)
{
return VDP_STATUS_OK;
}
+/**
+ * Destroy a VdpDevice.
+ */
VdpStatus
vlVdpDeviceDestroy(VdpDevice device)
{
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Destroying destroy\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Destroying device\n");
vlVdpDevice *dev = vlGetDataHTAB(device);
if (!dev)
FREE(dev);
vlDestroyHTAB();
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Device destroyed succesfully\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Device destroyed successfully\n");
return VDP_STATUS_OK;
}
+/**
+ * Retrieve a VDPAU function pointer.
+ */
VdpStatus
vlVdpGetProcAddress(VdpDevice device, VdpFuncId function_id, void **function_pointer)
{
#define _ERROR_TYPE(TYPE,STRING) case TYPE: return STRING;
+/**
+ * Retrieve a string describing an error code.
+ */
char const *
vlVdpGetErrorString (VdpStatus status)
{
#include "vdpau_private.h"
+/**
+ * Create a VdpVideoMixer.
+ */
VdpStatus
vlVdpVideoMixerCreate(VdpDevice device,
uint32_t feature_count,
return ret;
}
+/**
+ * Destroy a VdpVideoMixer.
+ */
VdpStatus
vlVdpVideoMixerDestroy(VdpVideoMixer mixer)
{
return VDP_STATUS_OK;
}
+/**
+ * Enable or disable features.
+ */
VdpStatus
vlVdpVideoMixerSetFeatureEnables(VdpVideoMixer mixer,
uint32_t feature_count,
return VDP_STATUS_OK;
}
+/**
+ * Perform a video post-processing and compositing operation.
+ */
VdpStatus vlVdpVideoMixerRender(VdpVideoMixer mixer,
VdpOutputSurface background_surface,
VdpRect const *background_source_rect,
return VDP_STATUS_OK;
}
+/**
+ * Set attribute values.
+ */
VdpStatus
vlVdpVideoMixerSetAttributeValues(VdpVideoMixer mixer,
uint32_t attribute_count,
return VDP_STATUS_OK;
}
+/**
+ * Retrieve whether features were requested at creation time.
+ */
VdpStatus
vlVdpVideoMixerGetFeatureSupport(VdpVideoMixer mixer,
uint32_t feature_count,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Retrieve whether features are enabled.
+ */
VdpStatus
vlVdpVideoMixerGetFeatureEnables(VdpVideoMixer mixer,
uint32_t feature_count,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Retrieve parameter values given at creation time.
+ */
VdpStatus
vlVdpVideoMixerGetParameterValues(VdpVideoMixer mixer,
uint32_t parameter_count,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Retrieve current attribute values.
+ */
VdpStatus
vlVdpVideoMixerGetAttributeValues(VdpVideoMixer mixer,
uint32_t attribute_count,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Generate a color space conversion matrix.
+ */
VdpStatus
vlVdpGenerateCSCMatrix(VdpProcamp *procamp,
VdpColorStandard standard,
#include "vdpau_private.h"
+/**
+ * Create a VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfaceCreate(VdpDevice device,
VdpRGBAFormat rgba_format,
return VDP_STATUS_OK;
}
+/**
+ * Destroy a VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfaceDestroy(VdpOutputSurface surface)
{
return VDP_STATUS_OK;
}
+/**
+ * Retrieve the parameters used to create a VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfaceGetParameters(VdpOutputSurface surface,
VdpRGBAFormat *rgba_format,
{
vlVdpOutputSurface *vlsurface;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] getting surface parameters\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Getting output surface parameters\n");
vlsurface = vlGetDataHTAB(surface);
if (!vlsurface)
return VDP_STATUS_OK;
}
+/**
+ * Copy image data from a VdpOutputSurface to application memory in the
+ * surface's native format.
+ */
VdpStatus
vlVdpOutputSurfaceGetBitsNative(VdpOutputSurface surface,
VdpRect const *source_rect,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Copy image data from application memory in the surface's native format to
+ * a VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfacePutBitsNative(VdpOutputSurface surface,
void const *const *source_data,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Copy image data from application memory in a specific indexed format to
+ * a VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfacePutBitsIndexed(VdpOutputSurface surface,
VdpIndexedFormat source_indexed_format,
struct pipe_box box;
struct pipe_video_rect dst_rect;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] uploading indexed output surface\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Uploading indexed output surface\n");
vlsurface = vlGetDataHTAB(surface);
if (!vlsurface)
return VDP_STATUS_RESOURCES;
}
+/**
+ * Copy image data from application memory in a specific YCbCr format to
+ * a VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfacePutBitsYCbCr(VdpOutputSurface surface,
VdpYCbCrFormat source_ycbcr_format,
return context->create_blend_state(context, &blend);
}
+/**
+ * Composite a sub-rectangle of a VdpOutputSurface into a sub-rectangle of
+ * another VdpOutputSurface; Output Surface object VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfaceRenderOutputSurface(VdpOutputSurface destination_surface,
VdpRect const *destination_rect,
void *blend;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] composing output surfaces\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Composing output surfaces\n");
dst_vlsurface = vlGetDataHTAB(destination_surface);
if (!dst_vlsurface)
return VDP_STATUS_OK;
}
+/**
+ * Composite a sub-rectangle of a VdpBitmapSurface into a sub-rectangle of
+ * a VdpOutputSurface; Output Surface object VdpOutputSurface.
+ */
VdpStatus
vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
VdpRect const *destination_rect,
#include <vdpau/vdpau.h>
+/**
+ * A callback to notify the client application that a device's display has
+ * been preempted.
+ */
void vlVdpPreemptionCallback(VdpDevice device, void *context)
{
/* TODO: Implement preemption */
}
+/**
+ * Configure the display preemption callback.
+ */
VdpStatus vlVdpPreemptionCallbackRegister(VdpDevice device,
VdpPreemptionCallback callback,
void *context)
#include "vdpau_private.h"
+/**
+ * Create a VdpPresentationQueue.
+ */
VdpStatus
vlVdpPresentationQueueCreate(VdpDevice device,
VdpPresentationQueueTarget presentation_queue_target,
return ret;
}
+/**
+ * Destroy a VdpPresentationQueue.
+ */
VdpStatus
vlVdpPresentationQueueDestroy(VdpPresentationQueue presentation_queue)
{
return VDP_STATUS_OK;
}
+/**
+ * Configure the background color setting.
+ */
VdpStatus
vlVdpPresentationQueueSetBackgroundColor(VdpPresentationQueue presentation_queue,
VdpColor *const background_color)
{
vlVdpPresentationQueue *pq;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Setting Background Color\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Setting background color\n");
if (!background_color)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_OK;
}
+/**
+ * Retrieve the current background color setting.
+ */
VdpStatus
vlVdpPresentationQueueGetBackgroundColor(VdpPresentationQueue presentation_queue,
VdpColor *const background_color)
{
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Getting background color\n");
+
if (!background_color)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Retrieve the presentation queue's "current" time.
+ */
VdpStatus
vlVdpPresentationQueueGetTime(VdpPresentationQueue presentation_queue,
VdpTime *current_time)
{
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Getting queue time\n");
+
if (!current_time)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Enter a surface into the presentation queue.
+ */
VdpStatus
vlVdpPresentationQueueDisplay(VdpPresentationQueue presentation_queue,
VdpOutputSurface surface,
return VDP_STATUS_OK;
}
+/**
+ * Wait for a surface to finish being displayed.
+ */
VdpStatus
vlVdpPresentationQueueBlockUntilSurfaceIdle(VdpPresentationQueue presentation_queue,
VdpOutputSurface surface,
return VDP_STATUS_OK;
}
+/**
+ * Poll the current queue status of a surface.
+ */
VdpStatus
vlVdpPresentationQueueQuerySurfaceStatus(VdpPresentationQueue presentation_queue,
VdpOutputSurface surface,
#include "pipe/p_defines.h"
#include "util/u_debug.h"
-
+/**
+ * Retrieve the VDPAU version implemented by the backend.
+ */
VdpStatus
vlVdpGetApiVersion(uint32_t *api_version)
{
return VDP_STATUS_OK;
}
+/**
+ * Retrieve an implementation-specific string description of the implementation.
+ * This typically includes detailed version information.
+ */
VdpStatus
vlVdpGetInformationString(char const **information_string)
{
return VDP_STATUS_OK;
}
+/**
+ * Query the implementation's VdpVideoSurface capabilities.
+ */
VdpStatus
vlVdpVideoSurfaceQueryCapabilities(VdpDevice device, VdpChromaType surface_chroma_type,
VdpBool *is_supported, uint32_t *max_width, uint32_t *max_height)
struct pipe_screen *pscreen;
uint32_t max_2d_texture_level;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying video surfaces\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpVideoSurface capabilities\n");
if (!(is_supported && max_width && max_height))
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_OK;
}
+/**
+ * Query the implementation's VdpVideoSurface GetBits/PutBits capabilities.
+ */
VdpStatus
vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities(VdpDevice device, VdpChromaType surface_chroma_type,
VdpYCbCrFormat bits_ycbcr_format,
vlVdpDevice *dev;
struct pipe_screen *pscreen;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying get put video surfaces\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpVideoSurface get/put bits YCbCr capabilities\n");
if (!is_supported)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_OK;
}
+/**
+ * Query the implementation's VdpDecoder capabilities.
+ */
VdpStatus
vlVdpDecoderQueryCapabilities(VdpDevice device, VdpDecoderProfile profile,
VdpBool *is_supported, uint32_t *max_level, uint32_t *max_macroblocks,
struct pipe_screen *pscreen;
enum pipe_video_profile p_profile;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying decoder\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpDecoder capabilities\n");
if (!(is_supported && max_level && max_macroblocks && max_width && max_height))
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_OK;
}
+/**
+ * Query the implementation's VdpOutputSurface capabilities.
+ */
VdpStatus
vlVdpOutputSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format,
VdpBool *is_supported, uint32_t *max_width, uint32_t *max_height)
if (!(is_supported && max_width && max_height))
return VDP_STATUS_INVALID_POINTER;
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying ouput surfaces\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpOutputSurface capabilities\n");
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's capability to perform a PutBits operation using
+ * application data matching the surface's format.
+ */
VdpStatus
vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format,
VdpBool *is_supported)
{
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying output surfaces get put native cap\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpOutputSurface get/put bits native capabilities\n");
if (!is_supported)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's capability to perform a PutBits operation using
+ * application data in a specific indexed format.
+ */
VdpStatus
vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities(VdpDevice device,
VdpRGBAFormat surface_rgba_format,
VdpColorTableFormat color_table_format,
VdpBool *is_supported)
{
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying output surfaces get put indexed cap\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpOutputSurface put bits indexed capabilities\n");
if (!is_supported)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's capability to perform a PutBits operation using
+ * application data in a specific YCbCr/YUB format.
+ */
VdpStatus
vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format,
VdpYCbCrFormat bits_ycbcr_format,
VdpBool *is_supported)
{
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying output surfaces put ycrcb cap\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpOutputSurface put bits YCbCr capabilities\n");
+
if (!is_supported)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's VdpBitmapSurface capabilities.
+ */
VdpStatus
vlVdpBitmapSurfaceQueryCapabilities(VdpDevice device, VdpRGBAFormat surface_rgba_format,
VdpBool *is_supported, uint32_t *max_width, uint32_t *max_height)
{
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying bitmap surfaces\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpBitmapSurface capabilities\n");
+
if (!(is_supported && max_width && max_height))
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's support for a specific feature.
+ */
VdpStatus
vlVdpVideoMixerQueryFeatureSupport(VdpDevice device, VdpVideoMixerFeature feature,
VdpBool *is_supported)
{
- VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying mixer feature support\n");
+ VDPAU_MSG(VDPAU_TRACE, "[VDPAU] Querying VdpVideoMixer feature support\n");
+
if (!is_supported)
return VDP_STATUS_INVALID_POINTER;
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's support for a specific parameter.
+ */
VdpStatus
vlVdpVideoMixerQueryParameterSupport(VdpDevice device, VdpVideoMixerParameter parameter,
VdpBool *is_supported)
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's supported for a specific parameter.
+ */
VdpStatus
vlVdpVideoMixerQueryParameterValueRange(VdpDevice device, VdpVideoMixerParameter parameter,
void *min_value, void *max_value)
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's support for a specific attribute.
+ */
VdpStatus
vlVdpVideoMixerQueryAttributeSupport(VdpDevice device, VdpVideoMixerAttribute attribute,
VdpBool *is_supported)
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Query the implementation's supported for a specific attribute.
+ */
VdpStatus
vlVdpVideoMixerQueryAttributeValueRange(VdpDevice device, VdpVideoMixerAttribute attribute,
void *min_value, void *max_value)
#include "vdpau_private.h"
+/**
+ * Create a VdpVideoSurface.
+ */
VdpStatus
vlVdpVideoSurfaceCreate(VdpDevice device, VdpChromaType chroma_type,
uint32_t width, uint32_t height,
return ret;
}
+/**
+ * Destroy a VdpVideoSurface.
+ */
VdpStatus
vlVdpVideoSurfaceDestroy(VdpVideoSurface surface)
{
return VDP_STATUS_OK;
}
+/**
+ * Retrieve the parameters used to create a VdpVideoSurface.
+ */
VdpStatus
vlVdpVideoSurfaceGetParameters(VdpVideoSurface surface,
VdpChromaType *chroma_type,
return VDP_STATUS_OK;
}
+/**
+ * Copy image data from a VdpVideoSurface to application memory in a specified
+ * YCbCr format.
+ */
VdpStatus
vlVdpVideoSurfaceGetBitsYCbCr(VdpVideoSurface surface,
VdpYCbCrFormat destination_ycbcr_format,
return VDP_STATUS_NO_IMPLEMENTATION;
}
+/**
+ * Copy image data from application memory in a specific YCbCr format to
+ * a VdpVideoSurface.
+ */
VdpStatus
vlVdpVideoSurfacePutBitsYCbCr(VdpVideoSurface surface,
VdpYCbCrFormat source_ycbcr_format,
#include "vl_winsys.h"
+/* Full VDPAU API documentation available at :
+ * ftp://download.nvidia.com/XFree86/vdpau/doxygen/html/index.html */
+
#define INFORMATION G3DVL VDPAU Driver Shared Library version VER_MAJOR.VER_MINOR
#define QUOTEME(x) #x
#define TOSTRING(x) QUOTEME(x)
//case PIPE_FORMAT_YUVA:
// return VDP_YCBCR_FORMAT_Y8U8V8A8;
case PIPE_FORMAT_VUYA:
- return VDP_YCBCR_FORMAT_V8U8Y8A8;
+ return VDP_YCBCR_FORMAT_V8U8Y8A8;
default:
assert(0);
}