taglist, plugins: fix compiler warnings with GLib >= 2.76
[platform/upstream/gstreamer.git] / subprojects / gst-plugins-bad / sys / msdk / msdk-enums.c
1 /* GStreamer Intel MSDK plugin
2  * Copyright (c) 2018, Intel corporation
3  * All rights reserved.
4  *
5  * Author:Sreerenj Balachandran <sreerenj.balachandran@intel.com>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are met:
9  *
10  * 1. Redistributions of source code must retain the above copyright notice,
11  *    this list of conditions and the following disclaimer.
12  *
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation
15  *    and/or other materials provided with the distribution.
16  *
17  * 3. Neither the name of the copyright holder nor the names of its contributors
18  *    may be used to endorse or promote products derived from this software
19  *    without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
23  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
24  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
25  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
27  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
28  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
29  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
30  * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33
34 #include "msdk-enums.h"
35
36 /*========= MSDK Decoder Enums =========================*/
37 GType
38 gst_msdkdec_output_order_get_type (void)
39 {
40   static GType type = 0;
41
42   static const GEnumValue values[] = {
43     {GST_MSDKDEC_OUTPUT_ORDER_DISPLAY, "Output frames in Display order",
44         "display"},
45     {GST_MSDKDEC_OUTPUT_ORDER_DECODE, "Output frames in Decoded order",
46         "decoded"},
47     {0, NULL, NULL}
48   };
49
50   if (!type) {
51     type = g_enum_register_static ("GstMsdkDecOutputOrder", values);
52   }
53   return type;
54 }
55
56 /*========= MSDK Encoder Enums =========================*/
57 GType
58 gst_msdkenc_rate_control_get_type (void)
59 {
60   static GType type = 0;
61
62   static const GEnumValue values[] = {
63     {MFX_RATECONTROL_CBR, "Constant Bitrate", "cbr"},
64     {MFX_RATECONTROL_VBR, "Variable Bitrate", "vbr"},
65     {MFX_RATECONTROL_CQP, "Constant Quantizer", "cqp"},
66     {MFX_RATECONTROL_AVBR, "Average Bitrate", "avbr"},
67     {MFX_RATECONTROL_LA, "VBR with look ahead (Non HRD compliant)", "la_vbr"},
68     {MFX_RATECONTROL_ICQ, "Intelligent CQP", "icq"},
69     {MFX_RATECONTROL_VCM, "Video Conferencing Mode (Non HRD compliant)", "vcm"},
70     {MFX_RATECONTROL_LA_ICQ, "Intelligent CQP with LA (Non HRD compliant)",
71         "la_icq"},
72 #if 0
73     /* intended for one to N transcode scenario */
74     {MFX_RATECONTROL_LA_EXT, "Extended LA", "la_ext"},
75 #endif
76     {MFX_RATECONTROL_LA_HRD, "HRD compliant LA", "la_hrd"},
77     {MFX_RATECONTROL_QVBR, "VBR with CQP", "qvbr"},
78     {0, NULL, NULL}
79   };
80
81   if (!type) {
82     type = g_enum_register_static ("GstMsdkEncRateControl", values);
83   }
84   return type;
85 }
86
87 GType
88 gst_msdkenc_trellis_quantization_get_type (void)
89 {
90   static GType type = 0;
91
92   static const GFlagsValue values[] = {
93     {_MFX_TRELLIS_NONE, "Disable for all frames", "None"},
94     {MFX_TRELLIS_I, "Enable for I frames", "i"},
95     {MFX_TRELLIS_P, "Enable for P frames", "p"},
96     {MFX_TRELLIS_B, "Enable for B frames", "b"},
97     {0, NULL, NULL}
98   };
99
100   if (!type) {
101     type = g_flags_register_static ("GstMsdkEncTrellisQuantization", values);
102   }
103   return type;
104 }
105
106 GType
107 gst_msdkenc_rc_lookahead_ds_get_type (void)
108 {
109   static GType type = 0;
110
111   static const GEnumValue values[] = {
112     {MFX_LOOKAHEAD_DS_UNKNOWN, "SDK desides what to do", "default"},
113     {MFX_LOOKAHEAD_DS_OFF, "No downsampling", "off"},
114     {MFX_LOOKAHEAD_DS_2x, "Down sample 2-times before estimation", "2x"},
115     {MFX_LOOKAHEAD_DS_4x, "Down sample 4-times before estimation", "4x"},
116     {0, NULL, NULL}
117   };
118
119   if (!type) {
120     type = g_enum_register_static ("GstMsdkEncRCLookAheadDownsampling", values);
121   }
122   return type;
123 }
124
125 GType
126 gst_msdkenc_mbbrc_get_type (void)
127 {
128   static GType type = 0;
129
130   static const GEnumValue values[] = {
131     {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
132     {MFX_CODINGOPTION_OFF, "Disable Macroblock level bit rate control", "off"},
133     {MFX_CODINGOPTION_ON, "Enable Macroblock level bit rate control ", "on"},
134     {0, NULL, NULL}
135   };
136
137   if (!type) {
138     type = g_enum_register_static ("GstMsdkEncMbBitrateControl", values);
139   }
140   return type;
141 }
142
143 GType
144 gst_msdkenc_lowdelay_brc_get_type (void)
145 {
146   static GType type = 0;
147
148   static const GEnumValue values[] = {
149     {MFX_CODINGOPTION_UNKNOWN, "SDK decides what to do", "auto"},
150     {MFX_CODINGOPTION_OFF, "Disable LowDelay bit rate control", "off"},
151     {MFX_CODINGOPTION_ON, "Enable LowDelay bit rate control ", "on"},
152     {0, NULL, NULL}
153   };
154
155   if (!type) {
156     type = g_enum_register_static ("GstMsdkEncLowDelayBitrateControl", values);
157   }
158   return type;
159 }
160
161 GType
162 gst_msdkenc_adaptive_i_get_type (void)
163 {
164   static GType type = 0;
165
166   static const GEnumValue values[] = {
167     {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
168     {MFX_CODINGOPTION_OFF, "Disable Adaptive I frame insertion ", "off"},
169     {MFX_CODINGOPTION_ON, "Enable Aaptive I frame insertion ", "on"},
170     {0, NULL, NULL}
171   };
172
173   if (!type) {
174     type = g_enum_register_static ("GstMsdkEncAdaptiveI", values);
175   }
176   return type;
177 }
178
179 GType
180 gst_msdkenc_adaptive_b_get_type (void)
181 {
182   static GType type = 0;
183
184   static const GEnumValue values[] = {
185     {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
186     {MFX_CODINGOPTION_OFF, "Disable Adaptive B-Frame insertion ", "off"},
187     {MFX_CODINGOPTION_ON, "Enable Aaptive B-Frame insertion ", "on"},
188     {0, NULL, NULL}
189   };
190
191   if (!type) {
192     type = g_enum_register_static ("GstMsdkEncAdaptiveB", values);
193   }
194   return type;
195 }
196
197 GType
198 gst_msdkenc_tune_mode_get_type (void)
199 {
200   static GType type = 0;
201
202   static const GEnumValue values[] = {
203     {MFX_CODINGOPTION_UNKNOWN, "Auto ", "auto"},
204     {MFX_CODINGOPTION_OFF, "None ", "none"},
205     {MFX_CODINGOPTION_ON, "Low power mode ", "low-power"},
206     {0, NULL, NULL}
207   };
208
209   if (!type) {
210     type = g_enum_register_static ("GstMsdkEncTuneMode", values);
211   }
212
213   return type;
214 }
215
216 GType
217 gst_msdkenc_transform_skip_get_type (void)
218 {
219   static GType type = 0;
220
221   static const GEnumValue values[] = {
222     {MFX_CODINGOPTION_UNKNOWN, "SDK desides what to do", "auto"},
223     {MFX_CODINGOPTION_OFF,
224         "transform_skip_enabled_flag will be set to 0 in PPS ", "off"},
225     {MFX_CODINGOPTION_ON,
226         "transform_skip_enabled_flag will be set to 1 in PPS ", "on"},
227     {0, NULL, NULL}
228   };
229
230   if (!type) {
231     type = g_enum_register_static ("GstMsdkEncTransformSkip", values);
232   }
233   return type;
234 }
235
236 GType
237 gst_msdkenc_intra_refresh_type_get_type (void)
238 {
239   static GType type = 0;
240
241   static const GEnumValue values[] = {
242     {MFX_REFRESH_NO, "No (default)", "no"},
243     {MFX_REFRESH_VERTICAL, "Vertical", "vertical"},
244     {MFX_REFRESH_HORIZONTAL, "Horizontal ", "horizontal"},
245     {MFX_REFRESH_SLICE, "Slice ", "slice"},
246     {0, NULL, NULL}
247   };
248
249   if (!type) {
250     type = g_enum_register_static ("GstMsdkEncIntraRefreshType", values);
251   }
252
253   return type;
254 }
255
256 /*========= MSDK VPP Enums =========================*/
257
258 #ifndef GST_REMOVE_DEPRECATED
259 GType
260 gst_msdkvpp_rotation_get_type (void)
261 {
262   static GType type = 0;
263
264   static const GEnumValue values[] = {
265     {MFX_ANGLE_0, "Unrotated mode", "0"},
266     {MFX_ANGLE_90, "Rotated by 90°", "90"},
267     {MFX_ANGLE_180, "Rotated by 180°", "180"},
268     {MFX_ANGLE_270, "Rotated by 270°", "270"},
269     {0, NULL, NULL}
270   };
271
272   if (!type) {
273     type = g_enum_register_static ("GstMsdkVPPRotation", values);
274   }
275   return type;
276 }
277 #endif
278
279 GType
280 gst_msdkvpp_deinterlace_mode_get_type (void)
281 {
282   static GType type = 0;
283
284   static const GEnumValue values[] = {
285     {GST_MSDKVPP_DEINTERLACE_MODE_AUTO,
286         "Auto detection", "auto"},
287     {GST_MSDKVPP_DEINTERLACE_MODE_INTERLACED,
288         "Force deinterlacing", "interlaced"},
289     {GST_MSDKVPP_DEINTERLACE_MODE_DISABLED,
290         "Never deinterlace", "disabled"},
291     {0, NULL, NULL},
292   };
293
294   if (!type) {
295     type = g_enum_register_static ("GstMsdkVPPDeinterlaceMode", values);
296   }
297   return type;
298 }
299
300 GType
301 gst_msdkvpp_deinterlace_method_get_type (void)
302 {
303   static GType type = 0;
304
305   static const GEnumValue values[] = {
306     {_MFX_DEINTERLACE_METHOD_NONE,
307         "Disable deinterlacing", "none"},
308     {MFX_DEINTERLACING_BOB, "Bob deinterlacing", "bob"},
309     {MFX_DEINTERLACING_ADVANCED, "Advanced deinterlacing (Motion adaptive)",
310         "advanced"},
311 #if 0
312     {MFX_DEINTERLACING_AUTO_DOUBLE,
313           "Auto mode with deinterlacing double framerate output",
314         "auto-double"},
315     {MFX_DEINTERLACING_AUTO_SINGLE,
316           "Auto mode with deinterlacing single framerate output",
317         "auto-single"},
318     {MFX_DEINTERLACING_FULL_FR_OUT,
319         "Deinterlace only mode with full framerate output", "full-fr"},
320     {MFX_DEINTERLACING_HALF_FR_OUT,
321         "Deinterlace only Mode with half framerate output", "half-fr"},
322     {MFX_DEINTERLACING_24FPS_OUT, "24 fps fixed output mode", "24-fps"},
323     {MFX_DEINTERLACING_FIXED_TELECINE_PATTERN,
324         "Fixed telecine pattern removal mode", "fixed-telecine-removal"},
325     {MFX_DEINTERLACING_30FPS_OUT, "30 fps fixed output mode", "30-fps"},
326     {MFX_DEINTERLACING_DETECT_INTERLACE, "Only interlace detection",
327         "only-detect"},
328 #endif
329     {MFX_DEINTERLACING_ADVANCED_NOREF,
330           "Advanced deinterlacing mode without using of reference frames",
331         "advanced-no-ref"},
332     {MFX_DEINTERLACING_ADVANCED_SCD,
333           "Advanced deinterlacing mode with scene change detection",
334         "advanced-scd"},
335     {MFX_DEINTERLACING_FIELD_WEAVING, "Field weaving", "field-weave"},
336     {0, NULL, NULL},
337   };
338
339   if (!type) {
340     type = g_enum_register_static ("GstMsdkVPPDeinterlaceMethod", values);
341   }
342   return type;
343 }
344
345 #ifndef GST_REMOVE_DEPRECATED
346 GType
347 gst_msdkvpp_mirroring_get_type (void)
348 {
349   static GType type = 0;
350
351   static const GEnumValue values[] = {
352     {MFX_MIRRORING_DISABLED, "Disable mirroring", "disable"},
353     {MFX_MIRRORING_HORIZONTAL, "Horizontal Mirroring", "horizontal"},
354     {MFX_MIRRORING_VERTICAL, "Vertical Mirroring", "vertical"},
355     {0, NULL, NULL}
356   };
357
358   if (!type) {
359     type = g_enum_register_static ("GstMsdkVPPMirroring", values);
360   }
361   return type;
362 }
363 #endif
364
365 GType
366 gst_msdkvpp_scaling_mode_get_type (void)
367 {
368   static GType type = 0;
369
370   static const GEnumValue values[] = {
371     {MFX_SCALING_MODE_DEFAULT, "Default Scaling", "disable"},
372     {MFX_SCALING_MODE_LOWPOWER, "Lowpower Scaling", "lowpower"},
373     {MFX_SCALING_MODE_QUALITY, "High Quality Scaling", "quality"},
374     {0, NULL, NULL}
375   };
376
377   if (!type) {
378     type = g_enum_register_static ("GstMsdkVPPScalingMode", values);
379   }
380   return type;
381 }
382
383 GType
384 gst_msdkvpp_frc_algorithm_get_type (void)
385 {
386   static GType type = 0;
387
388   static const GEnumValue values[] = {
389     {_MFX_FRC_ALGORITHM_NONE, "No FrameRate Control algorithm", "none"},
390     {MFX_FRCALGM_PRESERVE_TIMESTAMP,
391         "Frame dropping/repetition, Preserve timestamp", "preserve-ts"},
392     {MFX_FRCALGM_DISTRIBUTED_TIMESTAMP,
393         "Frame dropping/repetition, Distribute timestamp", "distribute-ts"},
394     {MFX_FRCALGM_FRAME_INTERPOLATION, "Frame interpolation", "interpolate"},
395     {MFX_FRCALGM_FRAME_INTERPOLATION | MFX_FRCALGM_PRESERVE_TIMESTAMP,
396         "Frame interpolation, Preserve timestamp", "interpolate-preserve-ts"},
397     {MFX_FRCALGM_FRAME_INTERPOLATION | MFX_FRCALGM_DISTRIBUTED_TIMESTAMP,
398           "Frame interpolation, Distribute timestamp",
399         "interpolate-distribute-ts"},
400     {0, NULL, NULL}
401   };
402
403   if (!type) {
404     type = g_enum_register_static ("GstMsdkVPPFrcAlgorithm", values);
405   }
406   return type;
407 }