Ticket #1074: use_specified_webcam_resolution.patch
| File use_specified_webcam_resolution.patch, 1.9 KB (added by , 18 years ago) |
|---|
-
stream/tvi_v4l2.c
780 780 return TVI_CONTROL_TRUE; 781 781 case TVI_CONTROL_VID_CHK_WIDTH: 782 782 return TVI_CONTROL_TRUE; 783 case TVI_CONTROL_VID_SET_WIDTH_HEIGHT: 784 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; 785 priv->format.fmt.pix.width = ((int *)arg)[0]; 786 priv->format.fmt.pix.height = ((int *)arg)[1]; 787 priv->format.fmt.pix.field = V4L2_FIELD_ANY; 788 if (ioctl(priv->video_fd, VIDIOC_S_FMT, &priv->format) < 0) 789 return TVI_CONTROL_FALSE; 790 return TVI_CONTROL_TRUE; 783 791 case TVI_CONTROL_VID_SET_WIDTH: 784 792 if (getfmt(priv) < 0) return TVI_CONTROL_FALSE; 785 793 priv->format.fmt.pix.width = *(int *)arg; -
stream/tv.c
439 439 #endif 440 440 441 441 /* limits on w&h are norm-dependent -- JM */ 442 if (tvh->tv_param->width != -1 && tvh->tv_param->height != -1) { 443 // first tell the driver both width and height, some drivers do not support setting them independently. 444 int dim[2]; 445 dim[0] = tvh->tv_param->width; dim[1] = tvh->tv_param->height; 446 funcs->control(tvh->priv, TVI_CONTROL_VID_SET_WIDTH_HEIGHT, dim); 447 } 442 448 /* set width */ 443 449 if (tvh->tv_param->width != -1) 444 450 { -
stream/tv.h
177 177 #define TVI_CONTROL_VID_GET_GAIN 0x120 178 178 179 179 /* TUNER controls */ 180 #define TVI_CONTROL_VID_SET_WIDTH_HEIGHT 0x121 180 181 #define TVI_CONTROL_TUN_GET_FREQ 0x201 181 182 #define TVI_CONTROL_TUN_SET_FREQ 0x202 182 183 #define TVI_CONTROL_TUN_GET_TUNER 0x203 /* update priv->tuner struct for used input */
