| 81 | } while (0) |
| 82 | |
| 83 | int main(void){ |
| 84 | void *iter = NULL; |
| 85 | const AVCodec *codec = NULL; |
| 86 | int ret = 0; |
| 87 | |
| 88 | while (codec = av_codec_iterate(&iter)) { |
| 89 | const FFCodec *const codec2 = ffcodec(codec); |
| 90 | const AVCodecDescriptor *desc; |
| 91 | int is_decoder = 0, is_encoder = 0; |
| 92 | |
| 93 | if (!codec->name) { |
| 94 | AV_LOG("Codec for format %s has no name\n", |
| 95 | avcodec_get_name(codec->id)); |
| 96 | ret = 1; |
| 97 | continue; |
| 98 | } |
| 99 | if (codec->type != AVMEDIA_TYPE_VIDEO && |
| 100 | codec->type != AVMEDIA_TYPE_AUDIO && |
| 101 | codec->type != AVMEDIA_TYPE_SUBTITLE) |
| 102 | ERR_EXT("Codec %s has unsupported type %s\n", |
| 103 | get_type_string(codec->type)); |
| 104 | if (codec->type != AVMEDIA_TYPE_AUDIO) { |
| 105 | FF_DISABLE_DEPRECATION_WARNINGS |
| 106 | if (codec->ch_layouts || codec->sample_fmts || |
| 107 | codec->supported_samplerates) |
| 108 | ERR("Non-audio codec %s has audio-only fields set\n"); |
| 109 | FF_ENABLE_DEPRECATION_WARNINGS |
| 110 | if (codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME | |
| 111 | AV_CODEC_CAP_CHANNEL_CONF | |
| 112 | AV_CODEC_CAP_VARIABLE_FRAME_SIZE)) |
| 113 | ERR("Non-audio codec %s has audio-only capabilities set\n"); |
| 114 | } else { |
| 115 | FF_DISABLE_DEPRECATION_WARNINGS |
| 116 | ARRAY_CHECK(supported_samplerates, sample_rate, int, sample_rate == 0, |
| 117 | sample_rate > 0, 1); |
| 118 | ARRAY_CHECK(sample_fmts, sample_fmt, enum AVSampleFormat, sample_fmt == AV_SAMPLE_FMT_NONE, |
| 119 | (unsigned)sample_fmt < AV_SAMPLE_FMT_NB, 1); |
| 120 | static const AVChannelLayout zero_channel_layout = { 0 }; |
| 121 | ARRAY_CHECK(ch_layouts, ch_layout, AVChannelLayout, ch_layout.nb_channels == 0, |
| 122 | av_channel_layout_check(&ch_layout), !memcmp(ptr, &zero_channel_layout, sizeof(ch_layout))); |
| 123 | FF_ENABLE_DEPRECATION_WARNINGS |
| 124 | } |
| 125 | if (codec->type != AVMEDIA_TYPE_VIDEO) { |
| 126 | FF_DISABLE_DEPRECATION_WARNINGS |
| 127 | if (codec->pix_fmts || codec->supported_framerates || |
| 128 | codec2->color_ranges || codec2->alpha_modes) |
| 129 | ERR("Non-video codec %s has video-only fields set\n"); |
| 130 | FF_ENABLE_DEPRECATION_WARNINGS |
| 131 | if (codec2->caps_internal & FF_CODEC_CAP_EXPORTS_CROPPING) |
| 132 | ERR("Non-video codec %s exports cropping\n"); |
| 133 | } |
| 134 | if (codec2->caps_internal & FF_CODEC_CAP_SLICE_THREAD_HAS_MF && |
| 135 | !(codec->capabilities & AV_CODEC_CAP_SLICE_THREADS)) |
| 136 | ERR("Codec %s wants mainfunction despite not being " |
| 137 | "slice-threading capable"); |
| 138 | if (codec2->caps_internal & FF_CODEC_CAP_AUTO_THREADS && |
| 139 | !(codec->capabilities & (AV_CODEC_CAP_FRAME_THREADS | |
| 140 | AV_CODEC_CAP_SLICE_THREADS | |
nothing calls this directly
no test coverage detected