From f851b16080daf0632e670312313d694bc9fed3ff Mon Sep 17 00:00:00 2001 From: Kamil Debski Date: Fri, 6 Feb 2015 11:43:26 +0100 Subject: v4l2-mfc-example: Add option to ignore FIMC format change Add option to ignore FIMC format change. This may be useful if using the application with an older kernel. Signed-off-by: Kamil Debski --- v4l2-mfc-example/args.c | 6 +++++- v4l2-mfc-example/common.h | 1 + v4l2-mfc-example/fimc.c | 7 +++++-- 3 files changed, 11 insertions(+), 3 deletions(-) (limited to 'v4l2-mfc-example') diff --git a/v4l2-mfc-example/args.c b/v4l2-mfc-example/args.c index 39abf96..3756001 100644 --- a/v4l2-mfc-example/args.c +++ b/v4l2-mfc-example/args.c @@ -44,6 +44,7 @@ void print_usage(char *name) printf("\t-D :: - DRM module (e.g. exynos:4:17)\n"); printf("\t-B - use DMABUF instead of userptr for sharing buffers\n"); printf("\t-V - synchronise to vsync\n"); + printf("\t-X - ignore format change by FIMC\n"); printf("\t\n"); printf("\tIf DRM or Frame buffer is used then FIMC should be suppplied.\n"); printf("\tOnly one of the following Frame Buffer, DRM can be used at a time.\n"); @@ -80,7 +81,7 @@ int parse_args(struct instance *i, int argc, char **argv) init_to_defaults(i); - while ((c = getopt(argc, argv, "c:d:f:i:m:VD:B")) != -1) { + while ((c = getopt(argc, argv, "c:d:f:i:m:VXD:B")) != -1) { switch (c) { case 'c': i->parser.codec = get_codec(optarg); @@ -102,6 +103,9 @@ int parse_args(struct instance *i, int argc, char **argv) case 'V': i->fimc.double_buf = 1; break; + case 'X': + i->fimc.ignore_format_change = 1; + break; case 'B': i->fimc.dmabuf = 1; break; diff --git a/v4l2-mfc-example/common.h b/v4l2-mfc-example/common.h index ea5a9d7..d338d5e 100644 --- a/v4l2-mfc-example/common.h +++ b/v4l2-mfc-example/common.h @@ -167,6 +167,7 @@ struct instance { char *p[MAX_BUFS]; int dbuf[MAX_BUFS]; int dmabuf; + char ignore_format_change; } fimc; /* MFC related parameters */ diff --git a/v4l2-mfc-example/fimc.c b/v4l2-mfc-example/fimc.c index 78a1475..a168100 100644 --- a/v4l2-mfc-example/fimc.c +++ b/v4l2-mfc-example/fimc.c @@ -113,10 +113,13 @@ int fimc_sfmt(struct instance *i, int width, int height, "Please read patch: \"s5p-fimc: Changed RGB32 to BGR32\"\n" "\thttp://www.spinics.net/lists/linux-media/msg74953.html\n" "\thttps://patchwork.linuxtv.org/patch/23236/"); - return -1; + if (i->fimc.ignore_format_change) { + err("!!! IGNORING FORMAT CHANGE !!!"); + } else { + return -1; + } } - dbg("Successful SFMT on %s of FIMC (%dx%d)", dbg_type[type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE], width, height); -- cgit v1.2.3