FFmpeg的IO分析
来源:互联网 发布:张逗张花 知乎 编辑:程序博客网 时间:2024/05/21 22:37
FFmpeg在使用之前,必须先调用av_register_all。
void av_register_all(void){ static AVOnce control = AV_ONCE_INIT; ff_thread_once(&control, register_all);}
这个函数又通过ff_thread_once调用了register_all,ff_thread_once的作用是保证register_all只会被调用一次。static void register_all(void){ avcodec_register_all(); /* (de)muxers */ REGISTER_MUXER (A64, a64); REGISTER_DEMUXER (AA, aa); ...}
avcode_register_all首先调用av_codec_register_all注册编解码器,然后是一系列REGISTER_MUXER和REGISTER_DEMUXER宏调用,这些宏是注册复用/解服用器。这些宏其实最后就是调用的av_register_input_format或者av_register_output_format
#define REGISTER_MUXER(X, x) \ { \ extern AVOutputFormat ff_##x##_muxer; \ if (CONFIG_##X##_MUXER) \ av_register_output_format(&ff_##x##_muxer); \ }#define REGISTER_DEMUXER(X, x) \ { \ extern AVInputFormat ff_##x##_demuxer; \ if (CONFIG_##X##_DEMUXER) \ av_register_input_format(&ff_##x##_demuxer); \ }从上面的宏定义可以看到,代码中预先定义了很多ff_xxx_muxer和ff_xxx_demuxer。这些都定义在libavformat目录下面相应的文件中,以a64为例
在a64.c文件的末尾定义如下
另外以上的注册的复用/解服用器存储在链表中,链表的表头表尾是全局变量,后续可以通过表头表尾指针查找相应的input/output format。
/** head of registered input format linked list */static AVInputFormat *first_iformat = NULL;/** head of registered output format linked list */static AVOutputFormat *first_oformat = NULL;static AVInputFormat **last_iformat = &first_iformat;static AVOutputFormat **last_oformat = &first_oformat;
阅读全文
0 0
- FFmpeg的IO分析
- ffmpeg的IO操作
- ffmpeg的IO操作
- ffmpeg的IO操作
- ffmpeg的IO操作
- ffmpeg的IO操作
- ffmpeg的filter分析
- ffmpeg关于io的输入输出操作
- FFmpeg的av_read_frame()的分析
- ffmpeg中guess_mv的分析
- FFMPEG的分析总体框架
- FFmpeg的库函数源代码分析
- FFMPEG分析
- FFmpeg分析
- 标准IO的函数分析
- IO-Polling的代码分析
- 性能分析之IO分析-jbd2引起的IO高
- FFMpeg的output_example.c例子分析
- java中String和int 的转换
- 剑指offer--(4) 重建二叉树
- 词向量源码解析:(5.8)ngram2vec源码解析之counts2ppmi等
- robotframework ‘ascii’ codec can’t decode byte 0xe6 in position 977
- 内存地址空间布局
- FFmpeg的IO分析
- Storm的相关概念
- java数据结构-集合
- 背包问题
- uva 1374 Power Calculus
- TensorFlow架构系统理解
- HDU 2054
- Single Number
- 《Volley源码分析》Part1、Volley的使用以及介绍