From patchwork Wed Aug 11 12:40:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13301 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 7C293BD87D for ; Wed, 11 Aug 2021 12:40:26 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id EA4836884F; Wed, 11 Aug 2021 14:40:25 +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="fyiIh3IZ"; 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 C007A68826 for ; Wed, 11 Aug 2021 14:40:24 +0200 (CEST) Received: by mail-pj1-x1030.google.com with SMTP id lw7-20020a17090b1807b029017881cc80b7so9296760pjb.3 for ; Wed, 11 Aug 2021 05:40:24 -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:mime-version :content-transfer-encoding; bh=TjMV2hbre32oGAcqU+C5WWfxIEQsxgiwwK4+OY7kvjk=; b=fyiIh3IZXqHU2P7+1Gd/iaC8KDMEqzOvrIs5f5Cw18dYqfiPOd84CGclxmCAWTyCnF W7Gwc6eI4FdZ5ylUudtT/yEruDJjTU+D9DONpkRB8XEpA+WcyvF5sewDcIvxiv0fpgub ToDnguNMvps15R4oirVYCQ3qTvQdCLS6Xu3N0= 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:mime-version :content-transfer-encoding; bh=TjMV2hbre32oGAcqU+C5WWfxIEQsxgiwwK4+OY7kvjk=; b=dbcZx0430qyBFMLxqxzyYjAAcxX92jzZNZvHiEecrTrccUEYA+blbcolPbXHdHAQLk v/gmXiSFT0VMuBkFvTHjmf/kkKJPGEGISuPC2RBprpJncNxdW5OeI/6Un0JSQi3pCHVw 0YQ+br6cFPYBcSH+9N00v9bLtcaHbKjViP8UpQ2gUpz520g/v1I39NnwwfCIKIjoSivw /9PQ6CCBZYdycnzXZOkgp95S68A4NlkvXs/gpUPYvJoVhmvDDxGVsT6lBiPhVrbCpWRi TUifoXeX1TTJvzcZTZg2hyndLllkndFHqFTGmcZLyEPukH6YqVPgzTk4zXStJNbO5FEq 9UQw== X-Gm-Message-State: AOAM530lvfeGotGYvIcheQmwaBAa/dkoDVxxBrxxBoaU0hNrgYxyFn61 pSxgqlLxgLuJujPmze6Qz85YL+hLYUP7/A== X-Google-Smtp-Source: ABdhPJwS0qZ2Fkx9o/w2K4MCxosYzNylxR2E8PDlSkzKYhhs5FTkgOW+SiFEWB3H0347k6n87/GaIA== X-Received: by 2002:a17:90a:c705:: with SMTP id o5mr21135494pjt.55.1628685622784; Wed, 11 Aug 2021 05:40:22 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:ba11:c25e:242c:485d]) by smtp.gmail.com with ESMTPSA id p30sm15722876pfh.116.2021.08.11.05.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Aug 2021 05:40:22 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Wed, 11 Aug 2021 21:40:10 +0900 Message-Id: <20210811124015.2116188-1-hiroh@chromium.org> X-Mailer: git-send-email 2.32.0.605.g8dce9f2422-goog MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 0/5] MappedFrameBuffer::maps() returns the plane address 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 goal is to acquire the plane address by MappedFrameBuffer::maps(). Currently it returns the address of the begging of a buffer where a plane exists. To achieve this, it is necessary to not only change MappedFrameBuffer implementation, but also fix codes of filling length in FrameBuffer::Plane. It is set to the buffer length, not plane length, in some places. Hirokazu Honda (5): libcamera: mapped_framebuffer: Return plane begin address by MappedBuffer::maps() cam: file_sink: Fix wrong mapping planes android: camera_device: Fills the size of plane to FrameBuffer::Plane::length WIP: libcamera: V4L2VideoDevice: Fix a bug in CreateBuffer() WIP: android: jpeg: Use maps() and clean up .../libcamera/internal/mapped_framebuffer.h | 4 +- src/android/camera_device.cpp | 37 +++++------ src/android/jpeg/encoder.h | 7 ++- src/android/jpeg/encoder_libjpeg.cpp | 32 +++------- src/android/jpeg/encoder_libjpeg.h | 10 +-- src/android/jpeg/post_processor_jpeg.cpp | 21 +++++-- src/android/jpeg/thumbnailer.cpp | 36 +++++++++-- src/android/jpeg/thumbnailer.h | 4 +- src/cam/file_sink.cpp | 30 +++++++-- src/cam/file_sink.h | 1 + src/libcamera/mapped_framebuffer.cpp | 61 ++++++++++++++++--- src/libcamera/v4l2_videodevice.cpp | 15 ++++- 12 files changed, 178 insertions(+), 80 deletions(-) --- 2.32.0.605.g8dce9f2422-goog