diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-06-28 12:50:02 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-07-27 22:04:50 +0300 |
commit | 7283eff090f801ba97a198e4929e64d0d158e063 (patch) | |
tree | 5a2a37d7a80815dad56da2b9b85344db522568fc /src | |
parent | 3437067e9bd923ee4dce857d83d7bce0f791537d (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/libcamera/pipeline/simple/simple.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcamera/pipeline/simple/simple.cpp b/src/libcamera/pipeline/simple/simple.cpp index 5221ff33..b1814b08 100644 --- a/src/libcamera/pipeline/simple/simple.cpp +++ b/src/libcamera/pipeline/simple/simple.cpp @@ -251,6 +251,14 @@ int SimpleCameraData::init() 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 * pipeline, and enumerate the corresponding possible V4L2 pixel @@ -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) |