void *logctx= ap && ap->prealloced_context ? *ic_ptr : NULL; // 因为 ap == NULL, 所以 logctx 也 == NULL.
if (!fmt && (err = ff_probe_input_buffer(&pb, &fmt, filename, logctx, 0,
logctx ? (*ic_ptr)->probesize : 0)) < 0) {
goto fail;
}
// fmt == NULL 时才执行 ff_probe_input_buffer 函数, 因为 fmt 就等于NULL, 成立.
int ff_probe_input_buffer(ByteIOContext **pb, // 字节IO上下文, 执行url_fopen得到的 |
/* 读待探测的数据 */ |
int get_buffer(ByteIOContext *s, unsigned char *buf, int size); /* 省略部分代码 */ /* 省略部分代码 */ /* 填充缓冲 */ fill_buffer(s); /* 省略部分代码 */ } |
static void fill_buffer(ByteIOContext *s) /* 省略部分代码 */ |
*fmt = av_probe_input_format2(&pd, 1, &score); |
AVInputFormat *av_probe_input_format2(AVProbeData *pd, int is_opened, int *score_max) /* 这次 is_opened == 1, fmt1->flags设置AVFMT_NOFILE标志才时成立 */ /* 由于 h264_demuxer.flags == AVFMT_GENERIC_INDEX, 所以上面不成立, 继续执行 */ /* h264_demuxer.extensions = "h26l,h264,264" */ |
int av_match_ext(const char *filename, const char *extensions) |