友善之臂视频监控方案源码学习(5) - 输入控制(4)

时间:2026-01-26

14. } 15. }

16. }

(c) 利用getopt函数解析参数

[html] view plaincopy 1. reset_getopt();

2. while(1) {

3. int option_index = 0, c=0;

4. static struct option long_options[] = \

5. {

6. {"h", no_argument, 0, 0},

7. {"help", no_argument, 0, 0},

8. {"d", required_argument, 0, 0},

9. {"device", required_argument, 0, 0},

10. {"r", required_argument, 0, 0},

11. {"resolution", required_argument, 0, 0},

12. {"f", required_argument, 0, 0},

13. {"fps", required_argument, 0, 0},

14. {"y", no_argument, 0, 0},

15. {"yuv", no_argument, 0, 0},

16. {"q", required_argument, 0, 0},

17. {"quality", required_argument, 0, 0},

18. {"m", required_argument, 0, 0},

19. {"minimum_size", required_argument, 0, 0},

20. {"n", no_argument, 0, 0},

21. {"no_dynctrl", no_argument, 0, 0},

22. {"l", required_argument, 0, 0},

23. {"led", required_argument, 0, 0},

24. {0, 0, 0, 0}

25. };

26.

27. /* parsing all parameters according to the list above is sufficent */ 28. c = getopt_long_only(argc, argv, "", long_options, &option_index); 该过程详细请参考友善之臂视频监控方案源码学习(2) - 主程序实现细节一文描述。 (d) 根据输入的参数执行相应的操作:

[html] view plaincopy

友善之臂视频监控方案源码学习(5) - 输入控制(4).doc 将本文的Word文档下载到电脑

精彩图片

热门精选

大家正在看

× 游客快捷下载通道(下载后可以自由复制和排版)

限时特价:4.9 元/份 原价:20元

支付方式:

开通VIP包月会员 特价:19元/月

注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219