summaryrefslogtreecommitdiff
path: root/src/gstreamer/gstlibcamera.cpp
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-07 20:48:33 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2020-03-07 21:53:59 +0200
commitf36ecf98247a81a322faded4f9b25f06fcbe4ccd (patch)
tree590713ec2c652b5e5fa4f7b559d8f79ae9a6a746 /src/gstreamer/gstlibcamera.cpp
parent6f344f8942768ee217c54d56d1809b5a83496970 (diff)
gst: Turn the top-level plugin file gstlibcamera.c into a C++ file
The top-level plugin file gstlibcamera.c is the only C source file in the whole libcamera GStreamer element. To avoid specifying both C and C++ compiler arguments in the future, turn it into a C++ file. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Diffstat (limited to 'src/gstreamer/gstlibcamera.cpp')
-rw-r--r--src/gstreamer/gstlibcamera.cpp27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/gstreamer/gstlibcamera.cpp b/src/gstreamer/gstlibcamera.cpp
new file mode 100644
index 00000000..81c7bb19
--- /dev/null
+++ b/src/gstreamer/gstlibcamera.cpp
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2019, Collabora Ltd.
+ * Author: Nicolas Dufresne <nicolas.dufresne@collabora.com>
+ *
+ * gstlibcamera.c - GStreamer plugin
+ */
+
+#include "gstlibcameraprovider.h"
+#include "gstlibcamerasrc.h"
+
+static gboolean
+plugin_init(GstPlugin *plugin)
+{
+ if (!gst_element_register(plugin, "libcamerasrc", GST_RANK_PRIMARY,
+ GST_TYPE_LIBCAMERA_SRC) ||
+ !gst_device_provider_register(plugin, "libcameraprovider",
+ GST_RANK_PRIMARY,
+ GST_TYPE_LIBCAMERA_PROVIDER))
+ return FALSE;
+
+ return TRUE;
+}
+
+GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR,
+ libcamera, "libcamera capture plugin",
+ plugin_init, VERSION, "LGPL", PACKAGE, "https://libcamera.org");