1 /**************************************************************************
3 * Copyright 2010 Younes Manton & Thomas Balling Sørensen.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
28 #ifndef VDPAU_PRIVATE_H
29 #define VDPAU_PRIVATE_H
33 #include <vdpau/vdpau.h>
34 #include <vdpau/vdpau_x11.h>
36 #include "pipe/p_compiler.h"
37 #include "pipe/p_video_codec.h"
39 #include "frontend/vdpau_interop.h"
40 #include "frontend/vdpau_dmabuf.h"
41 #include "frontend/vdpau_funcs.h"
43 #include "util/u_debug.h"
44 #include "util/u_rect.h"
45 #include "os/os_thread.h"
47 #include "vl/vl_video_buffer.h"
48 #include "vl/vl_bicubic_filter.h"
49 #include "vl/vl_compositor.h"
50 #include "vl/vl_csc.h"
51 #include "vl/vl_deint_filter.h"
52 #include "vl/vl_matrix_filter.h"
53 #include "vl/vl_median_filter.h"
54 #include "vl/vl_winsys.h"
56 /* Full VDPAU API documentation available at :
57 * ftp://download.nvidia.com/XFree86/vdpau/doxygen/html/index.html */
59 #define INFORMATION G3DVL VDPAU Driver Shared Library version VER_MAJOR.VER_MINOR
61 #define TOSTRING(x) QUOTEME(x)
62 #define INFORMATION_STRING TOSTRING(INFORMATION)
64 static inline enum pipe_video_chroma_format
65 ChromaToPipe(VdpChromaType vdpau_type
)
68 case VDP_CHROMA_TYPE_420
:
69 return PIPE_VIDEO_CHROMA_FORMAT_420
;
70 case VDP_CHROMA_TYPE_422
:
71 return PIPE_VIDEO_CHROMA_FORMAT_422
;
72 case VDP_CHROMA_TYPE_444
:
73 return PIPE_VIDEO_CHROMA_FORMAT_444
;
81 static inline VdpChromaType
82 PipeToChroma(enum pipe_video_chroma_format pipe_type
)
85 case PIPE_VIDEO_CHROMA_FORMAT_420
:
86 return VDP_CHROMA_TYPE_420
;
87 case PIPE_VIDEO_CHROMA_FORMAT_422
:
88 return VDP_CHROMA_TYPE_422
;
89 case PIPE_VIDEO_CHROMA_FORMAT_444
:
90 return VDP_CHROMA_TYPE_444
;
98 static inline enum pipe_video_chroma_format
99 FormatYCBCRToPipeChroma(VdpYCbCrFormat vdpau_format
)
101 switch (vdpau_format
) {
102 case VDP_YCBCR_FORMAT_NV12
:
103 return PIPE_VIDEO_CHROMA_FORMAT_420
;
104 case VDP_YCBCR_FORMAT_YV12
:
105 return PIPE_VIDEO_CHROMA_FORMAT_420
;
106 case VDP_YCBCR_FORMAT_UYVY
:
107 return PIPE_VIDEO_CHROMA_FORMAT_422
;
108 case VDP_YCBCR_FORMAT_YUYV
:
109 return PIPE_VIDEO_CHROMA_FORMAT_422
;
110 case VDP_YCBCR_FORMAT_Y8U8V8A8
:
111 return PIPE_VIDEO_CHROMA_FORMAT_444
;
112 case VDP_YCBCR_FORMAT_V8U8Y8A8
:
113 return PIPE_VIDEO_CHROMA_FORMAT_444
;
118 return PIPE_FORMAT_NONE
;
121 static inline enum pipe_format
122 FormatYCBCRToPipe(VdpYCbCrFormat vdpau_format
)
124 switch (vdpau_format
) {
125 case VDP_YCBCR_FORMAT_NV12
:
126 return PIPE_FORMAT_NV12
;
127 case VDP_YCBCR_FORMAT_YV12
:
128 return PIPE_FORMAT_YV12
;
129 case VDP_YCBCR_FORMAT_UYVY
:
130 return PIPE_FORMAT_UYVY
;
131 case VDP_YCBCR_FORMAT_YUYV
:
132 return PIPE_FORMAT_YUYV
;
133 case VDP_YCBCR_FORMAT_Y8U8V8A8
:
134 return PIPE_FORMAT_R8G8B8A8_UNORM
;
135 case VDP_YCBCR_FORMAT_V8U8Y8A8
:
136 return PIPE_FORMAT_B8G8R8A8_UNORM
;
137 #ifdef VDP_YCBCR_FORMAT_P010
138 case VDP_YCBCR_FORMAT_P010
:
139 return PIPE_FORMAT_P010
;
141 #ifdef VDP_YCBCR_FORMAT_P016
142 case VDP_YCBCR_FORMAT_P016
:
143 return PIPE_FORMAT_P016
;
146 /* NOTE: Can't be "unreachable", as it's quite reachable. */
147 assert(!"unexpected VdpYCbCrFormat");
149 #ifdef VDP_YCBCR_FORMAT_Y_UV_444
150 case VDP_YCBCR_FORMAT_Y_UV_444
:
152 #ifdef VDP_YCBCR_FORMAT_Y_U_V_444
153 case VDP_YCBCR_FORMAT_Y_U_V_444
:
155 #ifdef VDP_YCBCR_FORMAT_Y_U_V_444_16
156 case VDP_YCBCR_FORMAT_Y_U_V_444_16
:
158 return PIPE_FORMAT_NONE
;
163 static inline VdpYCbCrFormat
164 PipeToFormatYCBCR(enum pipe_format p_format
)
167 case PIPE_FORMAT_NV12
:
168 return VDP_YCBCR_FORMAT_NV12
;
169 case PIPE_FORMAT_YV12
:
170 return VDP_YCBCR_FORMAT_YV12
;
171 case PIPE_FORMAT_UYVY
:
172 return VDP_YCBCR_FORMAT_UYVY
;
173 case PIPE_FORMAT_YUYV
:
174 return VDP_YCBCR_FORMAT_YUYV
;
175 case PIPE_FORMAT_R8G8B8A8_UNORM
:
176 return VDP_YCBCR_FORMAT_Y8U8V8A8
;
177 case PIPE_FORMAT_B8G8R8A8_UNORM
:
178 return VDP_YCBCR_FORMAT_V8U8Y8A8
;
186 static inline VdpRGBAFormat
187 PipeToFormatRGBA(enum pipe_format p_format
)
190 case PIPE_FORMAT_A8_UNORM
:
191 return VDP_RGBA_FORMAT_A8
;
192 case PIPE_FORMAT_B10G10R10A2_UNORM
:
193 return VDP_RGBA_FORMAT_B10G10R10A2
;
194 case PIPE_FORMAT_B8G8R8A8_UNORM
:
195 return VDP_RGBA_FORMAT_B8G8R8A8
;
196 case PIPE_FORMAT_R10G10B10A2_UNORM
:
197 return VDP_RGBA_FORMAT_R10G10B10A2
;
198 case PIPE_FORMAT_R8G8B8A8_UNORM
:
199 return VDP_RGBA_FORMAT_R8G8B8A8
;
207 static inline enum pipe_format
208 FormatIndexedToPipe(VdpRGBAFormat vdpau_format
)
210 switch (vdpau_format
) {
211 case VDP_INDEXED_FORMAT_A4I4
:
212 return PIPE_FORMAT_R4A4_UNORM
;
213 case VDP_INDEXED_FORMAT_I4A4
:
214 return PIPE_FORMAT_A4R4_UNORM
;
215 case VDP_INDEXED_FORMAT_A8I8
:
216 return PIPE_FORMAT_A8R8_UNORM
;
217 case VDP_INDEXED_FORMAT_I8A8
:
218 return PIPE_FORMAT_R8A8_UNORM
;
223 return PIPE_FORMAT_NONE
;
226 static inline enum pipe_format
227 FormatColorTableToPipe(VdpColorTableFormat vdpau_format
)
229 switch(vdpau_format
) {
230 case VDP_COLOR_TABLE_FORMAT_B8G8R8X8
:
231 return PIPE_FORMAT_B8G8R8X8_UNORM
;
236 return PIPE_FORMAT_NONE
;
239 static inline enum pipe_video_profile
240 ProfileToPipe(VdpDecoderProfile vdpau_profile
)
242 switch (vdpau_profile
) {
243 case VDP_DECODER_PROFILE_MPEG1
:
244 return PIPE_VIDEO_PROFILE_MPEG1
;
245 case VDP_DECODER_PROFILE_MPEG2_SIMPLE
:
246 return PIPE_VIDEO_PROFILE_MPEG2_SIMPLE
;
247 case VDP_DECODER_PROFILE_MPEG2_MAIN
:
248 return PIPE_VIDEO_PROFILE_MPEG2_MAIN
;
249 case VDP_DECODER_PROFILE_H264_BASELINE
:
250 return PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE
;
251 case VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
:
252 return PIPE_VIDEO_PROFILE_MPEG4_AVC_CONSTRAINED_BASELINE
;
253 case VDP_DECODER_PROFILE_H264_MAIN
:
254 return PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN
;
255 case VDP_DECODER_PROFILE_H264_HIGH
:
256 return PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH
;
257 case VDP_DECODER_PROFILE_MPEG4_PART2_SP
:
258 return PIPE_VIDEO_PROFILE_MPEG4_SIMPLE
;
259 case VDP_DECODER_PROFILE_MPEG4_PART2_ASP
:
260 return PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE
;
261 case VDP_DECODER_PROFILE_VC1_SIMPLE
:
262 return PIPE_VIDEO_PROFILE_VC1_SIMPLE
;
263 case VDP_DECODER_PROFILE_VC1_MAIN
:
264 return PIPE_VIDEO_PROFILE_VC1_MAIN
;
265 case VDP_DECODER_PROFILE_VC1_ADVANCED
:
266 return PIPE_VIDEO_PROFILE_VC1_ADVANCED
;
267 case VDP_DECODER_PROFILE_HEVC_MAIN
:
268 return PIPE_VIDEO_PROFILE_HEVC_MAIN
;
269 case VDP_DECODER_PROFILE_HEVC_MAIN_10
:
270 return PIPE_VIDEO_PROFILE_HEVC_MAIN_10
;
271 case VDP_DECODER_PROFILE_HEVC_MAIN_STILL
:
272 return PIPE_VIDEO_PROFILE_HEVC_MAIN_STILL
;
273 case VDP_DECODER_PROFILE_HEVC_MAIN_12
:
274 return PIPE_VIDEO_PROFILE_HEVC_MAIN_12
;
275 case VDP_DECODER_PROFILE_HEVC_MAIN_444
:
276 return PIPE_VIDEO_PROFILE_HEVC_MAIN_444
;
278 return PIPE_VIDEO_PROFILE_UNKNOWN
;
282 static inline VdpDecoderProfile
283 PipeToProfile(enum pipe_video_profile p_profile
)
286 case PIPE_VIDEO_PROFILE_MPEG1
:
287 return VDP_DECODER_PROFILE_MPEG1
;
288 case PIPE_VIDEO_PROFILE_MPEG2_SIMPLE
:
289 return VDP_DECODER_PROFILE_MPEG2_SIMPLE
;
290 case PIPE_VIDEO_PROFILE_MPEG2_MAIN
:
291 return VDP_DECODER_PROFILE_MPEG2_MAIN
;
292 case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE
:
293 return VDP_DECODER_PROFILE_H264_BASELINE
;
294 case PIPE_VIDEO_PROFILE_MPEG4_AVC_CONSTRAINED_BASELINE
:
295 return VDP_DECODER_PROFILE_H264_CONSTRAINED_BASELINE
;
296 case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN
:
297 return VDP_DECODER_PROFILE_H264_MAIN
;
298 case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH
:
299 return VDP_DECODER_PROFILE_H264_HIGH
;
300 case PIPE_VIDEO_PROFILE_MPEG4_SIMPLE
:
301 return VDP_DECODER_PROFILE_MPEG4_PART2_SP
;
302 case PIPE_VIDEO_PROFILE_MPEG4_ADVANCED_SIMPLE
:
303 return VDP_DECODER_PROFILE_MPEG4_PART2_ASP
;
304 case PIPE_VIDEO_PROFILE_VC1_SIMPLE
:
305 return VDP_DECODER_PROFILE_VC1_SIMPLE
;
306 case PIPE_VIDEO_PROFILE_VC1_MAIN
:
307 return VDP_DECODER_PROFILE_VC1_MAIN
;
308 case PIPE_VIDEO_PROFILE_VC1_ADVANCED
:
309 return VDP_DECODER_PROFILE_VC1_ADVANCED
;
310 case PIPE_VIDEO_PROFILE_HEVC_MAIN
:
311 return VDP_DECODER_PROFILE_HEVC_MAIN
;
312 case PIPE_VIDEO_PROFILE_HEVC_MAIN_10
:
313 return VDP_DECODER_PROFILE_HEVC_MAIN_10
;
314 case PIPE_VIDEO_PROFILE_HEVC_MAIN_STILL
:
315 return VDP_DECODER_PROFILE_HEVC_MAIN_STILL
;
316 case PIPE_VIDEO_PROFILE_HEVC_MAIN_12
:
317 return VDP_DECODER_PROFILE_HEVC_MAIN_12
;
318 case PIPE_VIDEO_PROFILE_HEVC_MAIN_444
:
319 return VDP_DECODER_PROFILE_HEVC_MAIN_444
;
326 static inline struct u_rect
*
327 RectToPipe(const VdpRect
*src
, struct u_rect
*dst
)
339 static inline struct pipe_box
340 RectToPipeBox(const VdpRect
*rect
, struct pipe_resource
*res
)
347 box
.width
= res
->width0
;
348 box
.height
= res
->height0
;
352 box
.x
= MIN2(rect
->x0
, rect
->x1
);
353 box
.y
= MIN2(rect
->y0
, rect
->y1
);
354 box
.width
= abs(rect
->x1
- rect
->x0
);
355 box
.height
= abs(rect
->y1
- rect
->y0
);
362 CheckSurfaceParams(struct pipe_screen
*screen
,
363 const struct pipe_resource
*templ
)
365 return screen
->is_format_supported(screen
, templ
->format
, templ
->target
,
367 templ
->nr_storage_samples
, templ
->bind
);
372 struct pipe_reference reference
;
373 struct vl_screen
*vscreen
;
374 struct pipe_context
*context
;
375 struct vl_compositor compositor
;
376 struct pipe_sampler_view
*dummy_sv
;
383 struct vl_compositor_state cstate
;
386 bool supported
, enabled
;
387 float luma_min
, luma_max
;
391 bool supported
, enabled
, spatial
;
392 struct vl_deint_filter
*filter
;
396 bool supported
, enabled
;
397 struct vl_bicubic_filter
*filter
;
401 bool supported
, enabled
;
403 struct vl_median_filter
*filter
;
407 bool supported
, enabled
;
409 struct vl_matrix_filter
*filter
;
412 unsigned video_width
, video_height
;
413 enum pipe_video_chroma_format chroma_format
;
414 unsigned max_layers
, skip_chroma_deint
;
423 struct pipe_video_buffer templat
, *video_buffer
;
429 struct pipe_sampler_view
*sampler_view
;
430 } vlVdpBitmapSurface
;
432 typedef uint64_t vlVdpTime
;
437 struct pipe_surface
*surface
;
438 struct pipe_sampler_view
*sampler_view
;
439 struct pipe_fence_handle
*fence
;
440 struct vl_compositor_state cstate
;
441 struct u_rect dirty_area
;
443 } vlVdpOutputSurface
;
449 } vlVdpPresentationQueueTarget
;
455 struct vl_compositor_state cstate
;
456 vlVdpOutputSurface
*last_surf
;
457 } vlVdpPresentationQueue
;
463 struct pipe_video_codec
*decoder
;
466 typedef uint32_t vlHandle
;
468 boolean
vlCreateHTAB(void);
469 void vlDestroyHTAB(void);
470 vlHandle
vlAddDataHTAB(void *data
);
471 void* vlGetDataHTAB(vlHandle handle
);
472 void vlRemoveDataHTAB(vlHandle handle
);
474 boolean
vlGetFuncFTAB(VdpFuncId function_id
, void **func
);
476 /* Public functions */
477 VdpDeviceCreateX11 vdp_imp_device_create_x11
;
479 void vlVdpDefaultSamplerViewTemplate(struct pipe_sampler_view
*templ
, struct pipe_resource
*res
);
481 /* Internal function pointers */
482 VdpGetErrorString vlVdpGetErrorString
;
483 VdpDeviceDestroy vlVdpDeviceDestroy
;
484 void vlVdpDeviceFree(vlVdpDevice
*dev
);
485 VdpGetProcAddress vlVdpGetProcAddress
;
486 VdpGetApiVersion vlVdpGetApiVersion
;
487 VdpGetInformationString vlVdpGetInformationString
;
488 VdpVideoSurfaceQueryCapabilities vlVdpVideoSurfaceQueryCapabilities
;
489 VdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities vlVdpVideoSurfaceQueryGetPutBitsYCbCrCapabilities
;
490 VdpDecoderQueryCapabilities vlVdpDecoderQueryCapabilities
;
491 VdpOutputSurfaceQueryCapabilities vlVdpOutputSurfaceQueryCapabilities
;
492 VdpOutputSurfaceQueryGetPutBitsNativeCapabilities vlVdpOutputSurfaceQueryGetPutBitsNativeCapabilities
;
493 VdpOutputSurfaceQueryPutBitsIndexedCapabilities vlVdpOutputSurfaceQueryPutBitsIndexedCapabilities
;
494 VdpOutputSurfaceQueryPutBitsYCbCrCapabilities vlVdpOutputSurfaceQueryPutBitsYCbCrCapabilities
;
495 VdpBitmapSurfaceQueryCapabilities vlVdpBitmapSurfaceQueryCapabilities
;
496 VdpVideoMixerQueryFeatureSupport vlVdpVideoMixerQueryFeatureSupport
;
497 VdpVideoMixerQueryParameterSupport vlVdpVideoMixerQueryParameterSupport
;
498 VdpVideoMixerQueryParameterValueRange vlVdpVideoMixerQueryParameterValueRange
;
499 VdpVideoMixerQueryAttributeSupport vlVdpVideoMixerQueryAttributeSupport
;
500 VdpVideoMixerQueryAttributeValueRange vlVdpVideoMixerQueryAttributeValueRange
;
501 VdpVideoSurfaceCreate vlVdpVideoSurfaceCreate
;
502 VdpVideoSurfaceDestroy vlVdpVideoSurfaceDestroy
;
503 VdpVideoSurfaceGetParameters vlVdpVideoSurfaceGetParameters
;
504 VdpVideoSurfaceGetBitsYCbCr vlVdpVideoSurfaceGetBitsYCbCr
;
505 VdpVideoSurfacePutBitsYCbCr vlVdpVideoSurfacePutBitsYCbCr
;
506 void vlVdpVideoSurfaceClear(vlVdpSurface
*vlsurf
);
507 VdpDecoderCreate vlVdpDecoderCreate
;
508 VdpDecoderDestroy vlVdpDecoderDestroy
;
509 VdpDecoderGetParameters vlVdpDecoderGetParameters
;
510 VdpDecoderRender vlVdpDecoderRender
;
511 VdpOutputSurfaceCreate vlVdpOutputSurfaceCreate
;
512 VdpOutputSurfaceDestroy vlVdpOutputSurfaceDestroy
;
513 VdpOutputSurfaceGetParameters vlVdpOutputSurfaceGetParameters
;
514 VdpOutputSurfaceGetBitsNative vlVdpOutputSurfaceGetBitsNative
;
515 VdpOutputSurfacePutBitsNative vlVdpOutputSurfacePutBitsNative
;
516 VdpOutputSurfacePutBitsIndexed vlVdpOutputSurfacePutBitsIndexed
;
517 VdpOutputSurfacePutBitsYCbCr vlVdpOutputSurfacePutBitsYCbCr
;
518 VdpOutputSurfaceRenderOutputSurface vlVdpOutputSurfaceRenderOutputSurface
;
519 VdpOutputSurfaceRenderBitmapSurface vlVdpOutputSurfaceRenderBitmapSurface
;
520 VdpBitmapSurfaceCreate vlVdpBitmapSurfaceCreate
;
521 VdpBitmapSurfaceDestroy vlVdpBitmapSurfaceDestroy
;
522 VdpBitmapSurfaceGetParameters vlVdpBitmapSurfaceGetParameters
;
523 VdpBitmapSurfacePutBitsNative vlVdpBitmapSurfacePutBitsNative
;
524 VdpPresentationQueueTargetDestroy vlVdpPresentationQueueTargetDestroy
;
525 VdpPresentationQueueCreate vlVdpPresentationQueueCreate
;
526 VdpPresentationQueueDestroy vlVdpPresentationQueueDestroy
;
527 VdpPresentationQueueSetBackgroundColor vlVdpPresentationQueueSetBackgroundColor
;
528 VdpPresentationQueueGetBackgroundColor vlVdpPresentationQueueGetBackgroundColor
;
529 VdpPresentationQueueGetTime vlVdpPresentationQueueGetTime
;
530 VdpPresentationQueueDisplay vlVdpPresentationQueueDisplay
;
531 VdpPresentationQueueBlockUntilSurfaceIdle vlVdpPresentationQueueBlockUntilSurfaceIdle
;
532 VdpPresentationQueueQuerySurfaceStatus vlVdpPresentationQueueQuerySurfaceStatus
;
533 VdpPreemptionCallback vlVdpPreemptionCallback
;
534 VdpPreemptionCallbackRegister vlVdpPreemptionCallbackRegister
;
535 VdpVideoMixerSetFeatureEnables vlVdpVideoMixerSetFeatureEnables
;
536 VdpVideoMixerCreate vlVdpVideoMixerCreate
;
537 VdpVideoMixerRender vlVdpVideoMixerRender
;
538 VdpVideoMixerSetAttributeValues vlVdpVideoMixerSetAttributeValues
;
539 VdpVideoMixerGetFeatureSupport vlVdpVideoMixerGetFeatureSupport
;
540 VdpVideoMixerGetFeatureEnables vlVdpVideoMixerGetFeatureEnables
;
541 VdpVideoMixerGetParameterValues vlVdpVideoMixerGetParameterValues
;
542 VdpVideoMixerGetAttributeValues vlVdpVideoMixerGetAttributeValues
;
543 VdpVideoMixerDestroy vlVdpVideoMixerDestroy
;
544 VdpGenerateCSCMatrix vlVdpGenerateCSCMatrix
;
545 /* Winsys specific internal function pointers */
546 VdpPresentationQueueTargetCreateX11 vlVdpPresentationQueueTargetCreateX11
;
549 /* interop to mesa state tracker */
550 VdpVideoSurfaceGallium vlVdpVideoSurfaceGallium
;
551 VdpOutputSurfaceGallium vlVdpOutputSurfaceGallium
;
552 VdpVideoSurfaceDMABuf vlVdpVideoSurfaceDMABuf
;
553 VdpOutputSurfaceDMABuf vlVdpOutputSurfaceDMABuf
;
558 #define VDPAU_TRACE 3
560 static inline void VDPAU_MSG(unsigned int level
, const char *fmt
, ...)
562 static int debug_level
= -1;
564 if (debug_level
== -1) {
565 debug_level
= MAX2(debug_get_num_option("VDPAU_DEBUG", 0), 0);
568 if (level
<= debug_level
) {
571 _debug_vprintf(fmt
, ap
);
577 DeviceReference(vlVdpDevice
**ptr
, vlVdpDevice
*dev
)
579 vlVdpDevice
*old_dev
= *ptr
;
581 if (pipe_reference(&(*ptr
)->reference
, &dev
->reference
))
582 vlVdpDeviceFree(old_dev
);
586 #endif /* VDPAU_PRIVATE_H */