AVInputFormat结构体

来源:互联网 发布:专业网络销售团队 编辑:程序博客网 时间:2024/05/17 07:43

typedef struct AVInputFormat

{

// 标示format的名字,比如,“mov” “mp4” 等。

const char *name;

// 标示具体的format对应的Contextsize,如:MovContext

int priv_data_size;

//具体的操作函数

int(*read_probe)(AVProbeData*);

int(*read_header)(struct AVFormatContext *,AVFormatParameters *ap);

int(*read_packet)(struct AVFormatContext *, AVPacket *pkt);

int(*read_close)(struct AVFormatContext*);

struct AVInputFormat *next;

} AVInputFormat;

Movmp4的主要结构的初始化如下:

AVInputFormat ff_mov_demuxer = {

       "mov,mp4,m4a,3gp,3g2,mj2",

      NULL_IF_CONFIG_SMALL("QuickTime/MPEG-4/Motion JPEG 2000 format"),

     sizeof(MOVContext),

     mov_probe,

     mov_read_header,

     mov_read_packet,

     mov_read_close,

     mov_read_seek,

}

说明:

AVInputFormat 是类似COM接口的数据结构,表示输入文件容器 格式,着重于功能函数,一种文件容器格式对应一个AVInputFormat结构,在程序运行时有多个实例。next变量用于把所有支持的输入文件容器格式连接成链表,便于遍历查找。priv_data_size标示具体的文件容器格式对应的Context的大小,在本例中是MovContext,这些具体的结够定义散落于各个.c文件中。

0 0
原创粉丝点击