summaryrefslogtreecommitdiff
path: root/src/cam/kms_sink.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cam/kms_sink.cpp')
-rw-r--r--src/cam/kms_sink.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/cam/kms_sink.cpp b/src/cam/kms_sink.cpp
index d30fba78..da579846 100644
--- a/src/cam/kms_sink.cpp
+++ b/src/cam/kms_sink.cpp
@@ -136,7 +136,7 @@ int KMSSink::configure(const libcamera::CameraConfiguration &config)
return 0;
}
-int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
+int KMSSink::selectPipeline(const libcamera::PixelFormat &format)
{
/*
* If the requested format has an alpha channel, also consider the X
@@ -174,25 +174,31 @@ int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
crtc_ = crtc;
plane_ = plane;
format_ = format;
- break;
+ return 0;
}
if (plane->supportsFormat(xFormat)) {
crtc_ = crtc;
plane_ = plane;
format_ = xFormat;
- break;
+ return 0;
}
}
}
}
- if (!crtc_) {
+ return -EPIPE;
+}
+
+int KMSSink::configurePipeline(const libcamera::PixelFormat &format)
+{
+ const int ret = selectPipeline(format);
+ if (ret) {
std::cerr
<< "Unable to find display pipeline for format "
<< format.toString() << std::endl;
- return -EPIPE;
+ return ret;
}
std::cout