From c5ab56e9ddb95af6dcc30f9e0bd9d22015287da4 Mon Sep 17 00:00:00 2001 From: Mohammed Sameer Date: Sun, 23 Sep 2012 00:22:05 +0300 Subject: [PATCH] return true if we try to set the resolution and the pipeline is not running --- lib/qtcamimagemode.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/qtcamimagemode.cpp b/lib/qtcamimagemode.cpp index 05a6d10..df132d6 100644 --- a/lib/qtcamimagemode.cpp +++ b/lib/qtcamimagemode.cpp @@ -111,8 +111,14 @@ bool QtCamImageMode::capture(const QString& fileName) { bool QtCamImageMode::setResolution(const QtCamImageResolution& resolution) { d->resolution = resolution; + if (!d_ptr->dev->q_ptr->isRunning()) { + // We will return true here because setting the resolution on a non-running pipeline + // doesn't make much sense (Probably the only use case is as a kind of optimization only). + // We will set it anyway when the pipeline gets started. + return true; + } - if (!d_ptr->dev->q_ptr->isRunning() || !d_ptr->dev->q_ptr->isIdle()) { + if (!d_ptr->dev->q_ptr->isIdle()) { return false; } -- 2.25.1