看完注册函数后,可以轻松一下,这一篇解析init_opts函数。
init_opts()
先看该函数的出处 :声明在cmdutils,很明白了,该函数不属于ffmpeg本身,而是特定应用环境而编写的
该函数的说明如下:
/**
* Initialize the cmdutils option system, in particular
* allocate the *_opts contexts.
*/
* Initialize the cmdutils option system, in particular
* allocate the *_opts contexts.
*/
也就是特别的初始化命令系统吧,还有就是为 *_opts contexts这个指针分配内存
实现的源代码:
void init_opts(void)
{
#if CONFIG_SWSCALE
sws_opts = sws_getContext(16, 16, 0, 16, 16, 0, SWS_BICUBIC,
NULL, NULL, NULL);
#endif
}
一看源代码;原来作用就是初始化一个指针libswscale来处理图像缩放。这里先放在一边后面需要的时候再来看看它。