Lines Matching refs:fmt
258 static int zoran_enum_fmt(struct zoran *zr, struct v4l2_fmtdesc *fmt, int flag) in zoran_enum_fmt() argument
262 if (fmt->index >= ARRAY_SIZE(zoran_formats)) in zoran_enum_fmt()
264 if (fmt->type != V4L2_BUF_TYPE_VIDEO_CAPTURE) in zoran_enum_fmt()
268 if (zoran_formats[i].flags & flag && num++ == fmt->index) { in zoran_enum_fmt()
269 strscpy(fmt->description, zoran_formats[i].name, in zoran_enum_fmt()
270 sizeof(fmt->description)); in zoran_enum_fmt()
272 fmt->pixelformat = zoran_formats[i].fourcc; in zoran_enum_fmt()
274 fmt->flags |= V4L2_FMT_FLAG_COMPRESSED; in zoran_enum_fmt()
290 struct v4l2_format *fmt) in zoran_g_fmt_vid_out() argument
294 fmt->fmt.pix.width = zr->jpg_settings.img_width / zr->jpg_settings.hor_dcm; in zoran_g_fmt_vid_out()
295 fmt->fmt.pix.height = zr->jpg_settings.img_height * 2 / in zoran_g_fmt_vid_out()
297 fmt->fmt.pix.sizeimage = zr->buffer_size; in zoran_g_fmt_vid_out()
298 fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_MJPEG; in zoran_g_fmt_vid_out()
300 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? in zoran_g_fmt_vid_out()
303 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? in zoran_g_fmt_vid_out()
305 fmt->fmt.pix.bytesperline = 0; in zoran_g_fmt_vid_out()
306 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; in zoran_g_fmt_vid_out()
312 struct v4l2_format *fmt) in zoran_g_fmt_vid_cap() argument
317 return zoran_g_fmt_vid_out(file, __fh, fmt); in zoran_g_fmt_vid_cap()
318 fmt->fmt.pix.width = zr->v4l_settings.width; in zoran_g_fmt_vid_cap()
319 fmt->fmt.pix.height = zr->v4l_settings.height; in zoran_g_fmt_vid_cap()
320 fmt->fmt.pix.sizeimage = zr->buffer_size; in zoran_g_fmt_vid_cap()
321 fmt->fmt.pix.pixelformat = zr->v4l_settings.format->fourcc; in zoran_g_fmt_vid_cap()
322 fmt->fmt.pix.colorspace = zr->v4l_settings.format->colorspace; in zoran_g_fmt_vid_cap()
323 fmt->fmt.pix.bytesperline = zr->v4l_settings.bytesperline; in zoran_g_fmt_vid_cap()
325 fmt->fmt.pix.field = V4L2_FIELD_INTERLACED; in zoran_g_fmt_vid_cap()
327 fmt->fmt.pix.field = V4L2_FIELD_TOP; in zoran_g_fmt_vid_cap()
332 struct v4l2_format *fmt) in zoran_try_fmt_vid_out() argument
338 if (fmt->fmt.pix.pixelformat != V4L2_PIX_FMT_MJPEG) in zoran_try_fmt_vid_out()
344 if ((fmt->fmt.pix.height * 2) > BUZ_MAX_HEIGHT) in zoran_try_fmt_vid_out()
349 if (fmt->fmt.pix.height <= zr->jpg_settings.img_height / 2) in zoran_try_fmt_vid_out()
353 if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 4) in zoran_try_fmt_vid_out()
355 else if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 2) in zoran_try_fmt_vid_out()
378 fmt->fmt.pix.width = settings.img_width / settings.hor_dcm; in zoran_try_fmt_vid_out()
379 fmt->fmt.pix.height = settings.img_height * 2 / in zoran_try_fmt_vid_out()
382 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? in zoran_try_fmt_vid_out()
385 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? in zoran_try_fmt_vid_out()
388 fmt->fmt.pix.sizeimage = zoran_v4l2_calc_bufsize(&settings); in zoran_try_fmt_vid_out()
389 fmt->fmt.pix.bytesperline = 0; in zoran_try_fmt_vid_out()
390 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; in zoran_try_fmt_vid_out()
395 struct v4l2_format *fmt) in zoran_try_fmt_vid_cap() argument
401 if (fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG) in zoran_try_fmt_vid_cap()
402 return zoran_try_fmt_vid_out(file, __fh, fmt); in zoran_try_fmt_vid_cap()
405 if (zoran_formats[i].fourcc == fmt->fmt.pix.pixelformat) in zoran_try_fmt_vid_cap()
413 fmt->fmt.pix.pixelformat = zoran_formats[i].fourcc; in zoran_try_fmt_vid_cap()
414 fmt->fmt.pix.colorspace = zoran_formats[i].colorspace; in zoran_try_fmt_vid_cap()
415 if (BUZ_MAX_HEIGHT < (fmt->fmt.pix.height * 2)) in zoran_try_fmt_vid_cap()
416 fmt->fmt.pix.field = V4L2_FIELD_INTERLACED; in zoran_try_fmt_vid_cap()
418 fmt->fmt.pix.field = V4L2_FIELD_TOP; in zoran_try_fmt_vid_cap()
421 v4l_bound_align_image(&fmt->fmt.pix.width, BUZ_MIN_WIDTH, BUZ_MAX_WIDTH, in zoran_try_fmt_vid_cap()
423 &fmt->fmt.pix.height, BUZ_MIN_HEIGHT, BUZ_MAX_HEIGHT, in zoran_try_fmt_vid_cap()
425 fmt->fmt.pix.bytesperline = fmt->fmt.pix.width * bpp; in zoran_try_fmt_vid_cap()
426 fmt->fmt.pix.sizeimage = fmt->fmt.pix.bytesperline * fmt->fmt.pix.height; in zoran_try_fmt_vid_cap()
431 struct v4l2_format *fmt) in zoran_s_fmt_vid_out() argument
434 __le32 printformat = __cpu_to_le32(fmt->fmt.pix.pixelformat); in zoran_s_fmt_vid_out()
439 fmt->fmt.pix.width, fmt->fmt.pix.height, in zoran_s_fmt_vid_out()
440 fmt->fmt.pix.pixelformat, in zoran_s_fmt_vid_out()
442 if (fmt->fmt.pix.pixelformat != V4L2_PIX_FMT_MJPEG) in zoran_s_fmt_vid_out()
445 if (!fmt->fmt.pix.height || !fmt->fmt.pix.width) in zoran_s_fmt_vid_out()
451 if (fmt->fmt.pix.height * 2 > BUZ_MAX_HEIGHT) in zoran_s_fmt_vid_out()
456 if (fmt->fmt.pix.height <= zr->jpg_settings.img_height / 2) in zoran_s_fmt_vid_out()
460 if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 4) in zoran_s_fmt_vid_out()
462 else if (fmt->fmt.pix.width <= zr->jpg_settings.img_width / 2) in zoran_s_fmt_vid_out()
487 if (fmt->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) in zoran_s_fmt_vid_out()
495 fmt->fmt.pix.width = settings.img_width / settings.hor_dcm; in zoran_s_fmt_vid_out()
496 fmt->fmt.pix.height = settings.img_height * 2 / in zoran_s_fmt_vid_out()
499 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? in zoran_s_fmt_vid_out()
502 fmt->fmt.pix.field = (zr->jpg_settings.odd_even ? in zoran_s_fmt_vid_out()
504 fmt->fmt.pix.bytesperline = 0; in zoran_s_fmt_vid_out()
505 fmt->fmt.pix.sizeimage = zr->buffer_size; in zoran_s_fmt_vid_out()
506 fmt->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M; in zoran_s_fmt_vid_out()
511 struct v4l2_format *fmt) in zoran_s_fmt_vid_cap() argument
518 if (fmt->fmt.pix.pixelformat == V4L2_PIX_FMT_MJPEG) in zoran_s_fmt_vid_cap()
519 return zoran_s_fmt_vid_out(file, fh, fmt); in zoran_s_fmt_vid_cap()
522 if (fmt->fmt.pix.pixelformat == zoran_formats[i].fourcc) in zoran_s_fmt_vid_cap()
526 fmt->fmt.pix.pixelformat); in zoran_s_fmt_vid_cap()
531 fmt->fmt.pix.pixelformat = zoran_formats[i].fourcc; in zoran_s_fmt_vid_cap()
532 if (fmt->fmt.pix.height > BUZ_MAX_HEIGHT) in zoran_s_fmt_vid_cap()
533 fmt->fmt.pix.height = BUZ_MAX_HEIGHT; in zoran_s_fmt_vid_cap()
534 if (fmt->fmt.pix.width > BUZ_MAX_WIDTH) in zoran_s_fmt_vid_cap()
535 fmt->fmt.pix.width = BUZ_MAX_WIDTH; in zoran_s_fmt_vid_cap()
536 if (fmt->fmt.pix.height < BUZ_MIN_HEIGHT) in zoran_s_fmt_vid_cap()
537 fmt->fmt.pix.height = BUZ_MIN_HEIGHT; in zoran_s_fmt_vid_cap()
538 if (fmt->fmt.pix.width < BUZ_MIN_WIDTH) in zoran_s_fmt_vid_cap()
539 fmt->fmt.pix.width = BUZ_MIN_WIDTH; in zoran_s_fmt_vid_cap()
543 res = zoran_v4l_set_format(zr, fmt->fmt.pix.width, fmt->fmt.pix.height, in zoran_s_fmt_vid_cap()
549 fmt->fmt.pix.bytesperline = zr->v4l_settings.bytesperline; in zoran_s_fmt_vid_cap()
550 fmt->fmt.pix.sizeimage = zr->buffer_size; in zoran_s_fmt_vid_cap()
551 fmt->fmt.pix.colorspace = zr->v4l_settings.format->colorspace; in zoran_s_fmt_vid_cap()
553 fmt->fmt.pix.field = V4L2_FIELD_INTERLACED; in zoran_s_fmt_vid_cap()
555 fmt->fmt.pix.field = V4L2_FIELD_TOP; in zoran_s_fmt_vid_cap()