libcamera/src/gstreamer/gstlibcamera.c
Nicolas Dufresne 0e0cc2149e gst: Add initial device provider
This feature is used with GstDeviceMonitor in order to enumerate
and monitor devices to be used with the source element. The resulting
GstDevice implementation is also used by application to abstract the
configuration of the source element.

Implementation notes:
  - libcamera does not support polling yet
  - The device ID isn't unique in libcamera yet
  - The "name" property does not yet exist in libcamerasrc yet

Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2020-03-07 01:57:45 +02:00

27 lines
743 B
C

/* 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");