1 | // Copyright (C) 2024 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include <QtMultimedia/private/qsymbolsresolveutils_p.h> |
5 | |
6 | #include <va/va.h> |
7 | #include <va/va_str.h> |
8 | |
9 | // VAAPI generated the actual *.so name due to the rule: |
10 | // https://github.com/intel/libva/blob/master/configure.ac |
11 | // |
12 | // The library name is generated libva.<x>.<y>.0 where |
13 | // <x> = VA-API major version + 1 |
14 | // <y> = 100 * VA-API minor version + VA-API micro version |
15 | CHECK_VERSIONS("va" , VA_NEEDED_SOVERSION, VA_MAJOR_VERSION + 1); |
16 | |
17 | #ifdef Q_FFMPEG_PLUGIN_STUBS_ONLY |
18 | constexpr const char *loggingName = "va(in plugin)" ; |
19 | #else |
20 | constexpr const char *loggingName = nullptr; |
21 | #endif |
22 | |
23 | BEGIN_INIT_FUNCS("va" , VA_NEEDED_SOVERSION, loggingName) |
24 | |
25 | |
26 | INIT_FUNC(vaExportSurfaceHandle); |
27 | INIT_FUNC(vaSyncSurface); |
28 | INIT_FUNC(vaQueryVendorString); |
29 | |
30 | #ifndef Q_FFMPEG_PLUGIN_STUBS_ONLY |
31 | |
32 | INIT_FUNC(vaInitialize); |
33 | INIT_FUNC(vaTerminate); |
34 | INIT_FUNC(vaErrorStr); |
35 | INIT_FUNC(vaSetErrorCallback); |
36 | INIT_FUNC(vaSetInfoCallback); |
37 | |
38 | INIT_FUNC(vaCreateImage); |
39 | INIT_FUNC(vaGetImage); |
40 | INIT_FUNC(vaPutImage); |
41 | INIT_FUNC(vaDeriveImage); |
42 | INIT_FUNC(vaDestroyImage); |
43 | INIT_FUNC(vaQueryImageFormats); |
44 | |
45 | INIT_FUNC(vaBeginPicture); |
46 | INIT_FUNC(vaRenderPicture); |
47 | INIT_FUNC(vaEndPicture); |
48 | |
49 | INIT_FUNC(vaCreateBuffer); |
50 | INIT_FUNC(vaMapBuffer); |
51 | INIT_FUNC(vaUnmapBuffer); |
52 | #if VA_CHECK_VERSION(1, 9, 0) |
53 | INIT_FUNC(vaSyncBuffer); |
54 | #endif |
55 | INIT_FUNC(vaDestroyBuffer); |
56 | |
57 | INIT_FUNC(vaCreateSurfaces); |
58 | INIT_FUNC(vaDestroySurfaces); |
59 | |
60 | INIT_FUNC(vaCreateConfig); |
61 | INIT_FUNC(vaGetConfigAttributes); |
62 | INIT_FUNC(vaMaxNumProfiles); |
63 | INIT_FUNC(vaMaxNumImageFormats); |
64 | INIT_FUNC(vaMaxNumEntrypoints); |
65 | INIT_FUNC(vaQueryConfigProfiles); |
66 | INIT_FUNC(vaQueryConfigEntrypoints); |
67 | INIT_FUNC(vaQuerySurfaceAttributes); |
68 | INIT_FUNC(vaDestroyConfig); |
69 | |
70 | INIT_FUNC(vaCreateContext); |
71 | INIT_FUNC(vaDestroyContext); |
72 | |
73 | INIT_FUNC(vaProfileStr); |
74 | INIT_FUNC(vaEntrypointStr); |
75 | |
76 | INIT_FUNC(vaGetDisplayAttributes); |
77 | |
78 | INIT_FUNC(vaSetDriverName); |
79 | |
80 | INIT_FUNC(vaAcquireBufferHandle); |
81 | INIT_FUNC(vaReleaseBufferHandle); |
82 | |
83 | #endif |
84 | |
85 | END_INIT_FUNCS() |
86 | |
87 | constexpr auto emptyString = "" ; |
88 | |
89 | DEFINE_FUNC(vaExportSurfaceHandle, 5, VA_STATUS_ERROR_OPERATION_FAILED); |
90 | DEFINE_FUNC(vaSyncSurface, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
91 | DEFINE_FUNC(vaQueryVendorString, 1, emptyString); |
92 | |
93 | #ifndef Q_FFMPEG_PLUGIN_STUBS_ONLY |
94 | |
95 | DEFINE_FUNC(vaInitialize, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
96 | DEFINE_FUNC(vaTerminate, 1, VA_STATUS_ERROR_OPERATION_FAILED); |
97 | |
98 | constexpr auto errorStr = "VAAPI is not available" ; |
99 | DEFINE_FUNC(vaErrorStr, 1, errorStr); |
100 | DEFINE_FUNC(vaSetErrorCallback, 3); |
101 | DEFINE_FUNC(vaSetInfoCallback, 3); |
102 | |
103 | DEFINE_FUNC(vaCreateImage, 5, VA_STATUS_ERROR_OPERATION_FAILED); |
104 | DEFINE_FUNC(vaGetImage, 7, VA_STATUS_ERROR_OPERATION_FAILED); |
105 | DEFINE_FUNC(vaPutImage, 11, VA_STATUS_ERROR_OPERATION_FAILED); |
106 | DEFINE_FUNC(vaDeriveImage, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
107 | DEFINE_FUNC(vaDestroyImage, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
108 | DEFINE_FUNC(vaQueryImageFormats, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
109 | |
110 | DEFINE_FUNC(vaBeginPicture, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
111 | DEFINE_FUNC(vaRenderPicture, 4, VA_STATUS_ERROR_OPERATION_FAILED); |
112 | DEFINE_FUNC(vaEndPicture, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
113 | |
114 | DEFINE_FUNC(vaCreateBuffer, 7, VA_STATUS_ERROR_OPERATION_FAILED); |
115 | DEFINE_FUNC(vaMapBuffer, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
116 | DEFINE_FUNC(vaUnmapBuffer, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
117 | #if VA_CHECK_VERSION(1, 9, 0) |
118 | DEFINE_FUNC(vaSyncBuffer, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
119 | #endif |
120 | DEFINE_FUNC(vaDestroyBuffer, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
121 | |
122 | DEFINE_FUNC(vaCreateSurfaces, 8, VA_STATUS_ERROR_OPERATION_FAILED); |
123 | DEFINE_FUNC(vaDestroySurfaces, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
124 | |
125 | DEFINE_FUNC(vaCreateConfig, 6, VA_STATUS_ERROR_OPERATION_FAILED); |
126 | DEFINE_FUNC(vaGetConfigAttributes, 5, VA_STATUS_ERROR_OPERATION_FAILED); |
127 | DEFINE_FUNC(vaMaxNumProfiles, 1); |
128 | DEFINE_FUNC(vaMaxNumImageFormats, 1); |
129 | DEFINE_FUNC(vaMaxNumEntrypoints, 1); |
130 | DEFINE_FUNC(vaQueryConfigProfiles, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
131 | DEFINE_FUNC(vaQueryConfigEntrypoints, 4, VA_STATUS_ERROR_OPERATION_FAILED); |
132 | DEFINE_FUNC(vaQuerySurfaceAttributes, 4, VA_STATUS_ERROR_OPERATION_FAILED); |
133 | DEFINE_FUNC(vaDestroyConfig, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
134 | |
135 | DEFINE_FUNC(vaCreateContext, 8); |
136 | DEFINE_FUNC(vaDestroyContext, 2); |
137 | |
138 | |
139 | DEFINE_FUNC(vaProfileStr, 1, emptyString); |
140 | DEFINE_FUNC(vaEntrypointStr, 1, emptyString); |
141 | |
142 | DEFINE_FUNC(vaGetDisplayAttributes, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
143 | |
144 | DEFINE_FUNC(vaSetDriverName, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
145 | |
146 | DEFINE_FUNC(vaAcquireBufferHandle, 3, VA_STATUS_ERROR_OPERATION_FAILED); |
147 | DEFINE_FUNC(vaReleaseBufferHandle, 2, VA_STATUS_ERROR_OPERATION_FAILED); |
148 | |
149 | #endif |
150 | |
151 | |