From patchwork Wed Jul 8 13:44:17 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8690 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id DB4E0BD792 for ; Wed, 8 Jul 2020 13:45:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id A92246114B; Wed, 8 Jul 2020 15:45:15 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="bbXoQ940"; dkim-atps=neutral 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 3F9BD6112A for ; Wed, 8 Jul 2020 15:45:14 +0200 (CEST) Received: from pyrite.rasen.tech (unknown [IPv6:2400:4051:61:600:2c71:1b79:d06d:5032]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C26E451B; Wed, 8 Jul 2020 15:45:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594215914; bh=Y76cWm3jS1CcVT5hmHf3EU49LfWYrefHwqbT9EFavXE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbXoQ940NX/2XLO4c6GVLsACrp6s/otVVxEGK9QJzvkyz2cl0TmwFAn4fpfCNyjG4 oS+NFCcaPduXfYy+gCzKWq3+xgTSzHNEzt0sonkh5Aq7Xa8ImHYDfeBhj4mGESAUjw rhqk6zXfywKgrvMh3DU28bXfdEtXBmrvaAR3jf4M= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 8 Jul 2020 22:44:17 +0900 Message-Id: <20200708134417.67747-22-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200708134417.67747-1-paul.elder@ideasonboard.com> References: <20200708134417.67747-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 21/21] v4l2: v4l2_camera: Fix stream selection for buffer operations X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The buffer operations in V4L2Camera were getting the stream from the wrong place. Fix it. Signed-off-by: Paul Elder Reviewed-by: Laurent Pinchart Reviewed-by: Jacopo Mondi --- New in v4 --- src/v4l2/v4l2_camera.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/v4l2/v4l2_camera.cpp b/src/v4l2/v4l2_camera.cpp index 9f81c97..61bca07 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -160,7 +160,7 @@ int V4L2Camera::validateConfiguration(const PixelFormat &pixelFormat, int V4L2Camera::allocBuffers(unsigned int count) { - Stream *stream = *camera_->streams().begin(); + Stream *stream = config_->at(0).stream(); return bufferAllocator_->allocate(stream); } @@ -169,13 +169,13 @@ void V4L2Camera::freeBuffers() { pendingRequests_.clear(); - Stream *stream = *camera_->streams().begin(); + Stream *stream = config_->at(0).stream(); bufferAllocator_->free(stream); } FileDescriptor V4L2Camera::getBufferFd(unsigned int index) { - Stream *stream = *camera_->streams().begin(); + Stream *stream = config_->at(0).stream(); const std::vector> &buffers = bufferAllocator_->buffers(stream);