* clipped properly during blitting (if wrapping is disabled)
*/
-GST_DEBUG_CATEGORY (pango_debug);
-#define GST_CAT_DEFAULT pango_debug
-
#define DEFAULT_PROP_TEXT ""
#define DEFAULT_PROP_SHADING FALSE
#define DEFAULT_PROP_VALIGNMENT GST_BASE_TEXT_OVERLAY_VALIGN_BASELINE
return ret;
}
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- if (!gst_element_register (plugin, "textoverlay", GST_RANK_NONE,
- GST_TYPE_TEXT_OVERLAY) ||
- !gst_element_register (plugin, "timeoverlay", GST_RANK_NONE,
- GST_TYPE_TIME_OVERLAY) ||
- !gst_element_register (plugin, "clockoverlay", GST_RANK_NONE,
- GST_TYPE_CLOCK_OVERLAY) ||
- !gst_element_register (plugin, "textrender", GST_RANK_NONE,
- GST_TYPE_TEXT_RENDER)) {
- return FALSE;
- }
-
- /*texttestsrc_plugin_init(module, plugin); */
-
- GST_DEBUG_CATEGORY_INIT (pango_debug, "pango", 0, "Pango elements");
-
- return TRUE;
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
- pango, "Pango-based text rendering and overlay", plugin_init,
- VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#include "config.h"
#endif
-#include "gstclockoverlay.h"
#include <gst/video/video.h>
#include <time.h>
+#include "gstclockoverlay.h"
+#include "gstpangoelements.h"
#define DEFAULT_PROP_TIMEFORMAT "%H:%M:%S"
#define gst_clock_overlay_parent_class parent_class
G_DEFINE_TYPE (GstClockOverlay, gst_clock_overlay, GST_TYPE_BASE_TEXT_OVERLAY);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (clockoverlay, "clockoverlay",
+ GST_RANK_NONE, GST_TYPE_CLOCK_OVERLAY, pango_element_init (plugin));
static void gst_clock_overlay_finalize (GObject * object);
static void gst_clock_overlay_set_property (GObject * object, guint prop_id,
--- /dev/null
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) <2003> David Schleef <ds@schleef.org>
+ * Copyright (C) <2006> Julien Moutte <julien@moutte.net>
+ * Copyright (C) <2006> Zeeshan Ali <zeeshan.ali@nokia.com>
+ * Copyright (C) <2006-2008> Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) <2009> Young-Ho Cha <ganadist@gmail.com>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <scerveau@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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "gstpangoelements.h"
+
+GST_DEBUG_CATEGORY (pango_debug);
+#define GST_CAT_DEFAULT pango_debug
+
+void
+pango_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ /*texttestsrc_plugin_init(module, plugin); */
+ GST_DEBUG_CATEGORY_INIT (pango_debug, "pango", 0, "Pango elements");
+ g_once_init_leave (&res, TRUE);
+ }
+}
--- /dev/null
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) <2003> David Schleef <ds@schleef.org>
+ * Copyright (C) <2006> Julien Moutte <julien@moutte.net>
+ * Copyright (C) <2006> Zeeshan Ali <zeeshan.ali@nokia.com>
+ * Copyright (C) <2006-2008> Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) <2009> Young-Ho Cha <ganadist@gmail.com>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <scerveau@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_PANGO_ELEMENTS_H__
+#define __GST_PANGO_ELEMENTS_H__
+
+#include <gst/gst.h>
+
+G_BEGIN_DECLS
+
+G_GNUC_INTERNAL void pango_element_init (GstPlugin * plugin);
+
+GST_ELEMENT_REGISTER_DECLARE (textoverlay);
+GST_ELEMENT_REGISTER_DECLARE (timeoverlay);
+GST_ELEMENT_REGISTER_DECLARE (clockoverlay);
+GST_ELEMENT_REGISTER_DECLARE (textrender);
+
+G_END_DECLS
+
+#endif /* __GST_PANGO_ELEMENTS_H__ */
--- /dev/null
+/* GStreamer
+ * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
+ * Copyright (C) <2003> David Schleef <ds@schleef.org>
+ * Copyright (C) <2006> Julien Moutte <julien@moutte.net>
+ * Copyright (C) <2006> Zeeshan Ali <zeeshan.ali@nokia.com>
+ * Copyright (C) <2006-2008> Tim-Philipp Müller <tim centricular net>
+ * Copyright (C) <2009> Young-Ho Cha <ganadist@gmail.com>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ * @Author: Stéphane Cerveau <scerveau@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.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "gstpangoelements.h"
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ gboolean ret = FALSE;
+
+ ret |= GST_ELEMENT_REGISTER (textoverlay, plugin);
+ ret |= GST_ELEMENT_REGISTER (timeoverlay, plugin);
+ ret |= GST_ELEMENT_REGISTER (clockoverlay, plugin);
+ ret |= GST_ELEMENT_REGISTER (textrender, plugin);
+
+ return ret;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR,
+ pango, "Pango-based text rendering and overlay", plugin_init,
+ VERSION, GST_LICENSE, GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#include "config.h"
#endif
-#include <gsttextoverlay.h>
+#include "gsttextoverlay.h"
+#include "gstpangoelements.h"
static GstStaticPadTemplate text_sink_template_factory =
GST_STATIC_PAD_TEMPLATE ("text_sink",
);
G_DEFINE_TYPE (GstTextOverlay, gst_text_overlay, GST_TYPE_BASE_TEXT_OVERLAY);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (textoverlay, "textoverlay",
+ GST_RANK_NONE, GST_TYPE_TEXT_OVERLAY, pango_element_init (plugin));
static void
gst_text_overlay_class_init (GstTextOverlayClass * klass)
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
-
+#include <string.h>
#include <gst/gst.h>
#include <gst/video/video.h>
#include "gsttextrender.h"
-#include <string.h>
+#include "gstpangoelements.h"
+
#if G_BYTE_ORDER == G_LITTLE_ENDIAN
# define CAIRO_ARGB_A 3
#define gst_text_render_parent_class parent_class
G_DEFINE_TYPE (GstTextRender, gst_text_render, GST_TYPE_ELEMENT);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (textrender, "textrender",
+ GST_RANK_NONE, GST_TYPE_TEXT_RENDER, pango_element_init (plugin));
static void gst_text_render_finalize (GObject * object);
static void gst_text_render_set_property (GObject * object,
#include <gst/video/video.h>
#include "gsttimeoverlay.h"
+#include "gstpangoelements.h"
#define DEFAULT_TIME_LINE GST_TIME_OVERLAY_TIME_LINE_BUFFER_TIME
#define DEFAULT_SHOW_TIMES_AS_DATES FALSE
#define gst_time_overlay_parent_class parent_class
G_DEFINE_TYPE (GstTimeOverlay, gst_time_overlay, GST_TYPE_BASE_TEXT_OVERLAY);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (timeoverlay, "timeoverlay",
+ GST_RANK_NONE, GST_TYPE_TIME_OVERLAY, pango_element_init (plugin));
static void gst_time_overlay_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
pango_sources = [
+ 'gstpangoelement.c',
+ 'gstpangoplugin.c',
'gstbasetextoverlay.c',
'gstclockoverlay.c',
'gsttextoverlay.c',