| 766 | }; |
| 767 | |
| 768 | int ff_default_get_supported_config(const AVCodecContext *avctx, |
| 769 | const AVCodec *codec, |
| 770 | enum AVCodecConfig config, |
| 771 | unsigned flags, |
| 772 | const void **out_configs, |
| 773 | int *out_num_configs) |
| 774 | { |
| 775 | const FFCodec *codec2 = ffcodec(codec); |
| 776 | |
| 777 | switch (config) { |
| 778 | FF_DISABLE_DEPRECATION_WARNINGS |
| 779 | case AV_CODEC_CONFIG_PIX_FORMAT: |
| 780 | WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, pix_fmts, pix_fmt, enum AVPixelFormat, pix_fmt == AV_PIX_FMT_NONE); |
| 781 | case AV_CODEC_CONFIG_FRAME_RATE: |
| 782 | WRAP_CONFIG(AVMEDIA_TYPE_VIDEO, supported_framerates, framerate, AVRational, framerate.num == 0); |
| 783 | case AV_CODEC_CONFIG_SAMPLE_RATE: |
| 784 | WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, supported_samplerates, samplerate, int, samplerate == 0); |
| 785 | case AV_CODEC_CONFIG_SAMPLE_FORMAT: |
| 786 | WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, sample_fmts, sample_fmt, enum AVSampleFormat, sample_fmt == AV_SAMPLE_FMT_NONE); |
| 787 | case AV_CODEC_CONFIG_CHANNEL_LAYOUT: |
| 788 | WRAP_CONFIG(AVMEDIA_TYPE_AUDIO, ch_layouts, ch_layout, AVChannelLayout, ch_layout.nb_channels == 0); |
| 789 | FF_ENABLE_DEPRECATION_WARNINGS |
| 790 | |
| 791 | case AV_CODEC_CONFIG_COLOR_RANGE: |
| 792 | if (codec->type != AVMEDIA_TYPE_VIDEO) |
| 793 | return AVERROR(EINVAL); |
| 794 | unsigned color_ranges = codec2->color_ranges; |
| 795 | if (color_ranges) |
| 796 | *out_configs = color_range_tab + offset_tab[color_ranges]; |
| 797 | else |
| 798 | *out_configs = NULL; |
| 799 | *out_num_configs = av_popcount(color_ranges); |
| 800 | return 0; |
| 801 | |
| 802 | case AV_CODEC_CONFIG_COLOR_SPACE: |
| 803 | *out_configs = NULL; |
| 804 | *out_num_configs = 0; |
| 805 | return 0; |
| 806 | |
| 807 | case AV_CODEC_CONFIG_ALPHA_MODE: |
| 808 | if (codec->type != AVMEDIA_TYPE_VIDEO) |
| 809 | return AVERROR(EINVAL); |
| 810 | unsigned alpha_modes = codec2->alpha_modes; |
| 811 | if (alpha_modes) |
| 812 | *out_configs = alpha_mode_tab + offset_tab[alpha_modes]; |
| 813 | else |
| 814 | *out_configs = NULL; |
| 815 | *out_num_configs = av_popcount(alpha_modes); |
| 816 | return 0; |
| 817 | |
| 818 | default: |
| 819 | return AVERROR(EINVAL); |
| 820 | } |
| 821 | } |
| 822 | |
| 823 | int avcodec_get_supported_config(const AVCodecContext *avctx, const AVCodec *codec, |
| 824 | enum AVCodecConfig config, unsigned flags, |
no test coverage detected