Patch Detail
Show a patch.
GET /api/1.1/patches/3007/?format=api
{ "id": 3007, "url": "https://patchwork.libcamera.org/api/1.1/patches/3007/?format=api", "web_url": "https://patchwork.libcamera.org/patch/3007/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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": "<20200306202637.525587-2-nicolas@ndufresne.ca>", "date": "2020-03-06T20:26:11", "name": "[libcamera-devel,v3,01/27] Add GStreamer plugin and element skeleton", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ca9a0292c5c6bd2e141da1ac05ef9225c184c94f", "submitter": { "id": 30, "url": "https://patchwork.libcamera.org/api/1.1/people/30/?format=api", "name": "Nicolas Dufresne", "email": "nicolas@ndufresne.ca" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/3007/mbox/", "series": [ { "id": 705, "url": "https://patchwork.libcamera.org/api/1.1/series/705/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=705", "date": "2020-03-06T20:26:10", "name": "GStreamer Element for libcamera", "version": 3, "mbox": "https://patchwork.libcamera.org/series/705/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/3007/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/3007/checks/", "tags": {}, "headers": { "Return-Path": "<nicolas@ndufresne.ca>", "Received": [ "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 99AE560424\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 6 Mar 2020 21:26:57 +0100 (CET)", "from nicolas-tpx395.localdomain (unknown [IPv6:2610:98:8005::527])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nicolas)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 15F5F2970E7;\n\tFri, 6 Mar 2020 20:26:57 +0000 (GMT)" ], "From": "Nicolas Dufresne <nicolas@ndufresne.ca>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Nicolas Dufresne <nicolas.dufresne@collabora.com>,\n\tLaurent Pinchart <laurent.pinchart@ideasonboard.com>", "Date": "Fri, 6 Mar 2020 15:26:11 -0500", "Message-Id": "<20200306202637.525587-2-nicolas@ndufresne.ca>", "X-Mailer": "git-send-email 2.24.1", "In-Reply-To": "<20200306202637.525587-1-nicolas@ndufresne.ca>", "References": "<20200306202637.525587-1-nicolas@ndufresne.ca>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v3 01/27] Add GStreamer plugin and element\n\tskeleton", "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": "Fri, 06 Mar 2020 20:26:57 -0000" }, "content": "From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nThis implements the GStreamer plugin interface and adds libcamerasrc\nelement feature to it. This is just enough to allow plugin\nintrospection.\n\ngst-inspect-1.0 build/src/gstreamer/libgstlibcamera.so\nPlugin Details:\n Name libcamera\n Description libcamera capture plugin\n Filename build/src/gstreamer/libgstlibcamera.so\n Version 0.0.0+1042-6c9f16d3-dirty\n License LGPL\n Source module libcamera\n Binary package libcamera\n Origin URL https://libcamera.org\n\n libcamerasrc: libcamera Source\n\n 1 features:\n\nGST_PLUGIN_PATH=$(pwd)/build/src/gstreamer gst-inspect-1.0 libcamerasrc\nFactory Details:\n Rank primary (256)\n Long-name libcamera Source\n Klass Source/Video\n Description Linux Camera source using libcamera\n Author Nicolas Dufresne <nicolas.dufresne@collabora.com\n\nPlugin Details:\n Name libcamera\n Description libcamera capture plugin\n Filename /home/nicolas/Sources/libcamera/build/src/gstreamer/libgstlibcamera.so\n Version 0.0.0+1042-6c9f16d3-dirty\n License LGPL\n Source module libcamera\n Binary package libcamera\n Origin URL https://libcamera.org\n\nGObject\n +----GInitiallyUnowned\n +----GstObject\n +----GstElement\n +----GstLibcameraSrc\n\nPad Templates:\n none\n\nElement has no clocking capabilities.\nElement has no URI handling capabilities.\n\nPads:\n none\n\nElement Properties:\n name : The name of the object\n flags: accès en lecture, accès en écriture, 0x2000\n String. Default: \"libcamerasrc0\"\n parent : The parent of the object\n flags: accès en lecture, accès en écriture, 0x2000\n Object of type \"GstObject\"\n\nSigned-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n meson_options.txt | 5 +++++\n src/gstreamer/gstlibcamera.c | 21 +++++++++++++++++++++\n src/gstreamer/gstlibcamerasrc.cpp | 31 +++++++++++++++++++++++++++++++\n src/gstreamer/gstlibcamerasrc.h | 22 ++++++++++++++++++++++\n src/gstreamer/meson.build | 22 ++++++++++++++++++++++\n src/meson.build | 2 ++\n 6 files changed, 103 insertions(+)\n create mode 100644 src/gstreamer/gstlibcamera.c\n create mode 100644 src/gstreamer/gstlibcamerasrc.cpp\n create mode 100644 src/gstreamer/gstlibcamerasrc.h\n create mode 100644 src/gstreamer/meson.build", "diff": "diff --git a/meson_options.txt b/meson_options.txt\nindex 79ee4de..b17b6de 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -7,6 +7,11 @@ option('documentation',\n type : 'boolean',\n description : 'Generate the project documentation')\n \n+option('gstreamer',\n+ type : 'feature',\n+ value : 'auto',\n+ description : 'Compile libcamera GStreamer plugin')\n+\n option('test',\n type : 'boolean',\n description: 'Compile and include the tests')\ndiff --git a/src/gstreamer/gstlibcamera.c b/src/gstreamer/gstlibcamera.c\nnew file mode 100644\nindex 0000000..7dd94ca\n--- /dev/null\n+++ b/src/gstreamer/gstlibcamera.c\n@@ -0,0 +1,21 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Collabora Ltd.\n+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n+ *\n+ * gstlibcamera.c - GStreamer plugin\n+ */\n+\n+#include \"gstlibcamerasrc.h\"\n+\n+static gboolean\n+plugin_init(GstPlugin *plugin)\n+{\n+\treturn gst_element_register(plugin, \"libcamerasrc\", GST_RANK_PRIMARY,\n+\t\t\t\t GST_TYPE_LIBCAMERA_SRC);\n+\treturn TRUE;\n+}\n+\n+GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR,\n+\t\t libcamera, \"libcamera capture plugin\",\n+\t\t plugin_init, VERSION, \"LGPL\", PACKAGE, \"https://libcamera.org\");\ndiff --git a/src/gstreamer/gstlibcamerasrc.cpp b/src/gstreamer/gstlibcamerasrc.cpp\nnew file mode 100644\nindex 0000000..3807503\n--- /dev/null\n+++ b/src/gstreamer/gstlibcamerasrc.cpp\n@@ -0,0 +1,31 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Collabora Ltd.\n+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n+ *\n+ * gstlibcamerasrc.cpp - GStreamer Capture Element\n+ */\n+\n+#include \"gstlibcamerasrc.h\"\n+\n+struct _GstLibcameraSrc {\n+\tGstElement parent;\n+};\n+\n+G_DEFINE_TYPE(GstLibcameraSrc, gst_libcamera_src, GST_TYPE_ELEMENT);\n+\n+static void\n+gst_libcamera_src_init(GstLibcameraSrc *self)\n+{\n+}\n+\n+static void\n+gst_libcamera_src_class_init(GstLibcameraSrcClass *klass)\n+{\n+\tGstElementClass *element_class = (GstElementClass *)klass;\n+\n+\tgst_element_class_set_metadata(element_class,\n+\t\t\t\t \"libcamera Source\", \"Source/Video\",\n+\t\t\t\t \"Linux Camera source using libcamera\",\n+\t\t\t\t \"Nicolas Dufresne <nicolas.dufresne@collabora.com\");\n+}\ndiff --git a/src/gstreamer/gstlibcamerasrc.h b/src/gstreamer/gstlibcamerasrc.h\nnew file mode 100644\nindex 0000000..0144cbc\n--- /dev/null\n+++ b/src/gstreamer/gstlibcamerasrc.h\n@@ -0,0 +1,22 @@\n+/* SPDX-License-Identifier: LGPL-2.1-or-later */\n+/*\n+ * Copyright (C) 2019, Collabora Ltd.\n+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n+ *\n+ * gstlibcamerasrc.h - GStreamer Capture Element\n+ */\n+\n+#ifndef __GST_LIBCAMERA_SRC_H__\n+#define __GST_LIBCAMERA_SRC_H__\n+\n+#include <gst/gst.h>\n+\n+G_BEGIN_DECLS\n+\n+#define GST_TYPE_LIBCAMERA_SRC gst_libcamera_src_get_type()\n+G_DECLARE_FINAL_TYPE(GstLibcameraSrc, gst_libcamera_src,\n+\t\t GST_LIBCAMERA, SRC, GstElement)\n+\n+G_END_DECLS\n+\n+#endif /* __GST_LIBCAMERA_SRC_H__ */\ndiff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build\nnew file mode 100644\nindex 0000000..25350f2\n--- /dev/null\n+++ b/src/gstreamer/meson.build\n@@ -0,0 +1,22 @@\n+libcamera_gst_sources = [\n+ 'gstlibcamera.c',\n+ 'gstlibcamerasrc.cpp',\n+]\n+\n+libcamera_gst_c_args = [\n+ '-DVERSION=\"@0@\"'.format(libcamera_git_version),\n+ '-DPACKAGE=\"@0@\"'.format(meson.project_name()),\n+]\n+\n+gst_dep = dependency('gstreamer-video-1.0', version : '>=1.14.0',\n+ required : get_option('gstreamer'))\n+\n+if gst_dep.found()\n+ libcamera_gst = shared_library('gstlibcamera',\n+ libcamera_gst_sources,\n+ c_args : libcamera_gst_c_args,\n+ dependencies : [libcamera_dep, gst_dep],\n+ install: true,\n+ install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')),\n+ )\n+endif\ndiff --git a/src/meson.build b/src/meson.build\nindex 5adcd61..d818d8b 100644\n--- a/src/meson.build\n+++ b/src/meson.build\n@@ -10,3 +10,5 @@ subdir('qcam')\n if get_option('v4l2')\n subdir('v4l2')\n endif\n+\n+subdir('gstreamer')\n", "prefixes": [ "libcamera-devel", "v3", "01/27" ] }