From patchwork Wed Feb 13 15:10:22 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kieran Bingham X-Patchwork-Id: 572 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 40050610B3 for ; Wed, 13 Feb 2019 16:10:33 +0100 (CET) Received: from localhost.localdomain (cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D5B2C9A5; Wed, 13 Feb 2019 16:10:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1550070633; bh=82pPgT7VeMS1QMd0DnOjk6Y3MuE2k9tcwpUCTpCPNxo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YOIg8bDoVBxtczGmqWqMqaOSKOSno2Sw9TireaxzVk9lfd8hwCOaKBsLAsYxhQOvB Z4asZ4qYekkaQ5QAaxaVF2x0YBYT1OJwcUW7uDB4u9koncd1DsXCTQId+YmKeR/eFB lOYuG5QgVrGlB+/M9OjohMm+NA7Tw+cJkZf2ZPNQ= From: Kieran Bingham To: LibCamera Devel Date: Wed, 13 Feb 2019 15:10:22 +0000 Message-Id: <20190213151027.6376-4-kieran.bingham@ideasonboard.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190213151027.6376-1-kieran.bingham@ideasonboard.com> References: <20190213151027.6376-1-kieran.bingham@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 3/8] libcamera: v4l2_device: streamOff() when releasing buffers X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Feb 2019 15:10:33 -0000 We must ensure that the stream is disabled before releasing buffers. It will not hurt to call streamOff() even if it is already off before releasing any buffers back to the device. Signed-off-by: Kieran Bingham --- src/libcamera/v4l2_device.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 23c0da295905..83073c28b817 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -642,6 +642,8 @@ int V4L2Device::releaseBuffers() { LOG(V4L2, Debug) << "Releasing bufferPool"; + streamOff(); + requestBuffers(0); bufferPool_ = nullptr;