From f36ecf98247a81a322faded4f9b25f06fcbe4ccd Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Sat, 7 Mar 2020 20:48:33 +0200 Subject: 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 Reviewed-by: Nicolas Dufresne --- src/gstreamer/gstlibcamera.c | 27 --------------------------- src/gstreamer/gstlibcamera.cpp | 27 +++++++++++++++++++++++++++ src/gstreamer/meson.build | 8 ++++---- 3 files changed, 31 insertions(+), 31 deletions(-) delete mode 100644 src/gstreamer/gstlibcamera.c create mode 100644 src/gstreamer/gstlibcamera.cpp (limited to 'src/gstreamer') diff --git a/src/gstreamer/gstlibcamera.c b/src/gstreamer/gstlibcamera.c deleted file mode 100644 index 81c7bb19..00000000 --- a/src/gstreamer/gstlibcamera.c +++ /dev/null @@ -1,27 +0,0 @@ -/* SPDX-License-Identifier: LGPL-2.1-or-later */ -/* - * Copyright (C) 2019, Collabora Ltd. - * Author: Nicolas Dufresne - * - * 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"); 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 + * + * 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"); diff --git a/src/gstreamer/meson.build b/src/gstreamer/meson.build index 1965b504..8759a122 100644 --- a/src/gstreamer/meson.build +++ b/src/gstreamer/meson.build @@ -1,6 +1,6 @@ libcamera_gst_sources = [ 'gstlibcamera-utils.cpp', - 'gstlibcamera.c', + 'gstlibcamera.cpp', 'gstlibcameraallocator.cpp', 'gstlibcamerapad.cpp', 'gstlibcamerapool.cpp', @@ -8,7 +8,7 @@ libcamera_gst_sources = [ 'gstlibcamerasrc.cpp', ] -libcamera_gst_c_args = [ +libcamera_gst_cpp_args = [ '-DVERSION="@0@"'.format(libcamera_git_version), '-DPACKAGE="@0@"'.format(meson.project_name()), ] @@ -27,12 +27,12 @@ if glib_dep.found() and gstvideo_dep.found() and gstallocator_dep.found() # complain about the ones we are not using. Silence the -Wunused-function # warning in that case. if cc.get_id() == 'clang' and glib_dep.version().version_compare('<2.63.0') - libcamera_gst_c_args += [ '-Wno-unused-function' ] + libcamera_gst_cpp_args += [ '-Wno-unused-function' ] endif libcamera_gst = shared_library('gstlibcamera', libcamera_gst_sources, - c_args : libcamera_gst_c_args, + cpp_args : libcamera_gst_cpp_args, dependencies : [libcamera_dep, gstvideo_dep, gstallocator_dep], install: true, install_dir : '@0@/gstreamer-1.0'.format(get_option('libdir')), -- cgit v1.2.1