summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-10-21 04:54:15 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-11-07 20:24:31 +0200
commitb394dc8b8001dd702dfa171a123f4e33c1e29c6b (patch)
tree765afff370b22faeaecf196fbe394a1520903de5 /src
parente9463449049c78b6b1c61410082a5339338b2e81 (diff)
libcamera: Drop unnecessary explicit initialization of V4L2DeviceFormat
The V4L2DeviceFormat class now has default initializers for all members, explicit initialization isn't needed anymore. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp2
-rw-r--r--src/libcamera/pipeline/raspberrypi/raspberrypi.cpp6
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1.cpp4
-rw-r--r--src/libcamera/pipeline/rkisp1/rkisp1_path.cpp4
-rw-r--r--src/libcamera/pipeline/simple/converter.cpp2
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp4
-rw-r--r--src/libcamera/pipeline/uvcvideo/uvcvideo.cpp4
-rw-r--r--src/libcamera/pipeline/vimc/vimc.cpp4
8 files changed, 15 insertions, 15 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 5a6ee1a8..4cedb32b 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -463,7 +463,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
* adjusted format to be propagated to the ImgU output devices.
*/
const Size &sensorSize = config->cio2Format().size;
- V4L2DeviceFormat cio2Format = {};
+ V4L2DeviceFormat cio2Format;
ret = cio2->configure(sensorSize, &cio2Format);
if (ret)
return ret;
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
index 0a60442c..7ad66f21 100644
--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp
@@ -73,7 +73,7 @@ V4L2DeviceFormat findBestMode(V4L2VideoDevice::Formats &formatsMap,
const Size &req)
{
double bestScore = std::numeric_limits<double>::max(), score;
- V4L2DeviceFormat bestMode = {};
+ V4L2DeviceFormat bestMode;
#define PENALTY_AR 1500.0
#define PENALTY_8BIT 2000.0
@@ -429,7 +429,7 @@ CameraConfiguration::Status RPiCameraConfiguration::validate()
status = Adjusted;
}
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = dev->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
@@ -600,7 +600,7 @@ int PipelineHandlerRPi::configure(Camera *camera, CameraConfiguration *config)
* See which streams are requested, and route the user
* StreamConfiguration appropriately.
*/
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
for (unsigned i = 0; i < config->size(); i++) {
StreamConfiguration &cfg = config->at(i);
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
index c74a2e9b..1b1922a9 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp
@@ -720,13 +720,13 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
return ret;
}
- V4L2DeviceFormat paramFormat = {};
+ V4L2DeviceFormat paramFormat;
paramFormat.fourcc = V4L2PixelFormat(V4L2_META_FMT_RK_ISP1_PARAMS);
ret = param_->setFormat(&paramFormat);
if (ret)
return ret;
- V4L2DeviceFormat statFormat = {};
+ V4L2DeviceFormat statFormat;
statFormat.fourcc = V4L2PixelFormat(V4L2_META_FMT_RK_ISP1_STAT_3A);
ret = stat_->setFormat(&statFormat);
if (ret)
diff --git a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
index e98515c8..80e1818d 100644
--- a/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
+++ b/src/libcamera/pipeline/rkisp1/rkisp1_path.cpp
@@ -85,7 +85,7 @@ CameraConfiguration::Status RkISP1Path::validate(StreamConfiguration *cfg)
cfg->size.expandTo(minResolution_);
cfg->bufferCount = RKISP1_BUFFER_COUNT;
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = video_->toV4L2PixelFormat(cfg->pixelFormat);
format.size = cfg->size;
@@ -146,7 +146,7 @@ int RkISP1Path::configure(const StreamConfiguration &config,
<< ispFormat.toString();
const PixelFormatInfo &info = PixelFormatInfo::info(config.pixelFormat);
- V4L2DeviceFormat outputFormat = {};
+ V4L2DeviceFormat outputFormat;
outputFormat.fourcc = video_->toV4L2PixelFormat(config.pixelFormat);
outputFormat.size = config.size;
outputFormat.planesCount = info.numPlanes();
diff --git a/src/libcamera/pipeline/simple/converter.cpp b/src/libcamera/pipeline/simple/converter.cpp
index c21479a1..57538ab0 100644
--- a/src/libcamera/pipeline/simple/converter.cpp
+++ b/src/libcamera/pipeline/simple/converter.cpp
@@ -265,7 +265,7 @@ std::tuple<unsigned int, unsigned int>
SimpleConverter::strideAndFrameSize(const Size &size,
const PixelFormat &pixelFormat)
{
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = m2m_->capture()->toV4L2PixelFormat(pixelFormat);
format.size = size;
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp
index 3d2039f3..0d3078f7 100644
--- a/src/libcamera/pipeline/simple/simple.cpp
+++ b/src/libcamera/pipeline/simple/simple.cpp
@@ -482,7 +482,7 @@ CameraConfiguration::Status SimpleCameraConfiguration::validate()
/* Set the stride and frameSize. */
if (!needConversion_) {
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
@@ -587,7 +587,7 @@ int SimplePipelineHandler::configure(Camera *camera, CameraConfiguration *c)
/* Configure the video node. */
V4L2PixelFormat videoFormat = video->toV4L2PixelFormat(pipeConfig.pixelFormat);
- V4L2DeviceFormat captureFormat = {};
+ V4L2DeviceFormat captureFormat;
captureFormat.fourcc = videoFormat;
captureFormat.size = pipeConfig.captureSize;
diff --git a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
index 3862631b..0f3241cc 100644
--- a/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
+++ b/src/libcamera/pipeline/uvcvideo/uvcvideo.cpp
@@ -154,7 +154,7 @@ CameraConfiguration::Status UVCCameraConfiguration::validate()
cfg.bufferCount = 4;
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
@@ -210,7 +210,7 @@ int PipelineHandlerUVC::configure(Camera *camera, CameraConfiguration *config)
StreamConfiguration &cfg = config->at(0);
int ret;
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp
index 7416c37c..914b6b54 100644
--- a/src/libcamera/pipeline/vimc/vimc.cpp
+++ b/src/libcamera/pipeline/vimc/vimc.cpp
@@ -172,7 +172,7 @@ CameraConfiguration::Status VimcCameraConfiguration::validate()
cfg.bufferCount = 4;
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = data_->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;
@@ -276,7 +276,7 @@ int PipelineHandlerVimc::configure(Camera *camera, CameraConfiguration *config)
if (ret)
return ret;
- V4L2DeviceFormat format = {};
+ V4L2DeviceFormat format;
format.fourcc = data->video_->toV4L2PixelFormat(cfg.pixelFormat);
format.size = cfg.size;