main: Correctly configure mbus for 8-bits Bayer pix fmts

The mbus has to be configured correctly for each of the pixel
formats in order to send the right indications to V4L2.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org>
This commit is contained in:
AngeloGioacchino Del Regno 2020-10-25 17:17:55 +01:00 committed by Martijn Braam
parent 43a68ba0db
commit 6a5f1078ef
1 changed files with 3 additions and 0 deletions

3
main.c
View File

@ -937,13 +937,16 @@ config_ini_handler(void *user, const char *section, const char *name,
} else if (strcmp(name, "fmt") == 0) {
if (strcmp(value, "RGGB8") == 0) {
cc->fmt = V4L2_PIX_FMT_SRGGB8;
cc->mbus = MEDIA_BUS_FMT_SRGGB8_1X8;
} else if (strcmp(value, "BGGR8") == 0) {
cc->fmt = V4L2_PIX_FMT_SBGGR8;
cc->mbus = MEDIA_BUS_FMT_SBGGR8_1X8;
} else if (strcmp(value, "GRBG8") == 0) {
cc->fmt = V4L2_PIX_FMT_SGRBG8;
cc->mbus = MEDIA_BUS_FMT_SGRBG8_1X8;
} else if (strcmp(value, "GBRG8") == 0) {
cc->fmt = V4L2_PIX_FMT_SGBRG8;
cc->mbus = MEDIA_BUS_FMT_SGBRG8_1X8;
} else {
g_printerr("Unsupported pixelformat %s\n", value);
exit(1);