MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / find_probe_decoder

Function find_probe_decoder

libavformat/demux.c:73–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

71}
72
73static const AVCodec *find_probe_decoder(AVFormatContext *s, const AVStream *st, enum AVCodecID codec_id)
74{
75 const AVCodec *codec;
76
77#if CONFIG_H264_DECODER
78 /* Other parts of the code assume this decoder to be used for h264,
79 * so force it if possible. */
80 if (codec_id == AV_CODEC_ID_H264)
81 return avcodec_find_decoder_by_name("h264");
82#endif
83
84 codec = ff_find_decoder(s, st, codec_id);
85 if (!codec)
86 return NULL;
87
88 if (codec->capabilities & AV_CODEC_CAP_AVOID_PROBING) {
89 const AVCodec *probe_codec = NULL;
90 void *iter = NULL;
91 while ((probe_codec = av_codec_iterate(&iter))) {
92 if (probe_codec->id == codec->id &&
93 av_codec_is_decoder(probe_codec) &&
94 !(probe_codec->capabilities & (AV_CODEC_CAP_AVOID_PROBING | AV_CODEC_CAP_EXPERIMENTAL))) {
95 return probe_codec;
96 }
97 }
98 }
99
100 return codec;
101}
102
103static int set_codec_from_probe_data(AVFormatContext *s, AVStream *st,
104 AVProbeData *pd)

Callers 2

try_decode_frameFunction · 0.85

Calls 4

ff_find_decoderFunction · 0.85
av_codec_iterateFunction · 0.85
av_codec_is_decoderFunction · 0.85

Tested by

no test coverage detected