typedef struct URLContext {
const AVClass *av_class; /**< information for av_log(). Set by url_open(). */
struct URLProtocol *prot;
void *priv_data;
char *filename; /**< specified URL */
int flags;
int max_packet_size; /**< if non zero, the stream is packetized with this max packet size */
int is_streamed; /**< true if streamed (no seek possible), default = false */
int is_connected;
AVIOInterruptCB interrupt_callback;
int64_t rw_timeout; /**< maximum time to wait for (network) read/write operation completion, in mcs */
} URLContext;
1、context 当前运行的上下文环境,其实说白了就是C的全局变量,用来保存当前模块运行时的多个函数需要使用到的共同变量。每一个模块里面都会有一个 context 来表示运行上下文,模块里面的具体实现都要使用到和其对应的 context 。file 协议是在 file.c 中实现的,里面有一个 FileContext, 和一个 AVClass file_class
2、URLContext 中的 av_class 是它自身的 AVClass ffurl_context_class
3、URLContext 中的 prot 是指向具体的协议的,URLProtocol 抽象出了一些接口,上层使用这些接口去操作数据,而在不同的协议里面实现了这些接口。打开的是一个文件协议的话,此时的 prot 就是指向