#include "config.h"
#endif
+#include "gstautodetectelements.h"
+#include "gstautodetect.h"
#include "gstautoaudiosink.h"
#define DEFAULT_TS_OFFSET 0
GstElement * kid);
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",
GST_PAD_SINK,
#include "config.h"
#endif
+#include "gstautodetectelements.h"
+#include "gstautodetect.h"
#include "gstautoaudiosrc.h"
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",
GST_PAD_SRC,
#include <gst/gst.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
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)
#ifndef __GST_AUTO_DETECT_H__
#define __GST_AUTO_DETECT_H__
-G_BEGIN_DECLS
+#include <gst/gst.h>
-GST_DEBUG_CATEGORY_EXTERN (autodetect_debug);
-#define GST_CAT_DEFAULT autodetect_debug
+G_BEGIN_DECLS
#define GST_TYPE_AUTO_DETECT (gst_auto_detect_get_type ())
#define GST_AUTO_DETECT(obj) \
--- /dev/null
+/* 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);
+ }
+}
--- /dev/null
+/* 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__ */
--- /dev/null
+/* 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)
#include "config.h"
#endif
+#include "gstautodetectelements.h"
+#include "gstautodetect.h"
#include "gstautovideosink.h"
#define DEFAULT_TS_OFFSET 0
GstElement * kid);
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",
GST_PAD_SINK,
#include "config.h"
#endif
+#include "gstautodetectelements.h"
+#include "gstautodetect.h"
#include "gstautovideosrc.h"
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",
GST_PAD_SRC,
'gstautoaudiosink.c',
'gstautoaudiosrc.c',
'gstautodetect.c',
+ 'gstautodetectplugin.c',
+ 'gstautodetectelement.c',
'gstautovideosink.c',
'gstautovideosrc.c',
]