aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-05 14:28:59 -0300
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-09-05 14:28:59 -0300
commita64c94d43fe1044d76d003254eaa5e843cc2ee51 (patch)
tree9c4e5caf082de62d95657f79b2f287d84d8427be /src
parent01fccdeaea087e73c933e71890908a6b6dc23ac1 (diff)
callbacks: fix apply_filters() logic
The filters should work with RGB data. If data is on YUV420, they should be converted first to RGB before filtered. Please notice that this shouldn't happen, in practice, as libv4l will always provide a RGB output, but, if something changes there, it may end doing a wrong thing. So, better to fix. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'src')
-rw-r--r--src/callbacks.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/callbacks.c b/src/callbacks.c
index a38a1dc..5f8df42 100644
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -479,13 +479,13 @@ void on_about_activate(GtkMenuItem *menuitem, cam_t *cam)
gtk_widget_show(about);
}
-static void apply_filters(cam_t *cam)
+static void apply_filters(cam_t *cam, unsigned char *pic_buf)
{
/* v4l has reverse rgb order from what camora expect so call the color
filter to fix things up before running the user selected filters */
- camorama_filter_color_filter(NULL, cam->pic_buf, cam->width,
+ camorama_filter_color_filter(NULL, pic_buf, cam->width,
cam->height, cam->bpp / 8);
- camorama_filter_chain_apply(cam->filter_chain, cam->pic_buf,
+ camorama_filter_chain_apply(cam->filter_chain, pic_buf,
cam->width, cam->height, cam->bpp / 8);
}
@@ -645,7 +645,7 @@ gint read_timeout_func(cam_t *cam)
cam->bpp / 8);
pic_buf = cam->tmp;
}
- apply_filters(cam);
+ apply_filters(cam, pic_buf);
cam->pb = gdk_pixbuf_new_from_data(pic_buf, GDK_COLORSPACE_RGB, FALSE, 8,
cam->width, cam->height,
(cam->width * cam->bpp / 8),
@@ -668,7 +668,7 @@ gint timeout_func(cam_t *cam)
cam->bpp / 8);
pic_buf = cam->tmp;
}
- apply_filters(cam);
+ apply_filters(cam, pic_buf);
cam->pb = gdk_pixbuf_new_from_data(pic_buf, GDK_COLORSPACE_RGB, FALSE, 8,
cam->width, cam->height,
(cam->width * cam->bpp / 8),

Privacy Policy