summaryrefslogtreecommitdiffstats
path: root/meta-emenlow/recipes/libva/libva-0.31.0/392_compat.dso.patch
blob: 57ae44f9d42778bae2a5c238ea562d9f00360f1d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
commit 389323f728fb2d6392d266d967eddde40465fd93
Author: Gwenole Beauchesne <gbeauchesne@splitted-desktop.com>
Date:   Fri Oct 16 12:35:27 2009 +0000

    Fix compatibility with older programs linked against libva.so.0.

diff --git a/src/Makefile.am b/src/Makefile.am
index 232d8e8..2d696f1 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -72,3 +72,8 @@ EXTRA_DIST = \
 	va_compat_template.h
 
 va_compat.c: va_compat_template.h
+
+lib_LTLIBRARIES			+= libva-compat.la
+libva_compat_la_SOURCES		= va_compat_lib.c
+libva_compat_la_LIBADD		= libva-x11.la -ldl
+libva_compat_la_DEPENDENCIES	= libva-x11.la
diff --git a/src/va_compat_lib.c b/src/va_compat_lib.c
new file mode 100644
index 0000000..b7e9ea5
--- /dev/null
+++ b/src/va_compat_lib.c
@@ -0,0 +1,158 @@
+/*
+ * Copyright (C) 2009 Splitted-Desktop Systems. All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sub license, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ * 
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial portions
+ * of the Software.
+ * 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
+ * IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#define _GNU_SOURCE 1
+#include <dlfcn.h>
+#include <assert.h>
+#include <stddef.h>
+
+typedef void           *VADisplay;
+typedef int             VAStatus;
+typedef unsigned int    VAGenericID;
+typedef VAGenericID     VAContextID;
+typedef VAGenericID     VASurfaceID;
+typedef VAGenericID     VAImageID;
+typedef VAGenericID     VASubpictureID;
+
+#define PREPARE_FUNC(NAME, RET, ARGS)           \
+    static RET (*lib_##NAME) ARGS;              \
+    if (lib_##NAME == NULL)                     \
+        lib_##NAME = dlsym(RTLD_NEXT, #NAME);   \
+    assert(lib_##NAME != NULL)
+
+VAStatus
+vaSyncSurface(
+    VADisplay           dpy,
+    VAContextID         context,
+    VASurfaceID         render_target
+)
+{
+    PREPARE_FUNC(vaSyncSurface, VAStatus, (VADisplay, VASurfaceID));
+
+    return lib_vaSyncSurface(dpy, render_target);
+}
+
+VAStatus
+vaPutImage(
+    VADisplay           dpy,
+    VASurfaceID         surface,
+    VAImageID           image,
+    int                 src_x,
+    int                 src_y,
+    unsigned int        width,
+    unsigned int        height,
+    int                 dest_x,
+    int                 dest_y
+)
+{
+    PREPARE_FUNC(vaPutImage, VAStatus, (VADisplay, VASurfaceID, VAImageID,
+                                        int, int, unsigned int, unsigned int,
+                                        int, int, unsigned int, unsigned int));
+
+    return lib_vaPutImage(dpy, surface, image,
+                          src_x, src_y, width, height,
+                          dest_x, dest_y, width, height);
+}
+
+VAStatus
+vaPutImage2(
+    VADisplay           dpy,
+    VASurfaceID         surface,
+    VAImageID           image,
+    int                 src_x,
+    int                 src_y,
+    unsigned int        src_width,
+    unsigned int        src_height,
+    int                 dest_x,
+    int                 dest_y,
+    unsigned int        dest_width,
+    unsigned int        dest_height
+)
+{
+    PREPARE_FUNC(vaPutImage, VAStatus, (VADisplay, VASurfaceID, VAImageID,
+                                        int, int, unsigned int, unsigned int,
+                                        int, int, unsigned int, unsigned int));
+
+    return lib_vaPutImage(dpy, surface, image,
+                          src_x, src_y, src_width, src_height,
+                          dest_x, dest_y, dest_width, dest_height);
+}
+
+VAStatus
+vaAssociateSubpicture(
+    VADisplay           dpy,
+    VASubpictureID      subpicture,
+    VASurfaceID        *target_surfaces,
+    int                 num_surfaces,
+    short               src_x,
+    short               src_y,
+    short               dest_x,
+    short               dest_y,
+    unsigned short      width,
+    unsigned short      height,
+    unsigned int        flags
+)
+{
+    PREPARE_FUNC(vaAssociateSubpicture,
+                 VAStatus, (VADisplay, VASubpictureID, VASurfaceID *, int,
+                            short, short, unsigned short, unsigned short,
+                            short, short, unsigned short, unsigned short,
+                            unsigned int));
+
+    return lib_vaAssociateSubpicture(dpy, subpicture,
+                                     target_surfaces, num_surfaces,
+                                     src_x, src_y, width, height,
+                                     dest_x, dest_y, width, height,
+                                     flags);
+}
+
+VAStatus
+vaAssociateSubpicture2(
+    VADisplay           dpy,
+    VASubpictureID      subpicture,
+    VASurfaceID        *target_surfaces,
+    int                 num_surfaces,
+    short               src_x,
+    short               src_y,
+    unsigned short      src_width,
+    unsigned short      src_height,
+    short               dest_x,
+    short               dest_y,
+    unsigned short      dest_width,
+    unsigned short      dest_height,
+    unsigned int        flags
+)
+{
+    PREPARE_FUNC(vaAssociateSubpicture,
+                 VAStatus, (VADisplay, VASubpictureID, VASurfaceID *, int,
+                            short, short, unsigned short, unsigned short,
+                            short, short, unsigned short, unsigned short,
+                            unsigned int));
+
+    return lib_vaAssociateSubpicture(dpy, subpicture,
+                                     target_surfaces, num_surfaces,
+                                     src_x, src_y, src_width, src_height,
+                                     dest_x, dest_y, dest_width, dest_height,
+                                     flags);
+}