• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Provide registration of all codecs, parsers and bitstream filters for libavcodec.
3  * Copyright (c) 2002 Fabrice Bellard
4  *
5  * This file is part of FFmpeg.
6  *
7  * FFmpeg is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2.1 of the License, or (at your option) any later version.
11  *
12  * FFmpeg is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public
18  * License along with FFmpeg; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20  */
21 
22 /**
23  * @file
24  * Provide registration of all codecs, parsers and bitstream filters for libavcodec.
25  */
26 
27 #include "config.h"
28 #include "libavutil/thread.h"
29 #include "avcodec.h"
30 #include "version.h"
31 
32 extern AVCodec ff_a64multi_encoder;
33 extern AVCodec ff_a64multi5_encoder;
34 extern AVCodec ff_aasc_decoder;
35 extern AVCodec ff_aic_decoder;
36 extern AVCodec ff_alias_pix_encoder;
37 extern AVCodec ff_alias_pix_decoder;
38 extern AVCodec ff_agm_decoder;
39 extern AVCodec ff_amv_encoder;
40 extern AVCodec ff_amv_decoder;
41 extern AVCodec ff_anm_decoder;
42 extern AVCodec ff_ansi_decoder;
43 extern AVCodec ff_apng_encoder;
44 extern AVCodec ff_apng_decoder;
45 extern AVCodec ff_arbc_decoder;
46 extern AVCodec ff_argo_decoder;
47 extern AVCodec ff_asv1_encoder;
48 extern AVCodec ff_asv1_decoder;
49 extern AVCodec ff_asv2_encoder;
50 extern AVCodec ff_asv2_decoder;
51 extern AVCodec ff_aura_decoder;
52 extern AVCodec ff_aura2_decoder;
53 extern AVCodec ff_avrp_encoder;
54 extern AVCodec ff_avrp_decoder;
55 extern AVCodec ff_avrn_decoder;
56 extern AVCodec ff_avs_decoder;
57 extern AVCodec ff_avui_encoder;
58 extern AVCodec ff_avui_decoder;
59 extern AVCodec ff_ayuv_encoder;
60 extern AVCodec ff_ayuv_decoder;
61 extern AVCodec ff_bethsoftvid_decoder;
62 extern AVCodec ff_bfi_decoder;
63 extern AVCodec ff_bink_decoder;
64 extern AVCodec ff_bitpacked_decoder;
65 extern AVCodec ff_bmp_encoder;
66 extern AVCodec ff_bmp_decoder;
67 extern AVCodec ff_bmv_video_decoder;
68 extern AVCodec ff_brender_pix_decoder;
69 extern AVCodec ff_c93_decoder;
70 extern AVCodec ff_cavs_decoder;
71 extern AVCodec ff_cdgraphics_decoder;
72 extern AVCodec ff_cdtoons_decoder;
73 extern AVCodec ff_cdxl_decoder;
74 extern AVCodec ff_cfhd_encoder;
75 extern AVCodec ff_cfhd_decoder;
76 extern AVCodec ff_cinepak_encoder;
77 extern AVCodec ff_cinepak_decoder;
78 extern AVCodec ff_clearvideo_decoder;
79 extern AVCodec ff_cljr_encoder;
80 extern AVCodec ff_cljr_decoder;
81 extern AVCodec ff_cllc_decoder;
82 extern AVCodec ff_comfortnoise_encoder;
83 extern AVCodec ff_comfortnoise_decoder;
84 extern AVCodec ff_cpia_decoder;
85 extern AVCodec ff_cri_decoder;
86 extern AVCodec ff_cscd_decoder;
87 extern AVCodec ff_cyuv_decoder;
88 extern AVCodec ff_dds_decoder;
89 extern AVCodec ff_dfa_decoder;
90 extern AVCodec ff_dirac_decoder;
91 extern AVCodec ff_dnxhd_encoder;
92 extern AVCodec ff_dnxhd_decoder;
93 extern AVCodec ff_dpx_encoder;
94 extern AVCodec ff_dpx_decoder;
95 extern AVCodec ff_dsicinvideo_decoder;
96 extern AVCodec ff_dvaudio_decoder;
97 extern AVCodec ff_dvvideo_encoder;
98 extern AVCodec ff_dvvideo_decoder;
99 extern AVCodec ff_dxa_decoder;
100 extern AVCodec ff_dxtory_decoder;
101 extern AVCodec ff_dxv_decoder;
102 extern AVCodec ff_eacmv_decoder;
103 extern AVCodec ff_eamad_decoder;
104 extern AVCodec ff_eatgq_decoder;
105 extern AVCodec ff_eatgv_decoder;
106 extern AVCodec ff_eatqi_decoder;
107 extern AVCodec ff_eightbps_decoder;
108 extern AVCodec ff_eightsvx_exp_decoder;
109 extern AVCodec ff_eightsvx_fib_decoder;
110 extern AVCodec ff_escape124_decoder;
111 extern AVCodec ff_escape130_decoder;
112 extern AVCodec ff_exr_encoder;
113 extern AVCodec ff_exr_decoder;
114 extern AVCodec ff_ffv1_encoder;
115 extern AVCodec ff_ffv1_decoder;
116 extern AVCodec ff_ffvhuff_encoder;
117 extern AVCodec ff_ffvhuff_decoder;
118 extern AVCodec ff_fic_decoder;
119 extern AVCodec ff_fits_encoder;
120 extern AVCodec ff_fits_decoder;
121 extern AVCodec ff_flashsv_encoder;
122 extern AVCodec ff_flashsv_decoder;
123 extern AVCodec ff_flashsv2_encoder;
124 extern AVCodec ff_flashsv2_decoder;
125 extern AVCodec ff_flic_decoder;
126 extern AVCodec ff_flv_encoder;
127 extern AVCodec ff_flv_decoder;
128 extern AVCodec ff_fmvc_decoder;
129 extern AVCodec ff_fourxm_decoder;
130 extern AVCodec ff_fraps_decoder;
131 extern AVCodec ff_frwu_decoder;
132 extern AVCodec ff_g2m_decoder;
133 extern AVCodec ff_gdv_decoder;
134 extern AVCodec ff_gif_encoder;
135 extern AVCodec ff_gif_decoder;
136 extern AVCodec ff_h261_encoder;
137 extern AVCodec ff_h261_decoder;
138 extern AVCodec ff_h263_encoder;
139 extern AVCodec ff_h263_decoder;
140 extern AVCodec ff_h263i_decoder;
141 extern AVCodec ff_h263p_encoder;
142 extern AVCodec ff_h263p_decoder;
143 extern AVCodec ff_h263_v4l2m2m_decoder;
144 extern AVCodec ff_h264_decoder;
145 extern AVCodec ff_h264_crystalhd_decoder;
146 extern AVCodec ff_h264_v4l2m2m_decoder;
147 extern AVCodec ff_h264_mediacodec_decoder;
148 extern AVCodec ff_h264_mmal_decoder;
149 extern AVCodec ff_h264_qsv_decoder;
150 extern AVCodec ff_h264_rkmpp_decoder;
151 extern AVCodec ff_hap_encoder;
152 extern AVCodec ff_hap_decoder;
153 extern AVCodec ff_hevc_decoder;
154 extern AVCodec ff_hevc_qsv_decoder;
155 extern AVCodec ff_hevc_rkmpp_decoder;
156 extern AVCodec ff_hevc_v4l2m2m_decoder;
157 extern AVCodec ff_hnm4_video_decoder;
158 extern AVCodec ff_hq_hqa_decoder;
159 extern AVCodec ff_hqx_decoder;
160 extern AVCodec ff_huffyuv_encoder;
161 extern AVCodec ff_huffyuv_decoder;
162 extern AVCodec ff_hymt_decoder;
163 extern AVCodec ff_idcin_decoder;
164 extern AVCodec ff_iff_ilbm_decoder;
165 extern AVCodec ff_imm4_decoder;
166 extern AVCodec ff_imm5_decoder;
167 extern AVCodec ff_indeo2_decoder;
168 extern AVCodec ff_indeo3_decoder;
169 extern AVCodec ff_indeo4_decoder;
170 extern AVCodec ff_indeo5_decoder;
171 extern AVCodec ff_interplay_video_decoder;
172 extern AVCodec ff_ipu_decoder;
173 extern AVCodec ff_jpeg2000_encoder;
174 extern AVCodec ff_jpeg2000_decoder;
175 extern AVCodec ff_jpegls_encoder;
176 extern AVCodec ff_jpegls_decoder;
177 extern AVCodec ff_jv_decoder;
178 extern AVCodec ff_kgv1_decoder;
179 extern AVCodec ff_kmvc_decoder;
180 extern AVCodec ff_lagarith_decoder;
181 extern AVCodec ff_ljpeg_encoder;
182 extern AVCodec ff_loco_decoder;
183 extern AVCodec ff_lscr_decoder;
184 extern AVCodec ff_m101_decoder;
185 extern AVCodec ff_magicyuv_encoder;
186 extern AVCodec ff_magicyuv_decoder;
187 extern AVCodec ff_mdec_decoder;
188 extern AVCodec ff_mimic_decoder;
189 extern AVCodec ff_mjpeg_encoder;
190 extern AVCodec ff_mjpeg_decoder;
191 extern AVCodec ff_mjpegb_decoder;
192 extern AVCodec ff_mmvideo_decoder;
193 extern AVCodec ff_mobiclip_decoder;
194 extern AVCodec ff_motionpixels_decoder;
195 extern AVCodec ff_mpeg1video_encoder;
196 extern AVCodec ff_mpeg1video_decoder;
197 extern AVCodec ff_mpeg2video_encoder;
198 extern AVCodec ff_mpeg2video_decoder;
199 extern AVCodec ff_mpeg4_encoder;
200 extern AVCodec ff_mpeg4_decoder;
201 extern AVCodec ff_mpeg4_crystalhd_decoder;
202 extern AVCodec ff_mpeg4_v4l2m2m_decoder;
203 extern AVCodec ff_mpeg4_mmal_decoder;
204 extern AVCodec ff_mpegvideo_decoder;
205 extern AVCodec ff_mpeg1_v4l2m2m_decoder;
206 extern AVCodec ff_mpeg2_mmal_decoder;
207 extern AVCodec ff_mpeg2_crystalhd_decoder;
208 extern AVCodec ff_mpeg2_v4l2m2m_decoder;
209 extern AVCodec ff_mpeg2_qsv_decoder;
210 extern AVCodec ff_mpeg2_mediacodec_decoder;
211 extern AVCodec ff_msa1_decoder;
212 extern AVCodec ff_mscc_decoder;
213 extern AVCodec ff_msmpeg4v1_decoder;
214 extern AVCodec ff_msmpeg4v2_encoder;
215 extern AVCodec ff_msmpeg4v2_decoder;
216 extern AVCodec ff_msmpeg4v3_encoder;
217 extern AVCodec ff_msmpeg4v3_decoder;
218 extern AVCodec ff_msmpeg4_crystalhd_decoder;
219 extern AVCodec ff_msp2_decoder;
220 extern AVCodec ff_msrle_decoder;
221 extern AVCodec ff_mss1_decoder;
222 extern AVCodec ff_mss2_decoder;
223 extern AVCodec ff_msvideo1_encoder;
224 extern AVCodec ff_msvideo1_decoder;
225 extern AVCodec ff_mszh_decoder;
226 extern AVCodec ff_mts2_decoder;
227 extern AVCodec ff_mv30_decoder;
228 extern AVCodec ff_mvc1_decoder;
229 extern AVCodec ff_mvc2_decoder;
230 extern AVCodec ff_mvdv_decoder;
231 extern AVCodec ff_mvha_decoder;
232 extern AVCodec ff_mwsc_decoder;
233 extern AVCodec ff_mxpeg_decoder;
234 extern AVCodec ff_notchlc_decoder;
235 extern AVCodec ff_nuv_decoder;
236 extern AVCodec ff_paf_video_decoder;
237 extern AVCodec ff_pam_encoder;
238 extern AVCodec ff_pam_decoder;
239 extern AVCodec ff_pbm_encoder;
240 extern AVCodec ff_pbm_decoder;
241 extern AVCodec ff_pcx_encoder;
242 extern AVCodec ff_pcx_decoder;
243 extern AVCodec ff_pfm_encoder;
244 extern AVCodec ff_pfm_decoder;
245 extern AVCodec ff_pgm_encoder;
246 extern AVCodec ff_pgm_decoder;
247 extern AVCodec ff_pgmyuv_encoder;
248 extern AVCodec ff_pgmyuv_decoder;
249 extern AVCodec ff_pgx_decoder;
250 extern AVCodec ff_photocd_decoder;
251 extern AVCodec ff_pictor_decoder;
252 extern AVCodec ff_pixlet_decoder;
253 extern AVCodec ff_png_encoder;
254 extern AVCodec ff_png_decoder;
255 extern AVCodec ff_ppm_encoder;
256 extern AVCodec ff_ppm_decoder;
257 extern AVCodec ff_prores_encoder;
258 extern AVCodec ff_prores_decoder;
259 extern AVCodec ff_prores_aw_encoder;
260 extern AVCodec ff_prores_ks_encoder;
261 extern AVCodec ff_prosumer_decoder;
262 extern AVCodec ff_psd_decoder;
263 extern AVCodec ff_ptx_decoder;
264 extern AVCodec ff_qdraw_decoder;
265 extern AVCodec ff_qpeg_decoder;
266 extern AVCodec ff_qtrle_encoder;
267 extern AVCodec ff_qtrle_decoder;
268 extern AVCodec ff_r10k_encoder;
269 extern AVCodec ff_r10k_decoder;
270 extern AVCodec ff_r210_encoder;
271 extern AVCodec ff_r210_decoder;
272 extern AVCodec ff_rasc_decoder;
273 extern AVCodec ff_rawvideo_encoder;
274 extern AVCodec ff_rawvideo_decoder;
275 extern AVCodec ff_rl2_decoder;
276 extern AVCodec ff_roq_encoder;
277 extern AVCodec ff_roq_decoder;
278 extern AVCodec ff_rpza_encoder;
279 extern AVCodec ff_rpza_decoder;
280 extern AVCodec ff_rscc_decoder;
281 extern AVCodec ff_rv10_encoder;
282 extern AVCodec ff_rv10_decoder;
283 extern AVCodec ff_rv20_encoder;
284 extern AVCodec ff_rv20_decoder;
285 extern AVCodec ff_rv30_decoder;
286 extern AVCodec ff_rv40_decoder;
287 extern AVCodec ff_s302m_encoder;
288 extern AVCodec ff_s302m_decoder;
289 extern AVCodec ff_sanm_decoder;
290 extern AVCodec ff_scpr_decoder;
291 extern AVCodec ff_screenpresso_decoder;
292 extern AVCodec ff_sga_decoder;
293 extern AVCodec ff_sgi_encoder;
294 extern AVCodec ff_sgi_decoder;
295 extern AVCodec ff_sgirle_decoder;
296 extern AVCodec ff_sheervideo_decoder;
297 extern AVCodec ff_simbiosis_imx_decoder;
298 extern AVCodec ff_smacker_decoder;
299 extern AVCodec ff_smc_decoder;
300 extern AVCodec ff_smvjpeg_decoder;
301 extern AVCodec ff_snow_encoder;
302 extern AVCodec ff_snow_decoder;
303 extern AVCodec ff_sp5x_decoder;
304 extern AVCodec ff_speedhq_decoder;
305 extern AVCodec ff_speedhq_encoder;
306 extern AVCodec ff_srgc_decoder;
307 extern AVCodec ff_sunrast_encoder;
308 extern AVCodec ff_sunrast_decoder;
309 extern AVCodec ff_svq1_encoder;
310 extern AVCodec ff_svq1_decoder;
311 extern AVCodec ff_svq3_decoder;
312 extern AVCodec ff_targa_encoder;
313 extern AVCodec ff_targa_decoder;
314 extern AVCodec ff_targa_y216_decoder;
315 extern AVCodec ff_tdsc_decoder;
316 extern AVCodec ff_theora_decoder;
317 extern AVCodec ff_thp_decoder;
318 extern AVCodec ff_tiertexseqvideo_decoder;
319 extern AVCodec ff_tiff_encoder;
320 extern AVCodec ff_tiff_decoder;
321 extern AVCodec ff_tmv_decoder;
322 extern AVCodec ff_truemotion1_decoder;
323 extern AVCodec ff_truemotion2_decoder;
324 extern AVCodec ff_truemotion2rt_decoder;
325 extern AVCodec ff_tscc_decoder;
326 extern AVCodec ff_tscc2_decoder;
327 extern AVCodec ff_txd_decoder;
328 extern AVCodec ff_ulti_decoder;
329 extern AVCodec ff_utvideo_encoder;
330 extern AVCodec ff_utvideo_decoder;
331 extern AVCodec ff_v210_encoder;
332 extern AVCodec ff_v210_decoder;
333 extern AVCodec ff_v210x_decoder;
334 extern AVCodec ff_v308_encoder;
335 extern AVCodec ff_v308_decoder;
336 extern AVCodec ff_v408_encoder;
337 extern AVCodec ff_v408_decoder;
338 extern AVCodec ff_v410_encoder;
339 extern AVCodec ff_v410_decoder;
340 extern AVCodec ff_vb_decoder;
341 extern AVCodec ff_vble_decoder;
342 extern AVCodec ff_vc1_decoder;
343 extern AVCodec ff_vc1_crystalhd_decoder;
344 extern AVCodec ff_vc1image_decoder;
345 extern AVCodec ff_vc1_mmal_decoder;
346 extern AVCodec ff_vc1_qsv_decoder;
347 extern AVCodec ff_vc1_v4l2m2m_decoder;
348 extern AVCodec ff_vc2_encoder;
349 extern AVCodec ff_vcr1_decoder;
350 extern AVCodec ff_vmdvideo_decoder;
351 extern AVCodec ff_vmnc_decoder;
352 extern AVCodec ff_vp3_decoder;
353 extern AVCodec ff_vp4_decoder;
354 extern AVCodec ff_vp5_decoder;
355 extern AVCodec ff_vp6_decoder;
356 extern AVCodec ff_vp6a_decoder;
357 extern AVCodec ff_vp6f_decoder;
358 extern AVCodec ff_vp7_decoder;
359 extern AVCodec ff_vp8_decoder;
360 extern AVCodec ff_vp8_rkmpp_decoder;
361 extern AVCodec ff_vp8_v4l2m2m_decoder;
362 extern AVCodec ff_vp9_decoder;
363 extern AVCodec ff_vp9_rkmpp_decoder;
364 extern AVCodec ff_vp9_v4l2m2m_decoder;
365 extern AVCodec ff_vqa_decoder;
366 extern AVCodec ff_webp_decoder;
367 extern AVCodec ff_wcmv_decoder;
368 extern AVCodec ff_wrapped_avframe_encoder;
369 extern AVCodec ff_wrapped_avframe_decoder;
370 extern AVCodec ff_wmv1_encoder;
371 extern AVCodec ff_wmv1_decoder;
372 extern AVCodec ff_wmv2_encoder;
373 extern AVCodec ff_wmv2_decoder;
374 extern AVCodec ff_wmv3_decoder;
375 extern AVCodec ff_wmv3_crystalhd_decoder;
376 extern AVCodec ff_wmv3image_decoder;
377 extern AVCodec ff_wnv1_decoder;
378 extern AVCodec ff_xan_wc3_decoder;
379 extern AVCodec ff_xan_wc4_decoder;
380 extern AVCodec ff_xbm_encoder;
381 extern AVCodec ff_xbm_decoder;
382 extern AVCodec ff_xface_encoder;
383 extern AVCodec ff_xface_decoder;
384 extern AVCodec ff_xl_decoder;
385 extern AVCodec ff_xpm_decoder;
386 extern AVCodec ff_xwd_encoder;
387 extern AVCodec ff_xwd_decoder;
388 extern AVCodec ff_y41p_encoder;
389 extern AVCodec ff_y41p_decoder;
390 extern AVCodec ff_ylc_decoder;
391 extern AVCodec ff_yop_decoder;
392 extern AVCodec ff_yuv4_encoder;
393 extern AVCodec ff_yuv4_decoder;
394 extern AVCodec ff_zero12v_decoder;
395 extern AVCodec ff_zerocodec_decoder;
396 extern AVCodec ff_zlib_encoder;
397 extern AVCodec ff_zlib_decoder;
398 extern AVCodec ff_zmbv_encoder;
399 extern AVCodec ff_zmbv_decoder;
400 
401 /* audio codecs */
402 extern AVCodec ff_aac_encoder;
403 extern AVCodec ff_aac_decoder;
404 extern AVCodec ff_aac_fixed_decoder;
405 extern AVCodec ff_aac_latm_decoder;
406 extern AVCodec ff_ac3_encoder;
407 extern AVCodec ff_ac3_decoder;
408 extern AVCodec ff_ac3_fixed_encoder;
409 extern AVCodec ff_ac3_fixed_decoder;
410 extern AVCodec ff_acelp_kelvin_decoder;
411 extern AVCodec ff_alac_encoder;
412 extern AVCodec ff_alac_decoder;
413 extern AVCodec ff_als_decoder;
414 extern AVCodec ff_amrnb_decoder;
415 extern AVCodec ff_amrwb_decoder;
416 extern AVCodec ff_ape_decoder;
417 extern AVCodec ff_aptx_encoder;
418 extern AVCodec ff_aptx_decoder;
419 extern AVCodec ff_aptx_hd_encoder;
420 extern AVCodec ff_aptx_hd_decoder;
421 extern AVCodec ff_atrac1_decoder;
422 extern AVCodec ff_atrac3_decoder;
423 extern AVCodec ff_atrac3al_decoder;
424 extern AVCodec ff_atrac3p_decoder;
425 extern AVCodec ff_atrac3pal_decoder;
426 extern AVCodec ff_atrac9_decoder;
427 extern AVCodec ff_binkaudio_dct_decoder;
428 extern AVCodec ff_binkaudio_rdft_decoder;
429 extern AVCodec ff_bmv_audio_decoder;
430 extern AVCodec ff_cook_decoder;
431 extern AVCodec ff_dca_encoder;
432 extern AVCodec ff_dca_decoder;
433 extern AVCodec ff_dolby_e_decoder;
434 extern AVCodec ff_dsd_lsbf_decoder;
435 extern AVCodec ff_dsd_msbf_decoder;
436 extern AVCodec ff_dsd_lsbf_planar_decoder;
437 extern AVCodec ff_dsd_msbf_planar_decoder;
438 extern AVCodec ff_dsicinaudio_decoder;
439 extern AVCodec ff_dss_sp_decoder;
440 extern AVCodec ff_dst_decoder;
441 extern AVCodec ff_eac3_encoder;
442 extern AVCodec ff_eac3_decoder;
443 extern AVCodec ff_evrc_decoder;
444 extern AVCodec ff_fastaudio_decoder;
445 extern AVCodec ff_ffwavesynth_decoder;
446 extern AVCodec ff_flac_encoder;
447 extern AVCodec ff_flac_decoder;
448 extern AVCodec ff_g723_1_encoder;
449 extern AVCodec ff_g723_1_decoder;
450 extern AVCodec ff_g729_decoder;
451 extern AVCodec ff_gsm_decoder;
452 extern AVCodec ff_gsm_ms_decoder;
453 extern AVCodec ff_hca_decoder;
454 extern AVCodec ff_hcom_decoder;
455 extern AVCodec ff_iac_decoder;
456 extern AVCodec ff_ilbc_decoder;
457 extern AVCodec ff_imc_decoder;
458 extern AVCodec ff_interplay_acm_decoder;
459 extern AVCodec ff_mace3_decoder;
460 extern AVCodec ff_mace6_decoder;
461 extern AVCodec ff_metasound_decoder;
462 extern AVCodec ff_mlp_encoder;
463 extern AVCodec ff_mlp_decoder;
464 extern AVCodec ff_mp1_decoder;
465 extern AVCodec ff_mp1float_decoder;
466 extern AVCodec ff_mp2_encoder;
467 extern AVCodec ff_mp2_decoder;
468 extern AVCodec ff_mp2float_decoder;
469 extern AVCodec ff_mp2fixed_encoder;
470 extern AVCodec ff_mp3float_decoder;
471 extern AVCodec ff_mp3_decoder;
472 extern AVCodec ff_mp3adufloat_decoder;
473 extern AVCodec ff_mp3adu_decoder;
474 extern AVCodec ff_mp3on4float_decoder;
475 extern AVCodec ff_mp3on4_decoder;
476 extern AVCodec ff_mpc7_decoder;
477 extern AVCodec ff_mpc8_decoder;
478 extern AVCodec ff_nellymoser_encoder;
479 extern AVCodec ff_nellymoser_decoder;
480 extern AVCodec ff_on2avc_decoder;
481 extern AVCodec ff_opus_encoder;
482 extern AVCodec ff_opus_decoder;
483 extern AVCodec ff_paf_audio_decoder;
484 extern AVCodec ff_qcelp_decoder;
485 extern AVCodec ff_qdm2_decoder;
486 extern AVCodec ff_qdmc_decoder;
487 extern AVCodec ff_ra_144_encoder;
488 extern AVCodec ff_ra_144_decoder;
489 extern AVCodec ff_ra_288_decoder;
490 extern AVCodec ff_ralf_decoder;
491 extern AVCodec ff_sbc_encoder;
492 extern AVCodec ff_sbc_decoder;
493 extern AVCodec ff_shorten_decoder;
494 extern AVCodec ff_sipr_decoder;
495 extern AVCodec ff_siren_decoder;
496 extern AVCodec ff_smackaud_decoder;
497 extern AVCodec ff_sonic_encoder;
498 extern AVCodec ff_sonic_decoder;
499 extern AVCodec ff_sonic_ls_encoder;
500 extern AVCodec ff_tak_decoder;
501 extern AVCodec ff_truehd_encoder;
502 extern AVCodec ff_truehd_decoder;
503 extern AVCodec ff_truespeech_decoder;
504 extern AVCodec ff_tta_encoder;
505 extern AVCodec ff_tta_decoder;
506 extern AVCodec ff_twinvq_decoder;
507 extern AVCodec ff_vmdaudio_decoder;
508 extern AVCodec ff_vorbis_encoder;
509 extern AVCodec ff_vorbis_decoder;
510 extern AVCodec ff_wavpack_encoder;
511 extern AVCodec ff_wavpack_decoder;
512 extern AVCodec ff_wmalossless_decoder;
513 extern AVCodec ff_wmapro_decoder;
514 extern AVCodec ff_wmav1_encoder;
515 extern AVCodec ff_wmav1_decoder;
516 extern AVCodec ff_wmav2_encoder;
517 extern AVCodec ff_wmav2_decoder;
518 extern AVCodec ff_wmavoice_decoder;
519 extern AVCodec ff_ws_snd1_decoder;
520 extern AVCodec ff_xma1_decoder;
521 extern AVCodec ff_xma2_decoder;
522 
523 /* PCM codecs */
524 extern AVCodec ff_pcm_alaw_encoder;
525 extern AVCodec ff_pcm_alaw_decoder;
526 extern AVCodec ff_pcm_bluray_decoder;
527 extern AVCodec ff_pcm_dvd_encoder;
528 extern AVCodec ff_pcm_dvd_decoder;
529 extern AVCodec ff_pcm_f16le_decoder;
530 extern AVCodec ff_pcm_f24le_decoder;
531 extern AVCodec ff_pcm_f32be_encoder;
532 extern AVCodec ff_pcm_f32be_decoder;
533 extern AVCodec ff_pcm_f32le_encoder;
534 extern AVCodec ff_pcm_f32le_decoder;
535 extern AVCodec ff_pcm_f64be_encoder;
536 extern AVCodec ff_pcm_f64be_decoder;
537 extern AVCodec ff_pcm_f64le_encoder;
538 extern AVCodec ff_pcm_f64le_decoder;
539 extern AVCodec ff_pcm_lxf_decoder;
540 extern AVCodec ff_pcm_mulaw_encoder;
541 extern AVCodec ff_pcm_mulaw_decoder;
542 extern AVCodec ff_pcm_s8_encoder;
543 extern AVCodec ff_pcm_s8_decoder;
544 extern AVCodec ff_pcm_s8_planar_encoder;
545 extern AVCodec ff_pcm_s8_planar_decoder;
546 extern AVCodec ff_pcm_s16be_encoder;
547 extern AVCodec ff_pcm_s16be_decoder;
548 extern AVCodec ff_pcm_s16be_planar_encoder;
549 extern AVCodec ff_pcm_s16be_planar_decoder;
550 extern AVCodec ff_pcm_s16le_encoder;
551 extern AVCodec ff_pcm_s16le_decoder;
552 extern AVCodec ff_pcm_s16le_planar_encoder;
553 extern AVCodec ff_pcm_s16le_planar_decoder;
554 extern AVCodec ff_pcm_s24be_encoder;
555 extern AVCodec ff_pcm_s24be_decoder;
556 extern AVCodec ff_pcm_s24daud_encoder;
557 extern AVCodec ff_pcm_s24daud_decoder;
558 extern AVCodec ff_pcm_s24le_encoder;
559 extern AVCodec ff_pcm_s24le_decoder;
560 extern AVCodec ff_pcm_s24le_planar_encoder;
561 extern AVCodec ff_pcm_s24le_planar_decoder;
562 extern AVCodec ff_pcm_s32be_encoder;
563 extern AVCodec ff_pcm_s32be_decoder;
564 extern AVCodec ff_pcm_s32le_encoder;
565 extern AVCodec ff_pcm_s32le_decoder;
566 extern AVCodec ff_pcm_s32le_planar_encoder;
567 extern AVCodec ff_pcm_s32le_planar_decoder;
568 extern AVCodec ff_pcm_s64be_encoder;
569 extern AVCodec ff_pcm_s64be_decoder;
570 extern AVCodec ff_pcm_s64le_encoder;
571 extern AVCodec ff_pcm_s64le_decoder;
572 extern AVCodec ff_pcm_sga_decoder;
573 extern AVCodec ff_pcm_u8_encoder;
574 extern AVCodec ff_pcm_u8_decoder;
575 extern AVCodec ff_pcm_u16be_encoder;
576 extern AVCodec ff_pcm_u16be_decoder;
577 extern AVCodec ff_pcm_u16le_encoder;
578 extern AVCodec ff_pcm_u16le_decoder;
579 extern AVCodec ff_pcm_u24be_encoder;
580 extern AVCodec ff_pcm_u24be_decoder;
581 extern AVCodec ff_pcm_u24le_encoder;
582 extern AVCodec ff_pcm_u24le_decoder;
583 extern AVCodec ff_pcm_u32be_encoder;
584 extern AVCodec ff_pcm_u32be_decoder;
585 extern AVCodec ff_pcm_u32le_encoder;
586 extern AVCodec ff_pcm_u32le_decoder;
587 extern AVCodec ff_pcm_vidc_encoder;
588 extern AVCodec ff_pcm_vidc_decoder;
589 
590 /* DPCM codecs */
591 extern AVCodec ff_derf_dpcm_decoder;
592 extern AVCodec ff_gremlin_dpcm_decoder;
593 extern AVCodec ff_interplay_dpcm_decoder;
594 extern AVCodec ff_roq_dpcm_encoder;
595 extern AVCodec ff_roq_dpcm_decoder;
596 extern AVCodec ff_sdx2_dpcm_decoder;
597 extern AVCodec ff_sol_dpcm_decoder;
598 extern AVCodec ff_xan_dpcm_decoder;
599 
600 /* ADPCM codecs */
601 extern AVCodec ff_adpcm_4xm_decoder;
602 extern AVCodec ff_adpcm_adx_encoder;
603 extern AVCodec ff_adpcm_adx_decoder;
604 extern AVCodec ff_adpcm_afc_decoder;
605 extern AVCodec ff_adpcm_agm_decoder;
606 extern AVCodec ff_adpcm_aica_decoder;
607 extern AVCodec ff_adpcm_argo_decoder;
608 extern AVCodec ff_adpcm_argo_encoder;
609 extern AVCodec ff_adpcm_ct_decoder;
610 extern AVCodec ff_adpcm_dtk_decoder;
611 extern AVCodec ff_adpcm_ea_decoder;
612 extern AVCodec ff_adpcm_ea_maxis_xa_decoder;
613 extern AVCodec ff_adpcm_ea_r1_decoder;
614 extern AVCodec ff_adpcm_ea_r2_decoder;
615 extern AVCodec ff_adpcm_ea_r3_decoder;
616 extern AVCodec ff_adpcm_ea_xas_decoder;
617 extern AVCodec ff_adpcm_g722_encoder;
618 extern AVCodec ff_adpcm_g722_decoder;
619 extern AVCodec ff_adpcm_g726_encoder;
620 extern AVCodec ff_adpcm_g726_decoder;
621 extern AVCodec ff_adpcm_g726le_encoder;
622 extern AVCodec ff_adpcm_g726le_decoder;
623 extern AVCodec ff_adpcm_ima_amv_decoder;
624 extern AVCodec ff_adpcm_ima_amv_encoder;
625 extern AVCodec ff_adpcm_ima_alp_decoder;
626 extern AVCodec ff_adpcm_ima_alp_encoder;
627 extern AVCodec ff_adpcm_ima_apc_decoder;
628 extern AVCodec ff_adpcm_ima_apm_decoder;
629 extern AVCodec ff_adpcm_ima_apm_encoder;
630 extern AVCodec ff_adpcm_ima_cunning_decoder;
631 extern AVCodec ff_adpcm_ima_dat4_decoder;
632 extern AVCodec ff_adpcm_ima_dk3_decoder;
633 extern AVCodec ff_adpcm_ima_dk4_decoder;
634 extern AVCodec ff_adpcm_ima_ea_eacs_decoder;
635 extern AVCodec ff_adpcm_ima_ea_sead_decoder;
636 extern AVCodec ff_adpcm_ima_iss_decoder;
637 extern AVCodec ff_adpcm_ima_moflex_decoder;
638 extern AVCodec ff_adpcm_ima_mtf_decoder;
639 extern AVCodec ff_adpcm_ima_oki_decoder;
640 extern AVCodec ff_adpcm_ima_qt_encoder;
641 extern AVCodec ff_adpcm_ima_qt_decoder;
642 extern AVCodec ff_adpcm_ima_rad_decoder;
643 extern AVCodec ff_adpcm_ima_ssi_decoder;
644 extern AVCodec ff_adpcm_ima_ssi_encoder;
645 extern AVCodec ff_adpcm_ima_smjpeg_decoder;
646 extern AVCodec ff_adpcm_ima_wav_encoder;
647 extern AVCodec ff_adpcm_ima_wav_decoder;
648 extern AVCodec ff_adpcm_ima_ws_decoder;
649 extern AVCodec ff_adpcm_ms_encoder;
650 extern AVCodec ff_adpcm_ms_decoder;
651 extern AVCodec ff_adpcm_mtaf_decoder;
652 extern AVCodec ff_adpcm_psx_decoder;
653 extern AVCodec ff_adpcm_sbpro_2_decoder;
654 extern AVCodec ff_adpcm_sbpro_3_decoder;
655 extern AVCodec ff_adpcm_sbpro_4_decoder;
656 extern AVCodec ff_adpcm_swf_encoder;
657 extern AVCodec ff_adpcm_swf_decoder;
658 extern AVCodec ff_adpcm_thp_decoder;
659 extern AVCodec ff_adpcm_thp_le_decoder;
660 extern AVCodec ff_adpcm_vima_decoder;
661 extern AVCodec ff_adpcm_xa_decoder;
662 extern AVCodec ff_adpcm_yamaha_encoder;
663 extern AVCodec ff_adpcm_yamaha_decoder;
664 extern AVCodec ff_adpcm_zork_decoder;
665 
666 /* subtitles */
667 extern AVCodec ff_ssa_encoder;
668 extern AVCodec ff_ssa_decoder;
669 extern AVCodec ff_ass_encoder;
670 extern AVCodec ff_ass_decoder;
671 extern AVCodec ff_ccaption_decoder;
672 extern AVCodec ff_dvbsub_encoder;
673 extern AVCodec ff_dvbsub_decoder;
674 extern AVCodec ff_dvdsub_encoder;
675 extern AVCodec ff_dvdsub_decoder;
676 extern AVCodec ff_jacosub_decoder;
677 extern AVCodec ff_microdvd_decoder;
678 extern AVCodec ff_movtext_encoder;
679 extern AVCodec ff_movtext_decoder;
680 extern AVCodec ff_mpl2_decoder;
681 extern AVCodec ff_pgssub_decoder;
682 extern AVCodec ff_pjs_decoder;
683 extern AVCodec ff_realtext_decoder;
684 extern AVCodec ff_sami_decoder;
685 extern AVCodec ff_srt_encoder;
686 extern AVCodec ff_srt_decoder;
687 extern AVCodec ff_stl_decoder;
688 extern AVCodec ff_subrip_encoder;
689 extern AVCodec ff_subrip_decoder;
690 extern AVCodec ff_subviewer_decoder;
691 extern AVCodec ff_subviewer1_decoder;
692 extern AVCodec ff_text_encoder;
693 extern AVCodec ff_text_decoder;
694 extern AVCodec ff_ttml_encoder;
695 extern AVCodec ff_vplayer_decoder;
696 extern AVCodec ff_webvtt_encoder;
697 extern AVCodec ff_webvtt_decoder;
698 extern AVCodec ff_xsub_encoder;
699 extern AVCodec ff_xsub_decoder;
700 
701 /* external libraries */
702 extern AVCodec ff_aac_at_encoder;
703 extern AVCodec ff_aac_at_decoder;
704 extern AVCodec ff_ac3_at_decoder;
705 extern AVCodec ff_adpcm_ima_qt_at_decoder;
706 extern AVCodec ff_alac_at_encoder;
707 extern AVCodec ff_alac_at_decoder;
708 extern AVCodec ff_amr_nb_at_decoder;
709 extern AVCodec ff_eac3_at_decoder;
710 extern AVCodec ff_gsm_ms_at_decoder;
711 extern AVCodec ff_ilbc_at_encoder;
712 extern AVCodec ff_ilbc_at_decoder;
713 extern AVCodec ff_mp1_at_decoder;
714 extern AVCodec ff_mp2_at_decoder;
715 extern AVCodec ff_mp3_at_decoder;
716 extern AVCodec ff_pcm_alaw_at_encoder;
717 extern AVCodec ff_pcm_alaw_at_decoder;
718 extern AVCodec ff_pcm_mulaw_at_encoder;
719 extern AVCodec ff_pcm_mulaw_at_decoder;
720 extern AVCodec ff_qdmc_at_decoder;
721 extern AVCodec ff_qdm2_at_decoder;
722 extern AVCodec ff_libaom_av1_encoder;
723 extern AVCodec ff_libaribb24_decoder;
724 extern AVCodec ff_libcelt_decoder;
725 extern AVCodec ff_libcodec2_encoder;
726 extern AVCodec ff_libcodec2_decoder;
727 extern AVCodec ff_libdav1d_decoder;
728 extern AVCodec ff_libdavs2_decoder;
729 extern AVCodec ff_libfdk_aac_encoder;
730 extern AVCodec ff_libfdk_aac_decoder;
731 extern AVCodec ff_libgsm_encoder;
732 extern AVCodec ff_libgsm_decoder;
733 extern AVCodec ff_libgsm_ms_encoder;
734 extern AVCodec ff_libgsm_ms_decoder;
735 extern AVCodec ff_libilbc_encoder;
736 extern AVCodec ff_libilbc_decoder;
737 extern AVCodec ff_libmp3lame_encoder;
738 extern AVCodec ff_libopencore_amrnb_encoder;
739 extern AVCodec ff_libopencore_amrnb_decoder;
740 extern AVCodec ff_libopencore_amrwb_decoder;
741 extern AVCodec ff_libopenjpeg_encoder;
742 extern AVCodec ff_libopenjpeg_decoder;
743 extern AVCodec ff_libopus_encoder;
744 extern AVCodec ff_libopus_decoder;
745 extern AVCodec ff_librav1e_encoder;
746 extern AVCodec ff_librsvg_decoder;
747 extern AVCodec ff_libshine_encoder;
748 extern AVCodec ff_libspeex_encoder;
749 extern AVCodec ff_libspeex_decoder;
750 extern AVCodec ff_libsvtav1_encoder;
751 extern AVCodec ff_libtheora_encoder;
752 extern AVCodec ff_libtwolame_encoder;
753 extern AVCodec ff_libuavs3d_decoder;
754 extern AVCodec ff_libvo_amrwbenc_encoder;
755 extern AVCodec ff_libvorbis_encoder;
756 extern AVCodec ff_libvorbis_decoder;
757 extern AVCodec ff_libvpx_vp8_encoder;
758 extern AVCodec ff_libvpx_vp8_decoder;
759 extern AVCodec ff_libvpx_vp9_encoder;
760 extern AVCodec ff_libvpx_vp9_decoder;
761 /* preferred over libwebp */
762 extern AVCodec ff_libwebp_anim_encoder;
763 extern AVCodec ff_libwebp_encoder;
764 extern AVCodec ff_libx262_encoder;
765 extern AVCodec ff_libx264_encoder;
766 extern AVCodec ff_libx264rgb_encoder;
767 extern AVCodec ff_libx265_encoder;
768 extern AVCodec ff_libxavs_encoder;
769 extern AVCodec ff_libxavs2_encoder;
770 extern AVCodec ff_libxvid_encoder;
771 extern AVCodec ff_libzvbi_teletext_decoder;
772 
773 /* text */
774 extern AVCodec ff_bintext_decoder;
775 extern AVCodec ff_xbin_decoder;
776 extern AVCodec ff_idf_decoder;
777 
778 /* external libraries, that shouldn't be used by default if one of the
779  * above is available */
780 extern AVCodec ff_aac_mf_encoder;
781 extern AVCodec ff_ac3_mf_encoder;
782 extern AVCodec ff_h263_v4l2m2m_encoder;
783 extern AVCodec ff_libaom_av1_decoder;
784 /* hwaccel hooks only, so prefer external decoders */
785 extern AVCodec ff_av1_decoder;
786 extern AVCodec ff_av1_cuvid_decoder;
787 extern AVCodec ff_av1_qsv_decoder;
788 extern AVCodec ff_libopenh264_encoder;
789 extern AVCodec ff_libopenh264_decoder;
790 extern AVCodec ff_h264_amf_encoder;
791 extern AVCodec ff_h264_cuvid_decoder;
792 extern AVCodec ff_h264_mf_encoder;
793 extern AVCodec ff_h264_nvenc_encoder;
794 extern AVCodec ff_h264_omx_encoder;
795 extern AVCodec ff_h264_qsv_encoder;
796 extern AVCodec ff_h264_v4l2m2m_encoder;
797 extern AVCodec ff_h264_vaapi_encoder;
798 extern AVCodec ff_h264_videotoolbox_encoder;
799 #if FF_API_NVENC_OLD_NAME
800 extern AVCodec ff_nvenc_encoder;
801 extern AVCodec ff_nvenc_h264_encoder;
802 extern AVCodec ff_nvenc_hevc_encoder;
803 #endif
804 extern AVCodec ff_hevc_amf_encoder;
805 extern AVCodec ff_hevc_cuvid_decoder;
806 extern AVCodec ff_hevc_mediacodec_decoder;
807 extern AVCodec ff_hevc_mf_encoder;
808 extern AVCodec ff_hevc_nvenc_encoder;
809 extern AVCodec ff_hevc_qsv_encoder;
810 extern AVCodec ff_hevc_v4l2m2m_encoder;
811 extern AVCodec ff_hevc_vaapi_encoder;
812 extern AVCodec ff_hevc_videotoolbox_encoder;
813 extern AVCodec ff_libkvazaar_encoder;
814 extern AVCodec ff_mjpeg_cuvid_decoder;
815 extern AVCodec ff_mjpeg_qsv_encoder;
816 extern AVCodec ff_mjpeg_qsv_decoder;
817 extern AVCodec ff_mjpeg_vaapi_encoder;
818 extern AVCodec ff_mp3_mf_encoder;
819 extern AVCodec ff_mpeg1_cuvid_decoder;
820 extern AVCodec ff_mpeg2_cuvid_decoder;
821 extern AVCodec ff_mpeg2_qsv_encoder;
822 extern AVCodec ff_mpeg2_vaapi_encoder;
823 extern AVCodec ff_mpeg4_cuvid_decoder;
824 extern AVCodec ff_mpeg4_mediacodec_decoder;
825 extern AVCodec ff_mpeg4_omx_encoder;
826 extern AVCodec ff_mpeg4_v4l2m2m_encoder;
827 extern AVCodec ff_vc1_cuvid_decoder;
828 extern AVCodec ff_vp8_cuvid_decoder;
829 extern AVCodec ff_vp8_mediacodec_decoder;
830 extern AVCodec ff_vp8_qsv_decoder;
831 extern AVCodec ff_vp8_v4l2m2m_encoder;
832 extern AVCodec ff_vp8_vaapi_encoder;
833 extern AVCodec ff_vp9_cuvid_decoder;
834 extern AVCodec ff_vp9_mediacodec_decoder;
835 extern AVCodec ff_vp9_qsv_decoder;
836 extern AVCodec ff_vp9_vaapi_encoder;
837 extern AVCodec ff_vp9_qsv_encoder;
838 
839 // The iterate API is not usable with ossfuzz due to the excessive size of binaries created
840 #if CONFIG_OSSFUZZ
841 AVCodec * codec_list[] = {
842     NULL,
843     NULL,
844     NULL
845 };
846 #else
847 #include "libavcodec/codec_list.c"
848 #endif
849 
850 static AVOnce av_codec_static_init = AV_ONCE_INIT;
av_codec_init_static(void)851 static void av_codec_init_static(void)
852 {
853     for (int i = 0; codec_list[i]; i++) {
854         if (codec_list[i]->init_static_data)
855             codec_list[i]->init_static_data((AVCodec*)codec_list[i]);
856     }
857 }
858 
av_codec_iterate(void ** opaque)859 const AVCodec *av_codec_iterate(void **opaque)
860 {
861     uintptr_t i = (uintptr_t)*opaque;
862     const AVCodec *c = codec_list[i];
863 
864     ff_thread_once(&av_codec_static_init, av_codec_init_static);
865 
866     if (c)
867         *opaque = (void*)(i + 1);
868 
869     return c;
870 }
871 
872 #if FF_API_NEXT
873 FF_DISABLE_DEPRECATION_WARNINGS
874 static AVOnce av_codec_next_init = AV_ONCE_INIT;
875 
av_codec_init_next(void)876 static void av_codec_init_next(void)
877 {
878     AVCodec *prev = NULL, *p;
879     void *i = 0;
880     while ((p = (AVCodec*)av_codec_iterate(&i))) {
881         if (prev)
882             prev->next = p;
883         prev = p;
884     }
885 }
886 
887 
888 
avcodec_register(AVCodec * codec)889 av_cold void avcodec_register(AVCodec *codec)
890 {
891     ff_thread_once(&av_codec_next_init, av_codec_init_next);
892 }
893 
av_codec_next(const AVCodec * c)894 AVCodec *av_codec_next(const AVCodec *c)
895 {
896     ff_thread_once(&av_codec_next_init, av_codec_init_next);
897 
898     if (c)
899         return c->next;
900     else
901         return (AVCodec*)codec_list[0];
902 }
903 
avcodec_register_all(void)904 void avcodec_register_all(void)
905 {
906     ff_thread_once(&av_codec_next_init, av_codec_init_next);
907 }
908 FF_ENABLE_DEPRECATION_WARNINGS
909 #endif
910 
remap_deprecated_codec_id(enum AVCodecID id)911 static enum AVCodecID remap_deprecated_codec_id(enum AVCodecID id)
912 {
913     switch(id){
914         //This is for future deprecatec codec ids, its empty since
915         //last major bump but will fill up again over time, please don't remove it
916         default                                         : return id;
917     }
918 }
919 
find_codec(enum AVCodecID id,int (* x)(const AVCodec *))920 static AVCodec *find_codec(enum AVCodecID id, int (*x)(const AVCodec *))
921 {
922     const AVCodec *p, *experimental = NULL;
923     void *i = 0;
924 
925     id = remap_deprecated_codec_id(id);
926 
927     while ((p = av_codec_iterate(&i))) {
928         if (!x(p))
929             continue;
930         if (p->id == id) {
931             if (p->capabilities & AV_CODEC_CAP_EXPERIMENTAL && !experimental) {
932                 experimental = p;
933             } else
934                 return (AVCodec*)p;
935         }
936     }
937 
938     return (AVCodec*)experimental;
939 }
940 
avcodec_find_encoder(enum AVCodecID id)941 AVCodec *avcodec_find_encoder(enum AVCodecID id)
942 {
943     return find_codec(id, av_codec_is_encoder);
944 }
945 
avcodec_find_decoder(enum AVCodecID id)946 AVCodec *avcodec_find_decoder(enum AVCodecID id)
947 {
948     return find_codec(id, av_codec_is_decoder);
949 }
950 
find_codec_by_name(const char * name,int (* x)(const AVCodec *))951 static AVCodec *find_codec_by_name(const char *name, int (*x)(const AVCodec *))
952 {
953     void *i = 0;
954     const AVCodec *p;
955 
956     if (!name)
957         return NULL;
958 
959     while ((p = av_codec_iterate(&i))) {
960         if (!x(p))
961             continue;
962         if (strcmp(name, p->name) == 0)
963             return (AVCodec*)p;
964     }
965 
966     return NULL;
967 }
968 
avcodec_find_encoder_by_name(const char * name)969 AVCodec *avcodec_find_encoder_by_name(const char *name)
970 {
971     return find_codec_by_name(name, av_codec_is_encoder);
972 }
973 
avcodec_find_decoder_by_name(const char * name)974 AVCodec *avcodec_find_decoder_by_name(const char *name)
975 {
976     return find_codec_by_name(name, av_codec_is_decoder);
977 }
978