ffmpeg AVCodec结构体

avcodec_register_all();
codec = avcodec_find_decoder(CODEC_ID_H264);
if (!codec)
exit(
1);
context
= avcodec_alloc_context();
if (avcodec_open(context, codec) < 0)
exit(
1);

ffmpeg中编解码器是由链表结构管理的,链表的第一个节点是在文件libavcodec/util.c中声明的:  

  static AVCodec *first_avcodec = NULL;

对于编码器、与解码器的操作都是在围绕该链表执行的。

例如:AVCodec  *avcodec_find_decoder(enum CodecID id);  //遍历链表

posted on 2011-03-23 20:30  loveclover  阅读(1887)  评论(0编辑  收藏  举报

导航