- 论坛徽章:
- 0
|
这两天在阅读ffmpeg的代码( 真是痛苦的工作...... ),其中有一段代码,是这样写的:
const OptionDef options[] = {
/* main options */
{ "focus", HAS_ARG | OPT_VIDEO, {(void*)fcous}, "do focus", "focus" },
{ "osd", OPT_VIDEO, {(void*)Input_OSD}, "add input OSD function", "OSD" },
{ "motion", HAS_ARG | OPT_VIDEO, {(void*)read_motion_config}, "read motion configuration", "motion" },
{ "L", 0, {(void*)show_license}, "show license" },
{ "h", 0, {(void*)show_help}, "show help" },
。。。。。。。(中间的内容太多,省略掉)
{ NULL, },
};
其中的两个函数定义:
void Input_OSD(const char *arg)
{
do_OSD();
}
static void show_license(void)
{
show_banner();
printf(
"This library is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU Lesser General Public\n"
"License as published by the Free Software Foundation; either\n"
"version 2 of the License, or (at your option) any later version.\n"
"\n"
"This library is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU\n"
"Lesser General Public License for more details.\n"
"\n"
"You should have received a copy of the GNU Lesser General Public\n"
"License along with this library; if not, write to the Free Software\n"
"Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\n"
);
exit(1);
}
虽然能大概猜出这段程序是干什么的,不过细节的方面却一点儿都不明白,那个朋友能解释一下,而且Input_OSD函数是需要输入的,想上面那样什么都不写,到底是怎么通过的? |
|