Patch Detail
Show a patch.
GET /api/patches/11379/?format=api
{ "id": 11379, "url": "https://patchwork.libcamera.org/api/patches/11379/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11379/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210225161106.15954-1-dafna.hirschfeld@collabora.com>", "date": "2021-02-25T16:11:06", "name": "[libcamera-devel,v2] gst: use the streams of CameraConfiguration when allocating buffers", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "5f8c8b81ff9213e648577aa6199b19ea520eee9d", "submitter": { "id": 46, "url": "https://patchwork.libcamera.org/api/people/46/?format=api", "name": "Dafna Hirschfeld", "email": "dafna.hirschfeld@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11379/mbox/", "series": [ { "id": 1727, "url": "https://patchwork.libcamera.org/api/series/1727/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1727", "date": "2021-02-25T16:11:06", "name": "[libcamera-devel,v2] gst: use the streams of CameraConfiguration when allocating buffers", "version": 2, "mbox": "https://patchwork.libcamera.org/series/1727/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11379/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11379/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id F23DFBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 25 Feb 2021 16:11:15 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 68CED68A49;\n\tThu, 25 Feb 2021 17:11:15 +0100 (CET)", "from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1134D602EE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Feb 2021 17:11:13 +0100 (CET)", "from guri.fritz.box\n\t(p200300c7cf1cce00c495f7eb403f1d15.dip0.t-ipconnect.de\n\t[IPv6:2003:c7:cf1c:ce00:c495:f7eb:403f:1d15])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: dafna)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 73F2E1F462C6;\n\tThu, 25 Feb 2021 16:11:13 +0000 (GMT)" ], "From": "Dafna Hirschfeld <dafna.hirschfeld@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 25 Feb 2021 17:11:06 +0100", "Message-Id": "<20210225161106.15954-1-dafna.hirschfeld@collabora.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[libcamera-devel] [PATCH v2] gst: use the streams of\n\tCameraConfiguration when allocating buffers", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "Cc": "kernel@collabora.com, nicolas.dufresne@collabora.com", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Currently, when allocating buffers, the streams of\nthe Camera object are used. Instead the streams of\nthe CameraConfiguration object should be used.\nThis is because the Camera object holds all available\nstreams while the CameraConfiguration holds only the streams\nassociated with the current configuration.\n\nSigned-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>\nReviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n---\nChanges from v1: change the prefix to 'gst:' and extend\nthe commit log.\n\n src/gstreamer/gstlibcameraallocator.cpp | 6 ++++--\n src/gstreamer/gstlibcameraallocator.h | 4 +++-\n src/gstreamer/gstlibcamerasrc.cpp | 2 +-\n 3 files changed, 8 insertions(+), 4 deletions(-)", "diff": "diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\nindex 13c6b493..7bd8ba2d 100644\n--- a/src/gstreamer/gstlibcameraallocator.cpp\n+++ b/src/gstreamer/gstlibcameraallocator.cpp\n@@ -183,13 +183,15 @@ gst_libcamera_allocator_class_init(GstLibcameraAllocatorClass *klass)\n }\n \n GstLibcameraAllocator *\n-gst_libcamera_allocator_new(std::shared_ptr<Camera> camera)\n+gst_libcamera_allocator_new(std::shared_ptr<Camera> camera,\n+\t\t\t CameraConfiguration *config_)\n {\n \tauto *self = GST_LIBCAMERA_ALLOCATOR(g_object_new(GST_TYPE_LIBCAMERA_ALLOCATOR,\n \t\t\t\t\t\t\t nullptr));\n \n \tself->fb_allocator = new FrameBufferAllocator(camera);\n-\tfor (Stream *stream : camera->streams()) {\n+\tfor (StreamConfiguration &streamCfg : *config_) {\n+\t\tStream *stream = streamCfg.stream();\n \t\tgint ret;\n \n \t\tret = self->fb_allocator->allocate(stream);\ndiff --git a/src/gstreamer/gstlibcameraallocator.h b/src/gstreamer/gstlibcameraallocator.h\nindex befdcad6..f7fa6acd 100644\n--- a/src/gstreamer/gstlibcameraallocator.h\n+++ b/src/gstreamer/gstlibcameraallocator.h\n@@ -13,12 +13,14 @@\n #include <gst/allocators/allocators.h>\n \n #include <libcamera/stream.h>\n+#include <libcamera/camera.h>\n \n #define GST_TYPE_LIBCAMERA_ALLOCATOR gst_libcamera_allocator_get_type()\n G_DECLARE_FINAL_TYPE(GstLibcameraAllocator, gst_libcamera_allocator,\n \t\t GST_LIBCAMERA, ALLOCATOR, GstDmaBufAllocator)\n \n-GstLibcameraAllocator *gst_libcamera_allocator_new(std::shared_ptr<libcamera::Camera> camera);\n+GstLibcameraAllocator *gst_libcamera_allocator_new(std::shared_ptr<libcamera::Camera> camera,\n+\t\t\t\t\t\t libcamera::CameraConfiguration *config_);\n \n bool gst_libcamera_allocator_prepare_buffer(GstLibcameraAllocator *self,\n \t\t\t\t\t libcamera::Stream *stream,\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex 636c14df..7b13667b 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -429,7 +429,7 @@ gst_libcamera_src_task_enter(GstTask *task, [[maybe_unused]] GThread *thread,\n \t\treturn;\n \t}\n \n-\tself->allocator = gst_libcamera_allocator_new(state->cam_);\n+\tself->allocator = gst_libcamera_allocator_new(state->cam_, state->config_.get());\n \tif (!self->allocator) {\n \t\tGST_ELEMENT_ERROR(self, RESOURCE, NO_SPACE_LEFT,\n \t\t\t\t (\"Failed to allocate memory\"),\n", "prefixes": [ "libcamera-devel", "v2" ] }