diff options
author | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-02-21 00:13:02 +0100 |
---|---|---|
committer | Niklas Söderlund <niklas.soderlund@ragnatech.se> | 2019-02-25 23:12:57 +0100 |
commit | 2090f8fdd8f903683349f650ac572c15cd8a224e (patch) | |
tree | 5bf9ff4fb4da04d014ac94a5640c7459c83b072a /src/cam | |
parent | 0cd7602e9cfc7db28138d5962563a77366a977f9 (diff) |
cam: fix return type of configureStreams()
The only caller of configureStreams() stores its return value as an int
and not bool. This is confusing and also prevents the (possibly)
different error codes returned by Camera::configureStreams() to be
propagated inside the cam tool. Fix this by changing the return type to
int and propagate the return value from the camera.
Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/cam')
-rw-r--r-- | src/cam/main.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/cam/main.cpp b/src/cam/main.cpp index 9b67ab75..7c47ce65 100644 --- a/src/cam/main.cpp +++ b/src/cam/main.cpp @@ -78,7 +78,7 @@ static int parseOptions(int argc, char *argv[]) return 0; } -static bool configureStreams(Camera *camera, std::vector<Stream *> &streams) +static int configureStreams(Camera *camera, std::vector<Stream *> &streams) { KeyValueParser::Options format = options[OptFormat]; Stream *id = streams.front(); @@ -98,10 +98,7 @@ static bool configureStreams(Camera *camera, std::vector<Stream *> &streams) config[id].pixelFormat = format["pixelformat"]; } - if (camera->configureStreams(config)) - return false; - - return true; + return camera->configureStreams(config); } static void requestComplete(Request *request, const std::map<Stream *, Buffer *> &buffers) |