68 last_iformat = &format->
next;
78 last_oformat = &format->
next;
88 ext = strrchr(filename,
'.');
95 const char *mime_type)
101 #if CONFIG_IMAGE2_MUXER
102 if (!short_name && filename &&
121 if (score > score_max) {
130 const char *filename,
const char *mime_type,
142 #if CONFIG_IMAGE2_MUXER
143 if (!strcmp(fmt->
name,
"image2") || !strcmp(fmt->
name,
"image2pipe")) {
174 int score, nodat = 0, score_max = 0;
178 lpd.
buf = zerobuffer;
199 if (nodat == 0) score =
FFMAX(score, 1);
209 if (score > score_max) {
212 }
else if (score == score_max)
217 *score_ret = score_max;
226 if (score_ret > *score_max) {
227 *score_max = score_ret;
240 const char *filename,
void *logctx,
241 unsigned int offset,
unsigned int max_probe_size)
245 int ret = 0, probe_size, buf_offset = 0;
253 "Specified probe size value %u cannot be < %u\n", max_probe_size,
PROBE_BUF_MIN);
257 if (offset >= max_probe_size)
263 pd.
mime_type = (
const char *)mime_type_opt;
275 probe_size =
FFMIN(probe_size << 1,
276 FFMAX(max_probe_size, probe_size + 1))) {
282 if ((ret =
avio_read(pb, buf + buf_offset,
283 probe_size - buf_offset)) < 0) {
292 if (buf_offset < offset)
305 "Format %s detected only with low score of %d, "
306 "misdetection possible!\n", (*fmt)->name, score);
309 "Format %s probed with size=%d and score=%d\n",
310 (*fmt)->name, probe_size, score);
312 FILE *f = fopen(
"probestat.tmp",
"ab");
313 fprintf(f,
"probe_size:%d format:%s score:%d filename:%s\n", probe_size, (*fmt)->name, score, filename);
329 return ret < 0 ? ret : score;
333 const char *filename,
void *logctx,
334 unsigned int offset,
unsigned int max_probe_size)
337 return ret < 0 ? ret : 0;