]> git.pld-linux.org Git - packages/xine-lib.git/blob - xine-lib-vdpau-hooks.patch
- rediff patches
[packages/xine-lib.git] / xine-lib-vdpau-hooks.patch
1 diff -urNp -x '*.orig' xine-lib-1.2.8.org/src/video_out/Makefile.am xine-lib-1.2.8/src/video_out/Makefile.am
2 --- xine-lib-1.2.8.org/src/video_out/Makefile.am        2017-02-21 12:13:13.000000000 +0100
3 +++ xine-lib-1.2.8/src/video_out/Makefile.am    2022-02-14 00:14:01.953771680 +0100
4 @@ -48,6 +48,9 @@ endif
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_VAAPI
14 diff -urNp -x '*.orig' xine-lib-1.2.8.org/src/video_out/video_out_vdpau.c xine-lib-1.2.8/src/video_out/video_out_vdpau.c
15 --- xine-lib-1.2.8.org/src/video_out/video_out_vdpau.c  2017-02-21 12:13:13.000000000 +0100
16 +++ xine-lib-1.2.8/src/video_out/video_out_vdpau.c      2022-02-14 00:14:01.953771680 +0100
17 @@ -51,6 +51,7 @@
18  #include <vdpau/vdpau_x11.h>
19  #include "accel_vdpau.h"
20  
21 +#include "video_out_vdpau.h"
22  
23  
24  #define NUM_FRAMES_BACK 1
25 @@ -2637,6 +2638,7 @@ static vo_driver_t *vdpau_open_plugin (v
26  {
27    vdpau_class_t       *class   = (vdpau_class_t *) class_gen;
28    x11_visual_t        *visual  = (x11_visual_t *) visual_gen;
29 +  x11_visual_vdpau_t  *vdpau   = visual->d ? NULL : (x11_visual_vdpau_t *) visual_gen;
30    vdpau_driver_t      *this;
31    config_values_t      *config  = class->xine->config;
32    int i;
33 @@ -2713,15 +2715,22 @@ static vo_driver_t *vdpau_open_plugin (v
34    this->ovl_src_rect.x0 = 0;
35    this->ovl_src_rect.y0 = 0;
36  
37 -  VdpStatus st = vdp_device_create_x11( visual->display, visual->screen, &vdp_device, &vdp_get_proc_address );
38 -  if ( st != VDP_STATUS_OK ) {
39 -    fprintf(stderr, "vo_vdpau: Can't create vdp device : " );
40 -    if ( st == VDP_STATUS_NO_IMPLEMENTATION )
41 -      fprintf(stderr, "No vdpau implementation.\n" );
42 -    else
43 -      fprintf(stderr, "unsupported GPU?\n" );
44 -    vdpau_dispose( &this->vo_driver );
45 -    return NULL;
46 +  VdpStatus st;
47 +  if (vdpau) {
48 +    vdp_device           = vdpau->device;
49 +    vdp_get_proc_address = vdpau->vdp_get_proc_address;
50 +  }
51 +  else {
52 +    st = vdp_device_create_x11( visual->display, visual->screen, &vdp_device, &vdp_get_proc_address );
53 +    if ( st != VDP_STATUS_OK ) {
54 +      fprintf(stderr, "vo_vdpau: Can't create vdp device : " );
55 +      if ( st == VDP_STATUS_NO_IMPLEMENTATION )
56 +        fprintf(stderr, "No vdpau implementation.\n" );
57 +      else
58 +        fprintf(stderr, "unsupported GPU?\n" );
59 +      vdpau_dispose( &this->vo_driver );
60 +      return NULL;
61 +    }
62    }
63    st = vdp_get_proc_address( vdp_device, VDP_FUNC_ID_GET_ERROR_STRING , (void*)&vdp_get_error_string );
64    if ( vdpau_init_error( st, "Can't get GET_ERROR_STRING proc address !!", &this->vo_driver, 0 ) )
65 @@ -2929,6 +2938,22 @@ static vo_driver_t *vdpau_open_plugin (v
66    if ( vdpau_init_error( st, "Can't get PREEMPTION_CALLBACK_REGISTER proc address !!", &this->vo_driver, 1 ) )
67      return NULL;
68  
69 +  /* Check for extended initialization */
70 +  if (vdpau) {
71 +    vdp_queue_target_create_x11       = vdpau->vdp_queue_target_create_x11;
72 +    vdp_queue_target_destroy          = vdpau->vdp_queue_target_destroy;
73 +    vdp_queue_create                  = vdpau->vdp_queue_create;
74 +    vdp_queue_destroy                 = vdpau->vdp_queue_destroy;
75 +    vdp_queue_display                 = vdpau->vdp_queue_display;
76 +    vdp_queue_block                   = vdpau->vdp_queue_block;
77 +    vdp_queue_set_background_color    = vdpau->vdp_queue_set_background_color;
78 +    vdp_queue_get_time                = vdpau->vdp_queue_get_time;
79 +    vdp_queue_query_surface_status    = vdpau->vdp_queue_query_surface_status;
80 +
81 +    vdp_preemption_callback_register  = vdpau->vdp_preemption_callback_register;
82 +  }
83 +
84 +
85    st = vdp_preemption_callback_register(vdp_device, &vdp_preemption_callback, (void*)this);
86    if ( vdpau_init_error( st, "Can't register preemption callback !!", &this->vo_driver, 1 ) )
87      return NULL;
88 diff -urNp -x '*.orig' xine-lib-1.2.8.org/src/video_out/video_out_vdpau.h xine-lib-1.2.8/src/video_out/video_out_vdpau.h
89 --- xine-lib-1.2.8.org/src/video_out/video_out_vdpau.h  1970-01-01 01:00:00.000000000 +0100
90 +++ xine-lib-1.2.8/src/video_out/video_out_vdpau.h      2022-02-14 00:14:01.953771680 +0100
91 @@ -0,0 +1,58 @@
92 +/*
93 + * kate: space-indent on; indent-width 2; mixedindent off; indent-mode cstyle; remove-trailing-space on;
94 + * Copyright (C) 2008 the xine project
95 + * Copyright (C) 2008 Christophe Thommeret <hftom@free.fr>
96 + *
97 + * This file is part of xine, a free video player.
98 + *
99 + * xine is free software; you can redistribute it and/or modify
100 + * it under the terms of the GNU General Public License as published by
101 + * the Free Software Foundation; either version 2 of the License, or
102 + * (at your option) any later version.
103 + *
104 + * xine is distributed in the hope that it will be useful,
105 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
106 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
107 + * GNU General Public License for more details.
108 + *
109 + * You should have received a copy of the GNU General Public License
110 + * along with this program; if not, write to the Free Software
111 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
112 + *
113 + *
114 + * video_out_vdpau.c, a video output plugin
115 + * using VDPAU (Video Decode and Presentation Api for Unix)
116 + *
117 + *
118 + */
119 +
120 +#ifndef __VIDEO_OUT__VDPAU_H__
121 +#define __VIDEO_OUT__VDPAU_H__
122 +
123 +#include <xine.h>
124 +
125 +#include <vdpau/vdpau_x11.h>
126 +
127 +
128 +typedef struct {
129 +  x11_visual_t  x11;  // if x11.d (drawable) is zero, it will use this extended struct
130 +
131 +  VdpDevice device;
132 +
133 +  VdpGetProcAddress *vdp_get_proc_address;
134 +
135 +  VdpPresentationQueueTargetCreateX11 *vdp_queue_target_create_x11;
136 +  VdpPresentationQueueTargetDestroy *vdp_queue_target_destroy;
137 +  VdpPresentationQueueCreate *vdp_queue_create;
138 +  VdpPresentationQueueDestroy *vdp_queue_destroy;
139 +  VdpPresentationQueueDisplay *vdp_queue_display;
140 +  VdpPresentationQueueBlockUntilSurfaceIdle *vdp_queue_block;
141 +  VdpPresentationQueueSetBackgroundColor *vdp_queue_set_background_color;
142 +  VdpPresentationQueueGetTime *vdp_queue_get_time;
143 +  VdpPresentationQueueQuerySurfaceStatus *vdp_queue_query_surface_status;
144 +
145 +  VdpPreemptionCallbackRegister *vdp_preemption_callback_register;
146 +} x11_visual_vdpau_t;
147 +
148 +#endif
149 +
This page took 0.114326 seconds and 3 git commands to generate.