static int s5p_jpeg_enum_fmt_vid_out(struct file *file, void *priv,
				   struct v4l2_fmtdesc *f)
{
	struct s5p_jpeg_ctx *ctx = fh_to_ctx(priv);

	if (ctx->mode == S5P_JPEG_ENCODE)
		return enum_fmt(formats_enc, NUM_FORMATS_ENC, f,
				MEM2MEM_OUTPUT);

	return enum_fmt(formats_dec, NUM_FORMATS_DEC, f, MEM2MEM_OUTPUT);
}
Esempio n. 2
0
int main()
{
	page_size = sysconf(_SC_PAGESIZE);

	fd_cam = open(cam_name, O_RDWR, 0);
	fd_out = open(out_name, O_RDWR|O_CREAT);

	if(fd_cam < 0 || fd_out < 0 || errno){
		perror("open device");
		exit(1);
	}

	// if(ioctl(fd_cam, VIDIOC_QUERYCAP, &cap) < 0){
	// 	perror("VIDIOC_QUERYCAP");
	// 	exit(1);
	// }

	enum_fmt();
	get_input();
	get_format();

	capture();

	close(fd_cam);
	close(fd_out);
}