camera/drv-v4l2.c
static int capture_query_channel(V4L2Capture *dev){
  struct v4l2_input argp;
  int i=0;
  int fd = dev->fd;
  int res;
  int n;
	
  while (1){
    argp.index = i;
    res = ioctl(fd,VIDIOC_ENUMINPUT,&argp);
    //printf("res=%d\n",res);
    if (res)
      break;
    i++;
  }
	
  n = i;
		
  if (i){	
    dev->channel_list = realloc(dev->channel_list,sizeof(char*) * (i+1));
		
    for (i=0;i<n;i++){
      argp.index = i;
      res = v4l_ioctl(dev,VIDIOC_ENUMINPUT,&argp);
      //			v4l_log(dev,"%s::channel[%s] %s\n",
      //					__func__,
      //					argp.name,
      //					argp.type == V4L2_INPUT_TYPE_TUNER ? "has tuner" : "hasn't tuner");
      dev->channel_list[i] = strdup((char *)argp.name);		
    }
    dev->channel_list[i] = 0;
  }
	
  dev->nChannels = n;
	
  return n;
}
/** Internal function. Should be involved by v4l_dev_open only.
 *  Return no. of channel supported.
 */
Internal function. Should be involved by v4l_dev_open only.
Return no. of channel supported.
Internal function . Should be involved by v4l_dev_open only . Return no . of channel supported .
static int capture_query_channel(V4L2Capture *dev){
  struct v4l2_input argp;
  int i=0;
  int fd = dev->fd;
  int res;
  int n;
  while (1){
    argp.index = i;
    res = ioctl(fd,VIDIOC_ENUMINPUT,&argp);
    if (res)
      break;
    i++;
  }
  n = i;
  if (i){	
    dev->channel_list = realloc(dev->channel_list,sizeof(char*) * (i+1));
    for (i=0;i<n;i++){
      argp.index = i;
      res = v4l_ioctl(dev,VIDIOC_ENUMINPUT,&argp);
      dev->channel_list[i] = strdup((char *)argp.name);		
    }
    dev->channel_list[i] = 0;
  }
  dev->nChannels = n;
  return n;
}
static int capture_query_channel ( V4L2Capture * dev ) { struct v4l2_input argp ; int i = 0 ; int fd = dev -> fd ; int res ; int n ; while ( 1 ) { argp . index = i ; res = ioctl ( fd , VIDIOC_ENUMINPUT , & argp ) ; if ( res ) break ; i ++ ; } n = i ; if ( i ) { dev -> channel_list = realloc ( dev -> channel_list , sizeof ( char * ) * ( i + 1 ) ) ; for ( i = 0 ; i < n ; i ++ ) { argp . index = i ; res = v4l_ioctl ( dev , VIDIOC_ENUMINPUT , & argp ) ; dev -> channel_list [ i ] = strdup ( ( char * ) argp . name ) ; } dev -> channel_list [ i ] = 0 ; } dev -> nChannels = n ; return n ; }
Internal function.
Internal function .
//printf("res=%d\n",res); //			v4l_log(dev,"%s::channel[%s] %s\n", //					__func__, //					argp.name, //					argp.type == V4L2_INPUT_TYPE_TUNER ? "has tuner" : "hasn't tuner");