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")) {
172 int score, nodat = 0, score_max = 0;
176 lpd.
buf = zerobuffer;
197 if (nodat == 0) score =
FFMAX(score, 1);
207 if (score > score_max) {
210 }
else if (score == score_max)
215 *score_ret = score_max;
224 if (score_ret > *score_max) {
225 *score_max = score_ret;
238 const char *filename,
void *logctx,
239 unsigned int offset,
unsigned int max_probe_size)
243 int ret = 0, probe_size, buf_offset = 0;
251 "Specified probe size value %u cannot be < %u\n", max_probe_size,
PROBE_BUF_MIN);
255 if (offset >= max_probe_size)
261 pd.
mime_type = (
const char *)mime_type_opt;
273 probe_size =
FFMIN(probe_size << 1,
274 FFMAX(max_probe_size, probe_size + 1))) {
280 if ((ret =
avio_read(pb, buf + buf_offset,
281 probe_size - buf_offset)) < 0) {
290 if (buf_offset < offset)
303 "Format %s detected only with low score of %d, "
304 "misdetection possible!\n", (*fmt)->name, score);
307 "Format %s probed with size=%d and score=%d\n",
308 (*fmt)->name, probe_size, score);
310 FILE *f = fopen(
"probestat.tmp",
"ab");
311 fprintf(f,
"probe_size:%d format:%s score:%d filename:%s\n", probe_size, (*fmt)->name, score, filename);
327 return ret < 0 ? ret : score;
331 const char *filename,
void *logctx,
332 unsigned int offset,
unsigned int max_probe_size)
335 return ret < 0 ? ret : 0;