spcaview . spcaclient源码详解(2)

#include "utils.h"
#include "tcputils.h"
#include "spcaframe.h"                                  主要用到的自定义头文件

1 . 在main函数中:

/* default mmap */
 int grabMethod = 1;
 int format = VIDEO_PALETTE_YUV420P;                                 default  format

SPCASTATE funct                                                    根均输入的参数决定三种处理功能

funct = GRABBER;                                                default

if (strcmp (argv[i], "-i") == 0) {                                          输入参数 -i有效
   if (i + 1 >= argc) {
    printf ("No parameter specified with -i, aborting./n");
    exit (1);
   }
   inputfile = strdup (argv[i + 1]);
   funct = PLAYER ;                                                           执行play功能
  }

if (strcmp (argv[i], "-w") == 0) {                                            如果输入参数 -w有效
   if (i + 1 >= argc) {
    printf ("No parameter specified with -w, aborting./n");
    exit (1);
   }
   AdIpPort = strdup (argv[i + 1]);
   if(reportip(AdIpPort,AdIp,&ports) < 0)
   printf("error in port convertion /n");
   printf ("using Server %s Port %d /n",AdIp,ports);
   funct = CLIENT ;                                                               执行client功能
  }

switch (funct) {
 case PLAYER:
  {
  /* that is spcaview player */
  spcaPlay (inputfile, owidth, oheight); 
 }
 break;
 case GRABBER:
 {
  /* spcaview grabber */
  spcaGrab (outputfile,fourcc , videodevice, image_width,image_height, format, owidth, oheight,
   grabMethod, videoOn, audioout, videocomp, autobright, statOn, decodeOn);
 }
 break;
 case CLIENT:
 {
  spcaClient(AdIp,ports,owidth,oheight, statOn);
 }
 main函数结束,这里指对 spcaClient(AdIp,ports,owidth,oheight, statOn);
做详细解释。owidth和oheight是-m参数有效的时候传下来的特定W*H要求的参数,statOn为-t有效时打印统计数据,三述三个参数初始值都为0。

2 . SpcaClient()

to be continue.......................

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值