21 #include <vdpau/vdpau.h>
22 #include <vdpau/vdpau_x11.h>
76 XCloseDisplay(ctx->
dpy);
86 VdpVideoSurface surface = *(VdpVideoSurface*)data;
97 VdpVideoSurface *surface;
109 if (!frame->
buf[0]) {
119 if (err != VDP_STATUS_OK) {
133 VdpVideoSurface surface = (VdpVideoSurface)(uintptr_t)frame->
data[3];
137 int ret, chroma_type;
142 if (err != VDP_STATUS_OK) {
159 if (err != VDP_STATUS_OK) {
195 const char *display, *vendor;
214 av_log(NULL, loglevel,
"Cannot open the X11 display %s.\n",
218 display = XDisplayString(ctx->
dpy);
220 err = vdp_device_create_x11(ctx->
dpy, XDefaultScreen(ctx->
dpy), &ctx->
device,
222 if (err != VDP_STATUS_OK) {
223 av_log(NULL, loglevel,
"VDPAU device creation on X11 display %s failed.\n",
228 #define GET_CALLBACK(id, result) \
231 err = ctx->get_proc_address(ctx->device, id, &tmp); \
232 if (err != VDP_STATUS_OK) { \
233 av_log(NULL, loglevel, "Error getting the " #id " callback.\n"); \
239 GET_CALLBACK(VDP_FUNC_ID_GET_ERROR_STRING, get_error_string);
240 GET_CALLBACK(VDP_FUNC_ID_GET_INFORMATION_STRING, get_information_string);
241 GET_CALLBACK(VDP_FUNC_ID_DEVICE_DESTROY, device_destroy);
242 GET_CALLBACK(VDP_FUNC_ID_DECODER_CREATE, decoder_create);
243 GET_CALLBACK(VDP_FUNC_ID_DECODER_DESTROY, decoder_destroy);
244 GET_CALLBACK(VDP_FUNC_ID_DECODER_RENDER, decoder_render);
245 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, video_surface_create);
246 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, video_surface_destroy);
247 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, video_surface_get_bits);
248 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS, video_surface_get_parameters);
249 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES,
250 video_surface_query);
256 if (err != VDP_STATUS_OK) {
258 "Error querying VDPAU surface capabilities: %s\n",
267 "No supported VDPAU format for retrieving the data.\n");
282 "to decode input stream #%d:%d.\n", vendor,
288 av_log(NULL, loglevel,
"VDPAU init failed for stream #%d:%d.\n",
313 av_log(NULL, loglevel,
"No known VDPAU decoder profile for this stream.\n");
323 if (err != VDP_STATUS_OK) {
324 av_log(NULL, loglevel,
"Error creating the VDPAU decoder: %s\n",