hardware/intel/libva
修訂 | 6febbcadc81a5c4c0d877c450814fa222ff704f9 (tree) |
---|---|
時間 | 2013-06-05 10:38:35 |
作者 | Gwenole Beauchesne <gwenole.beauchesne@inte...> |
Commiter | Xiang, Haihao |
API: add compat glue for older vaCreateSurfaces().
@@ -31,6 +31,7 @@ LDADD = \ | ||
31 | 31 | |
32 | 32 | libva_source_c = \ |
33 | 33 | va.c \ |
34 | + va_compat.c \ | |
34 | 35 | va_fool.c \ |
35 | 36 | va_trace.c \ |
36 | 37 | $(NULL) |
@@ -40,6 +41,7 @@ libva_source_h = \ | ||
40 | 41 | va_backend.h \ |
41 | 42 | va_backend_tpi.h \ |
42 | 43 | va_backend_vpp.h \ |
44 | + va_compat.h \ | |
43 | 45 | va_dec_jpeg.h \ |
44 | 46 | va_drmcommon.h \ |
45 | 47 | va_enc_h264.h \ |
@@ -55,12 +57,18 @@ libva_source_h_priv = \ | ||
55 | 57 | va_trace.h \ |
56 | 58 | $(NULL) |
57 | 59 | |
60 | +libva_ldflags = \ | |
61 | + $(LDADD) -no-undefined \ | |
62 | + -Wl,-version-script,libva.syms \ | |
63 | + $(NULL) | |
64 | + | |
58 | 65 | lib_LTLIBRARIES = libva.la |
59 | 66 | libvaincludedir = ${includedir}/va |
60 | 67 | libvainclude_HEADERS = $(libva_source_h) |
61 | 68 | noinst_HEADERS = $(libva_source_h_priv) |
62 | 69 | libva_la_SOURCES = $(libva_source_c) |
63 | -libva_la_LDFLAGS = $(LDADD) -no-undefined | |
70 | +libva_la_LDFLAGS = $(libva_ldflags) | |
71 | +libva_la_DEPENDENCIES = libva.syms | |
64 | 72 | libva_la_LIBADD = $(LIBVA_LIBS) -ldl |
65 | 73 | |
66 | 74 | lib_LTLIBRARIES += libva-tpi.la |
@@ -0,0 +1,11 @@ | ||
1 | +VA_API_0.32.0 { | |
2 | + local: | |
3 | + vaCreateSurfaces_0_32_0; | |
4 | +}; | |
5 | + | |
6 | +VA_API_0.33.0 { | |
7 | + global: | |
8 | + vaCreateSurfaces; | |
9 | + local: | |
10 | + vaCreateSurfaces_0_33_0; | |
11 | +} VA_API_0.32.0; |
@@ -0,0 +1,43 @@ | ||
1 | +/* | |
2 | + * Copyright (c) 2007-2011 Intel Corporation. All Rights Reserved. | |
3 | + * | |
4 | + * Permission is hereby granted, free of charge, to any person obtaining a | |
5 | + * copy of this software and associated documentation files (the | |
6 | + * "Software"), to deal in the Software without restriction, including | |
7 | + * without limitation the rights to use, copy, modify, merge, publish, | |
8 | + * distribute, sub license, and/or sell copies of the Software, and to | |
9 | + * permit persons to whom the Software is furnished to do so, subject to | |
10 | + * the following conditions: | |
11 | + * | |
12 | + * The above copyright notice and this permission notice (including the | |
13 | + * next paragraph) shall be included in all copies or substantial portions | |
14 | + * of the Software. | |
15 | + * | |
16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
17 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
18 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |
19 | + * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR | |
20 | + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
21 | + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
22 | + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
23 | + */ | |
24 | + | |
25 | +#define VA_COMPAT_DISABLED 1 | |
26 | +#include "sysdeps.h" | |
27 | +#include "va.h" | |
28 | +#include "va_compat.h" | |
29 | + | |
30 | +VAStatus | |
31 | +vaCreateSurfaces_0_32_0( | |
32 | + VADisplay dpy, | |
33 | + int width, | |
34 | + int height, | |
35 | + int format, | |
36 | + int num_surfaces, | |
37 | + VASurfaceID *surfaces | |
38 | +) | |
39 | +{ | |
40 | + return vaCreateSurfaces(dpy, format, width, height, surfaces, num_surfaces, | |
41 | + NULL, 0); | |
42 | +} | |
43 | +VA_CPP_HELPER_ALIAS(vaCreateSurfaces, 0,32,0); |
@@ -0,0 +1,116 @@ | ||
1 | +/* | |
2 | + * Copyright (c) 2007-2011 Intel Corporation. All Rights Reserved. | |
3 | + * | |
4 | + * Permission is hereby granted, free of charge, to any person obtaining a | |
5 | + * copy of this software and associated documentation files (the | |
6 | + * "Software"), to deal in the Software without restriction, including | |
7 | + * without limitation the rights to use, copy, modify, merge, publish, | |
8 | + * distribute, sub license, and/or sell copies of the Software, and to | |
9 | + * permit persons to whom the Software is furnished to do so, subject to | |
10 | + * the following conditions: | |
11 | + * | |
12 | + * The above copyright notice and this permission notice (including the | |
13 | + * next paragraph) shall be included in all copies or substantial portions | |
14 | + * of the Software. | |
15 | + * | |
16 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |
17 | + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | |
18 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. | |
19 | + * IN NO EVENT SHALL INTEL AND/OR ITS SUPPLIERS BE LIABLE FOR | |
20 | + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | |
21 | + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | |
22 | + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |
23 | + */ | |
24 | + | |
25 | +/** | |
26 | + * \file va_compat.h | |
27 | + * \brief The Compatibility API | |
28 | + * | |
29 | + * This file contains the \ref api_compat "Compatibility API". | |
30 | + */ | |
31 | + | |
32 | +#ifndef VA_COMPAT_H | |
33 | +#define VA_COMPAT_H | |
34 | + | |
35 | +#ifdef __cplusplus | |
36 | +extern "C" { | |
37 | +#endif | |
38 | + | |
39 | +/** | |
40 | + * \defgroup api_compat Compatibility API | |
41 | + * | |
42 | + * The Compatibility API allows older programs that are not ported to | |
43 | + * the current API to still build and run correctly. In particular, | |
44 | + * this exposes older API to allow for backwards source compatibility. | |
45 | + * | |
46 | + * @{ | |
47 | + */ | |
48 | + | |
49 | +/** | |
50 | + * Makes a string literal out of the macro argument | |
51 | + */ | |
52 | +#define VA_CPP_HELPER_STRINGIFY(x) \ | |
53 | + VA_CPP_HELPER_STRINGIFY_(x) | |
54 | +#define VA_CPP_HELPER_STRINGIFY_(x) \ | |
55 | + #x | |
56 | + | |
57 | +/** | |
58 | + * Concatenates two macro arguments at preprocessing time. | |
59 | + */ | |
60 | +#define VA_CPP_HELPER_CONCAT(a, b) \ | |
61 | + VA_CPP_HELPER_CONCAT_(a, b) | |
62 | +#define VA_CPP_HELPER_CONCAT_(a, b) \ | |
63 | + a ## b | |
64 | + | |
65 | +/** | |
66 | + * Generates the number of macro arguments at preprocessing time. | |
67 | + * <http://groups.google.com/group/comp.std.c/browse_thread/thread/77ee8c8f92e4a3fb/346fc464319b1ee5> | |
68 | + * | |
69 | + * Note: this doesn't work for macros with no arguments | |
70 | + */ | |
71 | +#define VA_CPP_HELPER_N_ARGS(...) \ | |
72 | + VA_CPP_HELPER_N_ARGS_(__VA_ARGS__, VA_CPP_HELPER_N_ARGS_LIST_REV()) | |
73 | +#define VA_CPP_HELPER_N_ARGS_(...) \ | |
74 | + VA_CPP_HELPER_N_ARGS_LIST(__VA_ARGS__) | |
75 | +#define VA_CPP_HELPER_N_ARGS_LIST(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a12, a13, a14, a15, a16, N, ...) N | |
76 | +#define VA_CPP_HELPER_N_ARGS_LIST_REV() \ | |
77 | + 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0 | |
78 | + | |
79 | +/** | |
80 | + * Generates a versioned function alias. | |
81 | + * | |
82 | + * VA_CPP_HELPER_ALIAS(vaSomeFunction, 0,32,0) will generate | |
83 | + * .symber vaSomeFunction_0_32_0, vaSomeFunction@VA_API_0.32.0 | |
84 | + */ | |
85 | +#define VA_CPP_HELPER_ALIAS(func, major, minor, micro) \ | |
86 | + VA_CPP_HELPER_ALIAS_(func, major, minor, micro, "@") | |
87 | +#define VA_CPP_HELPER_ALIAS_DEFAULT(func, major, minor, micro) \ | |
88 | + VA_CPP_HELPER_ALIAS_(func, major, minor, micro, "@@") | |
89 | +#define VA_CPP_HELPER_ALIAS_(func, major, minor, micro, binding) \ | |
90 | + asm(".symver " #func "_" #major "_" #minor "_" #micro ", " \ | |
91 | + #func binding "VA_API_" #major "." #minor "." #micro) | |
92 | + | |
93 | +/* vaCreateSurfaces() */ | |
94 | + | |
95 | +#ifndef VA_COMPAT_DISABLED | |
96 | +#define vaCreateSurfaces(dpy, ...) \ | |
97 | + VA_CPP_HELPER_CONCAT(vaCreateSurfaces, \ | |
98 | + VA_CPP_HELPER_N_ARGS(dpy, __VA_ARGS__)) \ | |
99 | + (dpy, __VA_ARGS__) | |
100 | +#endif | |
101 | + | |
102 | +#define vaCreateSurfaces6(dpy, width, height, format, num_surfaces, surfaces) \ | |
103 | + (vaCreateSurfaces)(dpy, format, width, height, surfaces, num_surfaces, \ | |
104 | + NULL, 0) | |
105 | + | |
106 | +#define vaCreateSurfaces8(dpy, format, width, height, surfaces, num_surfaces, attribs, num_attribs) \ | |
107 | + (vaCreateSurfaces)(dpy, format, width, height, surfaces, num_surfaces, \ | |
108 | + attribs, num_attribs) | |
109 | + | |
110 | +/*@}*/ | |
111 | + | |
112 | +#ifdef __cplusplus | |
113 | +} | |
114 | +#endif | |
115 | + | |
116 | +#endif /* VA_COMPAT_H */ |