mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-24 17:15:07 +03:00
libcamera: pipeline: simple: Setup links outside for format try loop
The SimpleCameraData::init() function needs to setup links along the pipeline, but doesn't need to repeat that operation for each media bus code it tries. Move the link setup before the loop. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
3437067e9b
commit
7283eff090
1 changed files with 8 additions and 8 deletions
|
@ -250,6 +250,14 @@ int SimpleCameraData::init()
|
|||
SimpleConverter *converter = pipe->converter();
|
||||
int ret;
|
||||
|
||||
/*
|
||||
* Setup links first as some subdev drivers take active links into
|
||||
* account to propagate TRY formats. Such is life :-(
|
||||
*/
|
||||
ret = setupLinks();
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
/*
|
||||
* Enumerate the possible pipeline configurations. For each media bus
|
||||
* format supported by the sensor, propagate the formats through the
|
||||
|
@ -259,14 +267,6 @@ int SimpleCameraData::init()
|
|||
for (unsigned int code : sensor_->mbusCodes()) {
|
||||
V4L2SubdeviceFormat format{ code, sensor_->resolution() };
|
||||
|
||||
/*
|
||||
* Setup links first as some subdev drivers take active links
|
||||
* into account to propagate TRY formats. Such is life :-(
|
||||
*/
|
||||
ret = setupLinks();
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = setupFormats(&format, V4L2Subdevice::TryFormat);
|
||||
if (ret < 0) {
|
||||
LOG(SimplePipeline, Error)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue