From patchwork Wed Jul 22 13:30:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 8923 X-Patchwork-Delegate: kieran.bingham@ideasonboard.com 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 D367DBDB1B for ; Wed, 22 Jul 2020 13:30:41 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 9FE3660994; Wed, 22 Jul 2020 15:30:41 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=es-iitr-ac-in.20150623.gappssmtp.com header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.b="o/54liiM"; dkim-atps=neutral Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 311AF6053C for ; Wed, 22 Jul 2020 15:30:40 +0200 (CEST) Received: by mail-pl1-x62d.google.com with SMTP id o1so1007973plk.1 for ; Wed, 22 Jul 2020 06:30:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=+3c51sUyT4iYVoTl5eFwaN3u9y2+PNbkP+wIjWb1BkA=; b=o/54liiMDYEKyESIJdayAzX5SutPw7oqPcSH+bhKQPog+2Xr+UnHkwmzYsGwDYNgr1 wv540dbKjMTt9JQZY/uneWvpPBRIHuY3hRqSvU2SjllKmI3wXruRVVbpslWRnTBrpq69 +7xvM5hx3/CzuB1i2fZotpbgb93bk//yGuxOPjL+4LNCYNJU4KUisA+ODVpH6Tj+ZAvw BAV4C5opzleLUxoJiB5mZOtvA+VL7Vf80bU7XXNKTriCdVfj4sKq5kJtAFEYzKNZ605u CxumuzHcHAplorvCb/u9ipdjNb1gLPatY8YRC0jii+I/uB3jbgE2u2zhyI4r2vFbafkb OR9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=+3c51sUyT4iYVoTl5eFwaN3u9y2+PNbkP+wIjWb1BkA=; b=omQovNTvhHcev5FpstrAgeay8Q/k9AboCxIiYwdenMRHPCJU0ldMAtvK5UAgSFUMTe uC8E4enXADcffZWWKZqopxOHGVRNql5+58PZlH0zv2AIE3Lyx2bHpad2woeAlNCXJ3fi h9ccbxura2pfwGSY0HvwQHuKgm4PV1D/VKWVX1ZVarV6YWxAdt4wdMYZccNdnbkuS7Lt kWeHp/mc0Z6+3MQiioTTPatpX61rr/UW46vSUqcYYYXgSm024ob98uqQNJzd0fBfWxNa EapVgOZ3TTf4U2Cdx0vlb7JE1Obuphv9tjE6UpPNTPGMhV3p9SQqxjIONTaOqJB3uM5f kj4g== X-Gm-Message-State: AOAM533qtagS3YAHEn5CmNKfzpmWZ2nr9tVjQ3nhXKhfXcBANeVthp4J YnIK/XDWNCOc7vd1vvGDkz9eVA== X-Google-Smtp-Source: ABdhPJx6J3n9lzAagjUdiF4W742vusRB4lnE7d/+rIkCQV/tXdTbGAipZrLvYPMF4/kTXsid5F3VCQ== X-Received: by 2002:a17:902:b714:: with SMTP id d20mr24859373pls.318.1595424638816; Wed, 22 Jul 2020 06:30:38 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.178]) by smtp.gmail.com with ESMTPSA id z6sm23517788pfn.173.2020.07.22.06.30.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jul 2020 06:30:38 -0700 (PDT) From: Kaaira Gupta To: libcamera-devel@lists.libcamera.org, Kieran Bingham Date: Wed, 22 Jul 2020 19:00:08 +0530 Message-Id: <20200722133009.26528-7-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200722133009.26528-1-kgupta@es.iitr.ac.in> References: <20200722133009.26528-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH 6/7] libcamera: pipeline: vimc: Queue the buffers 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: , Cc: Kaaira Gupta MIME-Version: 1.0 Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Queue the buffers correctly according to the streams requested. Signed-off-by: Kaaira Gupta --- src/libcamera/pipeline/vimc/vimc.cpp | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/src/libcamera/pipeline/vimc/vimc.cpp b/src/libcamera/pipeline/vimc/vimc.cpp index 6010e1e..7e8d355 100644 --- a/src/libcamera/pipeline/vimc/vimc.cpp +++ b/src/libcamera/pipeline/vimc/vimc.cpp @@ -536,19 +536,30 @@ int PipelineHandlerVimc::processControls(VimcCameraData *data, Request *request) int PipelineHandlerVimc::queueRequestDevice(Camera *camera, Request *request) { VimcCameraData *data = cameraData(camera); - FrameBuffer *buffer = request->findBuffer(&data->rgbStream_); - if (!buffer) { - LOG(VIMC, Error) - << "Attempt to queue request with invalid stream"; + for (auto it : request->buffers()) { + Stream *stream = static_cast(it.first); + FrameBuffer *buffer = it.second; + if (!buffer) { + LOG(VIMC, Error) + << "Attempt to queue request with invalid stream"; + + return -ENOENT; + } - return -ENOENT; - } + int ret; - int ret = processControls(data, request); - if (ret < 0) - return ret; + if (stream == &data->rgbStream_) + ret = data->video_->queueBuffer(buffer); + if (stream == &data->rawStream_) + ret = data->raw_->queueBuffer(buffer); + else + continue; - ret = data->video_->queueBuffer(buffer); + if (ret < 0) + return ret; + return ret; + } + int ret = processControls(data, request); if (ret < 0) return ret;