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>
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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(¶mFormat);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
V4L2DeviceFormat statFormat = {};
|
||||
V4L2DeviceFormat statFormat;
|
||||
statFormat.fourcc = V4L2PixelFormat(V4L2_META_FMT_RK_ISP1_STAT_3A);
|
||||
ret = stat_->setFormat(&statFormat);
|
||||
if (ret)
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user