]> git.pld-linux.org Git - packages/xine-lib.git/blob - xine-lib-vdpau-hooks.patch
- updated to 1.2.3 (note: new plugins ABI)
[packages/xine-lib.git] / xine-lib-vdpau-hooks.patch
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
4 @@ -40,6 +40,9 @@
5  
6  if ENABLE_VDPAU
7  vdpau_module = xineplug_vo_out_vdpau.la
8 +
9 +xine_includedir = $(includedir)/xine
10 +xine_include_HEADERS = video_out_vdpau.h
11  endif
12  
13  if ENABLE_XCB
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
17 @@ -52,6 +52,8 @@
18  #include <vdpau/vdpau_x11.h>
19  #include "accel_vdpau.h"
20  
21 +#include "video_out_vdpau.h"
22 +
23  #ifdef HAVE_FFMPEG_AVUTIL_H
24  #  include <mem.h>
25  #else
26 @@ -2353,6 +2355,7 @@
27  {
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;
31    vdpau_driver_t      *this;
32    config_values_t      *config  = class->xine->config;
33    int i;
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 );
37  
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" );
43 -    else
44 -      fprintf(stderr, "unsupported GPU?\n" );
45 -    vdpau_dispose( &this->vo_driver );
46 -    return NULL;
47 +  VdpStatus st;
48 +  if (vdpau) {
49 +    vdp_device           = vdpau->device;
50 +    vdp_get_proc_address = vdpau->vdp_get_proc_address;
51 +  }
52 +  else {
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" );
58 +      else
59 +        fprintf(stderr, "unsupported GPU?\n" );
60 +      vdpau_dispose( &this->vo_driver );
61 +      return NULL;
62 +    }
63    }
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 ) )
68      return NULL;
69  
70 +  /* Check for extended initialization */
71 +  if (vdpau) {
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;
81 +
82 +    vdp_preemption_callback_register  = vdpau->vdp_preemption_callback_register;
83 +  }
84 +
85 +
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 ) )
88      return NULL;
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
92 @@ -0,0 +1,58 @@
93 +/*
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>
97 + *
98 + * This file is part of xine, a free video player.
99 + *
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.
104 + *
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.
109 + *
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
113 + *
114 + *
115 + * video_out_vdpau.c, a video output plugin
116 + * using VDPAU (Video Decode and Presentation Api for Unix)
117 + *
118 + *
119 + */
120 +
121 +#ifndef __VIDEO_OUT__VDPAU_H__
122 +#define __VIDEO_OUT__VDPAU_H__
123 +
124 +#include <xine.h>
125 +
126 +#include <vdpau/vdpau_x11.h>
127 +
128 +
129 +typedef struct {
130 +  x11_visual_t  x11;  // if x11.d (drawable) is zero, it will use this extended struct
131 +
132 +  VdpDevice device;
133 +
134 +  VdpGetProcAddress *vdp_get_proc_address;
135 +
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;
145 +
146 +  VdpPreemptionCallbackRegister *vdp_preemption_callback_register;
147 +} x11_visual_vdpau_t;
148 +
149 +#endif
150 +
This page took 0.090541 seconds and 4 git commands to generate.