From patchwork Thu Jul 9 13:28:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 8735 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 54B5BBD792 for ; Thu, 9 Jul 2020 13:29:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2187B611BA; Thu, 9 Jul 2020 15:29:41 +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="M5Ee6Eq3"; 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 DEC06611BA for ; Thu, 9 Jul 2020 15:29:39 +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 33DC256E; Thu, 9 Jul 2020 15:29:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1594301379; bh=dtc2+Z8g+ODJm3FVyETwxgyoQyMsa22bFPLH4RYBYpE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M5Ee6Eq3GLeeir6VaQ35CtNvtaJII6lsD2sdKks+Cj+4wv9J+9tqYXGh6ZxD5cWCI OW82POgkuM7uOX/3/cWdDHUvPGMM45UgeajxuFPRFE0k5Bo/f25xhGxEFBphxZxEe6 OUNLlnKmgpmgztz37nPajO1puaUV5/nDodOVUGSc= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 9 Jul 2020 22:28:32 +0900 Message-Id: <20200709132835.112593-21-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200709132835.112593-1-paul.elder@ideasonboard.com> References: <20200709132835.112593-1-paul.elder@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 20/23] 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 --- No change in v5 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 ffc1230..a923256 100644 --- a/src/v4l2/v4l2_camera.cpp +++ b/src/v4l2/v4l2_camera.cpp @@ -140,7 +140,7 @@ int V4L2Camera::configure(StreamConfiguration *streamConfigOut, int V4L2Camera::allocBuffers(unsigned int count) { - Stream *stream = *camera_->streams().begin(); + Stream *stream = config_->at(0).stream(); return bufferAllocator_->allocate(stream); } @@ -149,13 +149,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);