@@ -50,6 +50,7 @@ private:
friend class PipelineHandler;
void disconnect();
+ int exclusiveAccess();
std::shared_ptr<PipelineHandler> pipe_;
std::string name_;
@@ -240,6 +240,23 @@ Camera::streamConfiguration(std::vector<Stream *> &streams)
* \retval -EINVAL The configuration is not valid
*/
int Camera::configureStreams(std::map<Stream *, StreamConfiguration> &config)
+{
+ int ret;
+
+ ret = exclusiveAccess();
+ if (ret)
+ return ret;
+
+ if (!config.size()) {
+ LOG(Camera, Error)
+ << "Can't configure streams without a configuration";
+ return -EINVAL;
+ }
+
+ return pipe_->configureStreams(this, config);
+}
+
+int Camera::exclusiveAccess()
{
if (disconnected_)
return -ENODEV;
@@ -247,10 +264,7 @@ int Camera::configureStreams(std::map<Stream *, StreamConfiguration> &config)
if (!acquired_)
return -EACCES;
- if (!config.size())
- return -EINVAL;
-
- return pipe_->configureStreams(this, config);
+ return 0;
}
} /* namespace libcamera */