Lines Matching refs:codec
20 #include "libavcodec/codec.h"
34 AV_LOG(msg, codec->name __VA_ARGS__); \
40 static int priv_data_size_wrong(const FFCodec *codec)
42 if (codec->priv_data_size < 0 ||
43 codec->p.priv_class && codec->priv_data_size < sizeof(AVClass*))
45 if (!codec->p.priv_class || !codec->p.priv_class->option)
47 for (const AVOption *opt = codec->p.priv_class->option; opt->name; opt++) {
48 if (opt->offset >= codec->priv_data_size ||
61 const AVCodec *codec = NULL;
64 while (codec = av_codec_iterate(&iter)) {
65 const FFCodec *const codec2 = ffcodec(codec);
69 if (!codec->name) {
71 avcodec_get_name(codec->id));
75 if (codec->type != AVMEDIA_TYPE_VIDEO &&
76 codec->type != AVMEDIA_TYPE_AUDIO &&
77 codec->type != AVMEDIA_TYPE_SUBTITLE)
79 get_type_string(codec->type));
80 if (codec->type != AVMEDIA_TYPE_AUDIO) {
81 if (codec->ch_layouts || codec->sample_fmts ||
82 codec->supported_samplerates)
83 ERR("Non-audio codec %s has audio-only fields set\n");
84 if (codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME |
87 ERR("Non-audio codec %s has audio-only capabilities set\n");
89 if (codec->type != AVMEDIA_TYPE_VIDEO) {
90 if (codec->pix_fmts || codec->supported_framerates)
91 ERR("Non-video codec %s has video-only fields set\n");
93 ERR("Non-video codec %s exports cropping\n");
96 !(codec->capabilities & AV_CODEC_CAP_SLICE_THREADS))
100 !(codec->capabilities & (AV_CODEC_CAP_FRAME_THREADS |
120 if (is_decoder != av_codec_is_decoder(codec) ||
121 is_encoder != av_codec_is_encoder(codec)) {
135 if ((codec->type == AVMEDIA_TYPE_SUBTITLE) != (codec2->cb_type == FF_CODEC_CB_TYPE_ENCODE_SUB))
139 if (codec->type == AVMEDIA_TYPE_AUDIO) {
140 if (!codec->sample_fmts) {
141 av_log(NULL, AV_LOG_FATAL, "Encoder %s is missing the sample_fmts field\n", codec->name);
150 codec->capabilities & (AV_CODEC_CAP_AVOID_PROBING |
155 if (codec->capabilities & AV_CODEC_CAP_FRAME_THREADS &&
156 codec->capabilities & AV_CODEC_CAP_ENCODER_FLUSH)
159 if ((codec->type == AVMEDIA_TYPE_SUBTITLE) != (codec2->cb_type == FF_CODEC_CB_TYPE_DECODE_SUB))
161 if (codec->type == AVMEDIA_TYPE_SUBTITLE && codec2->bsfs)
164 if (codec->capabilities & (AV_CODEC_CAP_SMALL_LAST_FRAME |
170 !(codec->capabilities & AV_CODEC_CAP_FRAME_THREADS))
175 ERR_EXT("Private context of codec %s is impossibly-sized (size %d).",
177 if (!(desc = avcodec_descriptor_get(codec->id))) {
179 } else if (desc->type != codec->type)
182 get_type_string(codec->type), get_type_string(desc->type));