Patch Detail
Show a patch.
GET /api/patches/2902/?format=api
{ "id": 2902, "url": "https://patchwork.libcamera.org/api/patches/2902/?format=api", "web_url": "https://patchwork.libcamera.org/patch/2902/", "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": "<20200227200407.490616-21-nicolas.dufresne@collabora.com>", "date": "2020-02-27T20:04:00", "name": "[libcamera-devel,v2,20/27] gst: Add getters for Stream and FrameBuffer", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "6ae7516bc48c4f0d823da74575623275b7778445", "submitter": { "id": 31, "url": "https://patchwork.libcamera.org/api/people/31/?format=api", "name": "Nicolas Dufresne", "email": "nicolas.dufresne@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/2902/mbox/", "series": [ { "id": 693, "url": "https://patchwork.libcamera.org/api/series/693/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=693", "date": "2020-02-27T20:03:40", "name": "GStreamer Element for libcamera", "version": 2, "mbox": "https://patchwork.libcamera.org/series/693/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/2902/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/2902/checks/", "tags": {}, "headers": { "Return-Path": "<nicolas.dufresne@collabora.com>", "Received": [ "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 7A5946273C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 27 Feb 2020 21:04:27 +0100 (CET)", "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: nicolas) with ESMTPSA id EE40729654A" ], "From": "Nicolas Dufresne <nicolas.dufresne@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 27 Feb 2020 15:04:00 -0500", "Message-Id": "<20200227200407.490616-21-nicolas.dufresne@collabora.com>", "X-Mailer": "git-send-email 2.24.1", "In-Reply-To": "<20200227200407.490616-1-nicolas.dufresne@collabora.com>", "References": "<20200227200407.490616-1-nicolas.dufresne@collabora.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 20/27] gst: Add getters for Stream and\n\tFrameBuffer", "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>", "X-List-Received-Date": "Thu, 27 Feb 2020 20:04:30 -0000" }, "content": "This adds getters on pad/pool/allocator so that we can retrieve the\nStream or FrameBuffer.\n\nSigned-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/gstreamer/gstlibcameraallocator.cpp | 8 ++++++++\n src/gstreamer/gstlibcameraallocator.h | 2 ++\n src/gstreamer/gstlibcamerapad.cpp | 11 +++++++++++\n src/gstreamer/gstlibcamerapad.h | 2 ++\n src/gstreamer/gstlibcamerapool.cpp | 20 ++++++++++++++++++++\n src/gstreamer/gstlibcamerapool.h | 7 +++++++\n src/gstreamer/gstlibcamerasrc.cpp | 1 -\n 7 files changed, 50 insertions(+), 1 deletion(-)", "diff": "diff --git a/src/gstreamer/gstlibcameraallocator.cpp b/src/gstreamer/gstlibcameraallocator.cpp\nindex f268561..f87b52c 100644\n--- a/src/gstreamer/gstlibcameraallocator.cpp\n+++ b/src/gstreamer/gstlibcameraallocator.cpp\n@@ -242,3 +242,11 @@ gst_libcamera_allocator_get_pool_size(GstLibcameraAllocator *self,\n \n \treturn pool->length;\n }\n+\n+FrameBuffer *\n+gst_libcamera_memory_get_frame_buffer(GstMemory *mem)\n+{\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_;\n+}\ndiff --git a/src/gstreamer/gstlibcameraallocator.h b/src/gstreamer/gstlibcameraallocator.h\nindex 25cbf85..8839040 100644\n--- a/src/gstreamer/gstlibcameraallocator.h\n+++ b/src/gstreamer/gstlibcameraallocator.h\n@@ -26,4 +26,6 @@ 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+\n #endif /* __GST_LIBCAMERA_ALLOCATOR_H__ */\ndiff --git a/src/gstreamer/gstlibcamerapad.cpp b/src/gstreamer/gstlibcamerapad.cpp\nindex c4c466d..4f96546 100644\n--- a/src/gstreamer/gstlibcamerapad.cpp\n+++ b/src/gstreamer/gstlibcamerapad.cpp\n@@ -125,3 +125,14 @@ gst_libcamera_pad_set_pool(GstPad *pad, GstLibcameraPool *pool)\n \t\tg_object_unref(self->pool);\n \tself->pool = pool;\n }\n+\n+Stream *\n+gst_libcamera_pad_get_stream(GstPad *pad)\n+{\n+\tauto *self = GST_LIBCAMERA_PAD(pad);\n+\n+\tif (self->pool)\n+\t\treturn gst_libcamera_pool_get_stream(self->pool);\n+\n+\treturn nullptr;\n+}\ndiff --git a/src/gstreamer/gstlibcamerapad.h b/src/gstreamer/gstlibcamerapad.h\nindex 4570c0c..81d0d58 100644\n--- a/src/gstreamer/gstlibcamerapad.h\n+++ b/src/gstreamer/gstlibcamerapad.h\n@@ -24,4 +24,6 @@ GstLibcameraPool *gst_libcamera_pad_get_pool(GstPad *pad);\n \n void gst_libcamera_pad_set_pool(GstPad *pad, GstLibcameraPool *pool);\n \n+libcamera::Stream *gst_libcamera_pad_get_stream(GstPad *pad);\n+\n #endif /* __GST_LIBCAMERA_PAD_H__ */\ndiff --git a/src/gstreamer/gstlibcamerapool.cpp b/src/gstreamer/gstlibcamerapool.cpp\nindex ee106a7..f85c3aa 100644\n--- a/src/gstreamer/gstlibcamerapool.cpp\n+++ b/src/gstreamer/gstlibcamerapool.cpp\n@@ -107,3 +107,23 @@ gst_libcamera_pool_new(GstLibcameraAllocator *allocator, Stream *stream)\n \n \treturn pool;\n }\n+\n+Stream *\n+gst_libcamera_pool_get_stream(GstLibcameraPool *self)\n+{\n+\treturn self->stream;\n+}\n+\n+Stream *\n+gst_libcamera_buffer_get_stream(GstBuffer *buffer)\n+{\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 a764c75..6fd2913 100644\n--- a/src/gstreamer/gstlibcamerapool.h\n+++ b/src/gstreamer/gstlibcamerapool.h\n@@ -23,4 +23,11 @@ G_DECLARE_FINAL_TYPE(GstLibcameraPool, gst_libcamera_pool, GST_LIBCAMERA, POOL,\n GstLibcameraPool *gst_libcamera_pool_new(GstLibcameraAllocator *allocator,\n \t\t\t\t\t libcamera::Stream *stream);\n \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+\n+\n #endif /* __GST_LIBCAMERA_POOL_H__ */\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nindex fa9ff5b..83f93cc 100644\n--- a/src/gstreamer/gstlibcamerasrc.cpp\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -256,7 +256,6 @@ gst_libcamera_src_task_leave(GstTask *task, GThread *thread, gpointer user_data)\n \tGstLibcameraSrcState *state = self->state;\n \n \tGST_DEBUG_OBJECT(self, \"Streaming thread is about to stop\");\n-\tstate->cam->stop();\n \n \tfor (GstPad *srcpad : state->srcpads)\n \t\tgst_libcamera_pad_set_pool(srcpad, NULL);\n", "prefixes": [ "libcamera-devel", "v2", "20/27" ] }