1 diff -r 23f700befc6c src/video_out/Makefile.am
2 --- a/src/video_out/Makefile.am Sun Feb 20 23:38:32 2011 +0100
3 +++ b/src/video_out/Makefile.am Wed Mar 16 14:17:05 2011 +0100
7 vdpau_module = xineplug_vo_out_vdpau.la
9 +xine_includedir = $(includedir)/xine
10 +xine_include_HEADERS = video_out_vdpau.h
14 diff -r 23f700befc6c src/video_out/video_out_vdpau.c
15 --- a/src/video_out/video_out_vdpau.c Sun Feb 20 23:38:32 2011 +0100
16 +++ b/src/video_out/video_out_vdpau.c Wed Mar 16 14:17:05 2011 +0100
18 #include <vdpau/vdpau_x11.h>
19 #include "accel_vdpau.h"
21 +#include "video_out_vdpau.h"
23 #ifdef HAVE_FFMPEG_AVUTIL_H
28 vdpau_class_t *class = (vdpau_class_t *) class_gen;
29 x11_visual_t *visual = (x11_visual_t *) visual_gen;
30 + x11_visual_vdpau_t *vdpau = visual->d ? NULL : (x11_visual_vdpau_t *) visual_gen;
32 config_values_t *config = class->xine->config;
34 @@ -2437,15 +2440,22 @@
35 this->yuv2rgb_factory = yuv2rgb_factory_init (MODE_24_BGR, 0, NULL);
36 this->ovl_yuv2rgb = this->yuv2rgb_factory->create_converter( this->yuv2rgb_factory );
38 - VdpStatus st = vdp_device_create_x11( visual->display, visual->screen, &vdp_device, &vdp_get_proc_address );
39 - if ( st != VDP_STATUS_OK ) {
40 - fprintf(stderr, "vo_vdpau: Can't create vdp device : " );
41 - if ( st == VDP_STATUS_NO_IMPLEMENTATION )
42 - fprintf(stderr, "No vdpau implementation.\n" );
44 - fprintf(stderr, "unsupported GPU?\n" );
45 - vdpau_dispose( &this->vo_driver );
49 + vdp_device = vdpau->device;
50 + vdp_get_proc_address = vdpau->vdp_get_proc_address;
53 + st = vdp_device_create_x11( visual->display, visual->screen, &vdp_device, &vdp_get_proc_address );
54 + if ( st != VDP_STATUS_OK ) {
55 + fprintf(stderr, "vo_vdpau: Can't create vdp device : " );
56 + if ( st == VDP_STATUS_NO_IMPLEMENTATION )
57 + fprintf(stderr, "No vdpau implementation.\n" );
59 + fprintf(stderr, "unsupported GPU?\n" );
60 + vdpau_dispose( &this->vo_driver );
64 st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_GET_ERROR_STRING , (void*)&vdp_get_error_string );
65 if ( vdpau_init_error( st, "Can't get GET_ERROR_STRING proc address !!", &this->vo_driver, 0 ) )
66 @@ -2600,6 +2610,22 @@
67 if ( vdpau_init_error( st, "Can't get PREEMPTION_CALLBACK_REGISTER proc address !!", &this->vo_driver, 1 ) )
70 + /* Check for extended initialization */
72 + vdp_queue_target_create_x11 = vdpau->vdp_queue_target_create_x11;
73 + vdp_queue_target_destroy = vdpau->vdp_queue_target_destroy;
74 + vdp_queue_create = vdpau->vdp_queue_create;
75 + vdp_queue_destroy = vdpau->vdp_queue_destroy;
76 + vdp_queue_display = vdpau->vdp_queue_display;
77 + vdp_queue_block = vdpau->vdp_queue_block;
78 + vdp_queue_set_background_color = vdpau->vdp_queue_set_background_color;
79 + vdp_queue_get_time = vdpau->vdp_queue_get_time;
80 + vdp_queue_query_surface_status = vdpau->vdp_queue_query_surface_status;
82 + vdp_preemption_callback_register = vdpau->vdp_preemption_callback_register;
86 st = vdp_preemption_callback_register(vdp_device, &vdp_preemption_callback, (void*)this);
87 if ( vdpau_init_error( st, "Can't register preemption callback !!", &this->vo_driver, 1 ) )
89 diff -r 23f700befc6c src/video_out/video_out_vdpau.h
90 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
91 +++ b/src/video_out/video_out_vdpau.h Wed Mar 16 14:17:05 2011 +0100
94 + * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
95 + * Copyright (C) 2008 the xine project
96 + * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
98 + * This file is part of xine, a free video player.
100 + * xine is free software; you can redistribute it and/or modify
101 + * it under the terms of the GNU General Public License as published by
102 + * the Free Software Foundation; either version 2 of the License, or
103 + * (at your option) any later version.
105 + * xine is distributed in the hope that it will be useful,
106 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
107 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
108 + * GNU General Public License for more details.
110 + * You should have received a copy of the GNU General Public License
111 + * along with this program; if not, write to the Free Software
112 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
115 + * video_out_vdpau.c, a video output plugin
116 + * using VDPAU (Video Decode and Presentation Api for Unix)
121 +#ifndef __VIDEO_OUT__VDPAU_H__
122 +#define __VIDEO_OUT__VDPAU_H__
126 +#include <vdpau/vdpau_x11.h>
130 + x11_visual_t x11; // if x11.d (drawable) is zero, it will use this extended struct
134 + VdpGetProcAddress *vdp_get_proc_address;
136 + VdpPresentationQueueTargetCreateX11 *vdp_queue_target_create_x11;
137 + VdpPresentationQueueTargetDestroy *vdp_queue_target_destroy;
138 + VdpPresentationQueueCreate *vdp_queue_create;
139 + VdpPresentationQueueDestroy *vdp_queue_destroy;
140 + VdpPresentationQueueDisplay *vdp_queue_display;
141 + VdpPresentationQueueBlockUntilSurfaceIdle *vdp_queue_block;
142 + VdpPresentationQueueSetBackgroundColor *vdp_queue_set_background_color;
143 + VdpPresentationQueueGetTime *vdp_queue_get_time;
144 + VdpPresentationQueueQuerySurfaceStatus *vdp_queue_query_surface_status;
146 + VdpPreemptionCallbackRegister *vdp_preemption_callback_register;
147 +} x11_visual_vdpau_t;