vdpau_private.h revision f8ac7e034803a1c873bf156c012fede6d2640097
15c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)/**************************************************************************
25c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
35c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Copyright 2010 Younes Manton & Thomas Balling Sørensen.
45c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * All Rights Reserved.
55c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
65c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * Permission is hereby granted, free of charge, to any person obtaining a
75c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * copy of this software and associated documentation files (the
85c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * "Software"), to deal in the Software without restriction, including
95c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * without limitation the rights to use, copy, modify, merge, publish,
105c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * distribute, sub license, and/or sell copies of the Software, and to
115c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * permit persons to whom the Software is furnished to do so, subject to
125c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * the following conditions:
135c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
145c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * The above copyright notice and this permission notice (including the
155c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * next paragraph) shall be included in all copies or substantial portions
165c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * of the Software.
175c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
185c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
195c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
205c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
215c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
225c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
235c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
245c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
255c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) *
265c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) **************************************************************************/
275c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
285c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#ifndef VDPAU_PRIVATE_H
295c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define VDPAU_PRIVATE_H
305c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
315c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include <assert.h>
325c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
335c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include <vdpau/vdpau.h>
345c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include <vdpau/vdpau_x11.h>
355c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
365c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "pipe/p_compiler.h"
375c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "pipe/p_video_decoder.h"
385c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
395c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "util/u_debug.h"
405c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "util/u_rect.h"
415c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
425c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "vl/vl_compositor.h"
435c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "vl/vl_csc.h"
445c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "vl/vl_matrix_filter.h"
455c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "vl/vl_median_filter.h"
46926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
475c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#include "vl_winsys.h"
48926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)
49926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)/* Full VDPAU API documentation available at :
505c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles) * ftp://download.nvidia.com/XFree86/vdpau/doxygen/html/index.html */
515c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
525c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define INFORMATION G3DVL VDPAU Driver Shared Library version VER_MAJOR.VER_MINOR
535c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define QUOTEME(x) #x
545c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define TOSTRING(x) QUOTEME(x)
555c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define INFORMATION_STRING TOSTRING(INFORMATION)
565c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)#define VL_HANDLES
575c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
585c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)static inline enum pipe_video_chroma_format
595c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)ChromaToPipe(VdpChromaType vdpau_type)
605c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles){
61926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)   switch (vdpau_type) {
625c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)      case VDP_CHROMA_TYPE_420:
635c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)         return PIPE_VIDEO_CHROMA_FORMAT_420;
645c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)      case VDP_CHROMA_TYPE_422:
655c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)         return PIPE_VIDEO_CHROMA_FORMAT_422;
665c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)      case VDP_CHROMA_TYPE_444:
675c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)         return PIPE_VIDEO_CHROMA_FORMAT_444;
68926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)      default:
695c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)         assert(0);
705c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)   }
715c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
725c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)   return -1;
735c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)}
745c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)
755c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)static inline VdpChromaType
76926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)PipeToChroma(enum pipe_video_chroma_format pipe_type)
77926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles){
78926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)   switch (pipe_type) {
79926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)      case PIPE_VIDEO_CHROMA_FORMAT_420:
80926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)         return VDP_CHROMA_TYPE_420;
81926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)      case PIPE_VIDEO_CHROMA_FORMAT_422:
82926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)         return VDP_CHROMA_TYPE_422;
83926b001d589ce2f10facb93dd4b87578ea35a855Torne (Richard Coles)      case PIPE_VIDEO_CHROMA_FORMAT_444:
845c87bf8b86a7c82ef50fb7a89697d8e02e2553beTorne (Richard Coles)         return VDP_CHROMA_TYPE_444;
85      default:
86         assert(0);
87   }
88
89   return -1;
90}
91
92static inline enum pipe_format
93FormatYCBCRToPipe(VdpYCbCrFormat vdpau_format)
94{
95   switch (vdpau_format) {
96      case VDP_YCBCR_FORMAT_NV12:
97         return PIPE_FORMAT_NV12;
98      case VDP_YCBCR_FORMAT_YV12:
99         return PIPE_FORMAT_YV12;
100      case VDP_YCBCR_FORMAT_UYVY:
101         return PIPE_FORMAT_UYVY;
102      case VDP_YCBCR_FORMAT_YUYV:
103         return PIPE_FORMAT_YUYV;
104      case VDP_YCBCR_FORMAT_Y8U8V8A8: /* Not defined in p_format.h */
105         return PIPE_FORMAT_NONE;
106      case VDP_YCBCR_FORMAT_V8U8Y8A8:
107	     return PIPE_FORMAT_VUYA;
108      default:
109         assert(0);
110   }
111
112   return PIPE_FORMAT_NONE;
113}
114
115static inline VdpYCbCrFormat
116PipeToFormatYCBCR(enum pipe_format p_format)
117{
118   switch (p_format) {
119      case PIPE_FORMAT_NV12:
120         return VDP_YCBCR_FORMAT_NV12;
121      case PIPE_FORMAT_YV12:
122         return VDP_YCBCR_FORMAT_YV12;
123      case PIPE_FORMAT_UYVY:
124         return VDP_YCBCR_FORMAT_UYVY;
125      case PIPE_FORMAT_YUYV:
126         return VDP_YCBCR_FORMAT_YUYV;
127      //case PIPE_FORMAT_YUVA:
128        // return VDP_YCBCR_FORMAT_Y8U8V8A8;
129      case PIPE_FORMAT_VUYA:
130         return VDP_YCBCR_FORMAT_V8U8Y8A8;
131      default:
132         assert(0);
133   }
134
135   return -1;
136}
137
138static inline enum pipe_format
139FormatRGBAToPipe(VdpRGBAFormat vdpau_format)
140{
141   switch (vdpau_format) {
142      case VDP_RGBA_FORMAT_A8:
143         return PIPE_FORMAT_A8_UNORM;
144      case VDP_RGBA_FORMAT_B10G10R10A2:
145         return PIPE_FORMAT_B10G10R10A2_UNORM;
146      case VDP_RGBA_FORMAT_B8G8R8A8:
147         return PIPE_FORMAT_B8G8R8A8_UNORM;
148      case VDP_RGBA_FORMAT_R10G10B10A2:
149         return PIPE_FORMAT_R10G10B10A2_UNORM;
150      case VDP_RGBA_FORMAT_R8G8B8A8:
151         return PIPE_FORMAT_R8G8B8A8_UNORM;
152      default:
153         assert(0);
154   }
155
156   return PIPE_FORMAT_NONE;
157}
158
159static inline VdpRGBAFormat
160PipeToFormatRGBA(enum pipe_format p_format)
161{
162   switch (p_format) {
163      case PIPE_FORMAT_A8_UNORM:
164         return VDP_RGBA_FORMAT_A8;
165      case PIPE_FORMAT_B10G10R10A2_UNORM:
166         return VDP_RGBA_FORMAT_B10G10R10A2;
167      case PIPE_FORMAT_B8G8R8A8_UNORM:
168         return VDP_RGBA_FORMAT_B8G8R8A8;
169      case PIPE_FORMAT_R10G10B10A2_UNORM:
170         return VDP_RGBA_FORMAT_R10G10B10A2;
171      case PIPE_FORMAT_R8G8B8A8_UNORM:
172         return VDP_RGBA_FORMAT_R8G8B8A8;
173      default:
174         assert(0);
175   }
176
177   return -1;
178}
179
180static inline enum pipe_format
181FormatIndexedToPipe(VdpRGBAFormat vdpau_format)
182{
183   switch (vdpau_format) {
184      case VDP_INDEXED_FORMAT_A4I4:
185         return PIPE_FORMAT_A4R4_UNORM;
186      case VDP_INDEXED_FORMAT_I4A4:
187         return PIPE_FORMAT_R4A4_UNORM;
188      case VDP_INDEXED_FORMAT_A8I8:
189         return PIPE_FORMAT_A8R8_UNORM;
190      case VDP_INDEXED_FORMAT_I8A8:
191         return PIPE_FORMAT_R8A8_UNORM;
192      default:
193         assert(0);
194   }
195
196   return PIPE_FORMAT_NONE;
197}
198
199static inline enum pipe_format
200FormatColorTableToPipe(VdpColorTableFormat vdpau_format)
201{
202   switch(vdpau_format) {
203      case VDP_COLOR_TABLE_FORMAT_B8G8R8X8:
204         return PIPE_FORMAT_B8G8R8X8_UNORM;
205      default:
206         assert(0);
207   }
208
209   return PIPE_FORMAT_NONE;
210}
211
212static inline enum pipe_video_profile
213ProfileToPipe(VdpDecoderProfile vdpau_profile)
214{
215   switch (vdpau_profile) {
216      case VDP_DECODER_PROFILE_MPEG1:
217         return PIPE_VIDEO_PROFILE_MPEG1;
218      case VDP_DECODER_PROFILE_MPEG2_SIMPLE:
219         return PIPE_VIDEO_PROFILE_MPEG2_SIMPLE;
220      case VDP_DECODER_PROFILE_MPEG2_MAIN:
221         return PIPE_VIDEO_PROFILE_MPEG2_MAIN;
222      case VDP_DECODER_PROFILE_H264_BASELINE:
223         return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE;
224      case VDP_DECODER_PROFILE_H264_MAIN:
225         return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN;
226      case VDP_DECODER_PROFILE_H264_HIGH:
227         return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH;
228      case VDP_DECODER_PROFILE_MPEG4_PART2_SP:
229         return PIPE_VIDEO_PROFILE_MPEG4_SIMPLE;
230      case VDP_DECODER_PROFILE_MPEG4_PART2_ASP:
231         return PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE;
232      case VDP_DECODER_PROFILE_VC1_SIMPLE:
233         return PIPE_VIDEO_PROFILE_VC1_SIMPLE;
234      case VDP_DECODER_PROFILE_VC1_MAIN:
235         return PIPE_VIDEO_PROFILE_VC1_MAIN;
236      case VDP_DECODER_PROFILE_VC1_ADVANCED:
237         return PIPE_VIDEO_PROFILE_VC1_ADVANCED;
238      default:
239         return PIPE_VIDEO_PROFILE_UNKNOWN;
240   }
241}
242
243static inline VdpDecoderProfile
244PipeToProfile(enum pipe_video_profile p_profile)
245{
246   switch (p_profile) {
247      case PIPE_VIDEO_PROFILE_MPEG1:
248         return VDP_DECODER_PROFILE_MPEG1;
249      case PIPE_VIDEO_PROFILE_MPEG2_SIMPLE:
250         return VDP_DECODER_PROFILE_MPEG2_SIMPLE;
251      case PIPE_VIDEO_PROFILE_MPEG2_MAIN:
252         return VDP_DECODER_PROFILE_MPEG2_MAIN;
253      case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE:
254         return VDP_DECODER_PROFILE_H264_BASELINE;
255      case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN:
256         return VDP_DECODER_PROFILE_H264_MAIN;
257      case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:
258         return VDP_DECODER_PROFILE_H264_HIGH;
259      case PIPE_VIDEO_PROFILE_MPEG4_SIMPLE:
260         return VDP_DECODER_PROFILE_MPEG4_PART2_SP;
261      case PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE:
262         return VDP_DECODER_PROFILE_MPEG4_PART2_ASP;
263      case PIPE_VIDEO_PROFILE_VC1_SIMPLE:
264         return VDP_DECODER_PROFILE_VC1_SIMPLE;
265      case PIPE_VIDEO_PROFILE_VC1_MAIN:
266         return VDP_DECODER_PROFILE_VC1_MAIN;
267      case PIPE_VIDEO_PROFILE_VC1_ADVANCED:
268         return VDP_DECODER_PROFILE_VC1_ADVANCED;
269      default:
270         assert(0);
271         return -1;
272   }
273}
274
275static inline struct u_rect *
276RectToPipe(const VdpRect *src, struct u_rect *dst)
277{
278   if (src) {
279      dst->x0 = src->x0;
280      dst->y0 = src->y0;
281      dst->x1 = src->x1;
282      dst->y1 = src->y1;
283      return dst;
284   }
285   return NULL;
286}
287
288typedef struct
289{
290   struct vl_screen *vscreen;
291   struct pipe_context *context;
292   struct vl_compositor compositor;
293
294   struct {
295      struct vl_compositor_state *cstate;
296      VdpOutputSurface surface;
297   } delayed_rendering;
298} vlVdpDevice;
299
300typedef struct
301{
302   vlVdpDevice *device;
303   Drawable drawable;
304} vlVdpPresentationQueueTarget;
305
306typedef struct
307{
308   vlVdpDevice *device;
309   Drawable drawable;
310   struct vl_compositor_state cstate;
311} vlVdpPresentationQueue;
312
313typedef struct
314{
315   vlVdpDevice *device;
316   struct vl_compositor_state cstate;
317
318   struct {
319      bool supported, enabled;
320      unsigned level;
321      struct vl_median_filter *filter;
322   } noise_reduction;
323
324   struct {
325      bool supported, enabled;
326      float value;
327      struct vl_matrix_filter *filter;
328   } sharpness;
329
330   unsigned video_width, video_height;
331   enum pipe_video_chroma_format chroma_format;
332   unsigned max_layers, skip_chroma_deint;
333   float luma_key_min, luma_key_max;
334
335   bool custom_csc;
336   vl_csc_matrix csc;
337} vlVdpVideoMixer;
338
339typedef struct
340{
341   vlVdpDevice *device;
342   struct pipe_video_buffer templat, *video_buffer;
343} vlVdpSurface;
344
345typedef uint64_t vlVdpTime;
346
347typedef struct
348{
349   vlVdpTime timestamp;
350   vlVdpDevice *device;
351   struct pipe_surface *surface;
352   struct pipe_sampler_view *sampler_view;
353   struct pipe_fence_handle *fence;
354   struct vl_compositor_state cstate;
355   struct u_rect dirty_area;
356} vlVdpOutputSurface;
357
358typedef struct
359{
360   vlVdpDevice *device;
361   struct pipe_video_decoder *decoder;
362} vlVdpDecoder;
363
364typedef uint32_t vlHandle;
365
366boolean vlCreateHTAB(void);
367void vlDestroyHTAB(void);
368vlHandle vlAddDataHTAB(void *data);
369void* vlGetDataHTAB(vlHandle handle);
370void vlRemoveDataHTAB(vlHandle handle);
371
372boolean vlGetFuncFTAB(VdpFuncId function_id, void **func);
373
374/* Public functions */
375VdpDeviceCreateX11 vdp_imp_device_create_x11;
376VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11;
377
378/* Delayed rendering funtionality */
379void vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, struct u_rect *dirty_area);
380void vlVdpSave4DelayedRendering(vlVdpDevice *dev, VdpOutputSurface surface, struct vl_compositor_state *cstate);
381
382/* Internal function pointers */
383VdpGetErrorString vlVdpGetErrorString;
384VdpDeviceDestroy vlVdpDeviceDestroy;
385VdpGetProcAddress vlVdpGetProcAddress;
386VdpGetApiVersion vlVdpGetApiVersion;
387VdpGetInformationString vlVdpGetInformationString;
388VdpVideoSurfaceQueryCapabilities vlVdpVideoSurfaceQueryCapabilities;
389VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities;
390VdpDecoderQueryCapabilities vlVdpDecoderQueryCapabilities;
391VdpOutputSurfaceQueryCapabilities vlVdpOutputSurfaceQueryCapabilities;
392VdpOutputSurfaceQueryGetPutBitsNativeCapabilities vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities;
393VdpOutputSurfaceQueryPutBitsIndexedCapabilities vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities;
394VdpOutputSurfaceQueryPutBitsYCbCrCapabilities vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities;
395VdpBitmapSurfaceQueryCapabilities vlVdpBitmapSurfaceQueryCapabilities;
396VdpVideoMixerQueryFeatureSupport vlVdpVideoMixerQueryFeatureSupport;
397VdpVideoMixerQueryParameterSupport vlVdpVideoMixerQueryParameterSupport;
398VdpVideoMixerQueryParameterValueRange vlVdpVideoMixerQueryParameterValueRange;
399VdpVideoMixerQueryAttributeSupport vlVdpVideoMixerQueryAttributeSupport;
400VdpVideoMixerQueryAttributeValueRange vlVdpVideoMixerQueryAttributeValueRange;
401VdpVideoSurfaceCreate vlVdpVideoSurfaceCreate;
402VdpVideoSurfaceDestroy vlVdpVideoSurfaceDestroy;
403VdpVideoSurfaceGetParameters vlVdpVideoSurfaceGetParameters;
404VdpVideoSurfaceGetBitsYCbCr vlVdpVideoSurfaceGetBitsYCbCr;
405VdpVideoSurfacePutBitsYCbCr vlVdpVideoSurfacePutBitsYCbCr;
406VdpDecoderCreate vlVdpDecoderCreate;
407VdpDecoderDestroy vlVdpDecoderDestroy;
408VdpDecoderGetParameters vlVdpDecoderGetParameters;
409VdpDecoderRender vlVdpDecoderRender;
410VdpOutputSurfaceCreate vlVdpOutputSurfaceCreate;
411VdpOutputSurfaceDestroy vlVdpOutputSurfaceDestroy;
412VdpOutputSurfaceGetParameters vlVdpOutputSurfaceGetParameters;
413VdpOutputSurfaceGetBitsNative vlVdpOutputSurfaceGetBitsNative;
414VdpOutputSurfacePutBitsNative vlVdpOutputSurfacePutBitsNative;
415VdpOutputSurfacePutBitsIndexed vlVdpOutputSurfacePutBitsIndexed;
416VdpOutputSurfacePutBitsYCbCr vlVdpOutputSurfacePutBitsYCbCr;
417VdpOutputSurfaceRenderOutputSurface vlVdpOutputSurfaceRenderOutputSurface;
418VdpOutputSurfaceRenderBitmapSurface vlVdpOutputSurfaceRenderBitmapSurface;
419VdpBitmapSurfaceCreate vlVdpBitmapSurfaceCreate;
420VdpBitmapSurfaceDestroy vlVdpBitmapSurfaceDestroy;
421VdpBitmapSurfaceGetParameters vlVdpBitmapSurfaceGetParameters;
422VdpBitmapSurfacePutBitsNative vlVdpBitmapSurfacePutBitsNative;
423VdpPresentationQueueTargetDestroy vlVdpPresentationQueueTargetDestroy;
424VdpPresentationQueueCreate vlVdpPresentationQueueCreate;
425VdpPresentationQueueDestroy vlVdpPresentationQueueDestroy;
426VdpPresentationQueueSetBackgroundColor vlVdpPresentationQueueSetBackgroundColor;
427VdpPresentationQueueGetBackgroundColor vlVdpPresentationQueueGetBackgroundColor;
428VdpPresentationQueueGetTime vlVdpPresentationQueueGetTime;
429VdpPresentationQueueDisplay vlVdpPresentationQueueDisplay;
430VdpPresentationQueueBlockUntilSurfaceIdle vlVdpPresentationQueueBlockUntilSurfaceIdle;
431VdpPresentationQueueQuerySurfaceStatus vlVdpPresentationQueueQuerySurfaceStatus;
432VdpPreemptionCallback vlVdpPreemptionCallback;
433VdpPreemptionCallbackRegister vlVdpPreemptionCallbackRegister;
434VdpVideoMixerSetFeatureEnables vlVdpVideoMixerSetFeatureEnables;
435VdpVideoMixerCreate vlVdpVideoMixerCreate;
436VdpVideoMixerRender vlVdpVideoMixerRender;
437VdpVideoMixerSetAttributeValues vlVdpVideoMixerSetAttributeValues;
438VdpVideoMixerGetFeatureSupport vlVdpVideoMixerGetFeatureSupport;
439VdpVideoMixerGetFeatureEnables vlVdpVideoMixerGetFeatureEnables;
440VdpVideoMixerGetParameterValues vlVdpVideoMixerGetParameterValues;
441VdpVideoMixerGetAttributeValues vlVdpVideoMixerGetAttributeValues;
442VdpVideoMixerDestroy vlVdpVideoMixerDestroy;
443VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix;
444
445#define VDPAU_OUT   0
446#define VDPAU_ERR   1
447#define VDPAU_WARN  2
448#define VDPAU_TRACE 3
449
450static inline void VDPAU_MSG(unsigned int level, const char *fmt, ...)
451{
452   static int debug_level = -1;
453
454   if (debug_level == -1) {
455      debug_level = MAX2(debug_get_num_option("VDPAU_DEBUG", 0), 0);
456   }
457
458   if (level <= debug_level) {
459      va_list ap;
460      va_start(ap, fmt);
461      _debug_vprintf(fmt, ap);
462      va_end(ap);
463   }
464}
465
466#endif /* VDPAU_PRIVATE_H */
467