{"id":16348,"url":"https://patchwork.libcamera.org/api/patches/16348/?format=json","web_url":"https://patchwork.libcamera.org/patch/16348/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20220623232210.18742-3-laurent.pinchart@ideasonboard.com>","date":"2022-06-23T23:21:59","name":"[libcamera-devel,02/13] gstreamer: Inline gst_libcamera_buffer_get_frame_buffer()","commit_ref":null,"pull_url":null,"state":"rejected","archived":false,"hash":"2cac7cb71c1aa99d34b76cd109a271b11dbe4352","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/16348/mbox/","series":[{"id":3214,"url":"https://patchwork.libcamera.org/api/series/3214/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3214","date":"2022-06-23T23:21:57","name":"gstreamer: Queue multiple requests","version":1,"mbox":"https://patchwork.libcamera.org/series/3214/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/16348/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/16348/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 B532EBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 23 Jun 2022 23:22:36 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 70C7765637;\n\tFri, 24 Jun 2022 01:22:32 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A9AFA61FB2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Jun 2022 01:22:29 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 3A1D680A;\n\tFri, 24 Jun 2022 01:22:29 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656026552;\n\tbh=0wpZYTfLk/Mcc6U4ycBHRlBVzwvx/QvEUATQ8Os0Nes=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc:\n\tFrom;\n\tb=NmRxF9zTc3Stjcol2eD0MUXbr9fj4YFhtok5TqgIE22HX2rwHNBOPKFjAGNow+yAs\n\t+L6PV8H7DIaF8LylBf4IEWCDuT+02EH2ncp2320YQ580ZOcG+KhxFrbzHJR/PYRqXu\n\tK5au1Y9ujTeuNN4cSH4YUwTC1Wc31EG+xfGvpoAElzXTeHiYLM4b9xSjeHahVw+7KX\n\txGQNEJ1jiZpdRT+79con6ETrQbZUDSpsZeMJKKaMTaCzlQT1PDLhdcAoPbB34kp/sy\n\tD13xoadveagajpJg0Ry0tK2TpHbL7yNfUn4krmyeopXia4NFNEEZeD09RvKF9CNTmu\n\tIv2Utx9Lk5EAA==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1656026549;\n\tbh=0wpZYTfLk/Mcc6U4ycBHRlBVzwvx/QvEUATQ8Os0Nes=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=CMjoRpaVgc+qKYe4dzNa2jAscxBrleGV76UGYGTW//VPzL88tYvCPo8XF3Mj1hmwg\n\t4MQnC97+tumuLXyS7GdkGq0mCP+ijhULfNhep/CWt7tHL1Fl4VstLSqpd0lAlO3v6R\n\t1UvsQ7erqT3PXVktEeV0A1LT/T04ZfQLNiPUXGWE="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"CMjoRpaV\"; dkim-atps=neutral","To":"libcamera-devel@lists.libcamera.org","Date":"Fri, 24 Jun 2022 02:21:59 +0300","Message-Id":"<20220623232210.18742-3-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.35.1","In-Reply-To":"<20220623232210.18742-1-laurent.pinchart@ideasonboard.com>","References":"<20220623232210.18742-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH 02/13] gstreamer: Inline\n\tgst_libcamera_buffer_get_frame_buffer()","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>","From":"Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"Nicolas Dufresne <nicolas.dufresne@collabora.com>,\n\tVedant Paranjape <vedantparanjape160201@gmail.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The gst_libcamera_buffer_get_frame_buffer() function retrieves a\nFrameBuffer corresponding to the GstBuffer. While the GstLibcameraPool\nclass allocates the GstBuffer instances, associating them to a\nFrameBuffer is handled by GstLibcameraAllocator. The\ngst_libcamera_buffer_get_frame_buffer() function is ill-placed in\ngstlibcamerapool.cpp. Move it to gstlibcameraallocator.cpp, which allows\ninlining it in its single caller, simplifying the code flow.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/gstreamer/gstlibcameraallocator.cpp | 3 ++-\n src/gstreamer/gstlibcameraallocator.h   | 2 +-\n src/gstreamer/gstlibcamerapool.cpp      | 7 -------\n src/gstreamer/gstlibcamerapool.h        | 2 --\n 4 files changed, 3 insertions(+), 11 deletions(-)","diff":"diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\nindex c740b8fc82a8..53693834eeff 100644\n--- a/src/gstreamer/gstlibcameraallocator.cpp\n+++ b/src/gstreamer/gstlibcameraallocator.cpp\n@@ -252,8 +252,9 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self,\n }\n \n FrameBuffer *\n-gst_libcamera_memory_get_frame_buffer(GstMemory *mem)\n+gst_libcamera_buffer_get_frame_buffer(GstBuffer *buffer)\n {\n+\tGstMemory *mem = gst_buffer_peek_memory(buffer, 0);\n \tauto *frame = reinterpret_cast<FrameWrap *>(gst_mini_object_get_qdata(GST_MINI_OBJECT_CAST(mem),\n \t\t\t\t\t\t\t\t\t      FrameWrap::getQuark()));\n \treturn frame->buffer_;\ndiff --git a/src/gstreamer/gstlibcameraallocator.h b/src/gstreamer/gstlibcameraallocator.h\nindex 0a08c3bb3bbe..b1c038c50257 100644\n--- a/src/gstreamer/gstlibcameraallocator.h\n+++ b/src/gstreamer/gstlibcameraallocator.h\n@@ -28,4 +28,4 @@ bool gst_libcamera_allocator_prepare_buffer(GstLibcameraAllocator *self,\n gsize gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *allocator,\n \t\t\t\t\t    libcamera::Stream *stream);\n \n-libcamera::FrameBuffer *gst_libcamera_memory_get_frame_buffer(GstMemory *mem);\n+libcamera::FrameBuffer *gst_libcamera_buffer_get_frame_buffer(GstBuffer *buffer);\ndiff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp\nindex 1fde42135119..118bc6db7067 100644\n--- a/src/gstreamer/gstlibcamerapool.cpp\n+++ b/src/gstreamer/gstlibcamerapool.cpp\n@@ -140,10 +140,3 @@ gst_libcamera_buffer_get_stream(GstBuffer *buffer)\n \tauto *self = (GstLibcameraPool *)buffer->pool;\n \treturn self->stream;\n }\n-\n-FrameBuffer *\n-gst_libcamera_buffer_get_frame_buffer(GstBuffer *buffer)\n-{\n-\tGstMemory *mem = gst_buffer_peek_memory(buffer, 0);\n-\treturn gst_libcamera_memory_get_frame_buffer(mem);\n-}\ndiff --git a/src/gstreamer/gstlibcamerapool.h b/src/gstreamer/gstlibcamerapool.h\nindex 05795d21223e..06b38cb296fc 100644\n--- a/src/gstreamer/gstlibcamerapool.h\n+++ b/src/gstreamer/gstlibcamerapool.h\n@@ -26,5 +26,3 @@ GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n libcamera::Stream *gst_libcamera_pool_get_stream(GstLibcameraPool *self);\n \n libcamera::Stream *gst_libcamera_buffer_get_stream(GstBuffer *buffer);\n-\n-libcamera::FrameBuffer *gst_libcamera_buffer_get_frame_buffer(GstBuffer *buffer);\n","prefixes":["libcamera-devel","02/13"]}