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

时间:2026-01-26

1. /* no more options to parse */

2. if (c == -1) break;

3.

4. /* unrecognized option */

5. if (c == '?'){

6. help();

7. return 1;

8. }

9.

10. /* dispatch the given options */

11. switch (option_index) {

12. /* h, help */

13. case 0:

14. case 1:

15. DBG("case 0,1\n");

16. help();

17. return 1;

18. break;

19.

20. /* d, device */

21. case 2:

22. case 3:

23. DBG("case 2,3\n");

24. dev = strdup(optarg);

25. break;

26.

27. /* r, resolution */

28. case 4:

29. case 5:

30. DBG("case 4,5\n");

31. width = -1;

32. height = -1;

33.

34. /* try to find the resolution in lookup table "resolutions" */ 35. for ( i=0; i < LENGTH_OF(resolutions); i++ ) {

36. if ( strcmp(resolutions[i].string, optarg) == 0 ) { 37. width = resolutions[i].width;

38. height = resolutions[i].height;

39. }

40. }

41. /* done if width and height were set */

42. if(width != -1 && height != -1)

43. break;

44. /* parse value as decimal value */

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

精彩图片

热门精选

大家正在看

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

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

支付方式:

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

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