Lines Matching refs:format
160 * given frame format and size. This should be done by the device as part of
196 static u32 uvc_v4l2_get_bytesperline(const struct uvc_format *format,
199 switch (format->fcc) {
207 return format->bpp * frame->wWidth / 8;
216 const struct uvc_format *format = NULL;
229 uvc_dbg(stream->dev, FORMAT, "Trying format 0x%08x (%c%c%c%c): %ux%u\n",
235 * Check if the hardware supports the requested format, use the default
236 * format otherwise.
239 format = &stream->formats[i];
240 if (format->fcc == fmt->fmt.pix.pixelformat)
245 format = stream->def_format;
246 fmt->fmt.pix.pixelformat = format->fcc;
258 for (i = 0; i < format->nframes; ++i) {
259 u16 w = format->frames[i].wWidth;
260 u16 h = format->frames[i].wHeight;
266 frame = &format->frames[i];
286 /* Set the format index, frame index and frame interval. */
289 probe->bFormatIndex = format->index;
320 * accepted the requested format as-is.
324 format = &stream->formats[i];
334 for (i = 0; i < format->nframes; ++i) {
335 if (probe->bFrameIndex == format->frames[i].bFrameIndex) {
336 frame = &format->frames[i];
341 if (i == format->nframes)
349 fmt->fmt.pix.bytesperline = uvc_v4l2_get_bytesperline(format, frame);
351 fmt->fmt.pix.pixelformat = format->fcc;
352 fmt->fmt.pix.colorspace = format->colorspace;
353 fmt->fmt.pix.xfer_func = format->xfer_func;
354 fmt->fmt.pix.ycbcr_enc = format->ycbcr_enc;
357 *uvc_format = format;
367 const struct uvc_format *format;
375 format = stream->cur_format;
378 if (format == NULL || frame == NULL) {
383 fmt->fmt.pix.pixelformat = format->fcc;
387 fmt->fmt.pix.bytesperline = uvc_v4l2_get_bytesperline(format, frame);
389 fmt->fmt.pix.colorspace = format->colorspace;
390 fmt->fmt.pix.xfer_func = format->xfer_func;
391 fmt->fmt.pix.ycbcr_enc = format->ycbcr_enc;
402 const struct uvc_format *format;
409 ret = uvc_v4l2_try_format(stream, fmt, &probe, &format, &frame);
421 stream->cur_format = format;
469 const struct uvc_format *format;
495 format = stream->cur_format;
502 for (i = 0; i < format->nframes && maxd != 0; i++) {
505 if (&format->frames[i] == stream->cur_frame)
508 if (format->frames[i].wWidth != stream->cur_frame->wWidth ||
509 format->frames[i].wHeight != stream->cur_frame->wHeight)
512 ival = uvc_try_frame_interval(&format->frames[i], interval);
517 frame = &format->frames[i];
701 const struct uvc_format *format;
712 format = &stream->formats[fmt->index];
714 if (format->flags & UVC_FMT_FLAG_COMPRESSED)
716 fmt->pixelformat = format->fcc;
1253 const struct uvc_format *format = NULL;
1258 /* Look for the given pixel format */
1261 format = &stream->formats[i];
1265 if (format == NULL)
1269 for (i = 0, index = 0; i < format->nframes; i++) {
1270 if (frame && frame->wWidth == format->frames[i].wWidth &&
1271 frame->wHeight == format->frames[i].wHeight)
1273 frame = &format->frames[i];
1279 if (i == format->nframes)
1293 const struct uvc_format *format = NULL;
1299 /* Look for the given pixel format and frame size */
1302 format = &stream->formats[i];
1306 if (format == NULL)
1310 for (i = 0; i < format->nframes; i++) {
1311 if (format->frames[i].wWidth == fival->width &&
1312 format->frames[i].wHeight == fival->height) {
1313 frame = &format->frames[i];
1320 if (i == format->nframes)