summaryrefslogtreecommitdiff
path: root/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-02-26 13:27:39 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2024-03-15 12:55:03 +0200
commitd41e0585e972c1350d55679e61e0b91368bb61f9 (patch)
treec524928f8b3e928cc7fa7a97fd86c60513ec63a6 /src/libcamera/pipeline/rpi/common/pipeline_base.cpp
parent4c82481fc4622c2e78ec9f426bcad27728bb7079 (diff)
libcamera: v4l2_subdevice: Rename V4L2SubdeviceFormat::mbus_code to code
The V4L2SubdeviceFormat::mbus_code member doesn't follow the libcamera coding style as it should use camelCase. Fix it by renaming it to just 'code', to shorten lines in addition to fixing the coding style. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/libcamera/pipeline/rpi/common/pipeline_base.cpp')
-rw-r--r--src/libcamera/pipeline/rpi/common/pipeline_base.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
index e0bedcd8..9449c3dc 100644
--- a/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
+++ b/src/libcamera/pipeline/rpi/common/pipeline_base.cpp
@@ -37,10 +37,10 @@ namespace {
constexpr unsigned int defaultRawBitDepth = 12;
-PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,
+PixelFormat mbusCodeToPixelFormat(unsigned int code,
BayerFormat::Packing packingReq)
{
- BayerFormat bayer = BayerFormat::fromMbusCode(mbus_code);
+ BayerFormat bayer = BayerFormat::fromMbusCode(code);
ASSERT(bayer.isValid());
@@ -221,7 +221,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
* without modifications.
*/
if (sensorConfig) {
- BayerFormat bayer = BayerFormat::fromMbusCode(sensorFormat_.mbus_code);
+ BayerFormat bayer = BayerFormat::fromMbusCode(sensorFormat_.code);
if (bayer.bitDepth != sensorConfig->bitDepth ||
sensorFormat_.size != sensorConfig->outputSize) {
@@ -236,7 +236,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
StreamConfiguration *rawStream = raw.cfg;
/* Adjust the RAW stream to match the computed sensor format. */
- BayerFormat sensorBayer = BayerFormat::fromMbusCode(sensorFormat_.mbus_code);
+ BayerFormat sensorBayer = BayerFormat::fromMbusCode(sensorFormat_.code);
/*
* Some sensors change their Bayer order when they are h-flipped
@@ -377,8 +377,8 @@ V4L2DeviceFormat PipelineHandlerBase::toV4L2DeviceFormat(const V4L2VideoDevice *
const V4L2SubdeviceFormat &format,
BayerFormat::Packing packingReq)
{
- unsigned int mbus_code = format.mbus_code;
- const PixelFormat pix = mbusCodeToPixelFormat(mbus_code, packingReq);
+ unsigned int code = format.code;
+ const PixelFormat pix = mbusCodeToPixelFormat(code, packingReq);
V4L2DeviceFormat deviceFormat;
deviceFormat.fourcc = dev->toV4L2PixelFormat(pix);
@@ -409,7 +409,7 @@ PipelineHandlerBase::generateConfiguration(Camera *camera, Span<const StreamRole
case StreamRole::Raw:
size = sensorSize;
sensorFormat = data->findBestFormat(size, defaultRawBitDepth);
- pixelFormat = mbusCodeToPixelFormat(sensorFormat.mbus_code,
+ pixelFormat = mbusCodeToPixelFormat(sensorFormat.code,
BayerFormat::Packing::CSI2);
ASSERT(pixelFormat.isValid());
colorSpace = ColorSpace::Raw;
@@ -990,7 +990,7 @@ V4L2SubdeviceFormat CameraData::findBestFormat(const Size &req, unsigned int bit
if (score <= bestScore) {
bestScore = score;
- bestFormat.mbus_code = mbusCode;
+ bestFormat.code = mbusCode;
bestFormat.size = size;
}