aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-11-01 07:08:30 +0000
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2021-11-01 07:30:43 +0000
commit76a4f5d3dfd0c229876804bbbf2d16efd4e3d3f2 (patch)
tree9718b136c1311f95908d3c6f5ebc72392e603b23
parenta13eec2cb2e88c48ab2ba88163df61900ac0db33 (diff)
downloadv4l-utils-76a4f5d3dfd0c229876804bbbf2d16efd4e3d3f2.tar.gz
v4l2grab: don't try to convert formats on raw mode
If the device is in raw mode, it shouln't touch the image, just store it as-is. Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
-rw-r--r--contrib/test/v4l2grab.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/test/v4l2grab.c b/contrib/test/v4l2grab.c
index 04cd6653..4d7e0c3c 100644
--- a/contrib/test/v4l2grab.c
+++ b/contrib/test/v4l2grab.c
@@ -491,7 +491,7 @@ static int read_capture_loop(int fd, struct buffer *buffers,
fprintf(fout, "P6\n%d %d 255\n",
fmt->fmt.pix.width, fmt->fmt.pix.height);
- if (!out_buf) {
+ if (!ppm_output || !out_buf) {
out_buf = buffers[0].start;
} else {
size = convert_to_rgb24(fmt, buffers[0].start, out_buf);
@@ -566,7 +566,7 @@ static int userptr_capture_loop(int fd, struct buffer *buffers,
fprintf(fout, "P6\n%d %d 255\n",
fmt->fmt.pix.width, fmt->fmt.pix.height);
- if (!out_buf) {
+ if (!ppm_output || !out_buf) {
out_buf = buffers[buf.index].start;
size = buf.bytesused;
} else {
@@ -764,7 +764,7 @@ static int mmap_capture_threads(int fd, struct buffer *buffers,
buf = buf_queue.buffers[buf_queue.read_pos %
buf_queue.buffers_size];
- if (!out_buf) {
+ if (!ppm_output || !out_buf) {
out_buf = buffers[buf.index].start;
size = buf.bytesused;
} else {