module_param(isp_video_nr, int, 0644);
MODULE_PARM_DESC(isp_video_nr, "isp video device number");
+/*
+ * Workaround for GStreamer v4l2convert component not considering Bayer formats
+ * as raw, and therefore not considering a V4L2 device that supports them as
+ * as a suitable candidate.
+ */
+static bool disable_bayer;
+module_param(disable_bayer, bool, 0644);
+MODULE_PARM_DESC(disable_bayer, "Disable support for Bayer formats");
+
static unsigned int debug;
module_param(debug, uint, 0644);
MODULE_PARM_DESC(debug, "activates debug info (0-3)");
u32 flags;
u32 mmal_fmt;
int size_multiplier_x2;
+ bool is_bayer;
};
static const struct bcm2835_codec_fmt supported_formats[] = {
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SRGGB8,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SBGGR8,
.depth = 8,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SBGGR8,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGRBG8,
.depth = 8,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGRBG8,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGBRG8,
.depth = 8,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGBRG8,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
/* 10 bit */
.fourcc = V4L2_PIX_FMT_SRGGB10P,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SRGGB10P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SBGGR10P,
.depth = 10,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SBGGR10P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGRBG10P,
.depth = 10,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGRBG10P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGBRG10P,
.depth = 10,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGBRG10P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
/* 12 bit */
.fourcc = V4L2_PIX_FMT_SRGGB12P,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SRGGB12P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SBGGR12P,
.depth = 12,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SBGGR12P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGRBG12P,
.depth = 12,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGRBG12P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGBRG12P,
.depth = 12,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGBRG12P,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
/* 16 bit */
.fourcc = V4L2_PIX_FMT_SRGGB16,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SRGGB16,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SBGGR16,
.depth = 16,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SBGGR16,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGRBG16,
.depth = 16,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGRBG16,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
.fourcc = V4L2_PIX_FMT_SGBRG16,
.depth = 16,
.flags = 0,
.mmal_fmt = MMAL_ENCODING_BAYER_SGBRG16,
.size_multiplier_x2 = 2,
+ .is_bayer = true,
}, {
/* Compressed formats */
.fourcc = V4L2_PIX_FMT_H264,
unsigned int i;
for (i = 0; i < ARRAY_SIZE(supported_formats); i++) {
- if (supported_formats[i].mmal_fmt == mmal_fmt)
+ if (supported_formats[i].mmal_fmt == mmal_fmt &&
+ (!disable_bayer || !supported_formats[i].is_bayer))
return &supported_formats[i];
}
return NULL;