vdpau_private.h revision 494e0025d995fb2cab04474d13880ee438b0c868
1424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)/**************************************************************************
2424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) *
3424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * Copyright 2010 Younes Manton & Thomas Balling Sørensen.
4424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * All Rights Reserved.
5424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) *
6424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * Permission is hereby granted, free of charge, to any person obtaining a
758537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) * copy of this software and associated documentation files (the
858537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles) * "Software"), to deal in the Software without restriction, including
9424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * without limitation the rights to use, copy, modify, merge, publish,
10424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * distribute, sub license, and/or sell copies of the Software, and to
11424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * permit persons to whom the Software is furnished to do so, subject to
12424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * the following conditions:
13424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) *
141320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci * The above copyright notice and this permission notice (including the
151320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci * next paragraph) shall be included in all copies or substantial portions
161320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci * of the Software.
171320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci *
18424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) *
26424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles) **************************************************************************/
27424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
28424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#ifndef VDPAU_PRIVATE_H
29424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#define VDPAU_PRIVATE_H
30424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
311320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci#include <assert.h>
321320f92c476a1ad9d19dba2a48c72b75566198e9Primiano Tucci
33424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include <vdpau/vdpau.h>
34424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include <vdpau/vdpau_x11.h>
35424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
36424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include "pipe/p_compiler.h"
37424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include "pipe/p_video_decoder.h"
38424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
39424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include "util/u_debug.h"
40424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)#include "util/u_rect.h"
41424c4d7b64af9d0d8fd9624f381f469654d5e3d2Torne (Richard Coles)
4258537e28ecd584eab876aee8be7156509866d23aTorne (Richard Coles)#include "vl/vl_compositor.h"
43#include "vl/vl_csc.h"
44#include "vl/vl_matrix_filter.h"
45#include "vl/vl_median_filter.h"
46
47#include "vl_winsys.h"
48
49/* Full VDPAU API documentation available at :
50 * ftp://download.nvidia.com/XFree86/vdpau/doxygen/html/index.html */
51
52#define INFORMATION G3DVL VDPAU Driver Shared Library version VER_MAJOR.VER_MINOR
53#define QUOTEME(x) #x
54#define TOSTRING(x) QUOTEME(x)
55#define INFORMATION_STRING TOSTRING(INFORMATION)
56#define VL_HANDLES
57
58static inline enum pipe_video_chroma_format
59ChromaToPipe(VdpChromaType vdpau_type)
60{
61   switch (vdpau_type) {
62      case VDP_CHROMA_TYPE_420:
63         return PIPE_VIDEO_CHROMA_FORMAT_420;
64      case VDP_CHROMA_TYPE_422:
65         return PIPE_VIDEO_CHROMA_FORMAT_422;
66      case VDP_CHROMA_TYPE_444:
67         return PIPE_VIDEO_CHROMA_FORMAT_444;
68      default:
69         assert(0);
70   }
71
72   return -1;
73}
74
75static inline VdpChromaType
76PipeToChroma(enum pipe_video_chroma_format pipe_type)
77{
78   switch (pipe_type) {
79      case PIPE_VIDEO_CHROMA_FORMAT_420:
80         return VDP_CHROMA_TYPE_420;
81      case PIPE_VIDEO_CHROMA_FORMAT_422:
82         return VDP_CHROMA_TYPE_422;
83      case PIPE_VIDEO_CHROMA_FORMAT_444:
84         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
288static inline struct pipe_box
289RectToPipeBox(const VdpRect *rect, struct pipe_resource *res)
290{
291   struct pipe_box box;
292
293   box.x = 0;
294   box.y = 0;
295   box.z = 0;
296   box.width = res->width0;
297   box.height = res->height0;
298   box.depth = 1;
299
300   if (rect) {
301      box.x = MIN2(rect->x0, rect->x1);
302      box.y = MIN2(rect->y0, rect->y1);
303      box.width = abs(rect->x1 - rect->x0);
304      box.height = abs(rect->y1 - rect->y0);
305   }
306
307   return box;
308}
309
310typedef struct
311{
312   struct vl_screen *vscreen;
313   struct pipe_context *context;
314   struct vl_compositor compositor;
315
316   struct {
317      struct vl_compositor_state *cstate;
318      VdpOutputSurface surface;
319   } delayed_rendering;
320} vlVdpDevice;
321
322typedef struct
323{
324   vlVdpDevice *device;
325   Drawable drawable;
326} vlVdpPresentationQueueTarget;
327
328typedef struct
329{
330   vlVdpDevice *device;
331   Drawable drawable;
332   struct vl_compositor_state cstate;
333} vlVdpPresentationQueue;
334
335typedef struct
336{
337   vlVdpDevice *device;
338   struct vl_compositor_state cstate;
339
340   struct {
341      bool supported, enabled;
342      unsigned level;
343      struct vl_median_filter *filter;
344   } noise_reduction;
345
346   struct {
347      bool supported, enabled;
348      float value;
349      struct vl_matrix_filter *filter;
350   } sharpness;
351
352   unsigned video_width, video_height;
353   enum pipe_video_chroma_format chroma_format;
354   unsigned max_layers, skip_chroma_deint;
355   float luma_key_min, luma_key_max;
356
357   bool custom_csc;
358   vl_csc_matrix csc;
359} vlVdpVideoMixer;
360
361typedef struct
362{
363   vlVdpDevice *device;
364   struct pipe_video_buffer templat, *video_buffer;
365} vlVdpSurface;
366
367typedef struct
368{
369   vlVdpDevice *device;
370   struct pipe_sampler_view *sampler_view;
371} vlVdpBitmapSurface;
372
373typedef uint64_t vlVdpTime;
374
375typedef struct
376{
377   vlVdpTime timestamp;
378   vlVdpDevice *device;
379   struct pipe_surface *surface;
380   struct pipe_sampler_view *sampler_view;
381   struct pipe_fence_handle *fence;
382   struct vl_compositor_state cstate;
383   struct u_rect dirty_area;
384} vlVdpOutputSurface;
385
386typedef struct
387{
388   vlVdpDevice *device;
389   struct pipe_video_decoder *decoder;
390} vlVdpDecoder;
391
392typedef uint32_t vlHandle;
393
394boolean vlCreateHTAB(void);
395void vlDestroyHTAB(void);
396vlHandle vlAddDataHTAB(void *data);
397void* vlGetDataHTAB(vlHandle handle);
398void vlRemoveDataHTAB(vlHandle handle);
399
400boolean vlGetFuncFTAB(VdpFuncId function_id, void **func);
401
402/* Public functions */
403VdpDeviceCreateX11 vdp_imp_device_create_x11;
404VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11;
405
406void vlVdpDefaultSamplerViewTemplate(struct pipe_sampler_view *templ, struct pipe_resource *res);
407
408/* Delayed rendering funtionality */
409void vlVdpResolveDelayedRendering(vlVdpDevice *dev, struct pipe_surface *surface, struct u_rect *dirty_area);
410void vlVdpSave4DelayedRendering(vlVdpDevice *dev, VdpOutputSurface surface, struct vl_compositor_state *cstate);
411
412/* Internal function pointers */
413VdpGetErrorString vlVdpGetErrorString;
414VdpDeviceDestroy vlVdpDeviceDestroy;
415VdpGetProcAddress vlVdpGetProcAddress;
416VdpGetApiVersion vlVdpGetApiVersion;
417VdpGetInformationString vlVdpGetInformationString;
418VdpVideoSurfaceQueryCapabilities vlVdpVideoSurfaceQueryCapabilities;
419VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities;
420VdpDecoderQueryCapabilities vlVdpDecoderQueryCapabilities;
421VdpOutputSurfaceQueryCapabilities vlVdpOutputSurfaceQueryCapabilities;
422VdpOutputSurfaceQueryGetPutBitsNativeCapabilities vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities;
423VdpOutputSurfaceQueryPutBitsIndexedCapabilities vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities;
424VdpOutputSurfaceQueryPutBitsYCbCrCapabilities vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities;
425VdpBitmapSurfaceQueryCapabilities vlVdpBitmapSurfaceQueryCapabilities;
426VdpVideoMixerQueryFeatureSupport vlVdpVideoMixerQueryFeatureSupport;
427VdpVideoMixerQueryParameterSupport vlVdpVideoMixerQueryParameterSupport;
428VdpVideoMixerQueryParameterValueRange vlVdpVideoMixerQueryParameterValueRange;
429VdpVideoMixerQueryAttributeSupport vlVdpVideoMixerQueryAttributeSupport;
430VdpVideoMixerQueryAttributeValueRange vlVdpVideoMixerQueryAttributeValueRange;
431VdpVideoSurfaceCreate vlVdpVideoSurfaceCreate;
432VdpVideoSurfaceDestroy vlVdpVideoSurfaceDestroy;
433VdpVideoSurfaceGetParameters vlVdpVideoSurfaceGetParameters;
434VdpVideoSurfaceGetBitsYCbCr vlVdpVideoSurfaceGetBitsYCbCr;
435VdpVideoSurfacePutBitsYCbCr vlVdpVideoSurfacePutBitsYCbCr;
436VdpDecoderCreate vlVdpDecoderCreate;
437VdpDecoderDestroy vlVdpDecoderDestroy;
438VdpDecoderGetParameters vlVdpDecoderGetParameters;
439VdpDecoderRender vlVdpDecoderRender;
440VdpOutputSurfaceCreate vlVdpOutputSurfaceCreate;
441VdpOutputSurfaceDestroy vlVdpOutputSurfaceDestroy;
442VdpOutputSurfaceGetParameters vlVdpOutputSurfaceGetParameters;
443VdpOutputSurfaceGetBitsNative vlVdpOutputSurfaceGetBitsNative;
444VdpOutputSurfacePutBitsNative vlVdpOutputSurfacePutBitsNative;
445VdpOutputSurfacePutBitsIndexed vlVdpOutputSurfacePutBitsIndexed;
446VdpOutputSurfacePutBitsYCbCr vlVdpOutputSurfacePutBitsYCbCr;
447VdpOutputSurfaceRenderOutputSurface vlVdpOutputSurfaceRenderOutputSurface;
448VdpOutputSurfaceRenderBitmapSurface vlVdpOutputSurfaceRenderBitmapSurface;
449VdpBitmapSurfaceCreate vlVdpBitmapSurfaceCreate;
450VdpBitmapSurfaceDestroy vlVdpBitmapSurfaceDestroy;
451VdpBitmapSurfaceGetParameters vlVdpBitmapSurfaceGetParameters;
452VdpBitmapSurfacePutBitsNative vlVdpBitmapSurfacePutBitsNative;
453VdpPresentationQueueTargetDestroy vlVdpPresentationQueueTargetDestroy;
454VdpPresentationQueueCreate vlVdpPresentationQueueCreate;
455VdpPresentationQueueDestroy vlVdpPresentationQueueDestroy;
456VdpPresentationQueueSetBackgroundColor vlVdpPresentationQueueSetBackgroundColor;
457VdpPresentationQueueGetBackgroundColor vlVdpPresentationQueueGetBackgroundColor;
458VdpPresentationQueueGetTime vlVdpPresentationQueueGetTime;
459VdpPresentationQueueDisplay vlVdpPresentationQueueDisplay;
460VdpPresentationQueueBlockUntilSurfaceIdle vlVdpPresentationQueueBlockUntilSurfaceIdle;
461VdpPresentationQueueQuerySurfaceStatus vlVdpPresentationQueueQuerySurfaceStatus;
462VdpPreemptionCallback vlVdpPreemptionCallback;
463VdpPreemptionCallbackRegister vlVdpPreemptionCallbackRegister;
464VdpVideoMixerSetFeatureEnables vlVdpVideoMixerSetFeatureEnables;
465VdpVideoMixerCreate vlVdpVideoMixerCreate;
466VdpVideoMixerRender vlVdpVideoMixerRender;
467VdpVideoMixerSetAttributeValues vlVdpVideoMixerSetAttributeValues;
468VdpVideoMixerGetFeatureSupport vlVdpVideoMixerGetFeatureSupport;
469VdpVideoMixerGetFeatureEnables vlVdpVideoMixerGetFeatureEnables;
470VdpVideoMixerGetParameterValues vlVdpVideoMixerGetParameterValues;
471VdpVideoMixerGetAttributeValues vlVdpVideoMixerGetAttributeValues;
472VdpVideoMixerDestroy vlVdpVideoMixerDestroy;
473VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix;
474
475#define VDPAU_OUT   0
476#define VDPAU_ERR   1
477#define VDPAU_WARN  2
478#define VDPAU_TRACE 3
479
480static inline void VDPAU_MSG(unsigned int level, const char *fmt, ...)
481{
482   static int debug_level = -1;
483
484   if (debug_level == -1) {
485      debug_level = MAX2(debug_get_num_option("VDPAU_DEBUG", 0), 0);
486   }
487
488   if (level <= debug_level) {
489      va_list ap;
490      va_start(ap, fmt);
491      _debug_vprintf(fmt, ap);
492      va_end(ap);
493   }
494}
495
496#endif /* VDPAU_PRIVATE_H */
497