#include "config.h"
#endif
-#include "gstdvdec.h"
-#include "gstdvdemux.h"
+#include "gstdvelements.h"
static gboolean
plugin_init (GstPlugin * plugin)
{
- dv_init (0, 0);
+ gboolean ret = FALSE;
- if (!gst_element_register (plugin, "dvdemux", GST_RANK_PRIMARY,
- gst_dvdemux_get_type ()))
- return FALSE;
+ ret |= GST_ELEMENT_REGISTER (dvdemux, plugin);
+ ret |= GST_ELEMENT_REGISTER (dvdec, plugin);
- if (!gst_element_register (plugin, "dvdec", GST_RANK_MARGINAL,
- gst_dvdec_get_type ()))
- return FALSE;
-
- return TRUE;
+ return ret;
}
GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
#include <gst/video/gstvideometa.h>
#include <gst/video/gstvideopool.h>
+#include "gstdvelements.h"
#include "gstdvdec.h"
/* sizes of one input buffer */
#define gst_dvdec_parent_class parent_class
G_DEFINE_TYPE (GstDVDec, gst_dvdec, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvdec, "dvdec", GST_RANK_MARGINAL,
+ GST_TYPE_DVDEC, dv_element_init (plugin));
static GstFlowReturn gst_dvdec_chain (GstPad * pad, GstObject * parent,
GstBuffer * buffer);
#include <math.h>
#include <gst/audio/audio.h>
+#include "gstdvelements.h"
#include "gstdvdemux.h"
#include "gstsmptetimecode.h"
#define gst_dvdemux_parent_class parent_class
G_DEFINE_TYPE (GstDVDemux, gst_dvdemux, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (dvdemux, "dvdemux", GST_RANK_PRIMARY,
+ GST_TYPE_DVDEMUX, dv_element_init (plugin));
static void gst_dvdemux_finalize (GObject * object);
--- /dev/null
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * <2005> Wim Taymans <wim@fluendo.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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <libdv/dv.h>
+#include "gstdvelements.h"
+
+void
+dv_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ dv_init (0, 0);
+ g_once_init_leave (&res, TRUE);
+ }
+}
--- /dev/null
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Julian Bouzas <julian.bouzas@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_DV_ELEMENTS_H__
+#define __GST_DV_ELEMENTS_H__
+
+
+#include <gst/gst.h>
+#include <gst/video/video.h>
+
+
+G_BEGIN_DECLS
+
+void dv_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (dvdemux);
+GST_ELEMENT_REGISTER_DECLARE (dvdec);
+
+
+G_END_DECLS
+
+
+#endif /* __GST_DV_ELEMENTS_H__ */
dv_sources = [
'gstdv.c',
+ 'gstdvelement.c',
'gstdvdec.c',
'gstdvdemux.c',
'gstsmptetimecode.c',