Show a patch.

GET /api/1.1/patches/2735/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 2735,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/2735/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/2735/",
    "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": "<20200129033210.278800-2-nicolas@ndufresne.ca>",
    "date": "2020-01-29T03:31:48",
    "name": "[libcamera-devel,v1,01/23] Add GStreamer plugin and element skeleton",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "2f74d5acdb61e19b61b5aa49d3aa42918d6f172f",
    "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/2735/mbox/",
    "series": [
        {
            "id": 648,
            "url": "https://patchwork.libcamera.org/api/1.1/series/648/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=648",
            "date": "2020-01-29T03:31:47",
            "name": "GStreamer Element for libcamera",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/648/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/2735/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/2735/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<nicolas@ndufresne.ca>",
        "Received": [
            "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 919806044C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jan 2020 04:35:12 +0100 (CET)",
            "from nicolas-tpx395.localdomain (unknown\n\t[IPv6:2002:c0de:c115:0:66fc:8b:2a38:8313])\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 93DE1292988;\n\tWed, 29 Jan 2020 03:35:11 +0000 (GMT)"
        ],
        "From": "Nicolas Dufresne <nicolas@ndufresne.ca>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Nicolas Dufresne <nicolas.dufresne@collabora.com>",
        "Date": "Tue, 28 Jan 2020 22:31:48 -0500",
        "Message-Id": "<20200129033210.278800-2-nicolas@ndufresne.ca>",
        "X-Mailer": "git-send-email 2.24.1",
        "In-Reply-To": "<20200129033210.278800-1-nicolas@ndufresne.ca>",
        "References": "<20200129033210.278800-1-nicolas@ndufresne.ca>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1 01/23] 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": "Wed, 29 Jan 2020 03:35:12 -0000"
    },
    "content": "From: Nicolas Dufresne <nicolas.dufresne@collabora.com>\n\nSigned-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.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         | 23 +++++++++++++++++++++++\n src/meson.build                   |  2 ++\n 6 files changed, 104 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..1b78ed8 100644\n--- a/meson_options.txt\n+++ b/meson_options.txt\n@@ -15,3 +15,8 @@ option('v4l2',\n         type : 'boolean',\n         value : false,\n         description : 'Compile the V4L2 compatibility layer')\n+\n+option('gstreamer',\n+        type : 'feature',\n+        value : 'auto',\n+        description : 'Compile libcamera GStreamer plugin')\ndiff --git a/src/gstreamer/gstlibcamera.c b/src/gstreamer/gstlibcamera.c\nnew file mode 100644\nindex 0000000..953fb29\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..39a06a4\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..6d2f794\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+#include <gst/gst.h>\n+\n+#ifndef __GST_LIBCAMERA_SRC_H__\n+#define __GST_LIBCAMERA_SRC_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..32d4233\n--- /dev/null\n+++ b/src/gstreamer/meson.build\n@@ -0,0 +1,23 @@\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.16.1',\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+      include_directories : [],\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",
        "v1",
        "01/23"
    ]
}