void vidout_cmd(int ch, char *optarg)
{
	__u32 width, height, pixfmt;

	switch (ch) {
	case OptSetVideoOutMplaneFormat:
	case OptTryVideoOutMplaneFormat:
		set_fmts_out = parse_fmt(optarg, width, height, pixfmt);
		if (!set_fmts_out) {
			vidcap_usage();
			exit(1);
		}
		vfmt_out.fmt.pix_mp.width = width;
		vfmt_out.fmt.pix_mp.height = height;
		vfmt_out.fmt.pix_mp.pixelformat = pixfmt;
		break;

	case OptSetVideoOutFormat:
	case OptTryVideoOutFormat:
		set_fmts_out = parse_fmt(optarg, width, height, pixfmt);
		if (!set_fmts_out) {
			vidcap_usage();
			exit(1);
		}
		vfmt_out.fmt.pix.width = width;
		vfmt_out.fmt.pix.height = height;
		vfmt_out.fmt.pix.pixelformat = pixfmt;
		break;
	}
}
示例#2
0
void vidcap_cmd(int ch, char *optarg)
{
	__u32 colorspace, xfer_func, ycbcr, quantization;
	char *value, *subs;

	switch (ch) {
	case OptSetVideoFormat:
	case OptTryVideoFormat:
		set_fmts = parse_fmt(optarg, width, height, pixfmt, field, colorspace,
				xfer_func, ycbcr, quantization, flags, bytesperline);
		if (!set_fmts ||
		    (set_fmts & (FmtColorspace | FmtYCbCr | FmtQuantization | FmtXferFunc))) {
			vidcap_usage();
			exit(1);
		}
		break;
	case OptListFrameSizes:
		if (strlen(optarg) == 4)
			frmsize.pixel_format = v4l2_fourcc(optarg[0], optarg[1],
					optarg[2], optarg[3]);
		else
			frmsize.pixel_format = strtol(optarg, 0L, 0);
		break;
	case OptListFrameIntervals:
		subs = optarg;
		while (*subs != '\0') {
			static const char *const subopts[] = {
				"width",
				"height",
				"pixelformat",
				NULL
			};

			switch (parse_subopt(&subs, subopts, &value)) {
			case 0:
				frmival.width = strtol(value, 0L, 0);
				break;
			case 1:
				frmival.height = strtol(value, 0L, 0);
				break;
			case 2:
				if (strlen(value) == 4)
					frmival.pixel_format =
						v4l2_fourcc(value[0], value[1],
								value[2], value[3]);
				else
					frmival.pixel_format = strtol(value, 0L, 0);
				break;
			default:
				vidcap_usage();
				exit(1);
			}
		}
		break;
	}
}
示例#3
0
static void usage_all(void)
{
       common_usage();
       tuner_usage();
       io_usage();
       stds_usage();
       vidcap_usage();
       vidout_usage();
       overlay_usage();
       vbi_usage();
       sdr_usage();
       selection_usage();
       misc_usage();
       streaming_usage();
       edid_usage();
}