Lines Matching refs:fmt
70 struct video_format fmt; member
229 *(int64_t *)value = (int64_t)data->fmt.width * data->fmt.pitch * data->mode->fps; in emul_imager_get_ctrl()
267 struct video_frmival_enum fie = {.format = &data->fmt, .discrete = *frmival}; in emul_imager_set_frmival()
325 static void emul_imager_fill_framebuffer(const struct device *const dev, struct video_format *fmt) in emul_imager_fill_framebuffer() argument
332 switch (fmt->pixelformat) { in emul_imager_fill_framebuffer()
334 for (size_t i = 0; i < fmt->width; i++) { in emul_imager_fill_framebuffer()
335 y = pattern_8bars_yuv[i * 8 / fmt->width][0]; in emul_imager_fill_framebuffer()
336 uv = pattern_8bars_yuv[i * 8 / fmt->width][1 + i % 2]; in emul_imager_fill_framebuffer()
341 for (size_t i = 0; i < fmt->width; i++) { in emul_imager_fill_framebuffer()
342 r = pattern_8bars_rgb[i * 8 / fmt->width][0] >> (8 - 5); in emul_imager_fill_framebuffer()
343 g = pattern_8bars_rgb[i * 8 / fmt->width][1] >> (8 - 6); in emul_imager_fill_framebuffer()
344 b = pattern_8bars_rgb[i * 8 / fmt->width][2] >> (8 - 5); in emul_imager_fill_framebuffer()
349 LOG_WRN("Unsupported pixel format %x, supported: %x, %x", fmt->pixelformat, in emul_imager_fill_framebuffer()
351 memset(fb16, 0, fmt->pitch); in emul_imager_fill_framebuffer()
355 for (size_t i = 1; i < fmt->height; i++) { in emul_imager_fill_framebuffer()
356 memcpy(data->framebuffer + fmt->pitch * i, data->framebuffer, fmt->pitch); in emul_imager_fill_framebuffer()
361 struct video_format *fmt) in emul_imager_set_fmt() argument
371 if (fmt->pitch * fmt->height > CONFIG_VIDEO_EMUL_IMAGER_FRAMEBUFFER_SIZE) { in emul_imager_set_fmt()
373 dev->name, CONFIG_VIDEO_EMUL_IMAGER_FRAMEBUFFER_SIZE, fmt->pixelformat, in emul_imager_set_fmt()
374 fmt->width, fmt->height, fmt->pitch * fmt->height); in emul_imager_set_fmt()
378 if (memcmp(&data->fmt, fmt, sizeof(data->fmt)) == 0) { in emul_imager_set_fmt()
382 ret = video_format_caps_index(fmts, fmt, &fmt_id); in emul_imager_set_fmt()
384 LOG_ERR("Format %x %ux%u not found for %s", fmt->pixelformat, fmt->width, in emul_imager_set_fmt()
385 fmt->height, dev->name); in emul_imager_set_fmt()
395 emul_imager_fill_framebuffer(dev, fmt); in emul_imager_set_fmt()
398 data->fmt = *fmt; in emul_imager_set_fmt()
403 struct video_format *fmt) in emul_imager_get_fmt() argument
411 *fmt = data->fmt; in emul_imager_get_fmt()
451 struct video_format fmt; in emul_imager_init() local
472 fmt.pixelformat = fmts[0].pixelformat; in emul_imager_init()
473 fmt.width = fmts[0].width_min; in emul_imager_init()
474 fmt.height = fmts[0].height_min; in emul_imager_init()
475 fmt.pitch = fmt.width * 2; in emul_imager_init()
477 ret = emul_imager_set_fmt(dev, VIDEO_EP_OUT, &fmt); in emul_imager_init()
479 LOG_ERR("Failed to set %s to default format %x %ux%u", dev->name, fmt.pixelformat, in emul_imager_init()
480 fmt.width, fmt.height); in emul_imager_init()