xref: /aosp_15_r20/external/libva/va/va_str.c (revision 54e60f844a168e9a219354de272cd517ee8cd4b7)
1 /*
2  * Copyright (c) 2017 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 PRECISION INSIGHT 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 #include "va_str.h"
26 
27 #define TOSTR(enumCase) case enumCase: return #enumCase
28 
vaProfileStr(VAProfile profile)29 const char *vaProfileStr(VAProfile profile)
30 {
31     switch (profile) {
32         TOSTR(VAProfileNone);
33         TOSTR(VAProfileMPEG2Simple);
34         TOSTR(VAProfileMPEG2Main);
35         TOSTR(VAProfileMPEG4Simple);
36         TOSTR(VAProfileMPEG4AdvancedSimple);
37         TOSTR(VAProfileMPEG4Main);
38         TOSTR(VAProfileH264Main);
39         TOSTR(VAProfileH264High);
40         TOSTR(VAProfileH264High10);
41         TOSTR(VAProfileVC1Simple);
42         TOSTR(VAProfileVC1Main);
43         TOSTR(VAProfileVC1Advanced);
44         TOSTR(VAProfileH263Baseline);
45         TOSTR(VAProfileH264ConstrainedBaseline);
46         TOSTR(VAProfileJPEGBaseline);
47         TOSTR(VAProfileVP8Version0_3);
48         TOSTR(VAProfileH264MultiviewHigh);
49         TOSTR(VAProfileH264StereoHigh);
50         TOSTR(VAProfileHEVCMain);
51         TOSTR(VAProfileHEVCMain10);
52         TOSTR(VAProfileVP9Profile0);
53         TOSTR(VAProfileVP9Profile1);
54         TOSTR(VAProfileVP9Profile2);
55         TOSTR(VAProfileVP9Profile3);
56         TOSTR(VAProfileHEVCMain12);
57         TOSTR(VAProfileHEVCMain422_10);
58         TOSTR(VAProfileHEVCMain422_12);
59         TOSTR(VAProfileHEVCMain444);
60         TOSTR(VAProfileHEVCMain444_10);
61         TOSTR(VAProfileHEVCMain444_12);
62         TOSTR(VAProfileHEVCSccMain);
63         TOSTR(VAProfileHEVCSccMain10);
64         TOSTR(VAProfileHEVCSccMain444);
65         TOSTR(VAProfileAV1Profile0);
66         TOSTR(VAProfileAV1Profile1);
67         TOSTR(VAProfileHEVCSccMain444_10);
68         TOSTR(VAProfileProtected);
69         TOSTR(VAProfileVVCMain10);
70         TOSTR(VAProfileVVCMultilayerMain10);
71     default:
72         break;
73     }
74     return "<unknown profile>";
75 }
76 
77 
vaEntrypointStr(VAEntrypoint entrypoint)78 const char *vaEntrypointStr(VAEntrypoint entrypoint)
79 {
80     switch (entrypoint) {
81         TOSTR(VAEntrypointVLD);
82         TOSTR(VAEntrypointIZZ);
83         TOSTR(VAEntrypointIDCT);
84         TOSTR(VAEntrypointMoComp);
85         TOSTR(VAEntrypointDeblocking);
86         TOSTR(VAEntrypointEncSlice);
87         TOSTR(VAEntrypointEncPicture);
88         TOSTR(VAEntrypointEncSliceLP);
89         TOSTR(VAEntrypointVideoProc);
90         TOSTR(VAEntrypointFEI);
91         TOSTR(VAEntrypointStats);
92         TOSTR(VAEntrypointProtectedTEEComm);
93         TOSTR(VAEntrypointProtectedContent);
94     }
95     return "<unknown entrypoint>";
96 }
97 
vaConfigAttribTypeStr(VAConfigAttribType configAttribType)98 const char *vaConfigAttribTypeStr(VAConfigAttribType configAttribType)
99 {
100     switch (configAttribType) {
101         TOSTR(VAConfigAttribRTFormat);
102         TOSTR(VAConfigAttribSpatialResidual);
103         TOSTR(VAConfigAttribSpatialClipping);
104         TOSTR(VAConfigAttribIntraResidual);
105         TOSTR(VAConfigAttribEncryption);
106         TOSTR(VAConfigAttribRateControl);
107         TOSTR(VAConfigAttribDecSliceMode);
108         TOSTR(VAConfigAttribEncPackedHeaders);
109         TOSTR(VAConfigAttribEncInterlaced);
110         TOSTR(VAConfigAttribEncMaxRefFrames);
111         TOSTR(VAConfigAttribEncMaxSlices);
112         TOSTR(VAConfigAttribEncSliceStructure);
113         TOSTR(VAConfigAttribEncMacroblockInfo);
114         TOSTR(VAConfigAttribEncJPEG);
115         TOSTR(VAConfigAttribEncQualityRange);
116         TOSTR(VAConfigAttribEncSkipFrame);
117         TOSTR(VAConfigAttribEncROI);
118         TOSTR(VAConfigAttribEncRateControlExt);
119         TOSTR(VAConfigAttribFEIFunctionType);
120         TOSTR(VAConfigAttribFEIMVPredictors);
121         TOSTR(VAConfigAttribDecJPEG);
122         TOSTR(VAConfigAttribMaxPictureWidth);
123         TOSTR(VAConfigAttribMaxPictureHeight);
124         TOSTR(VAConfigAttribEncQuantization);
125         TOSTR(VAConfigAttribEncIntraRefresh);
126         TOSTR(VAConfigAttribProcessingRate);
127         TOSTR(VAConfigAttribEncDirtyRect);
128         TOSTR(VAConfigAttribEncParallelRateControl);
129         TOSTR(VAConfigAttribEncDynamicScaling);
130         TOSTR(VAConfigAttribDecProcessing);
131         TOSTR(VAConfigAttribFrameSizeToleranceSupport);
132         TOSTR(VAConfigAttribEncTileSupport);
133         TOSTR(VAConfigAttribCustomRoundingControl);
134         TOSTR(VAConfigAttribQPBlockSize);
135         TOSTR(VAConfigAttribStats);
136         TOSTR(VAConfigAttribMaxFrameSize);
137         TOSTR(VAConfigAttribPredictionDirection);
138         TOSTR(VAConfigAttribMultipleFrame);
139         TOSTR(VAConfigAttribContextPriority);
140         TOSTR(VAConfigAttribDecAV1Features);
141         TOSTR(VAConfigAttribTEEType);
142         TOSTR(VAConfigAttribTEETypeClient);
143         TOSTR(VAConfigAttribProtectedContentCipherAlgorithm);
144         TOSTR(VAConfigAttribProtectedContentCipherBlockSize);
145         TOSTR(VAConfigAttribProtectedContentCipherMode);
146         TOSTR(VAConfigAttribProtectedContentCipherSampleType);
147         TOSTR(VAConfigAttribProtectedContentUsage);
148         TOSTR(VAConfigAttribEncHEVCFeatures);
149         TOSTR(VAConfigAttribEncHEVCBlockSizes);
150         TOSTR(VAConfigAttribEncAV1);
151         TOSTR(VAConfigAttribEncAV1Ext1);
152         TOSTR(VAConfigAttribEncAV1Ext2);
153         TOSTR(VAConfigAttribEncPerBlockControl);
154         TOSTR(VAConfigAttribEncMaxTileRows);
155         TOSTR(VAConfigAttribEncMaxTileCols);
156     case VAConfigAttribTypeMax:
157         break;
158     }
159     return "<unknown config attribute type>";
160 }
161 
vaBufferTypeStr(VABufferType bufferType)162 const char *vaBufferTypeStr(VABufferType bufferType)
163 {
164     switch (bufferType) {
165         TOSTR(VAPictureParameterBufferType);
166         TOSTR(VAIQMatrixBufferType);
167         TOSTR(VABitPlaneBufferType);
168         TOSTR(VASliceGroupMapBufferType);
169         TOSTR(VASliceParameterBufferType);
170         TOSTR(VASliceDataBufferType);
171         TOSTR(VAMacroblockParameterBufferType);
172         TOSTR(VAResidualDataBufferType);
173         TOSTR(VADeblockingParameterBufferType);
174         TOSTR(VAImageBufferType);
175         TOSTR(VAProtectedSliceDataBufferType);
176         TOSTR(VAQMatrixBufferType);
177         TOSTR(VAHuffmanTableBufferType);
178         TOSTR(VAProbabilityBufferType);
179         TOSTR(VAEncCodedBufferType);
180         TOSTR(VAEncSequenceParameterBufferType);
181         TOSTR(VAEncPictureParameterBufferType);
182         TOSTR(VAEncSliceParameterBufferType);
183         TOSTR(VAEncPackedHeaderParameterBufferType);
184         TOSTR(VAEncPackedHeaderDataBufferType);
185         TOSTR(VAEncMiscParameterBufferType);
186         TOSTR(VAEncMacroblockParameterBufferType);
187         TOSTR(VAEncMacroblockMapBufferType);
188         TOSTR(VAProcPipelineParameterBufferType);
189         TOSTR(VAProcFilterParameterBufferType);
190         TOSTR(VAEncQPBufferType);
191         TOSTR(VAEncFEIMVBufferType);
192         TOSTR(VAEncFEIMBCodeBufferType);
193         TOSTR(VAEncFEIDistortionBufferType);
194         TOSTR(VAEncFEIMBControlBufferType);
195         TOSTR(VAEncFEIMVPredictorBufferType);
196         TOSTR(VAEncMacroblockDisableSkipMapBufferType);
197         TOSTR(VADecodeStreamoutBufferType);
198         TOSTR(VAStatsStatisticsParameterBufferType);
199         TOSTR(VAStatsStatisticsBufferType);
200         TOSTR(VAStatsStatisticsBottomFieldBufferType);
201         TOSTR(VAStatsMVBufferType);
202         TOSTR(VAStatsMVPredictorBufferType);
203         TOSTR(VAEncFEICTBCmdBufferType);
204         TOSTR(VAEncFEICURecordBufferType);
205         TOSTR(VASubsetsParameterBufferType);
206         TOSTR(VAContextParameterUpdateBufferType);
207         TOSTR(VAProtectedSessionExecuteBufferType);
208         TOSTR(VAEncryptionParameterBufferType);
209         TOSTR(VAEncDeltaQpPerBlockBufferType);
210         TOSTR(VAAlfBufferType);
211         TOSTR(VALmcsBufferType);
212         TOSTR(VASubPicBufferType);
213         TOSTR(VATileBufferType);
214         TOSTR(VASliceStructBufferType);
215     case VABufferTypeMax:
216         break;
217     }
218     return "<unknown buffer type>";
219 }
220 
vaStatusStr(VAStatus status)221 const char *vaStatusStr(VAStatus status)
222 {
223     switch (status) {
224         TOSTR(VA_STATUS_SUCCESS);
225         TOSTR(VA_STATUS_ERROR_OPERATION_FAILED);
226         TOSTR(VA_STATUS_ERROR_ALLOCATION_FAILED);
227         TOSTR(VA_STATUS_ERROR_INVALID_DISPLAY);
228         TOSTR(VA_STATUS_ERROR_INVALID_CONFIG);
229         TOSTR(VA_STATUS_ERROR_INVALID_CONTEXT);
230         TOSTR(VA_STATUS_ERROR_INVALID_SURFACE);
231         TOSTR(VA_STATUS_ERROR_INVALID_BUFFER);
232         TOSTR(VA_STATUS_ERROR_INVALID_IMAGE);
233         TOSTR(VA_STATUS_ERROR_INVALID_SUBPICTURE);
234         TOSTR(VA_STATUS_ERROR_ATTR_NOT_SUPPORTED);
235         TOSTR(VA_STATUS_ERROR_MAX_NUM_EXCEEDED);
236         TOSTR(VA_STATUS_ERROR_UNSUPPORTED_PROFILE);
237         TOSTR(VA_STATUS_ERROR_UNSUPPORTED_ENTRYPOINT);
238         TOSTR(VA_STATUS_ERROR_UNSUPPORTED_RT_FORMAT);
239         TOSTR(VA_STATUS_ERROR_UNSUPPORTED_BUFFERTYPE);
240         TOSTR(VA_STATUS_ERROR_SURFACE_BUSY);
241         TOSTR(VA_STATUS_ERROR_FLAG_NOT_SUPPORTED);
242         TOSTR(VA_STATUS_ERROR_INVALID_PARAMETER);
243         TOSTR(VA_STATUS_ERROR_RESOLUTION_NOT_SUPPORTED);
244         TOSTR(VA_STATUS_ERROR_UNIMPLEMENTED);
245         TOSTR(VA_STATUS_ERROR_SURFACE_IN_DISPLAYING);
246         TOSTR(VA_STATUS_ERROR_INVALID_IMAGE_FORMAT);
247         TOSTR(VA_STATUS_ERROR_DECODING_ERROR);
248         TOSTR(VA_STATUS_ERROR_ENCODING_ERROR);
249         TOSTR(VA_STATUS_ERROR_INVALID_VALUE);
250         TOSTR(VA_STATUS_ERROR_UNSUPPORTED_FILTER);
251         TOSTR(VA_STATUS_ERROR_INVALID_FILTER_CHAIN);
252         TOSTR(VA_STATUS_ERROR_HW_BUSY);
253         TOSTR(VA_STATUS_ERROR_UNSUPPORTED_MEMORY_TYPE);
254         TOSTR(VA_STATUS_ERROR_NOT_ENOUGH_BUFFER);
255         TOSTR(VA_STATUS_ERROR_UNKNOWN);
256     default:
257         break;
258     }
259     return "unknown return value";
260 }
261 
262 #undef TOSTR
263