sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt);
v4l2_fill_pix_format(pix, &sd_fmt.format);
- pix->colorspace = sd_fmt.format.colorspace;
- pix->xfer_func = sd_fmt.format.xfer_func;
- pix->ycbcr_enc = sd_fmt.format.ycbcr_enc;
- pix->quantization = sd_fmt.format.quantization;
}
pix->pixelformat = s->pixfmt;
sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt);
v4l2_fill_pix_format(pix, &sd_fmt.format);
- pix->colorspace = sd_fmt.format.colorspace;
- pix->xfer_func = sd_fmt.format.xfer_func;
- pix->ycbcr_enc = sd_fmt.format.ycbcr_enc;
- pix->quantization = sd_fmt.format.quantization;
}
switch (pix->pixelformat) {
struct cobalt_stream *s = video_drvdata(file);
struct v4l2_pix_format *pix = &f->fmt.pix;
struct v4l2_subdev_format sd_fmt = { 0 };
+ u32 code;
if (cobalt_try_fmt_vid_out(file, priv_fh, f))
return -EINVAL;
switch (pix->pixelformat) {
case V4L2_PIX_FMT_YUYV:
s->bpp = COBALT_BYTES_PER_PIXEL_YUYV;
+ code = MEDIA_BUS_FMT_UYVY8_1X16;
break;
case V4L2_PIX_FMT_BGR32:
s->bpp = COBALT_BYTES_PER_PIXEL_RGB32;
+ code = MEDIA_BUS_FMT_RGB888_1X24;
break;
default:
return -EINVAL;
s->ycbcr_enc = pix->ycbcr_enc;
s->quantization = pix->quantization;
sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
- v4l2_subdev_call(s->sd, pad, get_fmt, NULL, &sd_fmt);
- sd_fmt.format.colorspace = pix->colorspace;
- sd_fmt.format.xfer_func = pix->xfer_func;
- sd_fmt.format.ycbcr_enc = pix->ycbcr_enc;
- sd_fmt.format.quantization = pix->quantization;
+ v4l2_fill_mbus_format(&sd_fmt.format, pix, code);
v4l2_subdev_call(s->sd, pad, set_fmt, NULL, &sd_fmt);
return 0;
}