summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-06-28 12:50:02 +0300
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-07-27 22:04:50 +0300
commit7283eff090f801ba97a198e4929e64d0d158e063 (patch)
tree5a2a37d7a80815dad56da2b9b85344db522568fc
parent3437067e9bd923ee4dce857d83d7bce0f791537d (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>
-rw-r--r--src/libcamera/pipeline/simple/simple.cpp16
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)