The aim of this is twofold: a) Clang warns when setting a deprecated field in a definition and because several of the widely set AVCodec fields are deprecated, one gets several hundred warnings from Clang for an ordinary build. Yet fortunately Clang (unlike GCC) allows to disable deprecation warnings inside a definition, so that one can create simple macros to set these fields that also suppress deprecation warnings for Clang. This has already been done in fdff1b9cbfd8cf5a9810c29efa4baf13a4786742 for AVCodec.channel_layouts. b) Using macros will allow to easily migrate these fields to internal ones.
Unified · Split
| @@ -198,8 +198,7 @@ const FFCodec ff_eightsvx_fib_decoder = { · 197 unmodified lines | ||
| 198 | 198 | FF_CODEC_DECODE_CB(eightsvx_decode_frame), |
| 199 | 199 | .close = eightsvx_decode_close, |
| 200 | 200 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 201 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 202 | − AV_SAMPLE_FMT_NONE }, | |
| 201 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P), | |
| 203 | 202 | }; |
| 204 | 203 | #endif |
| 205 | 204 | #if CONFIG_EIGHTSVX_EXP_DECODER |
| @@ -213,7 +212,6 @@ const FFCodec ff_eightsvx_exp_decoder = { · 7 unmodified lines | ||
| 213 | 212 | FF_CODEC_DECODE_CB(eightsvx_decode_frame), |
| 214 | 213 | .close = eightsvx_decode_close, |
| 215 | 214 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 216 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 217 | − AV_SAMPLE_FMT_NONE }, | |
| 215 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P), | |
| 218 | 216 | }; |
| 219 | 217 | #endif |
| @@ -403,7 +403,7 @@ const FFCodec ff_a64multi_encoder = { · 402 unmodified lines | ||
| 403 | 403 | .init = a64multi_encode_init, |
| 404 | 404 | FF_CODEC_ENCODE_CB(a64multi_encode_frame), |
| 405 | 405 | .close = a64multi_close_encoder, |
| 406 | − .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, | |
| 406 | + CODEC_PIXFMTS(AV_PIX_FMT_GRAY8), | |
| 407 | 407 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 408 | 408 | }; |
| 409 | 409 | #endif |
| @@ -418,7 +418,7 @@ const FFCodec ff_a64multi5_encoder = { · 8 unmodified lines | ||
| 418 | 418 | .init = a64multi_encode_init, |
| 419 | 419 | FF_CODEC_ENCODE_CB(a64multi_encode_frame), |
| 420 | 420 | .close = a64multi_close_encoder, |
| 421 | − .p.pix_fmts = (const enum AVPixelFormat[]) {AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE}, | |
| 421 | + CODEC_PIXFMTS(AV_PIX_FMT_GRAY8), | |
| 422 | 422 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 423 | 423 | }; |
| 424 | 424 | #endif |
| @@ -2548,12 +2548,10 @@ const FFCodec ff_aac_decoder = { · 2547 unmodified lines | ||
| 2548 | 2548 | .init = ff_aac_decode_init_float, |
| 2549 | 2549 | .close = decode_close, |
| 2550 | 2550 | FF_CODEC_DECODE_CB(aac_decode_frame), |
| 2551 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 2552 | − AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE | |
| 2553 | − }, | |
| 2551 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 2554 | 2552 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, |
| 2555 | 2553 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2556 | − .p.ch_layouts = ff_aac_ch_layout, | |
| 2554 | + CODEC_CH_LAYOUTS_ARRAY(ff_aac_ch_layout), | |
| 2557 | 2555 | .flush = flush, |
| 2558 | 2556 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), |
| 2559 | 2557 | }; |
| @@ -2570,12 +2568,10 @@ const FFCodec ff_aac_fixed_decoder = { · 10 unmodified lines | ||
| 2570 | 2568 | .init = ff_aac_decode_init_fixed, |
| 2571 | 2569 | .close = decode_close, |
| 2572 | 2570 | FF_CODEC_DECODE_CB(aac_decode_frame), |
| 2573 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 2574 | − AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE | |
| 2575 | − }, | |
| 2571 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P), | |
| 2576 | 2572 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, |
| 2577 | 2573 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2578 | − .p.ch_layouts = ff_aac_ch_layout, | |
| 2574 | + CODEC_CH_LAYOUTS_ARRAY(ff_aac_ch_layout), | |
| 2579 | 2575 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), |
| 2580 | 2576 | .flush = flush, |
| 2581 | 2577 | }; |
| @@ -339,12 +339,10 @@ const FFCodec ff_aac_latm_decoder = { · 338 unmodified lines | ||
| 339 | 339 | .init = latm_decode_init, |
| 340 | 340 | .close = decode_close, |
| 341 | 341 | FF_CODEC_DECODE_CB(latm_decode_frame), |
| 342 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 343 | − AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE | |
| 344 | − }, | |
| 342 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 345 | 343 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | AV_CODEC_CAP_DR1, |
| 346 | 344 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 347 | − .p.ch_layouts = ff_aac_ch_layout, | |
| 345 | + CODEC_CH_LAYOUTS_ARRAY(ff_aac_ch_layout), | |
| 348 | 346 | .flush = flush, |
| 349 | 347 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_aac_profiles), |
| 350 | 348 | }; |
| @@ -1344,9 +1344,8 @@ const FFCodec ff_aac_encoder = { · 1343 unmodified lines | ||
| 1344 | 1344 | FF_CODEC_ENCODE_CB(aac_encode_frame), |
| 1345 | 1345 | .close = aac_encode_end, |
| 1346 | 1346 | .defaults = aac_encode_defaults, |
| 1347 | − .p.supported_samplerates = ff_mpeg4audio_sample_rates, | |
| 1347 | + CODEC_SAMPLERATES_ARRAY(ff_mpeg4audio_sample_rates), | |
| 1348 | 1348 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1349 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 1350 | − AV_SAMPLE_FMT_NONE }, | |
| 1349 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1351 | 1350 | .p.priv_class = &aacenc_class, |
| 1352 | 1351 | }; |
| @@ -186,7 +186,6 @@ const FFCodec ff_ac3_fixed_decoder = { · 185 unmodified lines | ||
| 186 | 186 | FF_CODEC_DECODE_CB(ac3_decode_frame), |
| 187 | 187 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 188 | 188 | AV_CODEC_CAP_DR1, |
| 189 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 190 | − AV_SAMPLE_FMT_NONE }, | |
| 189 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 191 | 190 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 192 | 191 | }; |
| @@ -76,8 +76,7 @@ const FFCodec ff_ac3_decoder = { · 75 unmodified lines | ||
| 76 | 76 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 77 | 77 | AV_CODEC_CAP_DR1, |
| 78 | 78 | CODEC_LONG_NAME("ATSC A/52A (AC-3)"), |
| 79 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 80 | − AV_SAMPLE_FMT_NONE }, | |
| 79 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 81 | 80 | .p.priv_class = &ac3_eac3_decoder_class, |
| 82 | 81 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 83 | 82 | }; |
| @@ -95,8 +94,7 @@ const FFCodec ff_eac3_decoder = { · 11 unmodified lines | ||
| 95 | 94 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 96 | 95 | AV_CODEC_CAP_DR1, |
| 97 | 96 | CODEC_LONG_NAME("ATSC A/52B (AC-3, E-AC-3)"), |
| 98 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 99 | − AV_SAMPLE_FMT_NONE }, | |
| 97 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 100 | 98 | .p.priv_class = &ac3_eac3_decoder_class, |
| 101 | 99 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_eac3_profiles), |
| 102 | 100 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -119,11 +119,10 @@ const FFCodec ff_ac3_fixed_encoder = { · 118 unmodified lines | ||
| 119 | 119 | .init = ac3_fixed_encode_init, |
| 120 | 120 | FF_CODEC_ENCODE_CB(ff_ac3_encode_frame), |
| 121 | 121 | .close = ff_ac3_encode_close, |
| 122 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, | |
| 123 | − AV_SAMPLE_FMT_NONE }, | |
| 122 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P), | |
| 124 | 123 | .p.priv_class = &ff_ac3enc_class, |
| 125 | 124 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 126 | − .p.supported_samplerates = ff_ac3_sample_rate_tab, | |
| 127 | − .p.ch_layouts = ff_ac3_ch_layouts, | |
| 125 | + CODEC_SAMPLERATES_ARRAY(ff_ac3_sample_rate_tab), | |
| 126 | + CODEC_CH_LAYOUTS_ARRAY(ff_ac3_ch_layouts), | |
| 128 | 127 | .defaults = ff_ac3_enc_defaults, |
| 129 | 128 | }; |
| @@ -121,11 +121,10 @@ const FFCodec ff_ac3_encoder = { · 120 unmodified lines | ||
| 121 | 121 | .init = ff_ac3_float_encode_init, |
| 122 | 122 | FF_CODEC_ENCODE_CB(ff_ac3_encode_frame), |
| 123 | 123 | .close = ff_ac3_encode_close, |
| 124 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 125 | − AV_SAMPLE_FMT_NONE }, | |
| 124 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 126 | 125 | .p.priv_class = &ff_ac3enc_class, |
| 127 | − .p.supported_samplerates = ff_ac3_sample_rate_tab, | |
| 128 | − .p.ch_layouts = ff_ac3_ch_layouts, | |
| 126 | + CODEC_SAMPLERATES_ARRAY(ff_ac3_sample_rate_tab), | |
| 127 | + CODEC_CH_LAYOUTS_ARRAY(ff_ac3_ch_layouts), | |
| 129 | 128 | .defaults = ff_ac3_enc_defaults, |
| 130 | 129 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 131 | 130 | }; |
| @@ -2395,7 +2395,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ · 2394 unmodified lines | ||
| 2395 | 2395 | .p.type = AVMEDIA_TYPE_AUDIO, \ |
| 2396 | 2396 | .p.id = id_, \ |
| 2397 | 2397 | .p.capabilities = AV_CODEC_CAP_DR1, \ |
| 2398 | − .p.sample_fmts = sample_fmts_, \ | |
| 2398 | + CODEC_SAMPLEFMTS_ARRAY(sample_fmts_), \ | |
| 2399 | 2399 | .priv_data_size = sizeof(ADPCMDecodeContext), \ |
| 2400 | 2400 | .init = adpcm_decode_init, \ |
| 2401 | 2401 | FF_CODEC_DECODE_CB(adpcm_decode_frame), \ |
| @@ -1002,11 +1002,11 @@ const FFCodec ff_ ## name_ ## _encoder = { \ · 1001 unmodified lines | ||
| 1002 | 1002 | CODEC_LONG_NAME(long_name_), \ |
| 1003 | 1003 | .p.type = AVMEDIA_TYPE_AUDIO, \ |
| 1004 | 1004 | .p.id = id_, \ |
| 1005 | − .p.sample_fmts = sample_fmts_, \ | |
| 1006 | − .p.ch_layouts = ch_layouts, \ | |
| 1007 | 1005 | .p.capabilities = capabilities_ | AV_CODEC_CAP_DR1 | \ |
| 1008 | 1006 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, \ |
| 1009 | 1007 | .p.priv_class = &adpcm_encoder_class, \ |
| 1008 | + CODEC_CH_LAYOUTS_ARRAY(ch_layouts), \ | |
| 1009 | + CODEC_SAMPLEFMTS_ARRAY(sample_fmts_), \ | |
| 1010 | 1010 | .priv_data_size = sizeof(ADPCMEncodeContext), \ |
| 1011 | 1011 | .init = adpcm_encode_init, \ |
| 1012 | 1012 | FF_CODEC_ENCODE_CB(adpcm_encode_frame), \ |
| @@ -264,6 +264,5 @@ const FFCodec ff_adpcm_adx_decoder = { · 263 unmodified lines | ||
| 264 | 264 | .flush = adx_decode_flush, |
| 265 | 265 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 266 | 266 | AV_CODEC_CAP_DR1, |
| 267 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 268 | − AV_SAMPLE_FMT_NONE }, | |
| 267 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 269 | 268 | }; |
| @@ -197,7 +197,6 @@ const FFCodec ff_adpcm_adx_encoder = { · 196 unmodified lines | ||
| 197 | 197 | .priv_data_size = sizeof(ADXContext), |
| 198 | 198 | .init = adx_encode_init, |
| 199 | 199 | FF_CODEC_ENCODE_CB(adx_encode_frame), |
| 200 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, | |
| 201 | − AV_SAMPLE_FMT_NONE }, | |
| 200 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 202 | 201 | .caps_internal = FF_CODEC_CAP_EOF_FLUSH, |
| 203 | 202 | }; |
| @@ -646,8 +646,6 @@ const FFCodec ff_alac_encoder = { · 645 unmodified lines | ||
| 646 | 646 | .init = alac_encode_init, |
| 647 | 647 | FF_CODEC_ENCODE_CB(alac_encode_frame), |
| 648 | 648 | .close = alac_encode_close, |
| 649 | − .p.ch_layouts = ff_alac_ch_layouts, | |
| 650 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32P, | |
| 651 | − AV_SAMPLE_FMT_S16P, | |
| 652 | − AV_SAMPLE_FMT_NONE }, | |
| 649 | + CODEC_CH_LAYOUTS_ARRAY(ff_alac_ch_layouts), | |
| 650 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_S16P), | |
| 653 | 651 | }; |
| @@ -108,7 +108,5 @@ const FFCodec ff_alias_pix_encoder = { · 107 unmodified lines | ||
| 108 | 108 | .p.id = AV_CODEC_ID_ALIAS_PIX, |
| 109 | 109 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 110 | 110 | FF_CODEC_ENCODE_CB(encode_frame), |
| 111 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 112 | − AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE | |
| 113 | − }, | |
| 111 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24, AV_PIX_FMT_GRAY8), | |
| 114 | 112 | }; |
| @@ -705,7 +705,7 @@ const FFCodec ff_##x##_amf_decoder = { \ · 704 unmodified lines | ||
| 705 | 705 | .bsfs = bsf_name, \ |
| 706 | 706 | .p.capabilities = AV_CODEC_CAP_HARDWARE | AV_CODEC_CAP_DELAY | AV_CODEC_CAP_AVOID_PROBING, \ |
| 707 | 707 | .p.priv_class = &amf_decode_class, \ |
| 708 | − .p.pix_fmts = amf_dec_pix_fmts, \ | |
| 708 | + CODEC_PIXFMTS_ARRAY(amf_dec_pix_fmts), \ | |
| 709 | 709 | .hw_configs = amf_hw_configs, \ |
| 710 | 710 | .p.wrapper_name = "amf", \ |
| 711 | 711 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, \ |
| @@ -713,7 +713,7 @@ const FFCodec ff_av1_amf_encoder = { · 712 unmodified lines | ||
| 713 | 713 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | |
| 714 | 714 | AV_CODEC_CAP_DR1, |
| 715 | 715 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 716 | − .p.pix_fmts = ff_amf_pix_fmts, | |
| 716 | + CODEC_PIXFMTS_ARRAY(ff_amf_pix_fmts), | |
| 717 | 717 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 718 | 718 | .p.wrapper_name = "amf", |
| 719 | 719 | .hw_configs = ff_amfenc_hw_configs, |
| @@ -609,7 +609,7 @@ const FFCodec ff_h264_amf_encoder = { · 608 unmodified lines | ||
| 609 | 609 | AV_CODEC_CAP_DR1, |
| 610 | 610 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 611 | 611 | FF_CODEC_CAP_INIT_CLEANUP, |
| 612 | − .p.pix_fmts = ff_amf_pix_fmts, | |
| 612 | + CODEC_PIXFMTS_ARRAY(ff_amf_pix_fmts), | |
| 613 | 613 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 614 | 614 | .p.wrapper_name = "amf", |
| 615 | 615 | .hw_configs = ff_amfenc_hw_configs, |
| @@ -558,7 +558,7 @@ const FFCodec ff_hevc_amf_encoder = { · 557 unmodified lines | ||
| 558 | 558 | AV_CODEC_CAP_DR1, |
| 559 | 559 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 560 | 560 | FF_CODEC_CAP_INIT_CLEANUP, |
| 561 | − .p.pix_fmts = ff_amf_pix_fmts, | |
| 561 | + CODEC_PIXFMTS_ARRAY(ff_amf_pix_fmts), | |
| 562 | 562 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 563 | 563 | .p.wrapper_name = "amf", |
| 564 | 564 | .hw_configs = ff_amfenc_hw_configs, |
| @@ -1104,6 +1104,5 @@ const FFCodec ff_amrnb_decoder = { · 1103 unmodified lines | ||
| 1104 | 1104 | .init = amrnb_decode_init, |
| 1105 | 1105 | FF_CODEC_DECODE_CB(amrnb_decode_frame), |
| 1106 | 1106 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 1107 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 1108 | − AV_SAMPLE_FMT_NONE }, | |
| 1107 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1109 | 1108 | }; |
| @@ -1307,6 +1307,5 @@ const FFCodec ff_amrwb_decoder = { · 1306 unmodified lines | ||
| 1307 | 1307 | .init = amrwb_decode_init, |
| 1308 | 1308 | FF_CODEC_DECODE_CB(amrwb_decode_frame), |
| 1309 | 1309 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 1310 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 1311 | − AV_SAMPLE_FMT_NONE }, | |
| 1310 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1312 | 1311 | }; |
| @@ -274,7 +274,5 @@ const FFCodec ff_apac_decoder = { · 273 unmodified lines | ||
| 274 | 274 | #endif |
| 275 | 275 | AV_CODEC_CAP_DR1, |
| 276 | 276 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 277 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 278 | − AV_SAMPLE_FMT_S16P, | |
| 279 | − AV_SAMPLE_FMT_NONE }, | |
| 277 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P), | |
| 280 | 278 | }; |
| @@ -1767,9 +1767,6 @@ const FFCodec ff_ape_decoder = { · 1766 unmodified lines | ||
| 1767 | 1767 | AV_CODEC_CAP_DR1, |
| 1768 | 1768 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1769 | 1769 | .flush = ape_flush, |
| 1770 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 1771 | − AV_SAMPLE_FMT_S16P, | |
| 1772 | − AV_SAMPLE_FMT_S32P, | |
| 1773 | − AV_SAMPLE_FMT_NONE }, | |
| 1770 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P), | |
| 1774 | 1771 | .p.priv_class = &ape_decoder_class, |
| 1775 | 1772 | }; |
| @@ -183,9 +183,8 @@ const FFCodec ff_aptx_decoder = { · 182 unmodified lines | ||
| 183 | 183 | .init = ff_aptx_init, |
| 184 | 184 | FF_CODEC_DECODE_CB(aptx_decode_frame), |
| 185 | 185 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 186 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, | |
| 187 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, | |
| 188 | − AV_SAMPLE_FMT_NONE }, | |
| 186 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_STEREO), | |
| 187 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P), | |
| 189 | 188 | }; |
| 190 | 189 | #endif |
| 191 | 190 | |
| @@ -199,8 +198,7 @@ const FFCodec ff_aptx_hd_decoder = { · 7 unmodified lines | ||
| 199 | 198 | .init = ff_aptx_init, |
| 200 | 199 | FF_CODEC_DECODE_CB(aptx_decode_frame), |
| 201 | 200 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 202 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, | |
| 203 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, | |
| 204 | − AV_SAMPLE_FMT_NONE }, | |
| 201 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_STEREO), | |
| 202 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P), | |
| 205 | 203 | }; |
| 206 | 204 | #endif |
| @@ -276,10 +276,9 @@ const FFCodec ff_aptx_encoder = { · 275 unmodified lines | ||
| 276 | 276 | .init = aptx_encode_init, |
| 277 | 277 | FF_CODEC_ENCODE_CB(aptx_encode_frame), |
| 278 | 278 | .close = aptx_close, |
| 279 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, | |
| 280 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, | |
| 281 | − AV_SAMPLE_FMT_NONE }, | |
| 282 | − .p.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0}, | |
| 279 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_STEREO), | |
| 280 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P), | |
| 281 | + CODEC_SAMPLERATES(8000, 16000, 24000, 32000, 44100, 48000), | |
| 283 | 282 | }; |
| 284 | 283 | #endif |
| 285 | 284 | |
| @@ -294,9 +293,8 @@ const FFCodec ff_aptx_hd_encoder = { · 8 unmodified lines | ||
| 294 | 293 | .init = aptx_encode_init, |
| 295 | 294 | FF_CODEC_ENCODE_CB(aptx_encode_frame), |
| 296 | 295 | .close = aptx_close, |
| 297 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_STEREO, { 0 } }, | |
| 298 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, | |
| 299 | − AV_SAMPLE_FMT_NONE }, | |
| 300 | − .p.supported_samplerates = (const int[]) {8000, 16000, 24000, 32000, 44100, 48000, 0}, | |
| 296 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_STEREO), | |
| 297 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P), | |
| 298 | + CODEC_SAMPLERATES(8000, 16000, 24000, 32000, 44100, 48000), | |
| 301 | 299 | }; |
| 302 | 300 | #endif |
| @@ -365,8 +365,7 @@ const FFCodec ff_asv1_encoder = { · 364 unmodified lines | ||
| 365 | 365 | .priv_data_size = sizeof(ASVEncContext), |
| 366 | 366 | .init = encode_init, |
| 367 | 367 | FF_CODEC_ENCODE_CB(encode_frame), |
| 368 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 369 | − AV_PIX_FMT_NONE }, | |
| 368 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 370 | 369 | .color_ranges = AVCOL_RANGE_MPEG, |
| 371 | 370 | }; |
| 372 | 371 | #endif |
| @@ -381,8 +380,7 @@ const FFCodec ff_asv2_encoder = { · 8 unmodified lines | ||
| 381 | 380 | .priv_data_size = sizeof(ASVEncContext), |
| 382 | 381 | .init = encode_init, |
| 383 | 382 | FF_CODEC_ENCODE_CB(encode_frame), |
| 384 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 385 | − AV_PIX_FMT_NONE }, | |
| 383 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 386 | 384 | .color_ranges = AVCOL_RANGE_MPEG, |
| 387 | 385 | }; |
| 388 | 386 | #endif |
| @@ -399,7 +399,6 @@ const FFCodec ff_atrac1_decoder = { · 398 unmodified lines | ||
| 399 | 399 | .close = atrac1_decode_end, |
| 400 | 400 | FF_CODEC_DECODE_CB(atrac1_decode_frame), |
| 401 | 401 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 402 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 403 | − AV_SAMPLE_FMT_NONE }, | |
| 402 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 404 | 403 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 405 | 404 | }; |
| @@ -1032,8 +1032,7 @@ const FFCodec ff_atrac3_decoder = { · 1031 unmodified lines | ||
| 1032 | 1032 | AV_CODEC_CAP_SUBFRAMES | |
| 1033 | 1033 | #endif |
| 1034 | 1034 | AV_CODEC_CAP_DR1, |
| 1035 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1036 | − AV_SAMPLE_FMT_NONE }, | |
| 1035 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1037 | 1036 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1038 | 1037 | }; |
| 1039 | 1038 | |
| @@ -1051,7 +1050,6 @@ const FFCodec ff_atrac3al_decoder = { · 11 unmodified lines | ||
| 1051 | 1050 | AV_CODEC_CAP_SUBFRAMES | |
| 1052 | 1051 | #endif |
| 1053 | 1052 | AV_CODEC_CAP_DR1, |
| 1054 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1055 | − AV_SAMPLE_FMT_NONE }, | |
| 1053 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1056 | 1054 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1057 | 1055 | }; |
| @@ -650,13 +650,10 @@ static const AVOption options[] = { · 649 unmodified lines | ||
| 650 | 650 | .p.priv_class = &ffat_##NAME##_enc_class, \ |
| 651 | 651 | .p.capabilities = AV_CODEC_CAP_DELAY | \ |
| 652 | 652 | AV_CODEC_CAP_ENCODER_FLUSH CAPS, \ |
| 653 | − .p.ch_layouts = CH_LAYOUTS, \ | |
| 654 | − .p.sample_fmts = (const enum AVSampleFormat[]) { \ | |
| 655 | − AV_SAMPLE_FMT_S16, \ | |
| 656 | − AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE \ | |
| 657 | − }, \ | |
| 658 | 653 | .p.profiles = PROFILES, \ |
| 659 | 654 | .p.wrapper_name = "at", \ |
| 655 | + CODEC_CH_LAYOUTS_ARRAY(CH_LAYOUTS), \ | |
| 656 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_U8), \ | |
| 660 | 657 | }; |
| 661 | 658 | |
| 662 | 659 | static const AVChannelLayout aac_at_ch_layouts[] = { |
| @@ -99,7 +99,7 @@ const FFCodec ff_avui_encoder = { · 98 unmodified lines | ||
| 99 | 99 | .p.id = AV_CODEC_ID_AVUI, |
| 100 | 100 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_EXPERIMENTAL | |
| 101 | 101 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 102 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_UYVY422, AV_PIX_FMT_NONE }, | |
| 102 | + CODEC_PIXFMTS(AV_PIX_FMT_UYVY422), | |
| 103 | 103 | .color_ranges = AVCOL_RANGE_MPEG, |
| 104 | 104 | .init = avui_encode_init, |
| 105 | 105 | FF_CODEC_ENCODE_CB(avui_encode_frame), |
| @@ -114,6 +114,5 @@ const FFCodec ff_bitpacked_encoder = { · 113 unmodified lines | ||
| 114 | 114 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 115 | 115 | .init = encode_init, |
| 116 | 116 | FF_CODEC_ENCODE_CB(encode_frame), |
| 117 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, | |
| 118 | − AV_PIX_FMT_NONE }, | |
| 117 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV422P10), | |
| 119 | 118 | }; |
| @@ -164,11 +164,9 @@ const FFCodec ff_bmp_encoder = { · 163 unmodified lines | ||
| 164 | 164 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 165 | 165 | .init = bmp_encode_init, |
| 166 | 166 | FF_CODEC_ENCODE_CB(bmp_encode_frame), |
| 167 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 168 | − AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24, | |
| 169 | − AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, | |
| 170 | − AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, | |
| 171 | − AV_PIX_FMT_MONOBLACK, | |
| 172 | − AV_PIX_FMT_NONE | |
| 173 | − }, | |
| 167 | + CODEC_PIXFMTS(AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR24, | |
| 168 | + AV_PIX_FMT_RGB565, AV_PIX_FMT_RGB555, AV_PIX_FMT_RGB444, | |
| 169 | + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, | |
| 170 | + AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, | |
| 171 | + AV_PIX_FMT_MONOBLACK), | |
| 174 | 172 | }; |
| @@ -432,6 +432,5 @@ const FFCodec ff_bonk_decoder = { · 431 unmodified lines | ||
| 432 | 432 | #endif |
| 433 | 433 | AV_CODEC_CAP_DR1, |
| 434 | 434 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 435 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 436 | − AV_SAMPLE_FMT_NONE }, | |
| 435 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 437 | 436 | }; |
| @@ -864,12 +864,7 @@ const FFCodec ff_cfhd_encoder = { · 863 unmodified lines | ||
| 864 | 864 | .init = cfhd_encode_init, |
| 865 | 865 | .close = cfhd_encode_close, |
| 866 | 866 | FF_CODEC_ENCODE_CB(cfhd_encode_frame), |
| 867 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 868 | − AV_PIX_FMT_YUV422P10, | |
| 869 | − AV_PIX_FMT_GBRP12, | |
| 870 | − AV_PIX_FMT_GBRAP12, | |
| 871 | − AV_PIX_FMT_NONE | |
| 872 | − }, | |
| 867 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV422P10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRAP12), | |
| 873 | 868 | .color_ranges = AVCOL_RANGE_MPEG, |
| 874 | 869 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 875 | 870 | }; |
| @@ -1223,7 +1223,7 @@ const FFCodec ff_cinepak_encoder = { · 1222 unmodified lines | ||
| 1223 | 1223 | .init = cinepak_encode_init, |
| 1224 | 1224 | FF_CODEC_ENCODE_CB(cinepak_encode_frame), |
| 1225 | 1225 | .close = cinepak_encode_end, |
| 1226 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE }, | |
| 1226 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_GRAY8), | |
| 1227 | 1227 | .p.priv_class = &cinepak_class, |
| 1228 | 1228 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1229 | 1229 | }; |
| @@ -116,8 +116,7 @@ const FFCodec ff_cljr_encoder = { · 115 unmodified lines | ||
| 116 | 116 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 117 | 117 | .priv_data_size = sizeof(CLJRContext), |
| 118 | 118 | FF_CODEC_ENCODE_CB(encode_frame), |
| 119 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, | |
| 120 | − AV_PIX_FMT_NONE }, | |
| 119 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV411P), | |
| 121 | 120 | .color_ranges = AVCOL_RANGE_MPEG, |
| 122 | 121 | .p.priv_class = &cljr_class, |
| 123 | 122 | }; |
| @@ -173,8 +173,7 @@ const FFCodec ff_comfortnoise_decoder = { · 172 unmodified lines | ||
| 173 | 173 | FF_CODEC_DECODE_CB(cng_decode_frame), |
| 174 | 174 | .flush = cng_decode_flush, |
| 175 | 175 | .close = cng_decode_close, |
| 176 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 177 | − AV_SAMPLE_FMT_NONE }, | |
| 176 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 178 | 177 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 179 | 178 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 180 | 179 | }; |
| @@ -108,8 +108,7 @@ const FFCodec ff_comfortnoise_encoder = { · 107 unmodified lines | ||
| 108 | 108 | .init = cng_encode_init, |
| 109 | 109 | FF_CODEC_ENCODE_CB(cng_encode_frame), |
| 110 | 110 | .close = cng_encode_close, |
| 111 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 112 | − AV_SAMPLE_FMT_NONE }, | |
| 113 | − .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 111 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 112 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 114 | 113 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 115 | 114 | }; |
| @@ -327,6 +327,34 @@ int ff_default_get_supported_config(const struct AVCodecContext *avctx, · 326 unmodified lines | ||
| 327 | 327 | .cb_type = FF_CODEC_CB_TYPE_RECEIVE_PACKET, \ |
| 328 | 328 | .cb.receive_packet = (func) |
| 329 | 329 | |
| 330 | +#ifdef __clang__ | |
| 331 | +#define DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS | |
| 332 | +#define ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS | |
| 333 | +#else | |
| 334 | +#define DISABLE_DEPRECATION_WARNINGS | |
| 335 | +#define ENABLE_DEPRECATION_WARNINGS | |
| 336 | +#endif | |
| 337 | + | |
| 338 | +#define CODEC_CH_LAYOUTS(...) CODEC_CH_LAYOUTS_ARRAY(((const AVChannelLayout[]) { __VA_ARGS__, { 0 } })) | |
| 339 | +#define CODEC_CH_LAYOUTS_ARRAY(array) CODEC_ARRAY(ch_layouts, (array)) | |
| 340 | + | |
| 341 | +#define CODEC_SAMPLERATES(...) CODEC_SAMPLERATES_ARRAY(((const int[]) { __VA_ARGS__, 0 })) | |
| 342 | +#define CODEC_SAMPLERATES_ARRAY(array) CODEC_ARRAY(supported_samplerates, (array)) | |
| 343 | + | |
| 344 | +#define CODEC_SAMPLEFMTS(...) CODEC_SAMPLEFMTS_ARRAY(((const enum AVSampleFormat[]) { __VA_ARGS__, AV_SAMPLE_FMT_NONE })) | |
| 345 | +#define CODEC_SAMPLEFMTS_ARRAY(array) CODEC_ARRAY(sample_fmts, (array)) | |
| 346 | + | |
| 347 | +#define CODEC_FRAMERATES(...) CODEC_FRAMERATES_ARRAY(((const AVRational[]) { __VA_ARGS__, { 0, 0 } })) | |
| 348 | +#define CODEC_FRAMERATES_ARRAY(array) CODEC_ARRAY(supported_framerates, (array)) | |
| 349 | + | |
| 350 | +#define CODEC_PIXFMTS(...) CODEC_PIXFMTS_ARRAY(((const enum AVPixelFormat[]) { __VA_ARGS__, AV_PIX_FMT_NONE })) | |
| 351 | +#define CODEC_PIXFMTS_ARRAY(array) CODEC_ARRAY(pix_fmts, (array)) | |
| 352 | + | |
| 353 | +#define CODEC_ARRAY(field, array) \ | |
| 354 | + DISABLE_DEPRECATION_WARNINGS \ | |
| 355 | + .p.field = (array) \ | |
| 356 | + ENABLE_DEPRECATION_WARNINGS | |
| 357 | + | |
| 330 | 358 | static av_always_inline const FFCodec *ffcodec(const AVCodec *codec) |
| 331 | 359 | { |
| 332 | 360 | return (const FFCodec*)codec; |
| @@ -1308,7 +1308,6 @@ const FFCodec ff_cook_decoder = { · 1307 unmodified lines | ||
| 1308 | 1308 | .close = cook_decode_close, |
| 1309 | 1309 | FF_CODEC_DECODE_CB(cook_decode_frame), |
| 1310 | 1310 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 1311 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1312 | − AV_SAMPLE_FMT_NONE }, | |
| 1311 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1313 | 1312 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1314 | 1313 | }; |
| @@ -788,10 +788,7 @@ const FFCodec ff_hevc_d3d12va_encoder = { · 787 unmodified lines | ||
| 788 | 788 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 789 | 789 | FF_CODEC_CAP_INIT_CLEANUP, |
| 790 | 790 | .defaults = d3d12va_encode_hevc_defaults, |
| 791 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 792 | − AV_PIX_FMT_D3D12, | |
| 793 | − AV_PIX_FMT_NONE, | |
| 794 | − }, | |
| 791 | + CODEC_PIXFMTS(AV_PIX_FMT_D3D12), | |
| 795 | 792 | .hw_configs = ff_d3d12va_encode_hw_configs, |
| 796 | 793 | .p.wrapper_name = "d3d12va", |
| 797 | 794 | }; |
| @@ -416,8 +416,7 @@ const FFCodec ff_dca_decoder = { · 415 unmodified lines | ||
| 416 | 416 | .close = dcadec_close, |
| 417 | 417 | .flush = dcadec_flush, |
| 418 | 418 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 419 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, | |
| 420 | − AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, | |
| 419 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP), | |
| 421 | 420 | .p.priv_class = &dcadec_class, |
| 422 | 421 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_dca_profiles), |
| 423 | 422 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -1322,17 +1322,11 @@ const FFCodec ff_dca_encoder = { · 1321 unmodified lines | ||
| 1322 | 1322 | .close = encode_close, |
| 1323 | 1323 | FF_CODEC_ENCODE_CB(encode_frame), |
| 1324 | 1324 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1325 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, | |
| 1326 | − AV_SAMPLE_FMT_NONE }, | |
| 1327 | − .p.supported_samplerates = sample_rates, | |
| 1328 | − .p.ch_layouts = (const AVChannelLayout[]){ | |
| 1329 | − AV_CHANNEL_LAYOUT_MONO, | |
| 1330 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 1331 | − AV_CHANNEL_LAYOUT_2_2, | |
| 1332 | − AV_CHANNEL_LAYOUT_5POINT0, | |
| 1333 | − AV_CHANNEL_LAYOUT_5POINT1, | |
| 1334 | − { 0 }, | |
| 1335 | − }, | |
| 1325 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32), | |
| 1326 | + CODEC_SAMPLERATES_ARRAY(sample_rates), | |
| 1327 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, | |
| 1328 | + AV_CHANNEL_LAYOUT_2_2, AV_CHANNEL_LAYOUT_5POINT0, | |
| 1329 | + AV_CHANNEL_LAYOUT_5POINT1), | |
| 1336 | 1330 | .defaults = defaults, |
| 1337 | 1331 | .p.priv_class = &dcaenc_class, |
| 1338 | 1332 | }; |
| @@ -115,7 +115,7 @@ const FFCodec ff_dfpwm_encoder = { · 114 unmodified lines | ||
| 115 | 115 | .priv_data_size = sizeof(DFPWMState), |
| 116 | 116 | .init = dfpwm_enc_init, |
| 117 | 117 | FF_CODEC_ENCODE_CB(dfpwm_enc_frame), |
| 118 | − .p.sample_fmts = (const enum AVSampleFormat[]){AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_NONE}, | |
| 118 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8), | |
| 119 | 119 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE | |
| 120 | 120 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 121 | 121 | }; |
| @@ -1360,13 +1360,8 @@ const FFCodec ff_dnxhd_encoder = { · 1359 unmodified lines | ||
| 1360 | 1360 | .init = dnxhd_encode_init, |
| 1361 | 1361 | FF_CODEC_ENCODE_CB(dnxhd_encode_picture), |
| 1362 | 1362 | .close = dnxhd_encode_end, |
| 1363 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1364 | − AV_PIX_FMT_YUV422P, | |
| 1365 | − AV_PIX_FMT_YUV422P10, | |
| 1366 | − AV_PIX_FMT_YUV444P10, | |
| 1367 | − AV_PIX_FMT_GBRP10, | |
| 1368 | − AV_PIX_FMT_NONE | |
| 1369 | − }, | |
| 1363 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV422P10, | |
| 1364 | + AV_PIX_FMT_YUV444P10, AV_PIX_FMT_GBRP10), | |
| 1370 | 1365 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1371 | 1366 | .p.priv_class = &dnxhd_class, |
| 1372 | 1367 | .defaults = dnxhd_defaults, |
| @@ -1310,6 +1310,6 @@ const FFCodec ff_dolby_e_decoder = { · 1309 unmodified lines | ||
| 1310 | 1310 | .close = dolby_e_close, |
| 1311 | 1311 | .flush = dolby_e_flush, |
| 1312 | 1312 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 1313 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, | |
| 1313 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1314 | 1314 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1315 | 1315 | }; |
| @@ -283,13 +283,11 @@ const FFCodec ff_dpx_encoder = { · 282 unmodified lines | ||
| 283 | 283 | .priv_data_size = sizeof(DPXContext), |
| 284 | 284 | .init = encode_init, |
| 285 | 285 | FF_CODEC_ENCODE_CB(encode_frame), |
| 286 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 287 | − AV_PIX_FMT_GRAY8, | |
| 288 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, | |
| 289 | − AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, | |
| 290 | − AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, | |
| 291 | − AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE, | |
| 292 | − AV_PIX_FMT_GBRP10LE, AV_PIX_FMT_GBRP10BE, | |
| 293 | − AV_PIX_FMT_GBRP12LE, AV_PIX_FMT_GBRP12BE, | |
| 294 | − AV_PIX_FMT_NONE}, | |
| 286 | + CODEC_PIXFMTS(AV_PIX_FMT_GRAY8, | |
| 287 | + AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_ABGR, | |
| 288 | + AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, | |
| 289 | + AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, | |
| 290 | + AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE, | |
| 291 | + AV_PIX_FMT_GBRP10LE, AV_PIX_FMT_GBRP10BE, | |
| 292 | + AV_PIX_FMT_GBRP12LE, AV_PIX_FMT_GBRP12BE), | |
| 295 | 293 | }; |
| @@ -126,8 +126,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ · 125 unmodified lines | ||
| 126 | 126 | .init = decode_init, \ |
| 127 | 127 | FF_CODEC_DECODE_CB(decode_frame), \ |
| 128 | 128 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS, \ |
| 129 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, \ | |
| 130 | − AV_SAMPLE_FMT_NONE }, \ | |
| 129 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), \ | |
| 131 | 130 | }; |
| 132 | 131 | |
| 133 | 132 | DSD_DECODER(DSD_LSBF, dsd_lsbf, "DSD (Direct Stream Digital), least significant bit first") |
| @@ -392,6 +392,5 @@ const FFCodec ff_dst_decoder = { · 391 unmodified lines | ||
| 392 | 392 | .init = decode_init, |
| 393 | 393 | FF_CODEC_DECODE_CB(decode_frame), |
| 394 | 394 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 395 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, | |
| 396 | − AV_SAMPLE_FMT_NONE }, | |
| 395 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT), | |
| 397 | 396 | }; |
| @@ -1247,10 +1247,7 @@ const FFCodec ff_dvvideo_encoder = { · 1246 unmodified lines | ||
| 1247 | 1247 | .priv_data_size = sizeof(DVEncContext), |
| 1248 | 1248 | .init = dvvideo_encode_init, |
| 1249 | 1249 | FF_CODEC_ENCODE_CB(dvvideo_encode_frame), |
| 1250 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1251 | − AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, | |
| 1252 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE | |
| 1253 | − }, | |
| 1250 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV411P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P), | |
| 1254 | 1251 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1255 | 1252 | .p.priv_class = &dvvideo_encode_class, |
| 1256 | 1253 | }; |
| @@ -351,8 +351,6 @@ const FFCodec ff_dxv_encoder = { · 350 unmodified lines | ||
| 351 | 351 | AV_CODEC_CAP_SLICE_THREADS | |
| 352 | 352 | AV_CODEC_CAP_FRAME_THREADS, |
| 353 | 353 | .p.priv_class = &dxvenc_class, |
| 354 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 355 | − AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE, | |
| 356 | − }, | |
| 354 | + CODEC_PIXFMTS(AV_PIX_FMT_RGBA), | |
| 357 | 355 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 358 | 356 | }; |
| @@ -273,11 +273,10 @@ const FFCodec ff_eac3_encoder = { · 272 unmodified lines | ||
| 273 | 273 | .init = eac3_encode_init, |
| 274 | 274 | FF_CODEC_ENCODE_CB(ff_ac3_encode_frame), |
| 275 | 275 | .close = ff_ac3_encode_close, |
| 276 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 277 | − AV_SAMPLE_FMT_NONE }, | |
| 276 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 278 | 277 | .p.priv_class = &eac3enc_class, |
| 279 | − .p.supported_samplerates = ff_ac3_sample_rate_tab, | |
| 280 | − .p.ch_layouts = ff_ac3_ch_layouts, | |
| 278 | + CODEC_SAMPLERATES_ARRAY(ff_ac3_sample_rate_tab), | |
| 279 | + CODEC_CH_LAYOUTS_ARRAY(ff_ac3_ch_layouts), | |
| 281 | 280 | .defaults = ff_ac3_enc_defaults, |
| 282 | 281 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 283 | 282 | }; |
| @@ -551,9 +551,5 @@ const FFCodec ff_exr_encoder = { · 550 unmodified lines | ||
| 551 | 551 | .init = encode_init, |
| 552 | 552 | FF_CODEC_ENCODE_CB(encode_frame), |
| 553 | 553 | .close = encode_close, |
| 554 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 555 | − AV_PIX_FMT_GRAYF32, | |
| 556 | − AV_PIX_FMT_GBRPF32, | |
| 557 | − AV_PIX_FMT_GBRAPF32, | |
| 558 | − AV_PIX_FMT_NONE }, | |
| 554 | + CODEC_PIXFMTS(AV_PIX_FMT_GRAYF32, AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GBRAPF32), | |
| 559 | 555 | }; |
| @@ -195,6 +195,5 @@ const FFCodec ff_fastaudio_decoder = { · 194 unmodified lines | ||
| 195 | 195 | FF_CODEC_DECODE_CB(fastaudio_decode), |
| 196 | 196 | .close = fastaudio_close, |
| 197 | 197 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 198 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 199 | − AV_SAMPLE_FMT_NONE }, | |
| 198 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 200 | 199 | }; |
| @@ -1400,7 +1400,7 @@ const FFCodec ff_ffv1_encoder = { · 1399 unmodified lines | ||
| 1400 | 1400 | .init = encode_init_internal, |
| 1401 | 1401 | FF_CODEC_ENCODE_CB(encode_frame), |
| 1402 | 1402 | .close = encode_close, |
| 1403 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1403 | + CODEC_PIXFMTS( | |
| 1404 | 1404 | AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUV444P, |
| 1405 | 1405 | AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV411P, |
| 1406 | 1406 | AV_PIX_FMT_YUV410P, AV_PIX_FMT_0RGB32, AV_PIX_FMT_RGB32, AV_PIX_FMT_YUV420P16, |
| @@ -1421,10 +1421,7 @@ const FFCodec ff_ffv1_encoder = { · 14 unmodified lines | ||
| 1421 | 1421 | AV_PIX_FMT_GRAY9, |
| 1422 | 1422 | AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14, |
| 1423 | 1423 | AV_PIX_FMT_YUV440P10, AV_PIX_FMT_YUV440P12, |
| 1424 | − AV_PIX_FMT_GBRPF16, | |
| 1425 | − AV_PIX_FMT_NONE | |
| 1426 | − | |
| 1427 | − }, | |
| 1424 | + AV_PIX_FMT_GBRPF16), | |
| 1428 | 1425 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1429 | 1426 | .p.priv_class = &ffv1_class, |
| 1430 | 1427 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EOF_FLUSH, |
| @@ -1854,10 +1854,7 @@ const FFCodec ff_ffv1_vulkan_encoder = { · 1853 unmodified lines | ||
| 1854 | 1854 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 1855 | 1855 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EOF_FLUSH, |
| 1856 | 1856 | .defaults = vulkan_encode_ffv1_defaults, |
| 1857 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1858 | − AV_PIX_FMT_VULKAN, | |
| 1859 | − AV_PIX_FMT_NONE, | |
| 1860 | − }, | |
| 1857 | + CODEC_PIXFMTS(AV_PIX_FMT_VULKAN), | |
| 1861 | 1858 | .hw_configs = vulkan_encode_ffv1_hw_configs, |
| 1862 | 1859 | .p.wrapper_name = "vulkan", |
| 1863 | 1860 | }; |
| @@ -117,11 +117,6 @@ const FFCodec ff_fits_encoder = { · 116 unmodified lines | ||
| 117 | 117 | .p.id = AV_CODEC_ID_FITS, |
| 118 | 118 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 119 | 119 | FF_CODEC_ENCODE_CB(fits_encode_frame), |
| 120 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_GBRAP16BE, | |
| 121 | − AV_PIX_FMT_GBRP16BE, | |
| 122 | − AV_PIX_FMT_GBRP, | |
| 123 | − AV_PIX_FMT_GBRAP, | |
| 124 | − AV_PIX_FMT_GRAY16BE, | |
| 125 | − AV_PIX_FMT_GRAY8, | |
| 126 | − AV_PIX_FMT_NONE }, | |
| 120 | + CODEC_PIXFMTS(AV_PIX_FMT_GBRAP16BE, AV_PIX_FMT_GBRP16BE, AV_PIX_FMT_GBRP, | |
| 121 | + AV_PIX_FMT_GBRAP, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY8), | |
| 127 | 122 | }; |
| @@ -827,10 +827,7 @@ const FFCodec ff_flac_decoder = { · 826 unmodified lines | ||
| 827 | 827 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 828 | 828 | AV_CODEC_CAP_DR1 | |
| 829 | 829 | AV_CODEC_CAP_FRAME_THREADS, |
| 830 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, | |
| 831 | − AV_SAMPLE_FMT_S16P, | |
| 832 | − AV_SAMPLE_FMT_S32, | |
| 833 | − AV_SAMPLE_FMT_S32P, | |
| 834 | − AV_SAMPLE_FMT_NONE }, | |
| 830 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, | |
| 831 | + AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P), | |
| 835 | 832 | .p.priv_class = &flac_decoder_class, |
| 836 | 833 | }; |
| @@ -1760,9 +1760,7 @@ const FFCodec ff_flac_encoder = { · 1759 unmodified lines | ||
| 1760 | 1760 | .init = flac_encode_init, |
| 1761 | 1761 | FF_CODEC_ENCODE_CB(flac_encode_frame), |
| 1762 | 1762 | .close = flac_encode_close, |
| 1763 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 1764 | − AV_SAMPLE_FMT_S32, | |
| 1765 | − AV_SAMPLE_FMT_NONE }, | |
| 1763 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), | |
| 1766 | 1764 | .p.priv_class = &flac_encoder_class, |
| 1767 | 1765 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_EOF_FLUSH, |
| 1768 | 1766 | }; |
| @@ -920,6 +920,6 @@ const FFCodec ff_flashsv2_encoder = { · 919 unmodified lines | ||
| 920 | 920 | .init = flashsv2_encode_init, |
| 921 | 921 | FF_CODEC_ENCODE_CB(flashsv2_encode_frame), |
| 922 | 922 | .close = flashsv2_encode_end, |
| 923 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, | |
| 923 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24), | |
| 924 | 924 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 925 | 925 | }; |
| @@ -262,5 +262,5 @@ const FFCodec ff_flashsv_encoder = { · 261 unmodified lines | ||
| 262 | 262 | .init = flashsv_encode_init, |
| 263 | 263 | FF_CODEC_ENCODE_CB(flashsv_encode_frame), |
| 264 | 264 | .close = flashsv_encode_end, |
| 265 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, | |
| 265 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24), | |
| 266 | 266 | }; |
| @@ -94,7 +94,6 @@ const FFCodec ff_flv_encoder = { · 93 unmodified lines | ||
| 94 | 94 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 95 | 95 | .close = ff_mpv_encode_end, |
| 96 | 96 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 97 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 98 | − AV_PIX_FMT_NONE}, | |
| 97 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 99 | 98 | .color_ranges = AVCOL_RANGE_MPEG, |
| 100 | 99 | }; |
| @@ -382,9 +382,7 @@ const FFCodec ff_adpcm_g722_encoder = { · 381 unmodified lines | ||
| 382 | 382 | .init = g722_encode_init, |
| 383 | 383 | .close = g722_encode_close, |
| 384 | 384 | FF_CODEC_ENCODE_CB(g722_encode_frame), |
| 385 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, | |
| 386 | − .p.ch_layouts = (const AVChannelLayout[]){ | |
| 387 | − AV_CHANNEL_LAYOUT_MONO, { 0 } | |
| 388 | − }, | |
| 385 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 386 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 389 | 387 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 390 | 388 | }; |
| @@ -1246,10 +1246,6 @@ const FFCodec ff_g723_1_encoder = { · 1245 unmodified lines | ||
| 1246 | 1246 | .init = g723_1_encode_init, |
| 1247 | 1247 | FF_CODEC_ENCODE_CB(g723_1_encode_frame), |
| 1248 | 1248 | .defaults = defaults, |
| 1249 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 1250 | − AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE | |
| 1251 | − }, | |
| 1252 | − .p.ch_layouts = (const AVChannelLayout[]){ | |
| 1253 | − AV_CHANNEL_LAYOUT_MONO, { 0 } | |
| 1254 | − }, | |
| 1249 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 1250 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 1255 | 1251 | }; |
| @@ -410,8 +410,7 @@ const FFCodec ff_adpcm_g726_encoder = { · 409 unmodified lines | ||
| 410 | 410 | .priv_data_size = sizeof(G726Context), |
| 411 | 411 | .init = g726_encode_init, |
| 412 | 412 | FF_CODEC_ENCODE_CB(g726_encode_frame), |
| 413 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 414 | − AV_SAMPLE_FMT_NONE }, | |
| 413 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 415 | 414 | .p.priv_class = &g726_class, |
| 416 | 415 | .defaults = defaults, |
| 417 | 416 | }; |
| @@ -428,8 +427,7 @@ const FFCodec ff_adpcm_g726le_encoder = { · 10 unmodified lines | ||
| 428 | 427 | .priv_data_size = sizeof(G726Context), |
| 429 | 428 | .init = g726_encode_init, |
| 430 | 429 | FF_CODEC_ENCODE_CB(g726_encode_frame), |
| 431 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 432 | − AV_SAMPLE_FMT_NONE }, | |
| 430 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 433 | 431 | .p.priv_class = &g726_class, |
| 434 | 432 | .defaults = defaults, |
| 435 | 433 | }; |
| @@ -559,10 +559,8 @@ const FFCodec ff_gif_encoder = { · 558 unmodified lines | ||
| 559 | 559 | .init = gif_encode_init, |
| 560 | 560 | FF_CODEC_ENCODE_CB(gif_encode_frame), |
| 561 | 561 | .close = gif_encode_close, |
| 562 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 563 | − AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, | |
| 564 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE | |
| 565 | − }, | |
| 562 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, | |
| 563 | + AV_PIX_FMT_BGR4_BYTE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8), | |
| 566 | 564 | .p.priv_class = &gif_class, |
| 567 | 565 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 568 | 566 | }; |
| @@ -395,7 +395,6 @@ const FFCodec ff_h261_encoder = { · 394 unmodified lines | ||
| 395 | 395 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 396 | 396 | .close = ff_mpv_encode_end, |
| 397 | 397 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 398 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 399 | − AV_PIX_FMT_NONE }, | |
| 398 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 400 | 399 | .color_ranges = AVCOL_RANGE_MPEG, |
| 401 | 400 | }; |
| @@ -361,8 +361,6 @@ const FFCodec ff_hap_encoder = { · 360 unmodified lines | ||
| 361 | 361 | .init = hap_init, |
| 362 | 362 | FF_CODEC_ENCODE_CB(hap_encode), |
| 363 | 363 | .close = hap_close, |
| 364 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 365 | − AV_PIX_FMT_RGBA, AV_PIX_FMT_NONE, | |
| 366 | − }, | |
| 364 | + CODEC_PIXFMTS(AV_PIX_FMT_RGBA), | |
| 367 | 365 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 368 | 366 | }; |
| @@ -634,6 +634,5 @@ const FFCodec ff_hca_decoder = { · 633 unmodified lines | ||
| 634 | 634 | .close = decode_close, |
| 635 | 635 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 636 | 636 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 637 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 638 | − AV_SAMPLE_FMT_NONE }, | |
| 637 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 639 | 638 | }; |
| @@ -182,9 +182,6 @@ const FFCodec ff_hdr_encoder = { · 181 unmodified lines | ||
| 182 | 182 | .init = hdr_encode_init, |
| 183 | 183 | FF_CODEC_ENCODE_CB(hdr_encode_frame), |
| 184 | 184 | .close = hdr_encode_close, |
| 185 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 186 | − AV_PIX_FMT_GBRPF32, | |
| 187 | − AV_PIX_FMT_NONE | |
| 188 | − }, | |
| 185 | + CODEC_PIXFMTS(AV_PIX_FMT_GBRPF32), | |
| 189 | 186 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 190 | 187 | }; |
| @@ -1022,10 +1022,7 @@ const FFCodec ff_huffyuv_encoder = { · 1021 unmodified lines | ||
| 1022 | 1022 | FF_CODEC_ENCODE_CB(encode_frame), |
| 1023 | 1023 | .close = encode_end, |
| 1024 | 1024 | .p.priv_class = &normal_class, |
| 1025 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 1026 | − AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24, | |
| 1027 | − AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE | |
| 1028 | − }, | |
| 1025 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV422P, AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB32), | |
| 1029 | 1026 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1030 | 1027 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1031 | 1028 | }; |
| @@ -1050,7 +1047,7 @@ const FFCodec ff_ffvhuff_encoder = { · 18 unmodified lines | ||
| 1050 | 1047 | FF_CODEC_ENCODE_CB(encode_frame), |
| 1051 | 1048 | .close = encode_end, |
| 1052 | 1049 | .p.priv_class = &ff_class, |
| 1053 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 1050 | + CODEC_PIXFMTS( | |
| 1054 | 1051 | AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV411P, |
| 1055 | 1052 | AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV440P, |
| 1056 | 1053 | AV_PIX_FMT_GBRP, |
| @@ -1065,8 +1062,7 @@ const FFCodec ff_ffvhuff_encoder = { · 8 unmodified lines | ||
| 1065 | 1062 | AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA422P16, |
| 1066 | 1063 | AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P16, |
| 1067 | 1064 | AV_PIX_FMT_RGB24, |
| 1068 | − AV_PIX_FMT_RGB32, AV_PIX_FMT_NONE | |
| 1069 | − }, | |
| 1065 | + AV_PIX_FMT_RGB32), | |
| 1070 | 1066 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1071 | 1067 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1072 | 1068 | }; |
| @@ -1031,8 +1031,7 @@ const FFCodec ff_imc_decoder = { · 1030 unmodified lines | ||
| 1031 | 1031 | FF_CODEC_DECODE_CB(imc_decode_frame), |
| 1032 | 1032 | .flush = flush, |
| 1033 | 1033 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 1034 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1035 | − AV_SAMPLE_FMT_NONE }, | |
| 1034 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1036 | 1035 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1037 | 1036 | }; |
| 1038 | 1037 | #endif |
| @@ -1048,8 +1047,7 @@ const FFCodec ff_iac_decoder = { · 9 unmodified lines | ||
| 1048 | 1047 | FF_CODEC_DECODE_CB(imc_decode_frame), |
| 1049 | 1048 | .flush = flush, |
| 1050 | 1049 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 1051 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1052 | − AV_SAMPLE_FMT_NONE }, | |
| 1050 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1053 | 1051 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1054 | 1052 | }; |
| 1055 | 1053 | #endif |
| @@ -903,7 +903,7 @@ const FFCodec ff_h263_encoder = { · 902 unmodified lines | ||
| 903 | 903 | CODEC_LONG_NAME("H.263 / H.263-1996"), |
| 904 | 904 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 905 | 905 | .p.id = AV_CODEC_ID_H263, |
| 906 | − .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE}, | |
| 906 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 907 | 907 | .color_ranges = AVCOL_RANGE_MPEG, |
| 908 | 908 | .p.priv_class = &h263_class, |
| 909 | 909 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| @@ -935,7 +935,7 @@ const FFCodec ff_h263p_encoder = { · 25 unmodified lines | ||
| 935 | 935 | CODEC_LONG_NAME("H.263+ / H.263-1998 / H.263 version 2"), |
| 936 | 936 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 937 | 937 | .p.id = AV_CODEC_ID_H263P, |
| 938 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 938 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 939 | 939 | .color_ranges = AVCOL_RANGE_MPEG, |
| 940 | 940 | .p.priv_class = &h263p_class, |
| 941 | 941 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_SLICE_THREADS | |
| @@ -1845,7 +1845,7 @@ const FFCodec ff_jpeg2000_encoder = { · 1844 unmodified lines | ||
| 1845 | 1845 | .init = j2kenc_init, |
| 1846 | 1846 | FF_CODEC_ENCODE_CB(encode_frame), |
| 1847 | 1847 | .close = j2kenc_destroy, |
| 1848 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1848 | + CODEC_PIXFMTS( | |
| 1849 | 1849 | AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48, |
| 1850 | 1850 | AV_PIX_FMT_GBR24P,AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, |
| 1851 | 1851 | AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY9, AV_PIX_FMT_GRAY10, AV_PIX_FMT_GRAY12, AV_PIX_FMT_GRAY14, AV_PIX_FMT_GRAY16, |
| @@ -1862,9 +1862,7 @@ const FFCodec ff_jpeg2000_encoder = { · 10 unmodified lines | ||
| 1862 | 1862 | AV_PIX_FMT_YUVA422P, AV_PIX_FMT_YUVA422P9, AV_PIX_FMT_YUVA422P10, AV_PIX_FMT_YUVA422P16, |
| 1863 | 1863 | AV_PIX_FMT_YUVA444P, AV_PIX_FMT_YUVA444P9, AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_YUVA444P16, |
| 1864 | 1864 | |
| 1865 | − AV_PIX_FMT_PAL8, | |
| 1866 | − AV_PIX_FMT_NONE | |
| 1867 | − }, | |
| 1865 | + AV_PIX_FMT_PAL8), | |
| 1868 | 1866 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1869 | 1867 | .p.priv_class = &j2k_class, |
| 1870 | 1868 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -484,10 +484,7 @@ const FFCodec ff_jpegls_encoder = { · 483 unmodified lines | ||
| 484 | 484 | .init = encode_jpegls_init, |
| 485 | 485 | FF_CODEC_ENCODE_CB(encode_picture_ls), |
| 486 | 486 | .close = encode_jpegls_close, |
| 487 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 488 | − AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, | |
| 489 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16, | |
| 490 | − AV_PIX_FMT_NONE | |
| 491 | − }, | |
| 487 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24, AV_PIX_FMT_RGB24, | |
| 488 | + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16), | |
| 492 | 489 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 493 | 490 | }; |
| @@ -162,6 +162,6 @@ const FFCodec ff_zlib_encoder = { · 161 unmodified lines | ||
| 162 | 162 | .init = encode_init, |
| 163 | 163 | FF_CODEC_ENCODE_CB(encode_frame), |
| 164 | 164 | .close = encode_end, |
| 165 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGR24, AV_PIX_FMT_NONE }, | |
| 165 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24), | |
| 166 | 166 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 167 | 167 | }; |
| @@ -182,9 +182,9 @@ const FFCodec ff_libcodec2_decoder = { · 181 unmodified lines | ||
| 182 | 182 | .p.type = AVMEDIA_TYPE_AUDIO, |
| 183 | 183 | .p.id = AV_CODEC_ID_CODEC2, |
| 184 | 184 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF, |
| 185 | − .p.supported_samplerates = (const int[]){ 8000, 0 }, | |
| 186 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, | |
| 187 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 185 | + CODEC_SAMPLERATES(8000), | |
| 186 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 187 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 188 | 188 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, |
| 189 | 189 | .priv_data_size = sizeof(LibCodec2Context), |
| 190 | 190 | .init = libcodec2_init_decoder, |
| @@ -199,9 +199,9 @@ const FFCodec ff_libcodec2_encoder = { · 8 unmodified lines | ||
| 199 | 199 | .p.id = AV_CODEC_ID_CODEC2, |
| 200 | 200 | .p.capabilities = AV_CODEC_CAP_DR1 | |
| 201 | 201 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 202 | − .p.supported_samplerates = (const int[]){ 8000, 0 }, | |
| 203 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, | |
| 204 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 202 | + CODEC_SAMPLERATES(8000), | |
| 203 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 204 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 205 | 205 | .p.priv_class = &libcodec2_enc_class, |
| 206 | 206 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, |
| 207 | 207 | .priv_data_size = sizeof(LibCodec2Context), |
| @@ -607,12 +607,11 @@ const FFCodec ff_libfdk_aac_encoder = { · 606 unmodified lines | ||
| 607 | 607 | FF_CODEC_ENCODE_CB(aac_encode_frame), |
| 608 | 608 | .flush = aac_encode_flush, |
| 609 | 609 | .close = aac_encode_close, |
| 610 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 611 | − AV_SAMPLE_FMT_NONE }, | |
| 610 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 612 | 611 | .p.priv_class = &aac_enc_class, |
| 613 | 612 | .defaults = aac_encode_defaults, |
| 614 | 613 | .p.profiles = profiles, |
| 615 | − .p.supported_samplerates = aac_sample_rates, | |
| 614 | + CODEC_SAMPLERATES_ARRAY(aac_sample_rates), | |
| 616 | 615 | .p.wrapper_name = "libfdk", |
| 617 | − .p.ch_layouts = aac_ch_layouts, | |
| 616 | + CODEC_CH_LAYOUTS_ARRAY(aac_ch_layouts), | |
| 618 | 617 | }; |
| @@ -127,9 +127,8 @@ const FFCodec ff_libgsm_encoder = { · 126 unmodified lines | ||
| 127 | 127 | FF_CODEC_ENCODE_CB(libgsm_encode_frame), |
| 128 | 128 | .close = libgsm_encode_close, |
| 129 | 129 | .defaults = libgsm_defaults, |
| 130 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 131 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 132 | − AV_SAMPLE_FMT_NONE }, | |
| 130 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 131 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 133 | 132 | .p.wrapper_name = "libgsm", |
| 134 | 133 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, |
| 135 | 134 | }; |
| @@ -145,9 +144,8 @@ const FFCodec ff_libgsm_ms_encoder = { · 9 unmodified lines | ||
| 145 | 144 | FF_CODEC_ENCODE_CB(libgsm_encode_frame), |
| 146 | 145 | .close = libgsm_encode_close, |
| 147 | 146 | .defaults = libgsm_defaults, |
| 148 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 149 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 150 | − AV_SAMPLE_FMT_NONE }, | |
| 147 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 148 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 151 | 149 | .p.wrapper_name = "libgsm", |
| 152 | 150 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE, |
| 153 | 151 | }; |
| @@ -210,8 +210,7 @@ const FFCodec ff_libilbc_encoder = { · 209 unmodified lines | ||
| 210 | 210 | .priv_data_size = sizeof(ILBCEncContext), |
| 211 | 211 | .init = ilbc_encode_init, |
| 212 | 212 | FF_CODEC_ENCODE_CB(ilbc_encode_frame), |
| 213 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 214 | − AV_SAMPLE_FMT_NONE }, | |
| 213 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 215 | 214 | .defaults = ilbc_encode_defaults, |
| 216 | 215 | .p.priv_class = &ilbc_enc_class, |
| 217 | 216 | .p.wrapper_name = "libbilbc", |
| @@ -699,7 +699,7 @@ const FFCodec ff_libjxl_encoder = { · 698 unmodified lines | ||
| 699 | 699 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 700 | 700 | FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP | |
| 701 | 701 | FF_CODEC_CAP_ICC_PROFILES, |
| 702 | − .p.pix_fmts = libjxl_supported_pixfmts, | |
| 702 | + CODEC_PIXFMTS_ARRAY(libjxl_supported_pixfmts), | |
| 703 | 703 | .p.priv_class = &libjxl_encode_class, |
| 704 | 704 | .p.wrapper_name = "libjxl", |
| 705 | 705 | }; |
| @@ -719,7 +719,7 @@ const FFCodec ff_libjxl_anim_encoder = { · 13 unmodified lines | ||
| 719 | 719 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 720 | 720 | FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP | |
| 721 | 721 | FF_CODEC_CAP_ICC_PROFILES, |
| 722 | − .p.pix_fmts = libjxl_supported_pixfmts, | |
| 722 | + CODEC_PIXFMTS_ARRAY(libjxl_supported_pixfmts), | |
| 723 | 723 | .p.priv_class = &libjxl_encode_class, |
| 724 | 724 | .p.wrapper_name = "libjxl", |
| 725 | 725 | }; |
| @@ -333,7 +333,7 @@ const FFCodec ff_libkvazaar_encoder = { · 332 unmodified lines | ||
| 333 | 333 | .p.id = AV_CODEC_ID_HEVC, |
| 334 | 334 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 335 | 335 | AV_CODEC_CAP_OTHER_THREADS, |
| 336 | − .p.pix_fmts = pix_fmts, | |
| 336 | + CODEC_PIXFMTS_ARRAY(pix_fmts), | |
| 337 | 337 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 338 | 338 | |
| 339 | 339 | .p.priv_class = &class, |
| @@ -201,12 +201,10 @@ const FFCodec ff_liblc3_encoder = { · 200 unmodified lines | ||
| 201 | 201 | .p.type = AVMEDIA_TYPE_AUDIO, |
| 202 | 202 | .p.id = AV_CODEC_ID_LC3, |
| 203 | 203 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 204 | − .p.supported_samplerates = (const int []) | |
| 205 | − { 96000, 48000, 32000, 24000, 16000, 8000, 0 }, | |
| 206 | − .p.sample_fmts = (const enum AVSampleFormat[]) | |
| 207 | − { AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_NONE }, | |
| 208 | 204 | .p.priv_class = &class, |
| 209 | 205 | .p.wrapper_name = "liblc3", |
| 206 | + CODEC_SAMPLERATES(96000, 48000, 32000, 24000, 16000, 8000), | |
| 207 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 210 | 208 | .priv_data_size = sizeof(LibLC3EncContext), |
| 211 | 209 | .init = liblc3_encode_init, |
| 212 | 210 | .close = liblc3_encode_close, |
| @@ -348,15 +348,9 @@ const FFCodec ff_libmp3lame_encoder = { · 347 unmodified lines | ||
| 348 | 348 | .init = mp3lame_encode_init, |
| 349 | 349 | FF_CODEC_ENCODE_CB(mp3lame_encode_frame), |
| 350 | 350 | .close = mp3lame_encode_close, |
| 351 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S32P, | |
| 352 | − AV_SAMPLE_FMT_FLTP, | |
| 353 | − AV_SAMPLE_FMT_S16P, | |
| 354 | − AV_SAMPLE_FMT_NONE }, | |
| 355 | − .p.supported_samplerates = libmp3lame_sample_rates, | |
| 356 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, | |
| 357 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 358 | − { 0 }, | |
| 359 | − }, | |
| 351 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_S16P), | |
| 352 | + CODEC_SAMPLERATES_ARRAY(libmp3lame_sample_rates), | |
| 353 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 360 | 354 | .p.priv_class = &libmp3lame_class, |
| 361 | 355 | .defaults = libmp3lame_defaults, |
| 362 | 356 | .p.wrapper_name = "libmp3lame", |
| @@ -302,8 +302,7 @@ const FFCodec ff_libopencore_amrnb_encoder = { · 301 unmodified lines | ||
| 302 | 302 | .init = amr_nb_encode_init, |
| 303 | 303 | FF_CODEC_ENCODE_CB(amr_nb_encode_frame), |
| 304 | 304 | .close = amr_nb_encode_close, |
| 305 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 306 | − AV_SAMPLE_FMT_NONE }, | |
| 305 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 307 | 306 | .p.priv_class = &amrnb_class, |
| 308 | 307 | }; |
| 309 | 308 | #endif /* CONFIG_LIBOPENCORE_AMRNB_ENCODER */ |
| @@ -442,9 +442,7 @@ const FFCodec ff_libopenh264_encoder = { · 441 unmodified lines | ||
| 442 | 442 | .close = svc_encode_close, |
| 443 | 443 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | |
| 444 | 444 | FF_CODEC_CAP_AUTO_THREADS, |
| 445 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, | |
| 446 | − AV_PIX_FMT_YUVJ420P, | |
| 447 | − AV_PIX_FMT_NONE }, | |
| 445 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVJ420P), | |
| 448 | 446 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 449 | 447 | .defaults = svc_enc_defaults, |
| 450 | 448 | .p.priv_class = &class, |
| @@ -765,7 +765,7 @@ const FFCodec ff_libopenjpeg_encoder = { · 764 unmodified lines | ||
| 765 | 765 | FF_CODEC_ENCODE_CB(libopenjpeg_encode_frame), |
| 766 | 766 | .p.capabilities = AV_CODEC_CAP_FRAME_THREADS | |
| 767 | 767 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 768 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 768 | + CODEC_PIXFMTS( | |
| 769 | 769 | AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB48, |
| 770 | 770 | AV_PIX_FMT_RGBA64, AV_PIX_FMT_GBR24P, |
| 771 | 771 | AV_PIX_FMT_GBRP9, AV_PIX_FMT_GBRP10, AV_PIX_FMT_GBRP12, AV_PIX_FMT_GBRP14, AV_PIX_FMT_GBRP16, |
| @@ -782,9 +782,7 @@ const FFCodec ff_libopenjpeg_encoder = { · 10 unmodified lines | ||
| 782 | 782 | AV_PIX_FMT_YUV420P14, AV_PIX_FMT_YUV422P14, AV_PIX_FMT_YUV444P14, |
| 783 | 783 | AV_PIX_FMT_YUV420P16, AV_PIX_FMT_YUV422P16, AV_PIX_FMT_YUV444P16, |
| 784 | 784 | AV_PIX_FMT_YUVA420P16, AV_PIX_FMT_YUVA422P16, AV_PIX_FMT_YUVA444P16, |
| 785 | − AV_PIX_FMT_XYZ12, | |
| 786 | − AV_PIX_FMT_NONE | |
| 787 | − }, | |
| 785 | + AV_PIX_FMT_XYZ12), | |
| 788 | 786 | .color_ranges = AVCOL_RANGE_MPEG, |
| 789 | 787 | .p.priv_class = &openjpeg_class, |
| 790 | 788 | .p.wrapper_name = "libopenjpeg", |
| @@ -244,9 +244,7 @@ const FFCodec ff_libopus_decoder = { · 243 unmodified lines | ||
| 244 | 244 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 245 | 245 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 246 | 246 | FF_CODEC_CAP_INIT_CLEANUP, |
| 247 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, | |
| 248 | − AV_SAMPLE_FMT_S16, | |
| 249 | − AV_SAMPLE_FMT_NONE }, | |
| 247 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_S16), | |
| 250 | 248 | .p.priv_class = &libopusdec_class, |
| 251 | 249 | .p.wrapper_name = "libopus", |
| 252 | 250 | }; |
| @@ -592,10 +592,8 @@ const FFCodec ff_libopus_encoder = { · 591 unmodified lines | ||
| 592 | 592 | .init = libopus_encode_init, |
| 593 | 593 | FF_CODEC_ENCODE_CB(libopus_encode), |
| 594 | 594 | .close = libopus_encode_close, |
| 595 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 596 | − AV_SAMPLE_FMT_FLT, | |
| 597 | − AV_SAMPLE_FMT_NONE }, | |
| 598 | − .p.supported_samplerates = libopus_sample_rates, | |
| 595 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_FLT), | |
| 596 | + CODEC_SAMPLERATES_ARRAY(libopus_sample_rates), | |
| 599 | 597 | .p.priv_class = &libopus_class, |
| 600 | 598 | .defaults = libopus_defaults, |
| 601 | 599 | .p.wrapper_name = "libopus", |
| @@ -667,7 +667,7 @@ const FFCodec ff_librav1e_encoder = { · 666 unmodified lines | ||
| 667 | 667 | .priv_data_size = sizeof(librav1eContext), |
| 668 | 668 | .p.priv_class = &class, |
| 669 | 669 | .defaults = librav1e_defaults, |
| 670 | − .p.pix_fmts = librav1e_pix_fmts, | |
| 670 | + CODEC_PIXFMTS_ARRAY(librav1e_pix_fmts), | |
| 671 | 671 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 672 | 672 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | |
| 673 | 673 | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_RECON_FRAME | |
| @@ -137,12 +137,8 @@ const FFCodec ff_libshine_encoder = { · 136 unmodified lines | ||
| 137 | 137 | .init = libshine_encode_init, |
| 138 | 138 | FF_CODEC_ENCODE_CB(libshine_encode_frame), |
| 139 | 139 | .close = libshine_encode_close, |
| 140 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16P, | |
| 141 | − AV_SAMPLE_FMT_NONE }, | |
| 142 | − .p.supported_samplerates = libshine_sample_rates, | |
| 143 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, | |
| 144 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 145 | − { 0 }, | |
| 146 | − }, | |
| 140 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 141 | + CODEC_SAMPLERATES_ARRAY(libshine_sample_rates), | |
| 142 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 147 | 143 | .p.wrapper_name = "libshine", |
| 148 | 144 | }; |
| @@ -353,13 +353,9 @@ const FFCodec ff_libspeex_encoder = { · 352 unmodified lines | ||
| 353 | 353 | .init = encode_init, |
| 354 | 354 | FF_CODEC_ENCODE_CB(encode_frame), |
| 355 | 355 | .close = encode_close, |
| 356 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 357 | − AV_SAMPLE_FMT_NONE }, | |
| 358 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, | |
| 359 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 360 | − { 0 }, | |
| 361 | − }, | |
| 362 | − .p.supported_samplerates = (const int[]){ 8000, 16000, 32000, 0 }, | |
| 356 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 357 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 358 | + CODEC_SAMPLERATES(8000, 16000, 32000), | |
| 363 | 359 | .p.priv_class = &speex_class, |
| 364 | 360 | .defaults = defaults, |
| 365 | 361 | .p.wrapper_name = "libspeex", |
| @@ -770,9 +770,7 @@ const FFCodec ff_libsvtav1_encoder = { · 769 unmodified lines | ||
| 770 | 770 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS, |
| 771 | 771 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 772 | 772 | FF_CODEC_CAP_AUTO_THREADS | FF_CODEC_CAP_INIT_CLEANUP, |
| 773 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, | |
| 774 | − AV_PIX_FMT_YUV420P10, | |
| 775 | − AV_PIX_FMT_NONE }, | |
| 773 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P10), | |
| 776 | 774 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 777 | 775 | .p.priv_class = &class, |
| 778 | 776 | .defaults = eb_enc_defaults, |
| @@ -388,9 +388,7 @@ const FFCodec ff_libtheora_encoder = { · 387 unmodified lines | ||
| 388 | 388 | .init = encode_init, |
| 389 | 389 | .close = encode_close, |
| 390 | 390 | FF_CODEC_ENCODE_CB(encode_frame), |
| 391 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 392 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE | |
| 393 | − }, | |
| 391 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P), | |
| 394 | 392 | .color_ranges = AVCOL_RANGE_MPEG, |
| 395 | 393 | .p.wrapper_name = "libtheora", |
| 396 | 394 | }; |
| @@ -221,18 +221,9 @@ const FFCodec ff_libtwolame_encoder = { · 220 unmodified lines | ||
| 221 | 221 | .close = twolame_encode_close, |
| 222 | 222 | .defaults = twolame_defaults, |
| 223 | 223 | .p.priv_class = &twolame_class, |
| 224 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 225 | − AV_SAMPLE_FMT_FLT, | |
| 226 | − AV_SAMPLE_FMT_FLTP, | |
| 227 | − AV_SAMPLE_FMT_S16, | |
| 228 | − AV_SAMPLE_FMT_S16P, | |
| 229 | − AV_SAMPLE_FMT_NONE | |
| 230 | − }, | |
| 231 | − .p.ch_layouts = (const AVChannelLayout[]) { | |
| 232 | − AV_CHANNEL_LAYOUT_MONO, | |
| 233 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 234 | − { 0 }, | |
| 235 | − }, | |
| 236 | − .p.supported_samplerates = twolame_samplerates, | |
| 224 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, | |
| 225 | + AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P), | |
| 226 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 227 | + CODEC_SAMPLERATES_ARRAY(twolame_samplerates), | |
| 237 | 228 | .p.wrapper_name = "libtwolame", |
| 238 | 229 | }; |
| @@ -153,6 +153,5 @@ const FFCodec ff_libvo_amrwbenc_encoder = { · 152 unmodified lines | ||
| 153 | 153 | .init = amr_wb_encode_init, |
| 154 | 154 | FF_CODEC_ENCODE_CB(amr_wb_encode_frame), |
| 155 | 155 | .close = amr_wb_encode_close, |
| 156 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 157 | − AV_SAMPLE_FMT_NONE }, | |
| 156 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 158 | 157 | }; |
| @@ -386,8 +386,7 @@ const FFCodec ff_libvorbis_encoder = { · 385 unmodified lines | ||
| 386 | 386 | .init = libvorbis_encode_init, |
| 387 | 387 | FF_CODEC_ENCODE_CB(libvorbis_encode_frame), |
| 388 | 388 | .close = libvorbis_encode_close, |
| 389 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 390 | − AV_SAMPLE_FMT_NONE }, | |
| 389 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 391 | 390 | .p.priv_class = &vorbis_class, |
| 392 | 391 | .defaults = defaults, |
| 393 | 392 | .p.wrapper_name = "libvorbis", |
| @@ -2044,7 +2044,7 @@ const FFCodec ff_libvpx_vp8_encoder = { · 2043 unmodified lines | ||
| 2044 | 2044 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 2045 | 2045 | FF_CODEC_CAP_INIT_CLEANUP | |
| 2046 | 2046 | FF_CODEC_CAP_AUTO_THREADS, |
| 2047 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P, AV_PIX_FMT_NONE }, | |
| 2047 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUVA420P), | |
| 2048 | 2048 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 2049 | 2049 | .p.priv_class = &class_vp8, |
| 2050 | 2050 | .defaults = defaults, |
| @@ -482,7 +482,7 @@ const FFCodec ff_libvvenc_encoder = { · 481 unmodified lines | ||
| 482 | 482 | .p.priv_class = &class, |
| 483 | 483 | .p.wrapper_name = "libvvenc", |
| 484 | 484 | .priv_data_size = sizeof(VVenCContext), |
| 485 | − .p.pix_fmts = pix_fmts_vvenc, | |
| 485 | + CODEC_PIXFMTS_ARRAY(pix_fmts_vvenc), | |
| 486 | 486 | .init = vvenc_init, |
| 487 | 487 | FF_CODEC_ENCODE_CB(vvenc_frame), |
| 488 | 488 | .close = vvenc_close, |
| @@ -94,7 +94,7 @@ const FFCodec ff_libwebp_encoder = { · 93 unmodified lines | ||
| 94 | 94 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 95 | 95 | .p.id = AV_CODEC_ID_WEBP, |
| 96 | 96 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 97 | − .p.pix_fmts = ff_libwebpenc_pix_fmts, | |
| 97 | + CODEC_PIXFMTS_ARRAY(ff_libwebpenc_pix_fmts), | |
| 98 | 98 | .color_ranges = AVCOL_RANGE_MPEG, |
| 99 | 99 | .p.priv_class = &ff_libwebpenc_class, |
| 100 | 100 | .p.wrapper_name = "libwebp", |
| @@ -167,7 +167,7 @@ const FFCodec ff_libwebp_anim_encoder = { · 166 unmodified lines | ||
| 167 | 167 | .p.id = AV_CODEC_ID_WEBP, |
| 168 | 168 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 169 | 169 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 170 | − .p.pix_fmts = ff_libwebpenc_pix_fmts, | |
| 170 | + CODEC_PIXFMTS_ARRAY(ff_libwebpenc_pix_fmts), | |
| 171 | 171 | .color_ranges = AVCOL_RANGE_MPEG, |
| 172 | 172 | .p.priv_class = &ff_libwebpenc_class, |
| 173 | 173 | .p.wrapper_name = "libwebp", |
| @@ -1633,7 +1633,7 @@ const FFCodec ff_libx264_encoder = { · 1632 unmodified lines | ||
| 1633 | 1633 | .flush = X264_flush, |
| 1634 | 1634 | .close = X264_close, |
| 1635 | 1635 | .defaults = x264_defaults, |
| 1636 | − .p.pix_fmts = pix_fmts_all, | |
| 1636 | + CODEC_PIXFMTS_ARRAY(pix_fmts_all), | |
| 1637 | 1637 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 1638 | 1638 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_AUTO_THREADS |
| 1639 | 1639 | #if X264_BUILD < 158 |
| @@ -1659,7 +1659,7 @@ const FFCodec ff_libx264rgb_encoder = { · 19 unmodified lines | ||
| 1659 | 1659 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 1660 | 1660 | AV_CODEC_CAP_OTHER_THREADS | |
| 1661 | 1661 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 1662 | − .p.pix_fmts = pix_fmts_8bit_rgb, | |
| 1662 | + CODEC_PIXFMTS_ARRAY(pix_fmts_8bit_rgb), | |
| 1663 | 1663 | .p.priv_class = &rgbclass, |
| 1664 | 1664 | .p.wrapper_name = "libx264", |
| 1665 | 1665 | .priv_data_size = sizeof(X264Context), |
| @@ -1691,7 +1691,7 @@ const FFCodec ff_libx262_encoder = { · 25 unmodified lines | ||
| 1691 | 1691 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 1692 | 1692 | AV_CODEC_CAP_OTHER_THREADS | |
| 1693 | 1693 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 1694 | − .p.pix_fmts = pix_fmts_8bit, | |
| 1694 | + CODEC_PIXFMTS_ARRAY(pix_fmts_8bit), | |
| 1695 | 1695 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1696 | 1696 | .p.priv_class = &X262_class, |
| 1697 | 1697 | .p.wrapper_name = "libx264", |
| @@ -434,7 +434,7 @@ const FFCodec ff_libxavs_encoder = { · 433 unmodified lines | ||
| 434 | 434 | .close = XAVS_close, |
| 435 | 435 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 436 | 436 | FF_CODEC_CAP_AUTO_THREADS, |
| 437 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 437 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 438 | 438 | .color_ranges = AVCOL_RANGE_MPEG, |
| 439 | 439 | .p.priv_class = &xavs_class, |
| 440 | 440 | .defaults = xavs_defaults, |
| @@ -299,8 +299,7 @@ const FFCodec ff_libxavs2_encoder = { · 298 unmodified lines | ||
| 299 | 299 | .close = xavs2_close, |
| 300 | 300 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 301 | 301 | FF_CODEC_CAP_AUTO_THREADS, |
| 302 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 303 | − AV_PIX_FMT_NONE }, | |
| 302 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 304 | 303 | .color_ranges = AVCOL_RANGE_MPEG, |
| 305 | 304 | .p.priv_class = &libxavs2, |
| 306 | 305 | .defaults = xavs2_defaults, |
| @@ -613,7 +613,7 @@ const FFCodec ff_libxeve_encoder = { · 612 unmodified lines | ||
| 613 | 613 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_OTHER_THREADS | AV_CODEC_CAP_DR1, |
| 614 | 614 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_evc_profiles), |
| 615 | 615 | .p.wrapper_name = "libxeve", |
| 616 | − .p.pix_fmts = supported_pixel_formats, | |
| 616 | + CODEC_PIXFMTS_ARRAY(supported_pixel_formats), | |
| 617 | 617 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 618 | 618 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_NOT_INIT_THREADSAFE, |
| 619 | 619 | }; |
| @@ -911,7 +911,7 @@ const FFCodec ff_libxvid_encoder = { · 910 unmodified lines | ||
| 911 | 911 | .init = xvid_encode_init, |
| 912 | 912 | FF_CODEC_ENCODE_CB(xvid_encode_frame), |
| 913 | 913 | .close = xvid_encode_close, |
| 914 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 914 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 915 | 915 | .color_ranges = AVCOL_RANGE_MPEG, |
| 916 | 916 | .p.priv_class = &xvid_class, |
| 917 | 917 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -323,10 +323,8 @@ const FFCodec ff_ljpeg_encoder = { · 322 unmodified lines | ||
| 323 | 323 | .init = ljpeg_encode_init, |
| 324 | 324 | FF_CODEC_ENCODE_CB(ljpeg_encode_frame), |
| 325 | 325 | .close = ljpeg_encode_close, |
| 326 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 327 | − AV_PIX_FMT_BGR24 , AV_PIX_FMT_BGRA , AV_PIX_FMT_BGR0, | |
| 328 | − AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, | |
| 329 | − AV_PIX_FMT_YUV420P , AV_PIX_FMT_YUV444P , AV_PIX_FMT_YUV422P, | |
| 330 | − AV_PIX_FMT_NONE}, | |
| 326 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_BGR0, | |
| 327 | + AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ444P, AV_PIX_FMT_YUVJ422P, | |
| 328 | + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUV422P), | |
| 331 | 329 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 332 | 330 | }; |
| @@ -293,8 +293,7 @@ const FFCodec ff_mace3_decoder = { · 292 unmodified lines | ||
| 293 | 293 | .init = mace_decode_init, |
| 294 | 294 | FF_CODEC_DECODE_CB(mace_decode_frame), |
| 295 | 295 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 296 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 297 | − AV_SAMPLE_FMT_NONE }, | |
| 296 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 298 | 297 | }; |
| 299 | 298 | |
| 300 | 299 | const FFCodec ff_mace6_decoder = { |
| @@ -306,6 +305,5 @@ const FFCodec ff_mace6_decoder = { · 5 unmodified lines | ||
| 306 | 305 | .init = mace_decode_init, |
| 307 | 306 | FF_CODEC_DECODE_CB(mace_decode_frame), |
| 308 | 307 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 309 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 310 | − AV_SAMPLE_FMT_NONE }, | |
| 308 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 311 | 309 | }; |
| @@ -691,11 +691,9 @@ const FFCodec ff_magicyuv_encoder = { · 690 unmodified lines | ||
| 691 | 691 | .init = magy_encode_init, |
| 692 | 692 | .close = magy_encode_close, |
| 693 | 693 | FF_CODEC_ENCODE_CB(magy_encode_frame), |
| 694 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 695 | − AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, | |
| 696 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, AV_PIX_FMT_GRAY8, | |
| 697 | − AV_PIX_FMT_NONE | |
| 698 | − }, | |
| 694 | + CODEC_PIXFMTS(AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, | |
| 695 | + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_YUVA444P, | |
| 696 | + AV_PIX_FMT_GRAY8), | |
| 699 | 697 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 700 | 698 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 701 | 699 | }; |
| @@ -1094,7 +1094,7 @@ const FFCodec ff_ ## short_name ## _mediacodec_encoder = { \ · 1093 unmodified lines | ||
| 1094 | 1094 | AV_CODEC_CAP_HARDWARE | \ |
| 1095 | 1095 | AV_CODEC_CAP_ENCODER_FLUSH, \ |
| 1096 | 1096 | .priv_data_size = sizeof(MediaCodecEncContext), \ |
| 1097 | − .p.pix_fmts = avc_pix_fmts, \ | |
| 1097 | + CODEC_PIXFMTS_ARRAY(avc_pix_fmts), \ | |
| 1098 | 1098 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, \ |
| 1099 | 1099 | .defaults = mediacodec_defaults, \ |
| 1100 | 1100 | .init = mediacodec_init, \ |
| @@ -374,7 +374,6 @@ const FFCodec ff_metasound_decoder = { · 373 unmodified lines | ||
| 374 | 374 | .close = ff_twinvq_decode_close, |
| 375 | 375 | FF_CODEC_DECODE_CB(ff_twinvq_decode_frame), |
| 376 | 376 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 377 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 378 | − AV_SAMPLE_FMT_NONE }, | |
| 377 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 379 | 378 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 380 | 379 | }; |
| @@ -1263,8 +1263,7 @@ static int mf_init(AVCodecContext *avctx) · 1262 unmodified lines | ||
| 1263 | 1263 | }; |
| 1264 | 1264 | |
| 1265 | 1265 | #define AFMTS \ |
| 1266 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, \ | |
| 1267 | − AV_SAMPLE_FMT_NONE }, | |
| 1266 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 1268 | 1267 | #define ACAPS \ |
| 1269 | 1268 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID | \ |
| 1270 | 1269 | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE, |
| @@ -1306,9 +1305,7 @@ static const FFCodecDefault defaults[] = { · 35 unmodified lines | ||
| 1306 | 1305 | }; |
| 1307 | 1306 | |
| 1308 | 1307 | #define VFMTS \ |
| 1309 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, \ | |
| 1310 | − AV_PIX_FMT_YUV420P, \ | |
| 1311 | − AV_PIX_FMT_NONE }, | |
| 1308 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_YUV420P), | |
| 1312 | 1309 | #define VCAPS \ |
| 1313 | 1310 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID | \ |
| 1314 | 1311 | AV_CODEC_CAP_DR1, |
| @@ -184,6 +184,5 @@ const FFCodec ff_misc4_decoder = { · 183 unmodified lines | ||
| 184 | 184 | AV_CODEC_CAP_SUBFRAMES | |
| 185 | 185 | #endif |
| 186 | 186 | AV_CODEC_CAP_CHANNEL_CONF, |
| 187 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, | |
| 188 | − AV_SAMPLE_FMT_NONE }, | |
| 187 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 189 | 188 | }; |
| @@ -688,11 +688,8 @@ FFCodec ff_mjpeg_encoder = { · 687 unmodified lines | ||
| 688 | 688 | AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | |
| 689 | 689 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 690 | 690 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP | FF_CODEC_CAP_ICC_PROFILES, |
| 691 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 692 | − AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, | |
| 693 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, | |
| 694 | − AV_PIX_FMT_NONE | |
| 695 | − }, | |
| 691 | + CODEC_PIXFMTS(AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_YUVJ422P, AV_PIX_FMT_YUVJ444P, | |
| 692 | + AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P), | |
| 696 | 693 | .p.priv_class = &mjpeg_class, |
| 697 | 694 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_mjpeg_profiles), |
| 698 | 695 | .get_supported_config = mjpeg_get_supported_config, |
| @@ -718,9 +715,7 @@ const FFCodec ff_amv_encoder = { · 19 unmodified lines | ||
| 718 | 715 | FF_CODEC_ENCODE_CB(amv_encode_picture), |
| 719 | 716 | .close = mjpeg_encode_close, |
| 720 | 717 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 721 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 722 | − AV_PIX_FMT_YUVJ420P, AV_PIX_FMT_NONE | |
| 723 | − }, | |
| 718 | + CODEC_PIXFMTS(AV_PIX_FMT_YUVJ420P), | |
| 724 | 719 | .color_ranges = AVCOL_RANGE_JPEG, |
| 725 | 720 | .p.priv_class = &amv_class, |
| 726 | 721 | }; |
| @@ -2308,9 +2308,9 @@ const FFCodec ff_mlp_encoder = { · 2307 unmodified lines | ||
| 2308 | 2308 | FF_CODEC_ENCODE_CB(mlp_encode_frame), |
| 2309 | 2309 | .close = mlp_encode_close, |
| 2310 | 2310 | .p.priv_class = &mlp_class, |
| 2311 | − .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE}, | |
| 2312 | − .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, | |
| 2313 | − .p.ch_layouts = ff_mlp_ch_layouts, | |
| 2311 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P), | |
| 2312 | + CODEC_SAMPLERATES(44100, 48000, 88200, 96000, 176400, 192000), | |
| 2313 | + CODEC_CH_LAYOUTS_ARRAY(ff_mlp_ch_layouts), | |
| 2314 | 2314 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2315 | 2315 | }; |
| 2316 | 2316 | #endif |
| @@ -2328,20 +2328,13 @@ const FFCodec ff_truehd_encoder = { · 11 unmodified lines | ||
| 2328 | 2328 | FF_CODEC_ENCODE_CB(mlp_encode_frame), |
| 2329 | 2329 | .close = mlp_encode_close, |
| 2330 | 2330 | .p.priv_class = &mlp_class, |
| 2331 | − .p.sample_fmts = (const enum AVSampleFormat[]) {AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_NONE}, | |
| 2332 | − .p.supported_samplerates = (const int[]) {44100, 48000, 88200, 96000, 176400, 192000, 0}, | |
| 2333 | − .p.ch_layouts = (const AVChannelLayout[]) { | |
| 2334 | − AV_CHANNEL_LAYOUT_MONO, | |
| 2335 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 2336 | − AV_CHANNEL_LAYOUT_2POINT1, | |
| 2337 | − AV_CHANNEL_LAYOUT_SURROUND, | |
| 2338 | − AV_CHANNEL_LAYOUT_3POINT1, | |
| 2339 | − AV_CHANNEL_LAYOUT_4POINT0, | |
| 2340 | − AV_CHANNEL_LAYOUT_4POINT1, | |
| 2341 | − AV_CHANNEL_LAYOUT_5POINT0, | |
| 2342 | − AV_CHANNEL_LAYOUT_5POINT1, | |
| 2343 | − { 0 } | |
| 2344 | − }, | |
| 2331 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P), | |
| 2332 | + CODEC_SAMPLERATES(44100, 48000, 88200, 96000, 176400, 192000), | |
| 2333 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, | |
| 2334 | + AV_CHANNEL_LAYOUT_2POINT1, AV_CHANNEL_LAYOUT_SURROUND, | |
| 2335 | + AV_CHANNEL_LAYOUT_3POINT1, AV_CHANNEL_LAYOUT_4POINT0, | |
| 2336 | + AV_CHANNEL_LAYOUT_4POINT1, AV_CHANNEL_LAYOUT_5POINT0, | |
| 2337 | + AV_CHANNEL_LAYOUT_5POINT1), | |
| 2345 | 2338 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2346 | 2339 | }; |
| 2347 | 2340 | #endif |
| @@ -323,6 +323,5 @@ const FFCodec ff_mpc7_decoder = { · 322 unmodified lines | ||
| 323 | 323 | FF_CODEC_DECODE_CB(mpc7_decode_frame), |
| 324 | 324 | .flush = mpc7_decode_flush, |
| 325 | 325 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 326 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 327 | − AV_SAMPLE_FMT_NONE }, | |
| 326 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 328 | 327 | }; |
| @@ -393,6 +393,5 @@ const FFCodec ff_mpc8_decoder = { · 392 unmodified lines | ||
| 393 | 393 | FF_CODEC_DECODE_CB(mpc8_decode_frame), |
| 394 | 394 | .flush = mpc8_decode_flush, |
| 395 | 395 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 396 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 397 | − AV_SAMPLE_FMT_NONE }, | |
| 396 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 398 | 397 | }; |
| @@ -1249,9 +1249,8 @@ const FFCodec ff_mpeg1video_encoder = { · 1248 unmodified lines | ||
| 1249 | 1249 | .init = encode_init, |
| 1250 | 1250 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 1251 | 1251 | .close = ff_mpv_encode_end, |
| 1252 | − .p.supported_framerates = ff_mpeg12_frame_rate_tab + 1, | |
| 1253 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 1254 | − AV_PIX_FMT_NONE }, | |
| 1252 | + CODEC_FRAMERATES_ARRAY(ff_mpeg12_frame_rate_tab + 1), | |
| 1253 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 1255 | 1254 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1256 | 1255 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 1257 | 1256 | AV_CODEC_CAP_SLICE_THREADS | |
| @@ -1269,10 +1268,8 @@ const FFCodec ff_mpeg2video_encoder = { · 11 unmodified lines | ||
| 1269 | 1268 | .init = encode_init, |
| 1270 | 1269 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 1271 | 1270 | .close = ff_mpv_encode_end, |
| 1272 | − .p.supported_framerates = ff_mpeg2_frame_rate_tab, | |
| 1273 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 1274 | − AV_PIX_FMT_YUV422P, | |
| 1275 | − AV_PIX_FMT_NONE }, | |
| 1271 | + CODEC_FRAMERATES_ARRAY(ff_mpeg2_frame_rate_tab), | |
| 1272 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P), | |
| 1276 | 1273 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1277 | 1274 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 1278 | 1275 | AV_CODEC_CAP_SLICE_THREADS | |
| @@ -1399,7 +1399,7 @@ const FFCodec ff_mpeg4_encoder = { · 1398 unmodified lines | ||
| 1399 | 1399 | .init = encode_init, |
| 1400 | 1400 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 1401 | 1401 | .close = ff_mpv_encode_end, |
| 1402 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 1402 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 1403 | 1403 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1404 | 1404 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 1405 | 1405 | AV_CODEC_CAP_SLICE_THREADS | |
| @@ -72,9 +72,7 @@ const FFCodec ff_mp1_decoder = { · 71 unmodified lines | ||
| 72 | 72 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 73 | 73 | AV_CODEC_CAP_DR1, |
| 74 | 74 | .flush = flush, |
| 75 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 76 | − AV_SAMPLE_FMT_S16, | |
| 77 | − AV_SAMPLE_FMT_NONE }, | |
| 75 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16), | |
| 78 | 76 | }; |
| 79 | 77 | #endif |
| 80 | 78 | #if CONFIG_MP2_DECODER |
| @@ -89,9 +87,7 @@ const FFCodec ff_mp2_decoder = { · 8 unmodified lines | ||
| 89 | 87 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 90 | 88 | AV_CODEC_CAP_DR1, |
| 91 | 89 | .flush = flush, |
| 92 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 93 | − AV_SAMPLE_FMT_S16, | |
| 94 | − AV_SAMPLE_FMT_NONE }, | |
| 90 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16), | |
| 95 | 91 | }; |
| 96 | 92 | #endif |
| 97 | 93 | #if CONFIG_MP3_DECODER |
| @@ -106,9 +102,7 @@ const FFCodec ff_mp3_decoder = { · 8 unmodified lines | ||
| 106 | 102 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 107 | 103 | AV_CODEC_CAP_DR1, |
| 108 | 104 | .flush = flush, |
| 109 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 110 | − AV_SAMPLE_FMT_S16, | |
| 111 | − AV_SAMPLE_FMT_NONE }, | |
| 105 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16), | |
| 112 | 106 | }; |
| 113 | 107 | #endif |
| 114 | 108 | #if CONFIG_MP3ADU_DECODER |
| @@ -123,9 +117,7 @@ const FFCodec ff_mp3adu_decoder = { · 8 unmodified lines | ||
| 123 | 117 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 124 | 118 | AV_CODEC_CAP_DR1, |
| 125 | 119 | .flush = flush, |
| 126 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 127 | − AV_SAMPLE_FMT_S16, | |
| 128 | − AV_SAMPLE_FMT_NONE }, | |
| 120 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S16), | |
| 129 | 121 | }; |
| 130 | 122 | #endif |
| 131 | 123 | #if CONFIG_MP3ON4_DECODER |
| @@ -141,8 +133,7 @@ const FFCodec ff_mp3on4_decoder = { · 9 unmodified lines | ||
| 141 | 133 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 142 | 134 | AV_CODEC_CAP_DR1, |
| 143 | 135 | .flush = flush_mp3on4, |
| 144 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 145 | − AV_SAMPLE_FMT_NONE }, | |
| 136 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 146 | 137 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 147 | 138 | }; |
| 148 | 139 | #endif |
| @@ -85,9 +85,7 @@ const FFCodec ff_mp1float_decoder = { · 84 unmodified lines | ||
| 85 | 85 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 86 | 86 | AV_CODEC_CAP_DR1, |
| 87 | 87 | .flush = flush, |
| 88 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 89 | − AV_SAMPLE_FMT_FLT, | |
| 90 | − AV_SAMPLE_FMT_NONE }, | |
| 88 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT), | |
| 91 | 89 | }; |
| 92 | 90 | #endif |
| 93 | 91 | #if CONFIG_MP2FLOAT_DECODER |
| @@ -102,9 +100,7 @@ const FFCodec ff_mp2float_decoder = { · 8 unmodified lines | ||
| 102 | 100 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 103 | 101 | AV_CODEC_CAP_DR1, |
| 104 | 102 | .flush = flush, |
| 105 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 106 | − AV_SAMPLE_FMT_FLT, | |
| 107 | − AV_SAMPLE_FMT_NONE }, | |
| 103 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT), | |
| 108 | 104 | }; |
| 109 | 105 | #endif |
| 110 | 106 | #if CONFIG_MP3FLOAT_DECODER |
| @@ -119,9 +115,7 @@ const FFCodec ff_mp3float_decoder = { · 8 unmodified lines | ||
| 119 | 115 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 120 | 116 | AV_CODEC_CAP_DR1, |
| 121 | 117 | .flush = flush, |
| 122 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 123 | − AV_SAMPLE_FMT_FLT, | |
| 124 | − AV_SAMPLE_FMT_NONE }, | |
| 118 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT), | |
| 125 | 119 | }; |
| 126 | 120 | #endif |
| 127 | 121 | #if CONFIG_MP3ADUFLOAT_DECODER |
| @@ -136,9 +130,7 @@ const FFCodec ff_mp3adufloat_decoder = { · 8 unmodified lines | ||
| 136 | 130 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 137 | 131 | AV_CODEC_CAP_DR1, |
| 138 | 132 | .flush = flush, |
| 139 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 140 | − AV_SAMPLE_FMT_FLT, | |
| 141 | − AV_SAMPLE_FMT_NONE }, | |
| 133 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP, AV_SAMPLE_FMT_FLT), | |
| 142 | 134 | }; |
| 143 | 135 | #endif |
| 144 | 136 | #if CONFIG_MP3ON4FLOAT_DECODER |
| @@ -154,8 +146,7 @@ const FFCodec ff_mp3on4float_decoder = { · 9 unmodified lines | ||
| 154 | 146 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 155 | 147 | AV_CODEC_CAP_DR1, |
| 156 | 148 | .flush = flush_mp3on4, |
| 157 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 158 | − AV_SAMPLE_FMT_NONE }, | |
| 149 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 159 | 150 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 160 | 151 | }; |
| 161 | 152 | #endif |
| @@ -32,13 +32,8 @@ const FFCodec ff_mp2fixed_encoder = { · 31 unmodified lines | ||
| 32 | 32 | .priv_data_size = sizeof(MpegAudioContext), |
| 33 | 33 | .init = MPA_encode_init, |
| 34 | 34 | FF_CODEC_ENCODE_CB(MPA_encode_frame), |
| 35 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 36 | − AV_SAMPLE_FMT_NONE }, | |
| 37 | − .p.supported_samplerates = (const int[]){ | |
| 38 | − 44100, 48000, 32000, 22050, 24000, 16000, 0 | |
| 39 | − }, | |
| 40 | − .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, | |
| 41 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 42 | − { 0 } }, | |
| 35 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 36 | + CODEC_SAMPLERATES(44100, 48000, 32000, 22050, 24000, 16000), | |
| 37 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 43 | 38 | .defaults = mp2_defaults, |
| 44 | 39 | }; |
| @@ -33,13 +33,8 @@ const FFCodec ff_mp2_encoder = { · 32 unmodified lines | ||
| 33 | 33 | .priv_data_size = sizeof(MpegAudioContext), |
| 34 | 34 | .init = MPA_encode_init, |
| 35 | 35 | FF_CODEC_ENCODE_CB(MPA_encode_frame), |
| 36 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 37 | − AV_SAMPLE_FMT_NONE }, | |
| 38 | − .p.supported_samplerates = (const int[]){ | |
| 39 | − 44100, 48000, 32000, 22050, 24000, 16000, 0 | |
| 40 | − }, | |
| 41 | − .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, | |
| 42 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 43 | − { 0 } }, | |
| 36 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 37 | + CODEC_SAMPLERATES(44100, 48000, 32000, 22050, 24000, 16000), | |
| 38 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 44 | 39 | .defaults = mp2_defaults, |
| 45 | 40 | }; |
| @@ -680,7 +680,7 @@ const FFCodec ff_msmpeg4v2_encoder = { · 679 unmodified lines | ||
| 680 | 680 | CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 2"), |
| 681 | 681 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 682 | 682 | .p.id = AV_CODEC_ID_MSMPEG4V2, |
| 683 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 683 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 684 | 684 | .color_ranges = AVCOL_RANGE_MPEG, |
| 685 | 685 | .p.priv_class = &ff_mpv_enc_class, |
| 686 | 686 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| @@ -696,7 +696,7 @@ const FFCodec ff_msmpeg4v3_encoder = { · 9 unmodified lines | ||
| 696 | 696 | CODEC_LONG_NAME("MPEG-4 part 2 Microsoft variant version 3"), |
| 697 | 697 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 698 | 698 | .p.id = AV_CODEC_ID_MSMPEG4V3, |
| 699 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 699 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 700 | 700 | .color_ranges = AVCOL_RANGE_MPEG, |
| 701 | 701 | .p.priv_class = &ff_mpv_enc_class, |
| 702 | 702 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| @@ -712,7 +712,7 @@ const FFCodec ff_wmv1_encoder = { · 9 unmodified lines | ||
| 712 | 712 | CODEC_LONG_NAME("Windows Media Video 7"), |
| 713 | 713 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 714 | 714 | .p.id = AV_CODEC_ID_WMV1, |
| 715 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 715 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 716 | 716 | .color_ranges = AVCOL_RANGE_MPEG, |
| 717 | 717 | .p.priv_class = &ff_mpv_enc_class, |
| 718 | 718 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| @@ -293,8 +293,6 @@ const FFCodec ff_msrle_encoder = { · 292 unmodified lines | ||
| 293 | 293 | .init = msrle_encode_init, |
| 294 | 294 | FF_CODEC_ENCODE_CB(msrle_encode_frame), |
| 295 | 295 | .close = msrle_encode_close, |
| 296 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 297 | − AV_PIX_FMT_PAL8, AV_PIX_FMT_NONE | |
| 298 | − }, | |
| 296 | + CODEC_PIXFMTS(AV_PIX_FMT_PAL8), | |
| 299 | 297 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 300 | 298 | }; |
| @@ -315,5 +315,5 @@ const FFCodec ff_msvideo1_encoder = { · 314 unmodified lines | ||
| 315 | 315 | .init = encode_init, |
| 316 | 316 | FF_CODEC_ENCODE_CB(encode_frame), |
| 317 | 317 | .close = encode_end, |
| 318 | − .p.pix_fmts = (const enum AVPixelFormat[]){AV_PIX_FMT_RGB555, AV_PIX_FMT_NONE}, | |
| 318 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB555), | |
| 319 | 319 | }; |
| @@ -202,6 +202,5 @@ const FFCodec ff_nellymoser_decoder = { · 201 unmodified lines | ||
| 202 | 202 | .close = decode_end, |
| 203 | 203 | FF_CODEC_DECODE_CB(decode_tag), |
| 204 | 204 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE | AV_CODEC_CAP_CHANNEL_CONF, |
| 205 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLT, | |
| 206 | − AV_SAMPLE_FMT_NONE }, | |
| 205 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT), | |
| 207 | 206 | }; |
| @@ -427,8 +427,7 @@ const FFCodec ff_nellymoser_encoder = { · 426 unmodified lines | ||
| 427 | 427 | .init = encode_init, |
| 428 | 428 | FF_CODEC_ENCODE_CB(encode_frame), |
| 429 | 429 | .close = encode_end, |
| 430 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLT, | |
| 431 | − AV_SAMPLE_FMT_NONE }, | |
| 432 | − .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 430 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLT), | |
| 431 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 433 | 432 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 434 | 433 | }; |
| @@ -81,15 +81,12 @@ const FFCodec ff_anull_encoder = { · 80 unmodified lines | ||
| 81 | 81 | .p.type = AVMEDIA_TYPE_AUDIO, |
| 82 | 82 | .p.id = AV_CODEC_ID_ANULL, |
| 83 | 83 | .p.capabilities = AV_CODEC_CAP_VARIABLE_FRAME_SIZE, |
| 84 | − .p.sample_fmts = (const enum AVSampleFormat[]){ | |
| 85 | − AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8P, | |
| 86 | − AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, | |
| 87 | − AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P, | |
| 88 | − AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64P, | |
| 89 | − AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, | |
| 90 | − AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP, | |
| 91 | − AV_SAMPLE_FMT_NONE, | |
| 92 | − }, | |
| 84 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_U8P, | |
| 85 | + AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S16P, | |
| 86 | + AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S32P, | |
| 87 | + AV_SAMPLE_FMT_S64, AV_SAMPLE_FMT_S64P, | |
| 88 | + AV_SAMPLE_FMT_FLT, AV_SAMPLE_FMT_FLTP, | |
| 89 | + AV_SAMPLE_FMT_DBL, AV_SAMPLE_FMT_DBLP), | |
| 93 | 90 | FF_CODEC_ENCODE_CB(null_encode), |
| 94 | 91 | }; |
| 95 | 92 | #endif |
| @@ -214,7 +214,7 @@ const FFCodec ff_av1_nvenc_encoder = { · 213 unmodified lines | ||
| 214 | 214 | .priv_data_size = sizeof(NvencContext), |
| 215 | 215 | .p.priv_class = &av1_nvenc_class, |
| 216 | 216 | .defaults = defaults, |
| 217 | − .p.pix_fmts = ff_nvenc_pix_fmts, | |
| 217 | + CODEC_PIXFMTS_ARRAY(ff_nvenc_pix_fmts), | |
| 218 | 218 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 219 | 219 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | |
| 220 | 220 | AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1 | |
| @@ -286,7 +286,7 @@ const FFCodec ff_h264_nvenc_encoder = { · 285 unmodified lines | ||
| 286 | 286 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 287 | 287 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 288 | 288 | FF_CODEC_CAP_INIT_CLEANUP, |
| 289 | − .p.pix_fmts = ff_nvenc_pix_fmts, | |
| 289 | + CODEC_PIXFMTS_ARRAY(ff_nvenc_pix_fmts), | |
| 290 | 290 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 291 | 291 | .p.wrapper_name = "nvenc", |
| 292 | 292 | .hw_configs = ff_nvenc_hw_configs, |
| @@ -267,7 +267,7 @@ const FFCodec ff_hevc_nvenc_encoder = { · 266 unmodified lines | ||
| 267 | 267 | .priv_data_size = sizeof(NvencContext), |
| 268 | 268 | .p.priv_class = &hevc_nvenc_class, |
| 269 | 269 | .defaults = defaults, |
| 270 | − .p.pix_fmts = ff_nvenc_pix_fmts, | |
| 270 | + CODEC_PIXFMTS_ARRAY(ff_nvenc_pix_fmts), | |
| 271 | 271 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 272 | 272 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HARDWARE | |
| 273 | 273 | AV_CODEC_CAP_ENCODER_FLUSH | AV_CODEC_CAP_DR1 | |
| @@ -951,7 +951,7 @@ const FFCodec ff_mpeg4_omx_encoder = { · 950 unmodified lines | ||
| 951 | 951 | .init = omx_encode_init, |
| 952 | 952 | FF_CODEC_ENCODE_CB(omx_encode_frame), |
| 953 | 953 | .close = omx_encode_end, |
| 954 | − .p.pix_fmts = omx_encoder_pix_fmts, | |
| 954 | + CODEC_PIXFMTS_ARRAY(omx_encoder_pix_fmts), | |
| 955 | 955 | .color_ranges = AVCOL_RANGE_MPEG, |
| 956 | 956 | .p.capabilities = AV_CODEC_CAP_DELAY, |
| 957 | 957 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -973,7 +973,7 @@ const FFCodec ff_h264_omx_encoder = { · 15 unmodified lines | ||
| 973 | 973 | .init = omx_encode_init, |
| 974 | 974 | FF_CODEC_ENCODE_CB(omx_encode_frame), |
| 975 | 975 | .close = omx_encode_end, |
| 976 | − .p.pix_fmts = omx_encoder_pix_fmts, | |
| 976 | + CODEC_PIXFMTS_ARRAY(omx_encoder_pix_fmts), | |
| 977 | 977 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 978 | 978 | .p.capabilities = AV_CODEC_CAP_DELAY, |
| 979 | 979 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -1023,6 +1023,5 @@ const FFCodec ff_on2avc_decoder = { · 1022 unmodified lines | ||
| 1023 | 1023 | .close = on2avc_decode_close, |
| 1024 | 1024 | .p.capabilities = AV_CODEC_CAP_DR1, |
| 1025 | 1025 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1026 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1027 | − AV_SAMPLE_FMT_NONE }, | |
| 1026 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1028 | 1027 | }; |
| @@ -746,9 +746,7 @@ const FFCodec ff_opus_encoder = { · 745 unmodified lines | ||
| 746 | 746 | FF_CODEC_ENCODE_CB(opus_encode_frame), |
| 747 | 747 | .close = opus_encode_end, |
| 748 | 748 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 749 | − .p.supported_samplerates = (const int []){ 48000, 0 }, | |
| 750 | − .p.ch_layouts = (const AVChannelLayout []){ AV_CHANNEL_LAYOUT_MONO, | |
| 751 | − AV_CHANNEL_LAYOUT_STEREO, { 0 } }, | |
| 752 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 753 | − AV_SAMPLE_FMT_NONE }, | |
| 749 | + CODEC_SAMPLERATES(48000), | |
| 750 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 751 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 754 | 752 | }; |
| @@ -489,9 +489,6 @@ const FFCodec ff_osq_decoder = { · 488 unmodified lines | ||
| 489 | 489 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 490 | 490 | AV_CODEC_CAP_DR1, |
| 491 | 491 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 492 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 493 | − AV_SAMPLE_FMT_S16P, | |
| 494 | − AV_SAMPLE_FMT_S32P, | |
| 495 | − AV_SAMPLE_FMT_NONE }, | |
| 492 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P), | |
| 496 | 493 | .flush = osq_flush, |
| 497 | 494 | }; |
| @@ -135,11 +135,9 @@ const FFCodec ff_pam_encoder = { · 134 unmodified lines | ||
| 135 | 135 | .p.id = AV_CODEC_ID_PAM, |
| 136 | 136 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 137 | 137 | FF_CODEC_ENCODE_CB(pam_encode_frame), |
| 138 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 139 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 140 | − AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, | |
| 141 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, | |
| 142 | − AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, | |
| 143 | − AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE | |
| 144 | − }, | |
| 138 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 139 | + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, | |
| 140 | + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, | |
| 141 | + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, | |
| 142 | + AV_PIX_FMT_MONOBLACK), | |
| 145 | 143 | }; |
| @@ -307,7 +307,5 @@ const FFCodec ff_pcm_bluray_decoder = { · 306 unmodified lines | ||
| 307 | 307 | .p.id = AV_CODEC_ID_PCM_BLURAY, |
| 308 | 308 | FF_CODEC_DECODE_CB(pcm_bluray_decode_frame), |
| 309 | 309 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 310 | − .p.sample_fmts = (const enum AVSampleFormat[]){ | |
| 311 | − AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE | |
| 312 | − }, | |
| 310 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), | |
| 313 | 311 | }; |
| @@ -278,20 +278,12 @@ const FFCodec ff_pcm_bluray_encoder = { · 277 unmodified lines | ||
| 278 | 278 | .priv_data_size = sizeof(BlurayPCMEncContext), |
| 279 | 279 | .init = pcm_bluray_encode_init, |
| 280 | 280 | FF_CODEC_ENCODE_CB(pcm_bluray_encode_frame), |
| 281 | − .p.supported_samplerates = (const int[]) { 48000, 96000, 192000, 0 }, | |
| 282 | − .p.ch_layouts = (const AVChannelLayout[]) { | |
| 283 | − AV_CHANNEL_LAYOUT_MONO, | |
| 284 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 285 | − AV_CHANNEL_LAYOUT_SURROUND, | |
| 286 | − AV_CHANNEL_LAYOUT_2_1, | |
| 287 | − AV_CHANNEL_LAYOUT_4POINT0, | |
| 288 | − AV_CHANNEL_LAYOUT_2_2, | |
| 289 | − AV_CHANNEL_LAYOUT_5POINT0, | |
| 290 | − AV_CHANNEL_LAYOUT_5POINT1, | |
| 291 | − AV_CHANNEL_LAYOUT_7POINT0, | |
| 292 | − AV_CHANNEL_LAYOUT_7POINT1, | |
| 293 | − { 0 } }, | |
| 294 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 295 | − AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE }, | |
| 281 | + CODEC_SAMPLERATES(48000, 96000, 192000), | |
| 282 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, | |
| 283 | + AV_CHANNEL_LAYOUT_SURROUND, AV_CHANNEL_LAYOUT_2_1, | |
| 284 | + AV_CHANNEL_LAYOUT_4POINT0, AV_CHANNEL_LAYOUT_2_2, | |
| 285 | + AV_CHANNEL_LAYOUT_5POINT0, AV_CHANNEL_LAYOUT_5POINT1, | |
| 286 | + AV_CHANNEL_LAYOUT_7POINT0, AV_CHANNEL_LAYOUT_7POINT1), | |
| 287 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), | |
| 296 | 288 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 297 | 289 | }; |
| @@ -305,7 +305,5 @@ const FFCodec ff_pcm_dvd_decoder = { · 304 unmodified lines | ||
| 305 | 305 | FF_CODEC_DECODE_CB(pcm_dvd_decode_frame), |
| 306 | 306 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 307 | 307 | AV_CODEC_CAP_DR1, |
| 308 | − .p.sample_fmts = (const enum AVSampleFormat[]) { | |
| 309 | − AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_NONE | |
| 310 | − }, | |
| 308 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), | |
| 311 | 309 | }; |
| @@ -181,13 +181,8 @@ const FFCodec ff_pcm_dvd_encoder = { · 180 unmodified lines | ||
| 181 | 181 | .priv_data_size = sizeof(PCMDVDContext), |
| 182 | 182 | .init = pcm_dvd_encode_init, |
| 183 | 183 | FF_CODEC_ENCODE_CB(pcm_dvd_encode_frame), |
| 184 | − .p.supported_samplerates = (const int[]) { 48000, 96000, 0}, | |
| 185 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, | |
| 186 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 187 | − AV_CHANNEL_LAYOUT_5POINT1, | |
| 188 | − AV_CHANNEL_LAYOUT_7POINT1, | |
| 189 | − { 0 } }, | |
| 190 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 191 | − AV_SAMPLE_FMT_S32, | |
| 192 | − AV_SAMPLE_FMT_NONE }, | |
| 184 | + CODEC_SAMPLERATES(48000, 96000), | |
| 185 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO, | |
| 186 | + AV_CHANNEL_LAYOUT_5POINT1, AV_CHANNEL_LAYOUT_7POINT1), | |
| 187 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), | |
| 193 | 188 | }; |
| @@ -557,8 +557,7 @@ const FFCodec ff_ ## name_ ## _encoder = { \ · 556 unmodified lines | ||
| 557 | 557 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, \ |
| 558 | 558 | .init = pcm_encode_init, \ |
| 559 | 559 | FF_CODEC_ENCODE_CB(pcm_encode_frame), \ |
| 560 | − .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ | |
| 561 | − AV_SAMPLE_FMT_NONE }, \ | |
| 560 | + CODEC_SAMPLEFMTS(sample_fmt_), \ | |
| 562 | 561 | } |
| 563 | 562 | |
| 564 | 563 | #define PCM_ENCODER_2(cf, id, sample_fmt, name, long_name) \ |
| @@ -579,8 +578,7 @@ const FFCodec ff_ ## name_ ## _decoder = { \ · 14 unmodified lines | ||
| 579 | 578 | .init = pcm_decode_init, \ |
| 580 | 579 | FF_CODEC_DECODE_CB(pcm_decode_frame), \ |
| 581 | 580 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_PARAM_CHANGE, \ |
| 582 | − .p.sample_fmts = (const enum AVSampleFormat[]){ sample_fmt_, \ | |
| 583 | − AV_SAMPLE_FMT_NONE }, \ | |
| 581 | + CODEC_SAMPLEFMTS(sample_fmt_), \ | |
| 584 | 582 | } |
| 585 | 583 | |
| 586 | 584 | #define PCM_DECODER_2(cf, id, sample_fmt, name, long_name) \ |
| @@ -199,11 +199,9 @@ const FFCodec ff_pcx_encoder = { · 198 unmodified lines | ||
| 199 | 199 | .p.id = AV_CODEC_ID_PCX, |
| 200 | 200 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 201 | 201 | FF_CODEC_ENCODE_CB(pcx_encode_frame), |
| 202 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 203 | − AV_PIX_FMT_RGB24, | |
| 204 | − AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, | |
| 205 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, | |
| 206 | − AV_PIX_FMT_MONOBLACK, | |
| 207 | − AV_PIX_FMT_NONE | |
| 208 | − }, | |
| 202 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, | |
| 203 | + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, | |
| 204 | + AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, | |
| 205 | + AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, | |
| 206 | + AV_PIX_FMT_MONOBLACK), | |
| 209 | 207 | }; |
| @@ -1233,14 +1233,12 @@ const FFCodec ff_png_encoder = { · 1232 unmodified lines | ||
| 1233 | 1233 | .init = png_enc_init, |
| 1234 | 1234 | .close = png_enc_close, |
| 1235 | 1235 | FF_CODEC_ENCODE_CB(encode_png), |
| 1236 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1237 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 1238 | − AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, | |
| 1239 | − AV_PIX_FMT_PAL8, | |
| 1240 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, | |
| 1241 | − AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, | |
| 1242 | − AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_NONE | |
| 1243 | − }, | |
| 1236 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 1237 | + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, | |
| 1238 | + AV_PIX_FMT_PAL8, | |
| 1239 | + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, | |
| 1240 | + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, | |
| 1241 | + AV_PIX_FMT_MONOBLACK), | |
| 1244 | 1242 | .p.priv_class = &pngenc_class, |
| 1245 | 1243 | .caps_internal = FF_CODEC_CAP_ICC_PROFILES, |
| 1246 | 1244 | }; |
| @@ -1256,14 +1254,11 @@ const FFCodec ff_apng_encoder = { · 9 unmodified lines | ||
| 1256 | 1254 | .init = png_enc_init, |
| 1257 | 1255 | .close = png_enc_close, |
| 1258 | 1256 | FF_CODEC_ENCODE_CB(encode_apng), |
| 1259 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1260 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 1261 | − AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, | |
| 1262 | − AV_PIX_FMT_PAL8, | |
| 1263 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, | |
| 1264 | − AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE, | |
| 1265 | − AV_PIX_FMT_NONE | |
| 1266 | − }, | |
| 1257 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 1258 | + AV_PIX_FMT_RGB48BE, AV_PIX_FMT_RGBA64BE, | |
| 1259 | + AV_PIX_FMT_PAL8, | |
| 1260 | + AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, | |
| 1261 | + AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_YA16BE), | |
| 1267 | 1262 | .p.priv_class = &pngenc_class, |
| 1268 | 1263 | .caps_internal = FF_CODEC_CAP_ICC_PROFILES, |
| 1269 | 1264 | }; |
| @@ -231,9 +231,7 @@ const FFCodec ff_pgm_encoder = { · 230 unmodified lines | ||
| 231 | 231 | .p.id = AV_CODEC_ID_PGM, |
| 232 | 232 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 233 | 233 | FF_CODEC_ENCODE_CB(pnm_encode_frame), |
| 234 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 235 | − AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_NONE | |
| 236 | − }, | |
| 234 | + CODEC_PIXFMTS(AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY16BE), | |
| 237 | 235 | }; |
| 238 | 236 | #endif |
| 239 | 237 | |
| @@ -245,9 +243,7 @@ const FFCodec ff_pgmyuv_encoder = { · 5 unmodified lines | ||
| 245 | 243 | .p.id = AV_CODEC_ID_PGMYUV, |
| 246 | 244 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 247 | 245 | FF_CODEC_ENCODE_CB(pnm_encode_frame), |
| 248 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 249 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE, AV_PIX_FMT_NONE | |
| 250 | − }, | |
| 246 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV420P16BE), | |
| 251 | 247 | }; |
| 252 | 248 | #endif |
| 253 | 249 | |
| @@ -259,9 +255,7 @@ const FFCodec ff_ppm_encoder = { · 5 unmodified lines | ||
| 259 | 255 | .p.id = AV_CODEC_ID_PPM, |
| 260 | 256 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 261 | 257 | FF_CODEC_ENCODE_CB(pnm_encode_frame), |
| 262 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 263 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE, AV_PIX_FMT_NONE | |
| 264 | − }, | |
| 258 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48BE), | |
| 265 | 259 | }; |
| 266 | 260 | #endif |
| 267 | 261 | |
| @@ -273,8 +267,7 @@ const FFCodec ff_pbm_encoder = { · 5 unmodified lines | ||
| 273 | 267 | .p.id = AV_CODEC_ID_PBM, |
| 274 | 268 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 275 | 269 | FF_CODEC_ENCODE_CB(pnm_encode_frame), |
| 276 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_MONOWHITE, | |
| 277 | − AV_PIX_FMT_NONE }, | |
| 270 | + CODEC_PIXFMTS(AV_PIX_FMT_MONOWHITE), | |
| 278 | 271 | }; |
| 279 | 272 | #endif |
| 280 | 273 | |
| @@ -286,11 +279,8 @@ const FFCodec ff_pfm_encoder = { · 5 unmodified lines | ||
| 286 | 279 | .p.id = AV_CODEC_ID_PFM, |
| 287 | 280 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 288 | 281 | FF_CODEC_ENCODE_CB(pnm_encode_frame), |
| 289 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32LE, | |
| 290 | − AV_PIX_FMT_GRAYF32LE, | |
| 291 | − AV_PIX_FMT_GBRPF32BE, | |
| 292 | − AV_PIX_FMT_GRAYF32BE, | |
| 293 | − AV_PIX_FMT_NONE }, | |
| 282 | + CODEC_PIXFMTS(AV_PIX_FMT_GBRPF32LE, AV_PIX_FMT_GRAYF32LE, | |
| 283 | + AV_PIX_FMT_GBRPF32BE, AV_PIX_FMT_GRAYF32BE), | |
| 294 | 284 | }; |
| 295 | 285 | #endif |
| 296 | 286 | |
| @@ -313,8 +303,6 @@ const FFCodec ff_phm_encoder = { · 16 unmodified lines | ||
| 313 | 303 | .priv_data_size = sizeof(PHMEncContext), |
| 314 | 304 | .init = phm_enc_init, |
| 315 | 305 | FF_CODEC_ENCODE_CB(pnm_encode_frame), |
| 316 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_GBRPF32, | |
| 317 | − AV_PIX_FMT_GRAYF32, | |
| 318 | − AV_PIX_FMT_NONE }, | |
| 306 | + CODEC_PIXFMTS(AV_PIX_FMT_GBRPF32, AV_PIX_FMT_GRAYF32), | |
| 319 | 307 | }; |
| 320 | 308 | #endif |
| @@ -955,7 +955,7 @@ const FFCodec ff_prores_aw_encoder = { · 954 unmodified lines | ||
| 955 | 955 | .p.id = AV_CODEC_ID_PRORES, |
| 956 | 956 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | |
| 957 | 957 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 958 | − .p.pix_fmts = pix_fmts, | |
| 958 | + CODEC_PIXFMTS_ARRAY(pix_fmts), | |
| 959 | 959 | .color_ranges = AVCOL_RANGE_MPEG, |
| 960 | 960 | .priv_data_size = sizeof(ProresContext), |
| 961 | 961 | .init = prores_encode_init, |
| @@ -973,7 +973,7 @@ const FFCodec ff_prores_encoder = { · 11 unmodified lines | ||
| 973 | 973 | .p.id = AV_CODEC_ID_PRORES, |
| 974 | 974 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | |
| 975 | 975 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 976 | − .p.pix_fmts = pix_fmts, | |
| 976 | + CODEC_PIXFMTS_ARRAY(pix_fmts), | |
| 977 | 977 | .color_ranges = AVCOL_RANGE_MPEG, |
| 978 | 978 | .priv_data_size = sizeof(ProresContext), |
| 979 | 979 | .init = prores_encode_init, |
| @@ -1381,10 +1381,7 @@ const FFCodec ff_prores_ks_encoder = { · 1380 unmodified lines | ||
| 1381 | 1381 | FF_CODEC_ENCODE_CB(encode_frame), |
| 1382 | 1382 | .p.capabilities = AV_CODEC_CAP_SLICE_THREADS | AV_CODEC_CAP_FRAME_THREADS | |
| 1383 | 1383 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 1384 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1385 | − AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, | |
| 1386 | − AV_PIX_FMT_YUVA444P10, AV_PIX_FMT_NONE | |
| 1387 | − }, | |
| 1384 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV444P10, AV_PIX_FMT_YUVA444P10), | |
| 1388 | 1385 | .color_ranges = AVCOL_RANGE_MPEG, |
| 1389 | 1386 | .p.priv_class = &proresenc_class, |
| 1390 | 1387 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_prores_profiles), |
| @@ -165,6 +165,5 @@ const FFCodec ff_qoa_decoder = { · 164 unmodified lines | ||
| 165 | 165 | FF_CODEC_DECODE_CB(qoa_decode_frame), |
| 166 | 166 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 167 | 167 | AV_CODEC_CAP_DR1, |
| 168 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, | |
| 169 | − AV_SAMPLE_FMT_NONE }, | |
| 168 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 170 | 169 | }; |
| @@ -134,8 +134,5 @@ const FFCodec ff_qoi_encoder = { · 133 unmodified lines | ||
| 134 | 134 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | |
| 135 | 135 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 136 | 136 | FF_CODEC_ENCODE_CB(qoi_encode_frame), |
| 137 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 138 | − AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24, | |
| 139 | − AV_PIX_FMT_NONE | |
| 140 | − }, | |
| 137 | + CODEC_PIXFMTS(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24), | |
| 141 | 138 | }; |
| @@ -217,10 +217,7 @@ FFCodec ff_av1_qsv_encoder = { · 216 unmodified lines | ||
| 217 | 217 | FF_CODEC_ENCODE_CB(qsv_enc_frame), |
| 218 | 218 | .close = qsv_enc_close, |
| 219 | 219 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, |
| 220 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, | |
| 221 | − AV_PIX_FMT_P010, | |
| 222 | − AV_PIX_FMT_QSV, | |
| 223 | − AV_PIX_FMT_NONE }, | |
| 220 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_QSV), | |
| 224 | 221 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 225 | 222 | .p.priv_class = &class, |
| 226 | 223 | .defaults = qsv_enc_defaults, |
| @@ -199,9 +199,7 @@ const FFCodec ff_h264_qsv_encoder = { · 198 unmodified lines | ||
| 199 | 199 | FF_CODEC_ENCODE_CB(qsv_enc_frame), |
| 200 | 200 | .close = qsv_enc_close, |
| 201 | 201 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, |
| 202 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, | |
| 203 | − AV_PIX_FMT_QSV, | |
| 204 | − AV_PIX_FMT_NONE }, | |
| 202 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_QSV), | |
| 205 | 203 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 206 | 204 | .p.priv_class = &class, |
| 207 | 205 | .defaults = qsv_enc_defaults, |
| @@ -396,17 +396,10 @@ const FFCodec ff_hevc_qsv_encoder = { · 395 unmodified lines | ||
| 396 | 396 | FF_CODEC_ENCODE_CB(qsv_enc_frame), |
| 397 | 397 | .close = qsv_enc_close, |
| 398 | 398 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, |
| 399 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, | |
| 400 | − AV_PIX_FMT_P010, | |
| 401 | − AV_PIX_FMT_P012, | |
| 402 | − AV_PIX_FMT_YUYV422, | |
| 403 | − AV_PIX_FMT_Y210, | |
| 404 | − AV_PIX_FMT_QSV, | |
| 405 | − AV_PIX_FMT_BGRA, | |
| 406 | − AV_PIX_FMT_X2RGB10, | |
| 407 | − AV_PIX_FMT_VUYX, | |
| 408 | − AV_PIX_FMT_XV30, | |
| 409 | − AV_PIX_FMT_NONE }, | |
| 399 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_P012, | |
| 400 | + AV_PIX_FMT_YUYV422, AV_PIX_FMT_Y210, AV_PIX_FMT_QSV, | |
| 401 | + AV_PIX_FMT_BGRA, AV_PIX_FMT_X2RGB10, AV_PIX_FMT_VUYX, | |
| 402 | + AV_PIX_FMT_XV30), | |
| 410 | 403 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 411 | 404 | .p.priv_class = &class, |
| 412 | 405 | .defaults = qsv_enc_defaults, |
| @@ -88,11 +88,8 @@ const FFCodec ff_mjpeg_qsv_encoder = { · 87 unmodified lines | ||
| 88 | 88 | FF_CODEC_ENCODE_CB(qsv_enc_frame), |
| 89 | 89 | .close = qsv_enc_close, |
| 90 | 90 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, |
| 91 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, | |
| 92 | − AV_PIX_FMT_YUYV422, | |
| 93 | − AV_PIX_FMT_BGRA, | |
| 94 | − AV_PIX_FMT_QSV, | |
| 95 | − AV_PIX_FMT_NONE }, | |
| 91 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_YUYV422, AV_PIX_FMT_BGRA, | |
| 92 | + AV_PIX_FMT_QSV), | |
| 96 | 93 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 97 | 94 | .p.priv_class = &class, |
| 98 | 95 | .defaults = qsv_enc_defaults, |
| @@ -102,9 +102,7 @@ const FFCodec ff_mpeg2_qsv_encoder = { · 101 unmodified lines | ||
| 102 | 102 | FF_CODEC_ENCODE_CB(qsv_enc_frame), |
| 103 | 103 | .close = qsv_enc_close, |
| 104 | 104 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, |
| 105 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, | |
| 106 | − AV_PIX_FMT_QSV, | |
| 107 | − AV_PIX_FMT_NONE }, | |
| 105 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_QSV), | |
| 108 | 106 | .color_ranges = AVCOL_RANGE_MPEG, |
| 109 | 107 | .p.priv_class = &class, |
| 110 | 108 | .defaults = qsv_enc_defaults, |
| @@ -111,12 +111,8 @@ const FFCodec ff_vp9_qsv_encoder = { · 110 unmodified lines | ||
| 111 | 111 | FF_CODEC_ENCODE_CB(qsv_enc_frame), |
| 112 | 112 | .close = qsv_enc_close, |
| 113 | 113 | .p.capabilities = AV_CODEC_CAP_DELAY | AV_CODEC_CAP_HYBRID, |
| 114 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_NV12, | |
| 115 | − AV_PIX_FMT_P010, | |
| 116 | − AV_PIX_FMT_VUYX, | |
| 117 | − AV_PIX_FMT_QSV, | |
| 118 | − AV_PIX_FMT_XV30, | |
| 119 | − AV_PIX_FMT_NONE }, | |
| 114 | + CODEC_PIXFMTS(AV_PIX_FMT_NV12, AV_PIX_FMT_P010, AV_PIX_FMT_VUYX, | |
| 115 | + AV_PIX_FMT_QSV, AV_PIX_FMT_XV30), | |
| 120 | 116 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 121 | 117 | .p.priv_class = &class, |
| 122 | 118 | .defaults = qsv_enc_defaults, |
| @@ -409,8 +409,7 @@ const FFCodec ff_qtrle_encoder = { · 408 unmodified lines | ||
| 409 | 409 | .init = qtrle_encode_init, |
| 410 | 410 | FF_CODEC_ENCODE_CB(qtrle_encode_frame), |
| 411 | 411 | .close = qtrle_encode_end, |
| 412 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 413 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, AV_PIX_FMT_GRAY8, AV_PIX_FMT_NONE | |
| 414 | − }, | |
| 412 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_ARGB, | |
| 413 | + AV_PIX_FMT_GRAY8), | |
| 415 | 414 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 416 | 415 | }; |
| @@ -99,7 +99,7 @@ const FFCodec ff_r210_encoder = { · 98 unmodified lines | ||
| 99 | 99 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 100 | 100 | .init = encode_init, |
| 101 | 101 | FF_CODEC_ENCODE_CB(encode_frame), |
| 102 | − .p.pix_fmts = pix_fmt, | |
| 102 | + CODEC_PIXFMTS_ARRAY(pix_fmt), | |
| 103 | 103 | }; |
| 104 | 104 | #endif |
| 105 | 105 | #if CONFIG_R10K_ENCODER |
| @@ -111,7 +111,7 @@ const FFCodec ff_r10k_encoder = { · 5 unmodified lines | ||
| 111 | 111 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 112 | 112 | .init = encode_init, |
| 113 | 113 | FF_CODEC_ENCODE_CB(encode_frame), |
| 114 | − .p.pix_fmts = pix_fmt, | |
| 114 | + CODEC_PIXFMTS_ARRAY(pix_fmt), | |
| 115 | 115 | }; |
| 116 | 116 | #endif |
| 117 | 117 | #if CONFIG_AVRP_ENCODER |
| @@ -123,6 +123,6 @@ const FFCodec ff_avrp_encoder = { · 5 unmodified lines | ||
| 123 | 123 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 124 | 124 | .init = encode_init, |
| 125 | 125 | FF_CODEC_ENCODE_CB(encode_frame), |
| 126 | − .p.pix_fmts = pix_fmt, | |
| 126 | + CODEC_PIXFMTS_ARRAY(pix_fmt), | |
| 127 | 127 | }; |
| 128 | 128 | #endif |
| @@ -546,8 +546,7 @@ const FFCodec ff_ra_144_encoder = { · 545 unmodified lines | ||
| 546 | 546 | .init = ra144_encode_init, |
| 547 | 547 | FF_CODEC_ENCODE_CB(ra144_encode_frame), |
| 548 | 548 | .close = ra144_encode_close, |
| 549 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 550 | − AV_SAMPLE_FMT_NONE }, | |
| 551 | − .p.supported_samplerates = (const int[]){ 8000, 0 }, | |
| 552 | − .p.ch_layouts = (const AVChannelLayout[]){ AV_CHANNEL_LAYOUT_MONO, { 0 } }, | |
| 549 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 550 | + CODEC_SAMPLERATES(8000), | |
| 551 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO), | |
| 553 | 552 | }; |
| @@ -523,7 +523,6 @@ const FFCodec ff_ralf_decoder = { · 522 unmodified lines | ||
| 523 | 523 | .flush = decode_flush, |
| 524 | 524 | .p.capabilities = AV_CODEC_CAP_CHANNEL_CONF | |
| 525 | 525 | AV_CODEC_CAP_DR1, |
| 526 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 527 | − AV_SAMPLE_FMT_NONE }, | |
| 526 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 528 | 527 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 529 | 528 | }; |
| @@ -198,6 +198,5 @@ const FFCodec ff_roq_dpcm_encoder = { · 197 unmodified lines | ||
| 198 | 198 | .init = roq_dpcm_encode_init, |
| 199 | 199 | FF_CODEC_ENCODE_CB(roq_dpcm_encode_frame), |
| 200 | 200 | .close = roq_dpcm_encode_close, |
| 201 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, | |
| 202 | − AV_SAMPLE_FMT_NONE }, | |
| 201 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 203 | 202 | }; |
| @@ -1126,8 +1126,7 @@ const FFCodec ff_roq_encoder = { · 1125 unmodified lines | ||
| 1126 | 1126 | .init = roq_encode_init, |
| 1127 | 1127 | FF_CODEC_ENCODE_CB(roq_encode_frame), |
| 1128 | 1128 | .close = roq_encode_end, |
| 1129 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUVJ444P, | |
| 1130 | − AV_PIX_FMT_NONE }, | |
| 1129 | + CODEC_PIXFMTS(AV_PIX_FMT_YUVJ444P), | |
| 1131 | 1130 | .color_ranges = AVCOL_RANGE_JPEG, |
| 1132 | 1131 | .p.priv_class = &roq_class, |
| 1133 | 1132 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -884,6 +884,5 @@ const FFCodec ff_rpza_encoder = { · 883 unmodified lines | ||
| 884 | 884 | .init = rpza_encode_init, |
| 885 | 885 | FF_CODEC_ENCODE_CB(rpza_encode_frame), |
| 886 | 886 | .close = rpza_encode_end, |
| 887 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_RGB555, | |
| 888 | − AV_PIX_FMT_NONE}, | |
| 887 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB555), | |
| 889 | 888 | }; |
| @@ -77,6 +77,6 @@ const FFCodec ff_rv10_encoder = { · 76 unmodified lines | ||
| 77 | 77 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 78 | 78 | .close = ff_mpv_encode_end, |
| 79 | 79 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 80 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 80 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 81 | 81 | .color_ranges = AVCOL_RANGE_MPEG, |
| 82 | 82 | }; |
| @@ -74,6 +74,6 @@ const FFCodec ff_rv20_encoder = { · 73 unmodified lines | ||
| 74 | 74 | FF_CODEC_ENCODE_CB(ff_mpv_encode_picture), |
| 75 | 75 | .close = ff_mpv_encode_end, |
| 76 | 76 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 77 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 77 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 78 | 78 | .color_ranges = AVCOL_RANGE_MPEG, |
| 79 | 79 | }; |
| @@ -181,8 +181,6 @@ const FFCodec ff_s302m_encoder = { · 180 unmodified lines | ||
| 181 | 181 | .priv_data_size = sizeof(S302MEncContext), |
| 182 | 182 | .init = s302m_encode_init, |
| 183 | 183 | FF_CODEC_ENCODE_CB(s302m_encode2_frame), |
| 184 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S32, | |
| 185 | − AV_SAMPLE_FMT_S16, | |
| 186 | − AV_SAMPLE_FMT_NONE }, | |
| 187 | − .p.supported_samplerates = (const int[]) { 48000, 0 }, | |
| 184 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S32, AV_SAMPLE_FMT_S16), | |
| 185 | + CODEC_SAMPLERATES(48000), | |
| 188 | 186 | }; |
| @@ -371,10 +371,7 @@ const FFCodec ff_sbc_decoder = { · 370 unmodified lines | ||
| 371 | 371 | .init = sbc_decode_init, |
| 372 | 372 | FF_CODEC_DECODE_CB(sbc_decode_frame), |
| 373 | 373 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 374 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, | |
| 375 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 376 | − { 0 } }, | |
| 377 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 378 | − AV_SAMPLE_FMT_NONE }, | |
| 379 | − .p.supported_samplerates = (const int[]) { 16000, 32000, 44100, 48000, 0 }, | |
| 374 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 375 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P), | |
| 376 | + CODEC_SAMPLERATES(16000, 32000, 44100, 48000), | |
| 380 | 377 | }; |
| @@ -356,12 +356,9 @@ const FFCodec ff_sbc_encoder = { · 355 unmodified lines | ||
| 356 | 356 | .priv_data_size = sizeof(SBCEncContext), |
| 357 | 357 | .init = sbc_encode_init, |
| 358 | 358 | FF_CODEC_ENCODE_CB(sbc_encode_frame), |
| 359 | − .p.ch_layouts = (const AVChannelLayout[]) { AV_CHANNEL_LAYOUT_MONO, | |
| 360 | − AV_CHANNEL_LAYOUT_STEREO, | |
| 361 | − { 0 } }, | |
| 362 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16, | |
| 363 | − AV_SAMPLE_FMT_NONE }, | |
| 364 | − .p.supported_samplerates = sbc_samplerates, | |
| 359 | + CODEC_CH_LAYOUTS(AV_CHANNEL_LAYOUT_MONO, AV_CHANNEL_LAYOUT_STEREO), | |
| 360 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 361 | + CODEC_SAMPLERATES_ARRAY(sbc_samplerates), | |
| 365 | 362 | .p.priv_class = &sbc_class, |
| 366 | 363 | .p.profiles = NULL_IF_CONFIG_SMALL(ff_sbc_profiles), |
| 367 | 364 | }; |
| @@ -281,11 +281,8 @@ const FFCodec ff_sgi_encoder = { · 280 unmodified lines | ||
| 281 | 281 | .p.priv_class = &sgi_class, |
| 282 | 282 | .init = encode_init, |
| 283 | 283 | FF_CODEC_ENCODE_CB(encode_frame), |
| 284 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 285 | − AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 286 | − AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, | |
| 287 | − AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE, | |
| 288 | − AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY8, | |
| 289 | − AV_PIX_FMT_NONE | |
| 290 | − }, | |
| 284 | + CODEC_PIXFMTS(AV_PIX_FMT_RGB24, AV_PIX_FMT_RGBA, | |
| 285 | + AV_PIX_FMT_RGB48LE, AV_PIX_FMT_RGB48BE, | |
| 286 | + AV_PIX_FMT_RGBA64LE, AV_PIX_FMT_RGBA64BE, | |
| 287 | + AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_GRAY16BE, AV_PIX_FMT_GRAY8), | |
| 291 | 288 | }; |
| @@ -821,7 +821,5 @@ const FFCodec ff_shorten_decoder = { · 820 unmodified lines | ||
| 821 | 821 | AV_CODEC_CAP_SUBFRAMES | |
| 822 | 822 | #endif |
| 823 | 823 | AV_CODEC_CAP_DR1, |
| 824 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 825 | − AV_SAMPLE_FMT_U8P, | |
| 826 | − AV_SAMPLE_FMT_NONE }, | |
| 824 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_U8P), | |
| 827 | 825 | }; |
| @@ -599,6 +599,5 @@ const FFCodec ff_smc_encoder = { · 598 unmodified lines | ||
| 599 | 599 | .init = smc_encode_init, |
| 600 | 600 | FF_CODEC_ENCODE_CB(smc_encode_frame), |
| 601 | 601 | .close = smc_encode_end, |
| 602 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, | |
| 603 | − AV_PIX_FMT_NONE}, | |
| 602 | + CODEC_PIXFMTS(AV_PIX_FMT_PAL8), | |
| 604 | 603 | }; |
| @@ -2141,11 +2141,8 @@ const FFCodec ff_snow_encoder = { · 2140 unmodified lines | ||
| 2141 | 2141 | .init = encode_init, |
| 2142 | 2142 | FF_CODEC_ENCODE_CB(encode_frame), |
| 2143 | 2143 | .close = encode_end, |
| 2144 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 2145 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV444P, | |
| 2146 | − AV_PIX_FMT_GRAY8, | |
| 2147 | − AV_PIX_FMT_NONE | |
| 2148 | − }, | |
| 2144 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV444P, | |
| 2145 | + AV_PIX_FMT_GRAY8), | |
| 2149 | 2146 | .color_ranges = AVCOL_RANGE_MPEG, |
| 2150 | 2147 | .p.priv_class = &snowenc_class, |
| 2151 | 2148 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| @@ -1102,7 +1102,7 @@ const FFCodec ff_sonic_encoder = { · 1101 unmodified lines | ||
| 1102 | 1102 | .priv_data_size = sizeof(SonicContext), |
| 1103 | 1103 | .init = sonic_encode_init, |
| 1104 | 1104 | FF_CODEC_ENCODE_CB(sonic_encode_frame), |
| 1105 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, | |
| 1105 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 1106 | 1106 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1107 | 1107 | .close = sonic_encode_close, |
| 1108 | 1108 | }; |
| @@ -1119,7 +1119,7 @@ const FFCodec ff_sonic_ls_encoder = { · 10 unmodified lines | ||
| 1119 | 1119 | .priv_data_size = sizeof(SonicContext), |
| 1120 | 1120 | .init = sonic_encode_init, |
| 1121 | 1121 | FF_CODEC_ENCODE_CB(sonic_encode_frame), |
| 1122 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }, | |
| 1122 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16), | |
| 1123 | 1123 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1124 | 1124 | .close = sonic_encode_close, |
| 1125 | 1125 | }; |
| @@ -285,8 +285,5 @@ const FFCodec ff_speedhq_encoder = { · 284 unmodified lines | ||
| 285 | 285 | .close = ff_mpv_encode_end, |
| 286 | 286 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 287 | 287 | .color_ranges = AVCOL_RANGE_MPEG, |
| 288 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 289 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P, | |
| 290 | − AV_PIX_FMT_NONE | |
| 291 | − }, | |
| 288 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV444P), | |
| 292 | 289 | }; |
| @@ -218,9 +218,8 @@ const FFCodec ff_sunrast_encoder = { · 217 unmodified lines | ||
| 218 | 218 | .init = sunrast_encode_init, |
| 219 | 219 | FF_CODEC_ENCODE_CB(sunrast_encode_frame), |
| 220 | 220 | .p.priv_class = &sunrast_class, |
| 221 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_BGR24, | |
| 222 | − AV_PIX_FMT_PAL8, | |
| 223 | − AV_PIX_FMT_GRAY8, | |
| 224 | − AV_PIX_FMT_MONOWHITE, | |
| 225 | − AV_PIX_FMT_NONE }, | |
| 221 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24, | |
| 222 | + AV_PIX_FMT_PAL8, | |
| 223 | + AV_PIX_FMT_GRAY8, | |
| 224 | + AV_PIX_FMT_MONOWHITE), | |
| 226 | 225 | }; |
| @@ -745,8 +745,7 @@ const FFCodec ff_svq1_encoder = { · 744 unmodified lines | ||
| 745 | 745 | .init = svq1_encode_init, |
| 746 | 746 | FF_CODEC_ENCODE_CB(svq1_encode_frame), |
| 747 | 747 | .close = svq1_encode_end, |
| 748 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV410P, | |
| 749 | − AV_PIX_FMT_NONE }, | |
| 748 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV410P), | |
| 750 | 749 | .color_ranges = AVCOL_RANGE_MPEG, |
| 751 | 750 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 752 | 751 | }; |
| @@ -950,8 +950,5 @@ const FFCodec ff_tak_decoder = { · 949 unmodified lines | ||
| 950 | 950 | FF_CODEC_DECODE_CB(tak_decode_frame), |
| 951 | 951 | UPDATE_THREAD_CONTEXT(update_thread_context), |
| 952 | 952 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | AV_CODEC_CAP_CHANNEL_CONF, |
| 953 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 954 | − AV_SAMPLE_FMT_S16P, | |
| 955 | − AV_SAMPLE_FMT_S32P, | |
| 956 | − AV_SAMPLE_FMT_NONE }, | |
| 953 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P), | |
| 957 | 954 | }; |
| @@ -215,8 +215,6 @@ const FFCodec ff_targa_encoder = { · 214 unmodified lines | ||
| 215 | 215 | .p.priv_class = &targa_class, |
| 216 | 216 | .init = targa_encode_init, |
| 217 | 217 | FF_CODEC_ENCODE_CB(targa_encode_frame), |
| 218 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 219 | − AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8, | |
| 220 | − AV_PIX_FMT_NONE | |
| 221 | − }, | |
| 218 | + CODEC_PIXFMTS(AV_PIX_FMT_BGR24, AV_PIX_FMT_BGRA, AV_PIX_FMT_RGB555LE, | |
| 219 | + AV_PIX_FMT_GRAY8, AV_PIX_FMT_PAL8), | |
| 222 | 220 | }; |
| @@ -580,15 +580,13 @@ const FFCodec ff_tiff_encoder = { · 579 unmodified lines | ||
| 580 | 580 | .init = encode_init, |
| 581 | 581 | .close = encode_close, |
| 582 | 582 | FF_CODEC_ENCODE_CB(encode_frame), |
| 583 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 583 | + CODEC_PIXFMTS( | |
| 584 | 584 | AV_PIX_FMT_RGB24, AV_PIX_FMT_RGB48LE, AV_PIX_FMT_PAL8, |
| 585 | 585 | AV_PIX_FMT_RGBA, AV_PIX_FMT_RGBA64LE, |
| 586 | 586 | AV_PIX_FMT_GRAY8, AV_PIX_FMT_GRAY8A, AV_PIX_FMT_GRAY16LE, AV_PIX_FMT_YA16LE, |
| 587 | 587 | AV_PIX_FMT_MONOBLACK, AV_PIX_FMT_MONOWHITE, |
| 588 | 588 | AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV440P, AV_PIX_FMT_YUV444P, |
| 589 | − AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P, | |
| 590 | − AV_PIX_FMT_NONE | |
| 591 | − }, | |
| 589 | + AV_PIX_FMT_YUV410P, AV_PIX_FMT_YUV411P), | |
| 592 | 590 | .color_ranges = AVCOL_RANGE_MPEG, |
| 593 | 591 | .p.priv_class = &tiffenc_class, |
| 594 | 592 | }; |
| @@ -211,8 +211,5 @@ const FFCodec ff_tta_encoder = { · 210 unmodified lines | ||
| 211 | 211 | .init = tta_encode_init, |
| 212 | 212 | .close = tta_encode_close, |
| 213 | 213 | FF_CODEC_ENCODE_CB(tta_encode_frame), |
| 214 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8, | |
| 215 | − AV_SAMPLE_FMT_S16, | |
| 216 | − AV_SAMPLE_FMT_S32, | |
| 217 | − AV_SAMPLE_FMT_NONE }, | |
| 214 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8, AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_S32), | |
| 218 | 215 | }; |
| @@ -423,7 +423,6 @@ const FFCodec ff_twinvq_decoder = { · 422 unmodified lines | ||
| 423 | 423 | .close = ff_twinvq_decode_close, |
| 424 | 424 | FF_CODEC_DECODE_CB(ff_twinvq_decode_frame), |
| 425 | 425 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 426 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 427 | − AV_SAMPLE_FMT_NONE }, | |
| 426 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 428 | 427 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 429 | 428 | }; |
| @@ -671,10 +671,8 @@ const FFCodec ff_utvideo_encoder = { · 670 unmodified lines | ||
| 671 | 671 | .init = utvideo_encode_init, |
| 672 | 672 | FF_CODEC_ENCODE_CB(utvideo_encode_frame), |
| 673 | 673 | .close = utvideo_encode_close, |
| 674 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 675 | − AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, AV_PIX_FMT_YUV422P, | |
| 676 | − AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE | |
| 677 | − }, | |
| 674 | + CODEC_PIXFMTS(AV_PIX_FMT_GBRP, AV_PIX_FMT_GBRAP, | |
| 675 | + AV_PIX_FMT_YUV422P, AV_PIX_FMT_YUV420P, AV_PIX_FMT_YUV444P), | |
| 678 | 676 | .color_ranges = AVCOL_RANGE_MPEG, |
| 679 | 677 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 680 | 678 | }; |
| @@ -117,5 +117,5 @@ const FFCodec ff_v210_encoder = { · 116 unmodified lines | ||
| 117 | 117 | .priv_data_size = sizeof(V210EncContext), |
| 118 | 118 | .init = encode_init, |
| 119 | 119 | FF_CODEC_ENCODE_CB(encode_frame), |
| 120 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P, AV_PIX_FMT_NONE }, | |
| 120 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV422P10, AV_PIX_FMT_YUV422P), | |
| 121 | 121 | }; |
| @@ -80,5 +80,5 @@ const FFCodec ff_v308_encoder = { · 79 unmodified lines | ||
| 80 | 80 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 81 | 81 | .init = v308_encode_init, |
| 82 | 82 | FF_CODEC_ENCODE_CB(v308_encode_frame), |
| 83 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P, AV_PIX_FMT_NONE }, | |
| 83 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV444P), | |
| 84 | 84 | }; |
| @@ -79,5 +79,5 @@ const FFCodec ff_v408_encoder = { · 78 unmodified lines | ||
| 79 | 79 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 80 | 80 | .init = v408_encode_init, |
| 81 | 81 | FF_CODEC_ENCODE_CB(v408_encode_frame), |
| 82 | − .p.pix_fmts = pix_fmt, | |
| 82 | + CODEC_PIXFMTS_ARRAY(pix_fmt), | |
| 83 | 83 | }; |
| @@ -84,5 +84,5 @@ const FFCodec ff_v410_encoder = { · 83 unmodified lines | ||
| 84 | 84 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 85 | 85 | .init = v410_encode_init, |
| 86 | 86 | FF_CODEC_ENCODE_CB(v410_encode_frame), |
| 87 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV444P10, AV_PIX_FMT_NONE }, | |
| 87 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV444P10), | |
| 88 | 88 | }; |
| @@ -1049,10 +1049,7 @@ const FFCodec ff_av1_vaapi_encoder = { · 1048 unmodified lines | ||
| 1049 | 1049 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 1050 | 1050 | FF_CODEC_CAP_INIT_CLEANUP, |
| 1051 | 1051 | .defaults = vaapi_encode_av1_defaults, |
| 1052 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1053 | − AV_PIX_FMT_VAAPI, | |
| 1054 | − AV_PIX_FMT_NONE, | |
| 1055 | − }, | |
| 1052 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 1056 | 1053 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 1057 | 1054 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 1058 | 1055 | .p.wrapper_name = "vaapi", |
| @@ -1178,10 +1178,7 @@ const FFCodec ff_h264_vaapi_encoder = { · 1177 unmodified lines | ||
| 1178 | 1178 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 1179 | 1179 | FF_CODEC_CAP_INIT_CLEANUP, |
| 1180 | 1180 | .defaults = vaapi_encode_h264_defaults, |
| 1181 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1182 | − AV_PIX_FMT_VAAPI, | |
| 1183 | − AV_PIX_FMT_NONE, | |
| 1184 | − }, | |
| 1181 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 1185 | 1182 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 1186 | 1183 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 1187 | 1184 | .p.wrapper_name = "vaapi", |
| @@ -1209,10 +1209,7 @@ const FFCodec ff_hevc_vaapi_encoder = { · 1208 unmodified lines | ||
| 1209 | 1209 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 1210 | 1210 | FF_CODEC_CAP_INIT_CLEANUP, |
| 1211 | 1211 | .defaults = vaapi_encode_h265_defaults, |
| 1212 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1213 | − AV_PIX_FMT_VAAPI, | |
| 1214 | − AV_PIX_FMT_NONE, | |
| 1215 | − }, | |
| 1212 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 1216 | 1213 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 1217 | 1214 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 1218 | 1215 | .p.wrapper_name = "vaapi", |
| @@ -582,10 +582,7 @@ const FFCodec ff_mjpeg_vaapi_encoder = { · 581 unmodified lines | ||
| 582 | 582 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 583 | 583 | FF_CODEC_CAP_INIT_CLEANUP, |
| 584 | 584 | .defaults = vaapi_encode_mjpeg_defaults, |
| 585 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 586 | − AV_PIX_FMT_VAAPI, | |
| 587 | − AV_PIX_FMT_NONE, | |
| 588 | − }, | |
| 585 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 589 | 586 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 590 | 587 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 591 | 588 | .p.wrapper_name = "vaapi", |
| @@ -705,10 +705,7 @@ const FFCodec ff_mpeg2_vaapi_encoder = { · 704 unmodified lines | ||
| 705 | 705 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 706 | 706 | FF_CODEC_CAP_INIT_CLEANUP, |
| 707 | 707 | .defaults = vaapi_encode_mpeg2_defaults, |
| 708 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 709 | − AV_PIX_FMT_VAAPI, | |
| 710 | − AV_PIX_FMT_NONE, | |
| 711 | − }, | |
| 708 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 712 | 709 | .color_ranges = AVCOL_RANGE_MPEG, |
| 713 | 710 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 714 | 711 | .p.wrapper_name = "vaapi", |
| @@ -260,10 +260,7 @@ const FFCodec ff_vp8_vaapi_encoder = { · 259 unmodified lines | ||
| 260 | 260 | .caps_internal = FF_CODEC_CAP_NOT_INIT_THREADSAFE | |
| 261 | 261 | FF_CODEC_CAP_INIT_CLEANUP, |
| 262 | 262 | .defaults = vaapi_encode_vp8_defaults, |
| 263 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 264 | − AV_PIX_FMT_VAAPI, | |
| 265 | − AV_PIX_FMT_NONE, | |
| 266 | − }, | |
| 263 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 267 | 264 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 268 | 265 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 269 | 266 | .p.wrapper_name = "vaapi", |
| @@ -318,10 +318,7 @@ const FFCodec ff_vp9_vaapi_encoder = { · 317 unmodified lines | ||
| 318 | 318 | FF_CODEC_CAP_INIT_CLEANUP, |
| 319 | 319 | .defaults = vaapi_encode_vp9_defaults, |
| 320 | 320 | .color_ranges = AVCOL_RANGE_MPEG, /* FIXME: implement tagging */ |
| 321 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 322 | − AV_PIX_FMT_VAAPI, | |
| 323 | − AV_PIX_FMT_NONE, | |
| 324 | − }, | |
| 321 | + CODEC_PIXFMTS(AV_PIX_FMT_VAAPI), | |
| 325 | 322 | .hw_configs = ff_vaapi_encode_hw_configs, |
| 326 | 323 | .p.wrapper_name = "vaapi", |
| 327 | 324 | }; |
| @@ -161,8 +161,6 @@ const FFCodec ff_vbn_encoder = { · 160 unmodified lines | ||
| 161 | 161 | .init = vbn_init, |
| 162 | 162 | FF_CODEC_ENCODE_CB(vbn_encode), |
| 163 | 163 | .priv_data_size = sizeof(VBNContext), |
| 164 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 165 | − AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24, AV_PIX_FMT_NONE, | |
| 166 | − }, | |
| 164 | + CODEC_PIXFMTS(AV_PIX_FMT_RGBA, AV_PIX_FMT_RGB24), | |
| 167 | 165 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 168 | 166 | }; |
| @@ -1244,6 +1244,6 @@ const FFCodec ff_vc2_encoder = { · 1243 unmodified lines | ||
| 1244 | 1244 | FF_CODEC_ENCODE_CB(vc2_encode_frame), |
| 1245 | 1245 | .p.priv_class = &vc2enc_class, |
| 1246 | 1246 | .defaults = vc2enc_defaults, |
| 1247 | − .p.pix_fmts = allowed_pix_fmts, | |
| 1247 | + CODEC_PIXFMTS_ARRAY(allowed_pix_fmts), | |
| 1248 | 1248 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 1249 | 1249 | }; |
| @@ -2974,7 +2974,7 @@ const FFCodec ff_h264_videotoolbox_encoder = { · 2973 unmodified lines | ||
| 2974 | 2974 | .p.id = AV_CODEC_ID_H264, |
| 2975 | 2975 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 2976 | 2976 | .priv_data_size = sizeof(VTEncContext), |
| 2977 | − .p.pix_fmts = avc_pix_fmts, | |
| 2977 | + CODEC_PIXFMTS_ARRAY(avc_pix_fmts), | |
| 2978 | 2978 | .defaults = vt_defaults, |
| 2979 | 2979 | .init = vtenc_init, |
| 2980 | 2980 | FF_CODEC_ENCODE_CB(vtenc_frame), |
| @@ -3012,7 +3012,7 @@ const FFCodec ff_hevc_videotoolbox_encoder = { · 31 unmodified lines | ||
| 3012 | 3012 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 3013 | 3013 | AV_CODEC_CAP_HARDWARE, |
| 3014 | 3014 | .priv_data_size = sizeof(VTEncContext), |
| 3015 | − .p.pix_fmts = hevc_pix_fmts, | |
| 3015 | + CODEC_PIXFMTS_ARRAY(hevc_pix_fmts), | |
| 3016 | 3016 | .defaults = vt_defaults, |
| 3017 | 3017 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 3018 | 3018 | .init = vtenc_init, |
| @@ -3053,7 +3053,7 @@ const FFCodec ff_prores_videotoolbox_encoder = { · 34 unmodified lines | ||
| 3053 | 3053 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY | |
| 3054 | 3054 | AV_CODEC_CAP_HARDWARE, |
| 3055 | 3055 | .priv_data_size = sizeof(VTEncContext), |
| 3056 | − .p.pix_fmts = prores_pix_fmts, | |
| 3056 | + CODEC_PIXFMTS_ARRAY(prores_pix_fmts), | |
| 3057 | 3057 | .defaults = vt_defaults, |
| 3058 | 3058 | .color_ranges = AVCOL_RANGE_MPEG | AVCOL_RANGE_JPEG, |
| 3059 | 3059 | .init = vtenc_init, |
| @@ -1894,7 +1894,6 @@ const FFCodec ff_vorbis_decoder = { · 1893 unmodified lines | ||
| 1894 | 1894 | .flush = vorbis_decode_flush, |
| 1895 | 1895 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_CHANNEL_CONF, |
| 1896 | 1896 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1897 | − .p.ch_layouts = ff_vorbis_ch_layouts, | |
| 1898 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1899 | − AV_SAMPLE_FMT_NONE }, | |
| 1897 | + CODEC_CH_LAYOUTS_ARRAY(ff_vorbis_ch_layouts), | |
| 1898 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1900 | 1899 | }; |
| @@ -1312,7 +1312,6 @@ const FFCodec ff_vorbis_encoder = { · 1311 unmodified lines | ||
| 1312 | 1312 | .init = vorbis_encode_init, |
| 1313 | 1313 | FF_CODEC_ENCODE_CB(vorbis_encode_frame), |
| 1314 | 1314 | .close = vorbis_encode_close, |
| 1315 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_FLTP, | |
| 1316 | − AV_SAMPLE_FMT_NONE }, | |
| 1315 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1317 | 1316 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1318 | 1317 | }; |
| @@ -1658,10 +1658,7 @@ const FFCodec ff_h264_vulkan_encoder = { · 1657 unmodified lines | ||
| 1658 | 1658 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 1659 | 1659 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1660 | 1660 | .defaults = vulkan_encode_h264_defaults, |
| 1661 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1662 | − AV_PIX_FMT_VULKAN, | |
| 1663 | − AV_PIX_FMT_NONE, | |
| 1664 | − }, | |
| 1661 | + CODEC_PIXFMTS(AV_PIX_FMT_VULKAN), | |
| 1665 | 1662 | .hw_configs = ff_vulkan_encode_hw_configs, |
| 1666 | 1663 | .p.wrapper_name = "vulkan", |
| 1667 | 1664 | }; |
| @@ -1785,10 +1785,7 @@ const FFCodec ff_hevc_vulkan_encoder = { · 1784 unmodified lines | ||
| 1785 | 1785 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 1786 | 1786 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1787 | 1787 | .defaults = vulkan_encode_h265_defaults, |
| 1788 | − .p.pix_fmts = (const enum AVPixelFormat[]) { | |
| 1789 | − AV_PIX_FMT_VULKAN, | |
| 1790 | − AV_PIX_FMT_NONE, | |
| 1791 | − }, | |
| 1788 | + CODEC_PIXFMTS(AV_PIX_FMT_VULKAN), | |
| 1792 | 1789 | .hw_configs = ff_vulkan_encode_hw_configs, |
| 1793 | 1790 | .p.wrapper_name = "vulkan", |
| 1794 | 1791 | }; |
| @@ -885,7 +885,5 @@ const FFCodec ff_wavarc_decoder = { · 884 unmodified lines | ||
| 885 | 885 | AV_CODEC_CAP_SUBFRAMES | |
| 886 | 886 | #endif |
| 887 | 887 | AV_CODEC_CAP_DELAY, |
| 888 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_U8P, | |
| 889 | − AV_SAMPLE_FMT_S16P, | |
| 890 | − AV_SAMPLE_FMT_NONE }, | |
| 888 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P), | |
| 891 | 889 | }; |
| @@ -2980,9 +2980,6 @@ const FFCodec ff_wavpack_encoder = { · 2979 unmodified lines | ||
| 2980 | 2980 | .init = wavpack_encode_init, |
| 2981 | 2981 | FF_CODEC_ENCODE_CB(wavpack_encode_frame), |
| 2982 | 2982 | .close = wavpack_encode_close, |
| 2983 | − .p.sample_fmts = (const enum AVSampleFormat[]){ AV_SAMPLE_FMT_U8P, | |
| 2984 | − AV_SAMPLE_FMT_S16P, | |
| 2985 | − AV_SAMPLE_FMT_S32P, | |
| 2986 | − AV_SAMPLE_FMT_FLTP, | |
| 2987 | − AV_SAMPLE_FMT_NONE }, | |
| 2983 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_U8P, AV_SAMPLE_FMT_S16P, | |
| 2984 | + AV_SAMPLE_FMT_S32P, AV_SAMPLE_FMT_FLTP), | |
| 2988 | 2985 | }; |
| @@ -83,8 +83,5 @@ const FFCodec ff_wbmp_encoder = { · 82 unmodified lines | ||
| 83 | 83 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_FRAME_THREADS | |
| 84 | 84 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 85 | 85 | FF_CODEC_ENCODE_CB(wbmp_encode_frame), |
| 86 | − .p.pix_fmts = (const enum AVPixelFormat[]){ | |
| 87 | − AV_PIX_FMT_MONOBLACK, | |
| 88 | − AV_PIX_FMT_NONE | |
| 89 | − }, | |
| 86 | + CODEC_PIXFMTS(AV_PIX_FMT_MONOBLACK), | |
| 90 | 87 | }; |
| @@ -1023,8 +1023,7 @@ const FFCodec ff_wmav1_decoder = { · 1022 unmodified lines | ||
| 1023 | 1023 | FF_CODEC_DECODE_CB(wma_decode_superframe), |
| 1024 | 1024 | .flush = flush, |
| 1025 | 1025 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 1026 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1027 | − AV_SAMPLE_FMT_NONE }, | |
| 1026 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1028 | 1027 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1029 | 1028 | }; |
| 1030 | 1029 | #endif |
| @@ -1040,8 +1039,7 @@ const FFCodec ff_wmav2_decoder = { · 9 unmodified lines | ||
| 1040 | 1039 | FF_CODEC_DECODE_CB(wma_decode_superframe), |
| 1041 | 1040 | .flush = flush, |
| 1042 | 1041 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 1043 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 1044 | − AV_SAMPLE_FMT_NONE }, | |
| 1042 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 1045 | 1043 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1046 | 1044 | }; |
| 1047 | 1045 | #endif |
| @@ -446,8 +446,7 @@ const FFCodec ff_wmav1_encoder = { · 445 unmodified lines | ||
| 446 | 446 | .init = encode_init, |
| 447 | 447 | FF_CODEC_ENCODE_CB(encode_superframe), |
| 448 | 448 | .close = ff_wma_end, |
| 449 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 450 | − AV_SAMPLE_FMT_NONE }, | |
| 449 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 451 | 450 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 452 | 451 | }; |
| 453 | 452 | #endif |
| @@ -462,8 +461,7 @@ const FFCodec ff_wmav2_encoder = { · 8 unmodified lines | ||
| 462 | 461 | .init = encode_init, |
| 463 | 462 | FF_CODEC_ENCODE_CB(encode_superframe), |
| 464 | 463 | .close = ff_wma_end, |
| 465 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 466 | − AV_SAMPLE_FMT_NONE }, | |
| 464 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 467 | 465 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 468 | 466 | }; |
| 469 | 467 | #endif |
| @@ -1341,7 +1341,5 @@ const FFCodec ff_wmalossless_decoder = { · 1340 unmodified lines | ||
| 1341 | 1341 | #endif |
| 1342 | 1342 | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 1343 | 1343 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 1344 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_S16P, | |
| 1345 | − AV_SAMPLE_FMT_S32P, | |
| 1346 | − AV_SAMPLE_FMT_NONE }, | |
| 1344 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_S16P, AV_SAMPLE_FMT_S32P), | |
| 1347 | 1345 | }; |
| @@ -2106,8 +2106,7 @@ const FFCodec ff_wmapro_decoder = { · 2105 unmodified lines | ||
| 2106 | 2106 | #endif |
| 2107 | 2107 | AV_CODEC_CAP_DR1, |
| 2108 | 2108 | .flush = wmapro_flush, |
| 2109 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 2110 | − AV_SAMPLE_FMT_NONE }, | |
| 2109 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 2111 | 2110 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2112 | 2111 | }; |
| 2113 | 2112 | |
| @@ -2126,8 +2125,7 @@ const FFCodec ff_xma1_decoder = { · 12 unmodified lines | ||
| 2126 | 2125 | AV_CODEC_CAP_SUBFRAMES | |
| 2127 | 2126 | #endif |
| 2128 | 2127 | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 2129 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 2130 | − AV_SAMPLE_FMT_NONE }, | |
| 2128 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 2131 | 2129 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2132 | 2130 | }; |
| 2133 | 2131 | |
| @@ -2146,7 +2144,6 @@ const FFCodec ff_xma2_decoder = { · 12 unmodified lines | ||
| 2146 | 2144 | AV_CODEC_CAP_SUBFRAMES | |
| 2147 | 2145 | #endif |
| 2148 | 2146 | AV_CODEC_CAP_DR1 | AV_CODEC_CAP_DELAY, |
| 2149 | − .p.sample_fmts = (const enum AVSampleFormat[]) { AV_SAMPLE_FMT_FLTP, | |
| 2150 | − AV_SAMPLE_FMT_NONE }, | |
| 2147 | + CODEC_SAMPLEFMTS(AV_SAMPLE_FMT_FLTP), | |
| 2151 | 2148 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 2152 | 2149 | }; |
| @@ -250,6 +250,5 @@ const FFCodec ff_wmv2_encoder = { · 249 unmodified lines | ||
| 250 | 250 | .close = ff_mpv_encode_end, |
| 251 | 251 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 252 | 252 | .color_ranges = AVCOL_RANGE_MPEG, |
| 253 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV420P, | |
| 254 | − AV_PIX_FMT_NONE }, | |
| 253 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 255 | 254 | }; |
| @@ -93,6 +93,5 @@ const FFCodec ff_xbm_encoder = { · 92 unmodified lines | ||
| 93 | 93 | .p.id = AV_CODEC_ID_XBM, |
| 94 | 94 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 95 | 95 | FF_CODEC_ENCODE_CB(xbm_encode_frame), |
| 96 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, | |
| 97 | − AV_PIX_FMT_NONE }, | |
| 96 | + CODEC_PIXFMTS(AV_PIX_FMT_MONOWHITE), | |
| 98 | 97 | }; |
| @@ -217,7 +217,7 @@ const FFCodec ff_xface_encoder = { · 216 unmodified lines | ||
| 217 | 217 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 218 | 218 | .p.id = AV_CODEC_ID_XFACE, |
| 219 | 219 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 220 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE, AV_PIX_FMT_NONE }, | |
| 220 | + CODEC_PIXFMTS(AV_PIX_FMT_MONOWHITE), | |
| 221 | 221 | .priv_data_size = sizeof(XFaceContext), |
| 222 | 222 | FF_CODEC_ENCODE_CB(xface_encode_frame), |
| 223 | 223 | }; |
| @@ -219,26 +219,12 @@ const FFCodec ff_xwd_encoder = { · 218 unmodified lines | ||
| 219 | 219 | .p.id = AV_CODEC_ID_XWD, |
| 220 | 220 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 221 | 221 | FF_CODEC_ENCODE_CB(xwd_encode_frame), |
| 222 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_BGRA, | |
| 223 | − AV_PIX_FMT_RGBA, | |
| 224 | − AV_PIX_FMT_ARGB, | |
| 225 | − AV_PIX_FMT_ABGR, | |
| 226 | − AV_PIX_FMT_RGB24, | |
| 227 | − AV_PIX_FMT_BGR24, | |
| 228 | − AV_PIX_FMT_RGB565BE, | |
| 229 | − AV_PIX_FMT_RGB565LE, | |
| 230 | − AV_PIX_FMT_BGR565BE, | |
| 231 | − AV_PIX_FMT_BGR565LE, | |
| 232 | − AV_PIX_FMT_RGB555BE, | |
| 233 | − AV_PIX_FMT_RGB555LE, | |
| 234 | − AV_PIX_FMT_BGR555BE, | |
| 235 | − AV_PIX_FMT_BGR555LE, | |
| 236 | − AV_PIX_FMT_RGB8, | |
| 237 | − AV_PIX_FMT_BGR8, | |
| 238 | − AV_PIX_FMT_RGB4_BYTE, | |
| 239 | − AV_PIX_FMT_BGR4_BYTE, | |
| 240 | − AV_PIX_FMT_PAL8, | |
| 241 | − AV_PIX_FMT_GRAY8, | |
| 242 | − AV_PIX_FMT_MONOWHITE, | |
| 243 | − AV_PIX_FMT_NONE }, | |
| 222 | + CODEC_PIXFMTS(AV_PIX_FMT_BGRA, AV_PIX_FMT_RGBA, AV_PIX_FMT_ARGB, | |
| 223 | + AV_PIX_FMT_ABGR, AV_PIX_FMT_RGB24, AV_PIX_FMT_BGR24, | |
| 224 | + AV_PIX_FMT_RGB565BE, AV_PIX_FMT_RGB565LE, AV_PIX_FMT_BGR565BE, | |
| 225 | + AV_PIX_FMT_BGR565LE, AV_PIX_FMT_RGB555BE, AV_PIX_FMT_RGB555LE, | |
| 226 | + AV_PIX_FMT_BGR555BE, AV_PIX_FMT_BGR555LE, | |
| 227 | + AV_PIX_FMT_RGB8, AV_PIX_FMT_BGR8, | |
| 228 | + AV_PIX_FMT_RGB4_BYTE, AV_PIX_FMT_BGR4_BYTE, | |
| 229 | + AV_PIX_FMT_PAL8, AV_PIX_FMT_GRAY8, AV_PIX_FMT_MONOWHITE), | |
| 244 | 230 | }; |
| @@ -85,6 +85,5 @@ const FFCodec ff_y41p_encoder = { · 84 unmodified lines | ||
| 85 | 85 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 86 | 86 | .init = y41p_encode_init, |
| 87 | 87 | FF_CODEC_ENCODE_CB(y41p_encode_frame), |
| 88 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_YUV411P, | |
| 89 | − AV_PIX_FMT_NONE }, | |
| 88 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV411P), | |
| 90 | 89 | }; |
| @@ -76,6 +76,6 @@ const FFCodec ff_yuv4_encoder = { · 75 unmodified lines | ||
| 76 | 76 | .p.type = AVMEDIA_TYPE_VIDEO, |
| 77 | 77 | .p.id = AV_CODEC_ID_YUV4, |
| 78 | 78 | .p.capabilities = AV_CODEC_CAP_DR1 | AV_CODEC_CAP_ENCODER_REORDERED_OPAQUE, |
| 79 | − .p.pix_fmts = (const enum AVPixelFormat[]){ AV_PIX_FMT_YUV420P, AV_PIX_FMT_NONE }, | |
| 79 | + CODEC_PIXFMTS(AV_PIX_FMT_YUV420P), | |
| 80 | 80 | FF_CODEC_ENCODE_CB(yuv4_encode_frame), |
| 81 | 81 | }; |
| @@ -410,6 +410,17 @@ static av_cold int encode_init(AVCodecContext *avctx) · 409 unmodified lines | ||
| 410 | 410 | return ff_deflate_init(&c->zstream, lvl, avctx); |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | +static const enum AVPixelFormat zmbv_pixfmts_list[] = { | |
| 414 | + AV_PIX_FMT_PAL8, | |
| 415 | + AV_PIX_FMT_RGB555LE, | |
| 416 | + AV_PIX_FMT_RGB565LE, | |
| 417 | +#ifdef ZMBV_ENABLE_24BPP | |
| 418 | + AV_PIX_FMT_BGR24, | |
| 419 | +#endif | |
| 420 | + AV_PIX_FMT_BGR0, | |
| 421 | + AV_PIX_FMT_NONE | |
| 422 | +}; | |
| 423 | + | |
| 413 | 424 | const FFCodec ff_zmbv_encoder = { |
| 414 | 425 | .p.name = "zmbv", |
| 415 | 426 | CODEC_LONG_NAME("Zip Motion Blocks Video"), |
| @@ -420,13 +431,6 @@ const FFCodec ff_zmbv_encoder = { · 4 unmodified lines | ||
| 420 | 431 | .init = encode_init, |
| 421 | 432 | FF_CODEC_ENCODE_CB(encode_frame), |
| 422 | 433 | .close = encode_end, |
| 423 | − .p.pix_fmts = (const enum AVPixelFormat[]) { AV_PIX_FMT_PAL8, | |
| 424 | − AV_PIX_FMT_RGB555LE, | |
| 425 | − AV_PIX_FMT_RGB565LE, | |
| 426 | −#ifdef ZMBV_ENABLE_24BPP | |
| 427 | − AV_PIX_FMT_BGR24, | |
| 428 | −#endif //ZMBV_ENABLE_24BPP | |
| 429 | − AV_PIX_FMT_BGR0, | |
| 430 | − AV_PIX_FMT_NONE }, | |
| 434 | + CODEC_PIXFMTS_ARRAY(zmbv_pixfmts_list), | |
| 431 | 435 | .caps_internal = FF_CODEC_CAP_INIT_CLEANUP, |
| 432 | 436 | }; |