From patchwork Mon Aug 16 04:31:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13365 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 84987BD87D for ; Mon, 16 Aug 2021 04:32:02 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1F797688C4; Mon, 16 Aug 2021 06:32:02 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YgTTNAX1"; dkim-atps=neutral Received: from mail-pj1-x1030.google.com (mail-pj1-x1030.google.com [IPv6:2607:f8b0:4864:20::1030]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8C06168892 for ; Mon, 16 Aug 2021 06:31:58 +0200 (CEST) Received: by mail-pj1-x1030.google.com with SMTP id w14so24477433pjh.5 for ; Sun, 15 Aug 2021 21:31:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a4AJqyB/WfqVzb/ZaK2PhCQNUXRUhr1JGmbh6yQPpkY=; b=YgTTNAX1hxb+UReWQCifyV6Cekq7CDqtLKOWb23M+mLTtshi3OWz0IFZTvDQiEieHg AqhzAO56FRlgzLL/h6awhF3uv987cWgjwxmXip9EWPLBq154AtaCtjbjN+JoAiWo07N4 zVZiBikDgoQXSSxkqEw/pnIfh/rdEvPrxzTVA= 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:mime-version:content-transfer-encoding; bh=a4AJqyB/WfqVzb/ZaK2PhCQNUXRUhr1JGmbh6yQPpkY=; b=k6DTYwPCEGe2BYTjbDW9B3+0qCCjyi/DUzit0ivwbFRbS8w/RryXXAQwJSDZ76OE/8 XPQrIGxlzcvcFKIlcRSV5udH/fQW/93tYuXgWo7o4/OLDKTuLBdVYDhjh1zAua/a2CQ/ 5+FrVyr62v/Z3GVl120uma6G9uGTkI/+7MShHxvOVp9+YdoN2OhBP/EuH5KzClfj75pO sAtY60/visFWFExSgC9I2KnJVKDsq1M2Kk8ncy1HTphX7htk7+UD/71zfaQCcPAXmLBJ nCDY3BPU6oWziBCv2fuqjWUDMFhmxi42f0yL4yofRP70svW0t0M3amIyu3afLpSpV84V 2AHw== X-Gm-Message-State: AOAM5322F6ld1eOwuJXqRoxLyFw0hZkd8+DUNUiC4ZJgf45aYt5AOxJC MbqP1q3NvMCZXeawtc6DLOg8dWp/v688Nw== X-Google-Smtp-Source: ABdhPJxCGlbH44hu3nJ47ivynPtb4RAv0t4KQ3gu9835Wn0u4egRMAl2SsR1orPmoL7ggOR/rOSd5g== X-Received: by 2002:a65:608f:: with SMTP id t15mr14128132pgu.452.1629088316973; Sun, 15 Aug 2021 21:31:56 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6f5f:1479:a6ab:4229]) by smtp.gmail.com with ESMTPSA id u10sm2767417pgj.48.2021.08.15.21.31.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 21:31:56 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Aug 2021 13:31:35 +0900 Message-Id: <20210816043138.957984-8-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog In-Reply-To: <20210816043138.957984-1-hiroh@chromium.org> References: <20210816043138.957984-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 07/10] gstreamer: gstlibcameraallocator: Use offset in creating a buffer 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 plane length is the length of the plane size. The buffer length to be allocated for a plane is the offset and the length of FrameBuffer::Plane. Signed-off-by: Hirokazu Honda --- src/gstreamer/gstlibcameraallocator.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp index 7bd8ba2d..a3ffec5b 100644 --- a/src/gstreamer/gstlibcameraallocator.cpp +++ b/src/gstreamer/gstlibcameraallocator.cpp @@ -52,7 +52,8 @@ FrameWrap::FrameWrap(GstAllocator *allocator, FrameBuffer *buffer, outstandingPlanes_(0) { for (const FrameBuffer::Plane &plane : buffer->planes()) { - GstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(), plane.length, + GstMemory *mem = gst_fd_allocator_alloc(allocator, plane.fd.fd(), + plane.offset + plane.length, GST_FD_MEMORY_FLAG_DONT_CLOSE); gst_mini_object_set_qdata(GST_MINI_OBJECT(mem), getQuark(), this, nullptr); GST_MINI_OBJECT(mem)->dispose = gst_libcamera_allocator_release;