21 #include <vdpau/vdpau.h>
22 #include <vdpau/vdpau_x11.h>
45 #if 1 // for ffmpegs older vdpau API, not the oldest though
80 XCloseDisplay(ctx->
dpy);
90 VdpVideoSurface surface = *(VdpVideoSurface*)data;
101 VdpVideoSurface *surface;
113 if (!frame->
buf[0]) {
123 if (err != VDP_STATUS_OK) {
137 VdpVideoSurface surface = (VdpVideoSurface)(uintptr_t)frame->
data[3];
141 int ret, chroma_type;
146 if (err != VDP_STATUS_OK) {
163 if (err != VDP_STATUS_OK) {
199 const char *display, *vendor;
218 av_log(NULL, loglevel,
"Cannot open the X11 display %s.\n",
222 display = XDisplayString(ctx->
dpy);
224 err = vdp_device_create_x11(ctx->
dpy, XDefaultScreen(ctx->
dpy), &ctx->
device,
226 if (err != VDP_STATUS_OK) {
227 av_log(NULL, loglevel,
"VDPAU device creation on X11 display %s failed.\n",
232 #define GET_CALLBACK(id, result) \
235 err = ctx->get_proc_address(ctx->device, id, &tmp); \
236 if (err != VDP_STATUS_OK) { \
237 av_log(NULL, loglevel, "Error getting the " #id " callback.\n"); \
243 GET_CALLBACK(VDP_FUNC_ID_GET_ERROR_STRING, get_error_string);
244 GET_CALLBACK(VDP_FUNC_ID_GET_INFORMATION_STRING, get_information_string);
245 GET_CALLBACK(VDP_FUNC_ID_DEVICE_DESTROY, device_destroy);
247 GET_CALLBACK(VDP_FUNC_ID_DECODER_CREATE, decoder_create);
249 GET_CALLBACK(VDP_FUNC_ID_DECODER_RENDER, decoder_render);
251 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_CREATE, video_surface_create);
252 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_DESTROY, video_surface_destroy);
253 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_BITS_Y_CB_CR, video_surface_get_bits);
254 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_GET_PARAMETERS, video_surface_get_parameters);
255 GET_CALLBACK(VDP_FUNC_ID_VIDEO_SURFACE_QUERY_GET_PUT_BITS_Y_CB_CR_CAPABILITIES,
256 video_surface_query);
262 if (err != VDP_STATUS_OK) {
264 "Error querying VDPAU surface capabilities: %s\n",
273 "No supported VDPAU format for retrieving the data.\n");
292 "to decode input stream #%d:%d.\n", vendor,
298 av_log(NULL, loglevel,
"VDPAU init failed for stream #%d:%d.\n",
323 av_log(NULL, loglevel,
"No known VDPAU decoder profile for this stream.\n");
333 if (err != VDP_STATUS_OK) {
334 av_log(NULL, loglevel,
"Error creating the VDPAU decoder: %s\n",