mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
autodetect: allow per feature registration
Split plugin into features including dynamic types which can be indiviually registered during a static build. More details here: https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/199 https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/661 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/876>
This commit is contained in:
parent
771d954c04
commit
277daa8286
10 changed files with 148 additions and 31 deletions
|
@ -39,6 +39,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gstautodetectelements.h"
|
||||||
|
#include "gstautodetect.h"
|
||||||
#include "gstautoaudiosink.h"
|
#include "gstautoaudiosink.h"
|
||||||
|
|
||||||
#define DEFAULT_TS_OFFSET 0
|
#define DEFAULT_TS_OFFSET 0
|
||||||
|
@ -58,6 +60,8 @@ static void gst_auto_audio_sink_configure (GstAutoDetect * autodetect,
|
||||||
GstElement * kid);
|
GstElement * kid);
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstAutoAudioSink, gst_auto_audio_sink, GST_TYPE_AUTO_DETECT);
|
G_DEFINE_TYPE (GstAutoAudioSink, gst_auto_audio_sink, GST_TYPE_AUTO_DETECT);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (autoaudiosink, "autoaudiosink",
|
||||||
|
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SINK, autodetect_element_init (plugin));
|
||||||
|
|
||||||
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
|
|
|
@ -40,9 +40,13 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gstautodetectelements.h"
|
||||||
|
#include "gstautodetect.h"
|
||||||
#include "gstautoaudiosrc.h"
|
#include "gstautoaudiosrc.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstAutoAudioSrc, gst_auto_audio_src, GST_TYPE_AUTO_DETECT);
|
G_DEFINE_TYPE (GstAutoAudioSrc, gst_auto_audio_src, GST_TYPE_AUTO_DETECT);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (autoaudiosrc, "autoaudiosrc",
|
||||||
|
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SRC, autodetect_element_init (plugin));
|
||||||
|
|
||||||
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
|
|
|
@ -27,12 +27,6 @@
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
#include "gstautodetect.h"
|
#include "gstautodetect.h"
|
||||||
#include "gstautoaudiosink.h"
|
|
||||||
#include "gstautoaudiosrc.h"
|
|
||||||
#include "gstautovideosink.h"
|
|
||||||
#include "gstautovideosrc.h"
|
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (autodetect_debug);
|
|
||||||
|
|
||||||
#define DEFAULT_SYNC TRUE
|
#define DEFAULT_SYNC TRUE
|
||||||
|
|
||||||
|
@ -486,25 +480,3 @@ gst_auto_detect_get_property (GObject * object, guint prop_id,
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
|
||||||
plugin_init (GstPlugin * plugin)
|
|
||||||
{
|
|
||||||
GST_DEBUG_CATEGORY_INIT (autodetect_debug, "autodetect", 0,
|
|
||||||
"Autodetection audio/video output wrapper elements");
|
|
||||||
|
|
||||||
return gst_element_register (plugin, "autovideosink",
|
|
||||||
GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_SINK) &&
|
|
||||||
gst_element_register (plugin, "autovideosrc",
|
|
||||||
GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_SRC) &&
|
|
||||||
gst_element_register (plugin, "autoaudiosink",
|
|
||||||
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SINK) &&
|
|
||||||
gst_element_register (plugin, "autoaudiosrc",
|
|
||||||
GST_RANK_NONE, GST_TYPE_AUTO_AUDIO_SRC);
|
|
||||||
}
|
|
||||||
|
|
||||||
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
|
||||||
GST_VERSION_MINOR,
|
|
||||||
autodetect,
|
|
||||||
"Plugin contains auto-detection plugins for video/audio in- and outputs",
|
|
||||||
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
|
||||||
|
|
|
@ -20,10 +20,9 @@
|
||||||
#ifndef __GST_AUTO_DETECT_H__
|
#ifndef __GST_AUTO_DETECT_H__
|
||||||
#define __GST_AUTO_DETECT_H__
|
#define __GST_AUTO_DETECT_H__
|
||||||
|
|
||||||
G_BEGIN_DECLS
|
#include <gst/gst.h>
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY_EXTERN (autodetect_debug);
|
G_BEGIN_DECLS
|
||||||
#define GST_CAT_DEFAULT autodetect_debug
|
|
||||||
|
|
||||||
#define GST_TYPE_AUTO_DETECT (gst_auto_detect_get_type ())
|
#define GST_TYPE_AUTO_DETECT (gst_auto_detect_get_type ())
|
||||||
#define GST_AUTO_DETECT(obj) \
|
#define GST_AUTO_DETECT(obj) \
|
||||||
|
|
42
gst/autodetect/gstautodetectelement.c
Normal file
42
gst/autodetect/gstautodetectelement.c
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
/* GStreamer
|
||||||
|
* (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#include "gstautodetectelements.h"
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY (autodetect_debug);
|
||||||
|
|
||||||
|
void
|
||||||
|
autodetect_element_init (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
static gsize res = FALSE;
|
||||||
|
if (g_once_init_enter (&res)) {
|
||||||
|
GST_DEBUG_CATEGORY_INIT (autodetect_debug, "autodetect", 0,
|
||||||
|
"Autodetection audio/video output wrapper elements");
|
||||||
|
g_once_init_leave (&res, TRUE);
|
||||||
|
}
|
||||||
|
}
|
41
gst/autodetect/gstautodetectelements.h
Normal file
41
gst/autodetect/gstautodetectelements.h
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
/* GStreamer
|
||||||
|
* (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
* Copyright (C) 2020 Huawei Technologies Co., Ltd.
|
||||||
|
* @Author: Stéphane Cerveau <stephane.cerveau@collabora.com>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef __GST_AUTO_DETECT_ELEMENTS_H__
|
||||||
|
#define __GST_AUTO_DETECT_ELEMENTS_H__
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
G_BEGIN_DECLS
|
||||||
|
|
||||||
|
void autodetect_element_init (GstPlugin * plugin);
|
||||||
|
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (autovideosink);
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (autovideosrc);
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (autoaudiosink);
|
||||||
|
GST_ELEMENT_REGISTER_DECLARE (autoaudiosrc);
|
||||||
|
|
||||||
|
GST_DEBUG_CATEGORY_EXTERN (autodetect_debug);
|
||||||
|
#define GST_CAT_DEFAULT autodetect_debug
|
||||||
|
|
||||||
|
G_END_DECLS
|
||||||
|
|
||||||
|
#endif /* __GST_AUTO_DETECT_ELEMENTS_H__ */
|
45
gst/autodetect/gstautodetectplugin.c
Normal file
45
gst/autodetect/gstautodetectplugin.c
Normal file
|
@ -0,0 +1,45 @@
|
||||||
|
/* GStreamer
|
||||||
|
* (c) 2005 Ronald S. Bultje <rbultje@ronald.bitfreak.net>
|
||||||
|
*
|
||||||
|
* This library is free software; you can redistribute it and/or
|
||||||
|
* modify it under the terms of the GNU Library General Public
|
||||||
|
* License as published by the Free Software Foundation; either
|
||||||
|
* version 2 of the License, or (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This library is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* Library General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Library General Public
|
||||||
|
* License along with this library; if not, write to the
|
||||||
|
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
|
||||||
|
* Boston, MA 02110-1301, USA.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
#include "gstautodetectelements.h"
|
||||||
|
|
||||||
|
static gboolean
|
||||||
|
plugin_init (GstPlugin * plugin)
|
||||||
|
{
|
||||||
|
gboolean ret = FALSE;
|
||||||
|
|
||||||
|
ret |= GST_ELEMENT_REGISTER (autovideosink, plugin);
|
||||||
|
ret |= GST_ELEMENT_REGISTER (autovideosrc, plugin);
|
||||||
|
ret |= GST_ELEMENT_REGISTER (autoaudiosink, plugin);
|
||||||
|
ret |= GST_ELEMENT_REGISTER (autoaudiosrc, plugin);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
|
||||||
|
GST_VERSION_MINOR,
|
||||||
|
autodetect,
|
||||||
|
"Plugin contains auto-detection plugins for video/audio in- and outputs",
|
||||||
|
plugin_init, VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
|
|
@ -39,6 +39,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gstautodetectelements.h"
|
||||||
|
#include "gstautodetect.h"
|
||||||
#include "gstautovideosink.h"
|
#include "gstautovideosink.h"
|
||||||
|
|
||||||
#define DEFAULT_TS_OFFSET 0
|
#define DEFAULT_TS_OFFSET 0
|
||||||
|
@ -58,6 +60,8 @@ static void gst_auto_video_sink_configure (GstAutoDetect * autodetect,
|
||||||
GstElement * kid);
|
GstElement * kid);
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstAutoVideoSink, gst_auto_video_sink, GST_TYPE_AUTO_DETECT);
|
G_DEFINE_TYPE (GstAutoVideoSink, gst_auto_video_sink, GST_TYPE_AUTO_DETECT);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (autovideosink, "autovideosink",
|
||||||
|
GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_SINK, autodetect_element_init (plugin));
|
||||||
|
|
||||||
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink",
|
||||||
GST_PAD_SINK,
|
GST_PAD_SINK,
|
||||||
|
|
|
@ -40,9 +40,13 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "gstautodetectelements.h"
|
||||||
|
#include "gstautodetect.h"
|
||||||
#include "gstautovideosrc.h"
|
#include "gstautovideosrc.h"
|
||||||
|
|
||||||
G_DEFINE_TYPE (GstAutoVideoSrc, gst_auto_video_src, GST_TYPE_AUTO_DETECT);
|
G_DEFINE_TYPE (GstAutoVideoSrc, gst_auto_video_src, GST_TYPE_AUTO_DETECT);
|
||||||
|
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (autovideosrc, "autovideosrc",
|
||||||
|
GST_RANK_NONE, GST_TYPE_AUTO_VIDEO_SRC, autodetect_element_init (plugin));
|
||||||
|
|
||||||
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
|
||||||
GST_PAD_SRC,
|
GST_PAD_SRC,
|
||||||
|
|
|
@ -2,6 +2,8 @@ autodetect_sources = [
|
||||||
'gstautoaudiosink.c',
|
'gstautoaudiosink.c',
|
||||||
'gstautoaudiosrc.c',
|
'gstautoaudiosrc.c',
|
||||||
'gstautodetect.c',
|
'gstautodetect.c',
|
||||||
|
'gstautodetectplugin.c',
|
||||||
|
'gstautodetectelement.c',
|
||||||
'gstautovideosink.c',
|
'gstautovideosink.c',
|
||||||
'gstautovideosrc.c',
|
'gstautovideosrc.c',
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue