#include <gst/pbutils/pbutils.h>
#include "gstplay-enum.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstrawcaps.h"
#include "gstplaybackutils.h"
* Standard GObject boilerplate *
********************************/
-static void gst_decode_bin_class_init (GstDecodeBinClass * klass);
-static void gst_decode_bin_init (GstDecodeBin * decode_bin);
static void gst_decode_bin_dispose (GObject * object);
static void gst_decode_bin_finalize (GObject * object);
-static GType
-gst_decode_bin_get_type (void)
-{
- static GType gst_decode_bin_type = 0;
-
- if (!gst_decode_bin_type) {
- static const GTypeInfo gst_decode_bin_info = {
- sizeof (GstDecodeBinClass),
- NULL,
- NULL,
- (GClassInitFunc) gst_decode_bin_class_init,
- NULL,
- NULL,
- sizeof (GstDecodeBin),
- 0,
- (GInstanceInitFunc) gst_decode_bin_init,
- NULL
- };
-
- gst_decode_bin_type =
- g_type_register_static (GST_TYPE_BIN, "GstDecodeBin",
- &gst_decode_bin_info, 0);
- }
-
- return gst_decode_bin_type;
-}
+/* Register some quarks here for the stream topology message */
+static GQuark topology_structure_name = 0;
+static GQuark topology_caps = 0;
+static GQuark topology_next = 0;
+static GQuark topology_pad = 0;
+static GQuark topology_element_srcpad = 0;
+
+GType gst_decode_bin_get_type (void);
+G_DEFINE_TYPE (GstDecodeBin, gst_decode_bin, GST_TYPE_BIN);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_decode_bin_debug, "decodebin", 0, "decoder bin");\
+ topology_structure_name = g_quark_from_static_string ("stream-topology"); \
+ topology_caps = g_quark_from_static_string ("caps");\
+ topology_next = g_quark_from_static_string ("next");\
+ topology_pad = g_quark_from_static_string ("pad");\
+ topology_element_srcpad = g_quark_from_static_string ("element-srcpad");\
+ ret |= playback_element_init (plugin);\
+
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decodebin, "decodebin", GST_RANK_NONE,
+ GST_TYPE_DECODE_BIN, _do_init);
static gboolean
_gst_boolean_accumulator (GSignalInvocationHint * ihint,
return caps;
}
-static GQuark topology_structure_name = 0;
-static GQuark topology_caps = 0;
-static GQuark topology_next = 0;
-static GQuark topology_pad = 0;
-static GQuark topology_element_srcpad = 0;
-
/* FIXME: Invent gst_structure_take_structure() to prevent all the
* structure copying for nothing
*/
return GST_BIN_CLASS (parent_class)->remove_element (bin, element);
}
-
-gboolean
-gst_decode_bin_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_decode_bin_debug, "decodebin", 0, "decoder bin");
-
- /* Register some quarks here for the stream topology message */
- topology_structure_name = g_quark_from_static_string ("stream-topology");
- topology_caps = g_quark_from_static_string ("caps");
- topology_next = g_quark_from_static_string ("next");
- topology_pad = g_quark_from_static_string ("pad");
- topology_element_srcpad = g_quark_from_static_string ("element-srcpad");
-
- return gst_element_register (plugin, "decodebin", GST_RANK_NONE,
- GST_TYPE_DECODE_BIN);
-}
#include <gst/gst.h>
#include <gst/pbutils/pbutils.h>
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplay-enum.h"
#include "gstrawcaps.h"
GType gst_decodebin3_get_type (void);
#define gst_decodebin3_parent_class parent_class
G_DEFINE_TYPE (GstDecodebin3, gst_decodebin3, GST_TYPE_BIN);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (decodebin3_debug, "decodebin3", 0, "decoder bin");\
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decodebin3, "decodebin3", GST_RANK_NONE,
+ GST_TYPE_DECODEBIN3, _do_init);
static GstStaticCaps default_raw_caps = GST_STATIC_CAPS (DEFAULT_RAW_CAPS);
beach:
return ret;
}
-
-gboolean
-gst_decodebin3_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (decodebin3_debug, "decodebin3", 0, "decoder bin");
-
- return gst_element_register (plugin, "decodebin3", GST_RANK_NONE,
- GST_TYPE_DECODEBIN3);
-}
#include <gst/pbutils/pbutils.h>
#include "gstplay-enum.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplaybackutils.h"
#include "gstrawcaps.h"
* Standard GObject boilerplate *
********************************/
-static void gst_parse_bin_class_init (GstParseBinClass * klass);
-static void gst_parse_bin_init (GstParseBin * parse_bin);
static void gst_parse_bin_dispose (GObject * object);
static void gst_parse_bin_finalize (GObject * object);
+static GType gst_parse_bin_get_type (void);
-static GType
-gst_parse_bin_get_type (void)
-{
- static GType gst_parse_bin_type = 0;
-
- if (!gst_parse_bin_type) {
- static const GTypeInfo gst_parse_bin_info = {
- sizeof (GstParseBinClass),
- NULL,
- NULL,
- (GClassInitFunc) gst_parse_bin_class_init,
- NULL,
- NULL,
- sizeof (GstParseBin),
- 0,
- (GInstanceInitFunc) gst_parse_bin_init,
- NULL
- };
-
- gst_parse_bin_type =
- g_type_register_static (GST_TYPE_BIN, "GstParseBin",
- &gst_parse_bin_info, 0);
- }
-
- return gst_parse_bin_type;
-}
+G_DEFINE_TYPE (GstParseBin, gst_parse_bin, GST_TYPE_BIN);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_parse_bin_debug, "parsebin", 0, "parser bin");\
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (parsebin, "parsebin", GST_RANK_NONE,
+ GST_TYPE_PARSE_BIN, _do_init);
static gboolean
_gst_boolean_accumulator (GSignalInvocationHint * ihint,
else
GST_BIN_CLASS (parent_class)->handle_message (bin, msg);
}
-
-gboolean
-gst_parse_bin_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_parse_bin_debug, "parsebin", 0, "parser bin");
-
- return gst_element_register (plugin, "parsebin", GST_RANK_NONE,
- GST_TYPE_PARSE_BIN);
-}
+++ /dev/null
-/* GStreamer
- * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.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.
- */
-/**
- * SECTION:plugin-playback:
- * @short_description: Set of elements to create dynamic pipelines (or part of it) to play
- * media files.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <string.h>
-#include <gst/gst.h>
-
-#include <gst/gst-i18n-plugin.h>
-#include <gst/pbutils/pbutils.h>
-
-#include "gstplayback.h"
-#include "gstplaysink.h"
-#include "gstsubtitleoverlay.h"
-#include "gststreamsynchronizer.h"
-
-static gboolean
-plugin_init (GstPlugin * plugin)
-{
- gboolean res;
-
- gst_pb_utils_init ();
-
-#ifdef ENABLE_NLS
- GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
- LOCALEDIR);
- bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
-#endif /* ENABLE_NLS */
-
- /* Swap in playbin3 as 'playbin' if USE_PLAYBIN3=1 */
- {
- const gchar *env = g_getenv ("USE_PLAYBIN3");
- if (env && g_str_has_prefix (env, "1"))
- res = gst_play_bin3_plugin_init (plugin, TRUE);
- else
- res = gst_play_bin2_plugin_init (plugin);
- }
-
- res &= gst_play_bin3_plugin_init (plugin, FALSE);
- res &= gst_play_sink_plugin_init (plugin);
- res &= gst_subtitle_overlay_plugin_init (plugin);
- res &= gst_stream_synchronizer_plugin_init (plugin);
-
- res &= gst_decode_bin_plugin_init (plugin);
- res &= gst_decodebin3_plugin_init (plugin);
- res &= gst_uri_decode_bin_plugin_init (plugin);
- res &= gst_uri_decode_bin3_plugin_init (plugin);
- res &= gst_uri_source_bin_plugin_init (plugin);
- res &= gst_parse_bin_plugin_init (plugin);
-
- return res;
-}
-
-GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
- GST_VERSION_MINOR,
- playback,
- "various playback elements", plugin_init, VERSION, GST_LICENSE,
- GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
+++ /dev/null
-/* GStreamer
- * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.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_PLAY_BACK_H__
-#define __GST_PLAY_BACK_H__
-
-
-#include <gst/gst.h>
-
-gboolean gst_decode_bin_plugin_init (GstPlugin * plugin);
-gboolean gst_decodebin3_plugin_init (GstPlugin * plugin);
-gboolean gst_uri_decode_bin_plugin_init (GstPlugin * plugin);
-gboolean gst_uri_decode_bin3_plugin_init (GstPlugin * plugin);
-gboolean gst_uri_source_bin_plugin_init (GstPlugin * plugin);
-gboolean gst_parse_bin_plugin_init (GstPlugin * plugin);
-
-gboolean gst_play_bin_plugin_init (GstPlugin * plugin);
-gboolean gst_play_bin2_plugin_init (GstPlugin * plugin);
-gboolean gst_play_bin3_plugin_init (GstPlugin * plugin, gboolean as_playbin);
-
-
-#endif /* __GST_PLAY_BACK_H__ */
--- /dev/null
+/* GStreamer
+ * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com>
+ * Copyright (C) 2020 Huawei Technologies Co., Ltd.
+ *
+ *
+ * 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.
+ */
+/**
+ * SECTION:plugin-playback:
+ * @short_description: Set of elements to create dynamic pipelines (or part of it) to play
+ * media files.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <gst/gst.h>
+
+#include <gst/gst-i18n-plugin.h>
+#include <gst/pbutils/pbutils.h>
+
+#include "gstplaybackelements.h"
+
+
+gboolean
+playback_element_init (GstPlugin * plugin)
+{
+ static gsize res = FALSE;
+ if (g_once_init_enter (&res)) {
+ gst_pb_utils_init ();
+
+#ifdef ENABLE_NLS
+ GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE,
+ LOCALEDIR);
+ bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR);
+ bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
+#endif /* ENABLE_NLS */
+ g_once_init_leave (&res, TRUE);
+ }
+ return res;
+}
--- /dev/null
+/* GStreamer
+ * Copyright (C) <2007> Wim Taymans <wim.taymans@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_PLAY_BACK_ELEMENTS_H__
+#define __GST_PLAY_BACK_ELEMENTS_H__
+
+#include <gst/gst.h>
+
+GST_ELEMENT_REGISTER_DECLARE (playbin);
+GST_ELEMENT_REGISTER_DECLARE (playbin3);
+GST_ELEMENT_REGISTER_DECLARE (playsink);
+GST_ELEMENT_REGISTER_DECLARE (subtitleoverlay);
+GST_ELEMENT_REGISTER_DECLARE (streamsynchronizer);
+GST_ELEMENT_REGISTER_DECLARE (decodebin);
+GST_ELEMENT_REGISTER_DECLARE (decodebin3);
+GST_ELEMENT_REGISTER_DECLARE (uridecodebin);
+GST_ELEMENT_REGISTER_DECLARE (uridecodebin3);
+GST_ELEMENT_REGISTER_DECLARE (urisourcebin);
+GST_ELEMENT_REGISTER_DECLARE (parsebin);
+
+gboolean gst_play_bin_custom_element_init (GstPlugin * plugin);
+gboolean gst_play_bin3_custom_element_init (GstPlugin * plugin);
+
+G_GNUC_INTERNAL gboolean playback_element_init (GstPlugin * plugin);
+
+#endif /* __GST_PLAY_BACK_ELEMENTS_H__ */
--- /dev/null
+/* GStreamer
+ * Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.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.
+ */
+/**
+ * SECTION:plugin-playback:
+ * @short_description: Set of elements to create dynamic pipelines (or part of it) to play
+ * media files.
+ */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <string.h>
+#include <gst/gst.h>
+
+#include <gst/gst-i18n-plugin.h>
+#include <gst/pbutils/pbutils.h>
+
+#include "gstplaybackelements.h"
+
+
+static gboolean
+plugin_init (GstPlugin * plugin)
+{
+ gboolean res = FALSE;
+ if (!g_getenv ("USE_PLAYBIN3"))
+ res |= GST_ELEMENT_REGISTER (playbin, plugin);
+ res |= GST_ELEMENT_REGISTER (playbin3, plugin);
+ res |= GST_ELEMENT_REGISTER (playsink, plugin);
+ res |= GST_ELEMENT_REGISTER (subtitleoverlay, plugin);
+ res |= GST_ELEMENT_REGISTER (streamsynchronizer, plugin);
+ res |= GST_ELEMENT_REGISTER (decodebin, plugin);
+ res |= GST_ELEMENT_REGISTER (decodebin3, plugin);
+ res |= GST_ELEMENT_REGISTER (uridecodebin, plugin);
+ res |= GST_ELEMENT_REGISTER (uridecodebin3, plugin);
+ res |= GST_ELEMENT_REGISTER (urisourcebin, plugin);
+ res |= GST_ELEMENT_REGISTER (parsebin, plugin);
+
+ return res;
+}
+
+GST_PLUGIN_DEFINE (GST_VERSION_MAJOR,
+ GST_VERSION_MINOR,
+ playback,
+ "various playback elements", plugin_init, VERSION, GST_LICENSE,
+ GST_PACKAGE_NAME, GST_PACKAGE_ORIGIN)
#include <gst/video/navigation.h>
#include <gst/video/colorbalance.h>
#include "gstplay-enum.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplaysink.h"
#include "gstsubtitleoverlay.h"
#include "gstplaybackutils.h"
static GstStaticCaps raw_audio_caps = GST_STATIC_CAPS ("audio/x-raw(ANY)");
static GstStaticCaps raw_video_caps = GST_STATIC_CAPS ("video/x-raw(ANY)");
-static void gst_play_bin_class_init (GstPlayBinClass * klass);
-static void gst_play_bin_init (GstPlayBin * playbin);
static void gst_play_bin_finalize (GObject * object);
static void gst_play_bin_set_property (GObject * object, guint prop_id,
static void gst_play_bin_colorbalance_init (gpointer g_iface,
gpointer g_iface_data);
-static GType
-gst_play_bin_get_type (void)
+static GType gst_play_bin_get_type (void);
+
+static void
+_do_init_type (GType type)
{
- static GType gst_play_bin_type = 0;
-
- if (!gst_play_bin_type) {
- static const GTypeInfo gst_play_bin_info = {
- sizeof (GstPlayBinClass),
- NULL,
- NULL,
- (GClassInitFunc) gst_play_bin_class_init,
- NULL,
- NULL,
- sizeof (GstPlayBin),
- 0,
- (GInstanceInitFunc) gst_play_bin_init,
- NULL
- };
- static const GInterfaceInfo svol_info = {
- NULL, NULL, NULL
- };
- static const GInterfaceInfo ov_info = {
- gst_play_bin_overlay_init,
- NULL, NULL
- };
- static const GInterfaceInfo nav_info = {
- gst_play_bin_navigation_init,
- NULL, NULL
- };
- static const GInterfaceInfo col_info = {
- gst_play_bin_colorbalance_init,
- NULL, NULL
- };
-
- gst_play_bin_type = g_type_register_static (GST_TYPE_PIPELINE,
- "GstPlayBin", &gst_play_bin_info, 0);
-
- g_type_add_interface_static (gst_play_bin_type, GST_TYPE_STREAM_VOLUME,
- &svol_info);
- g_type_add_interface_static (gst_play_bin_type, GST_TYPE_VIDEO_OVERLAY,
- &ov_info);
- g_type_add_interface_static (gst_play_bin_type, GST_TYPE_NAVIGATION,
- &nav_info);
- g_type_add_interface_static (gst_play_bin_type, GST_TYPE_COLOR_BALANCE,
- &col_info);
- }
-
- return gst_play_bin_type;
+
+ static const GInterfaceInfo svol_info = {
+ NULL, NULL, NULL
+ };
+ static const GInterfaceInfo ov_info = {
+ gst_play_bin_overlay_init,
+ NULL, NULL
+ };
+ static const GInterfaceInfo nav_info = {
+ gst_play_bin_navigation_init,
+ NULL, NULL
+ };
+ static const GInterfaceInfo col_info = {
+ gst_play_bin_colorbalance_init,
+ NULL, NULL
+ };
+
+ g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info);
+ g_type_add_interface_static (type, GST_TYPE_VIDEO_OVERLAY, &ov_info);
+ g_type_add_interface_static (type, GST_TYPE_NAVIGATION, &nav_info);
+ g_type_add_interface_static (type, GST_TYPE_COLOR_BALANCE, &col_info);
}
-static void
+G_DEFINE_TYPE_WITH_CODE (GstPlayBin, gst_play_bin, GST_TYPE_PIPELINE,
+ _do_init_type (g_define_type_id));
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_play_bin_debug, "playbin", 0, "play bin");\
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (playbin, "playbin", GST_RANK_NONE,
+ GST_TYPE_PLAY_BIN, _do_init);
+
+void
gst_play_bin_class_init (GstPlayBinClass * klass)
{
GObjectClass *gobject_klass;
iface->get_value = gst_play_bin_colorbalance_get_value;
iface->get_balance_type = gst_play_bin_colorbalance_get_balance_type;
}
-
-gboolean
-gst_play_bin2_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_play_bin_debug, "playbin", 0, "play bin");
-
- return gst_element_register (plugin, "playbin", GST_RANK_NONE,
- GST_TYPE_PLAY_BIN);
-}
#include <gst/video/navigation.h>
#include <gst/video/colorbalance.h>
#include "gstplay-enum.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplaysink.h"
#include "gstsubtitleoverlay.h"
#include "gstplaybackutils.h"
static GstStaticCaps raw_video_caps = GST_STATIC_CAPS ("video/x-raw(ANY)");
#endif
-static void gst_play_bin3_class_init (GstPlayBin3Class * klass);
-static void gst_play_bin3_init (GstPlayBin3 * playbin);
static void gst_play_bin3_finalize (GObject * object);
static void gst_play_bin3_set_property (GObject * object, guint prop_id,
static void gst_play_bin3_colorbalance_init (gpointer g_iface,
gpointer g_iface_data);
-static GType
-gst_play_bin3_get_type (void)
+static void
+_do_init_type (GType type)
{
- static GType gst_play_bin3_type = 0;
-
- if (!gst_play_bin3_type) {
- static const GTypeInfo gst_play_bin3_info = {
- sizeof (GstPlayBin3Class),
- NULL,
- NULL,
- (GClassInitFunc) gst_play_bin3_class_init,
- NULL,
- NULL,
- sizeof (GstPlayBin3),
- 0,
- (GInstanceInitFunc) gst_play_bin3_init,
- NULL
- };
- static const GInterfaceInfo svol_info = {
- NULL, NULL, NULL
- };
- static const GInterfaceInfo ov_info = {
- gst_play_bin3_overlay_init,
- NULL, NULL
- };
- static const GInterfaceInfo nav_info = {
- gst_play_bin3_navigation_init,
- NULL, NULL
- };
- static const GInterfaceInfo col_info = {
- gst_play_bin3_colorbalance_init,
- NULL, NULL
- };
-
- gst_play_bin3_type = g_type_register_static (GST_TYPE_PIPELINE,
- "GstPlayBin3", &gst_play_bin3_info, 0);
-
- g_type_add_interface_static (gst_play_bin3_type, GST_TYPE_STREAM_VOLUME,
- &svol_info);
- g_type_add_interface_static (gst_play_bin3_type, GST_TYPE_VIDEO_OVERLAY,
- &ov_info);
- g_type_add_interface_static (gst_play_bin3_type, GST_TYPE_NAVIGATION,
- &nav_info);
- g_type_add_interface_static (gst_play_bin3_type, GST_TYPE_COLOR_BALANCE,
- &col_info);
- }
-
- return gst_play_bin3_type;
+ static const GInterfaceInfo svol_info = {
+ NULL, NULL, NULL
+ };
+ static const GInterfaceInfo ov_info = {
+ gst_play_bin3_overlay_init,
+ NULL, NULL
+ };
+ static const GInterfaceInfo nav_info = {
+ gst_play_bin3_navigation_init,
+ NULL, NULL
+ };
+ static const GInterfaceInfo col_info = {
+ gst_play_bin3_colorbalance_init,
+ NULL, NULL
+ };
+
+ g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info);
+ g_type_add_interface_static (type, GST_TYPE_VIDEO_OVERLAY, &ov_info);
+ g_type_add_interface_static (type, GST_TYPE_NAVIGATION, &nav_info);
+ g_type_add_interface_static (type, GST_TYPE_COLOR_BALANCE, &col_info);
}
+static GType gst_play_bin3_get_type (void);
+G_DEFINE_TYPE_WITH_CODE (GstPlayBin3, gst_play_bin3, GST_TYPE_PIPELINE,
+ _do_init_type (g_define_type_id));
+
+GST_ELEMENT_REGISTER_DEFINE_CUSTOM (playbin3,
+ gst_play_bin3_custom_element_init);
+
static void
gst_play_bin3_class_init (GstPlayBin3Class * klass)
{
}
gboolean
-gst_play_bin3_plugin_init (GstPlugin * plugin, gboolean as_playbin)
+gst_play_bin3_custom_element_init (GstPlugin * plugin)
{
- GST_DEBUG_CATEGORY_INIT (gst_play_bin3_debug, "playbin3", 0, "play bin");
+ gboolean ret = TRUE;
- if (as_playbin)
- return gst_element_register (plugin, "playbin", GST_RANK_NONE,
+ GST_DEBUG_CATEGORY_INIT (gst_play_bin3_debug, "playbin3", 0, "play bin3");
+
+ ret &= playback_element_init (plugin);
+
+ if (g_getenv ("USE_PLAYBIN3"))
+ ret &= gst_element_register (plugin, "playbin", GST_RANK_NONE,
+ GST_TYPE_PLAY_BIN);
+ else
+ ret &= gst_element_register (plugin, "playbin3", GST_RANK_NONE,
GST_TYPE_PLAY_BIN);
- return gst_element_register (plugin, "playbin3", GST_RANK_NONE,
- GST_TYPE_PLAY_BIN);
+ return ret;
}
#include <gst/video/videooverlay.h>
#include <gst/video/navigation.h>
+#include "gstplaybackelements.h"
#include "gstplaysink.h"
#include "gststreamsynchronizer.h"
#include "gstplaysinkvideoconvert.h"
gpointer g_iface_data);
static void
-_do_init (GType type)
+_do_init_type (GType type)
{
static const GInterfaceInfo svol_info = {
NULL, NULL, NULL
}
G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN,
- _do_init (g_define_type_id));
+ _do_init_type (g_define_type_id));
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_play_sink_debug, "playsink", 0, "play sink");\
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (playsink, "playsink", GST_RANK_NONE,
+ GST_TYPE_PLAY_SINK, _do_init);
+
static void
gst_play_sink_class_init (GstPlaySinkClass * klass)
iface->get_value = gst_play_sink_colorbalance_get_value;
iface->get_balance_type = gst_play_sink_colorbalance_get_balance_type;
}
-
-gboolean
-gst_play_sink_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_play_sink_debug, "playsink", 0, "play bin");
- return gst_element_register (plugin, "playsink", GST_RANK_NONE,
- GST_TYPE_PLAY_SINK);
-}
gboolean gst_play_sink_reconfigure (GstPlaySink * playsink);
-gboolean gst_play_sink_plugin_init (GstPlugin * plugin);
-
G_END_DECLS
#endif /* __GST_PLAY_SINK_H__ */
#include "config.h"
#endif
+#include "gstplaybackelements.h"
#include "gststreamsynchronizer.h"
GST_DEBUG_CATEGORY_STATIC (stream_synchronizer_debug);
#define gst_stream_synchronizer_parent_class parent_class
G_DEFINE_TYPE (GstStreamSynchronizer, gst_stream_synchronizer,
GST_TYPE_ELEMENT);
+#define _do_init \
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (streamsynchronizer, "streamsynchronizer",
+ GST_RANK_NONE, GST_TYPE_STREAM_SYNCHRONIZER, _do_init);
typedef struct
{
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_request_new_pad);
element_class->release_pad =
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_release_pad);
-}
-gboolean
-gst_stream_synchronizer_plugin_init (GstPlugin * plugin)
-{
GST_DEBUG_CATEGORY_INIT (stream_synchronizer_debug,
"streamsynchronizer", 0, "Stream Synchronizer");
-
- return gst_element_register (plugin, "streamsynchronizer", GST_RANK_NONE,
- GST_TYPE_STREAM_SYNCHRONIZER);
}
GType gst_stream_synchronizer_get_type (void);
-gboolean gst_stream_synchronizer_plugin_init (GstPlugin * plugin);
-
G_END_DECLS
#endif /* __GST_STREAM_SYNCHRONIZER_H__ */
#include "config.h"
#endif
+#include "gstplaybackelements.h"
#include "gstsubtitleoverlay.h"
#include <gst/pbutils/missing-plugins.h>
static GQuark _subtitle_overlay_event_marker_id = 0;
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (subtitle_overlay_debug, "subtitleoverlay", 0, "Subtitle Overlay"); \
+ ret |= playback_element_init (plugin); \
+ _subtitle_overlay_event_marker_id = g_quark_from_static_string ("gst-subtitle-overlay-event-marker")
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (subtitleoverlay, "subtitleoverlay",
+ GST_RANK_NONE, GST_TYPE_SUBTITLE_OVERLAY, _do_init);
+
static void
do_async_start (GstSubtitleOverlay * self)
{
self->fps_n = 0;
self->fps_d = 0;
}
-
-gboolean
-gst_subtitle_overlay_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (subtitle_overlay_debug, "subtitleoverlay", 0,
- "Subtitle Overlay");
-
- _subtitle_overlay_event_marker_id =
- g_quark_from_static_string ("gst-subtitle-overlay-event-marker");
-
- return gst_element_register (plugin, "subtitleoverlay", GST_RANK_NONE,
- GST_TYPE_SUBTITLE_OVERLAY);
-}
};
GType gst_subtitle_overlay_get_type (void);
-gboolean gst_subtitle_overlay_plugin_init (GstPlugin * plugin);
GstCaps *gst_subtitle_overlay_create_factory_caps (void);
#include "gstplay-enum.h"
#include "gstrawcaps.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplaybackutils.h"
#define GST_TYPE_URI_DECODE_BIN \
#define gst_uri_decode_bin_parent_class parent_class
G_DEFINE_TYPE (GstURIDecodeBin, gst_uri_decode_bin, GST_TYPE_BIN);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_uri_decode_bin_debug, "uridecodebin", 0, "URI decoder element"); \
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (uridecodebin, "uridecodebin",
+ GST_RANK_NONE, GST_TYPE_URI_DECODE_BIN, _do_init);
+
static void remove_decoders (GstURIDecodeBin * bin, gboolean force);
static void gst_uri_decode_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
return GST_STATE_CHANGE_FAILURE;
}
}
-
-gboolean
-gst_uri_decode_bin_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_uri_decode_bin_debug, "uridecodebin", 0,
- "URI decoder element");
-
- return gst_element_register (plugin, "uridecodebin", GST_RANK_NONE,
- GST_TYPE_URI_DECODE_BIN);
-}
#include "gstplay-enum.h"
#include "gstrawcaps.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplaybackutils.h"
#define GST_TYPE_URI_DECODE_BIN3 \
#define gst_uri_decode_bin3_parent_class parent_class
G_DEFINE_TYPE (GstURIDecodeBin3, gst_uri_decode_bin3, GST_TYPE_BIN);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_uri_decode_bin3_debug, "uridecodebin3", 0, "URI decoder element 3"); \
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (uridecodebin3, "uridecodebin3",
+ GST_RANK_NONE, GST_TYPE_URI_DECODE_BIN3, _do_init);
+
#define REMOVE_SIGNAL(obj,id) \
if (id) { \
g_signal_handler_disconnect (obj, id); \
return GST_ELEMENT_CLASS (parent_class)->send_event (element, event);
}
-
-gboolean
-gst_uri_decode_bin3_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_uri_decode_bin3_debug, "uridecodebin3", 0,
- "URI decoder element 3");
-
- return gst_element_register (plugin, "uridecodebin3", GST_RANK_NONE,
- GST_TYPE_URI_DECODE_BIN3);
-}
#include "gstplay-enum.h"
#include "gstrawcaps.h"
-#include "gstplayback.h"
+#include "gstplaybackelements.h"
#include "gstplaybackutils.h"
#define GST_TYPE_URI_SOURCE_BIN \
#define gst_uri_source_bin_parent_class parent_class
G_DEFINE_TYPE (GstURISourceBin, gst_uri_source_bin, GST_TYPE_BIN);
+#define _do_init \
+ GST_DEBUG_CATEGORY_INIT (gst_uri_source_bin_debug, "urisourcebin", 0, "URI source element"); \
+ ret |= playback_element_init (plugin);
+GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (urisourcebin, "urisourcebin",
+ GST_RANK_NONE, GST_TYPE_URI_SOURCE_BIN, _do_init);
+
static void gst_uri_source_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec);
static void gst_uri_source_bin_get_property (GObject * object, guint prop_id,
return GST_STATE_CHANGE_FAILURE;
}
}
-
-gboolean
-gst_uri_source_bin_plugin_init (GstPlugin * plugin)
-{
- GST_DEBUG_CATEGORY_INIT (gst_uri_source_bin_debug, "urisourcebin", 0,
- "URI source element");
-
- return gst_element_register (plugin, "urisourcebin", GST_RANK_NONE,
- GST_TYPE_URI_SOURCE_BIN);
-}
'gsturidecodebin3.c',
'gsturisourcebin.c',
'gstparsebin.c',
- 'gstplayback.c',
+ 'gstplaybackplugin.c',
+ 'gstplaybackelement.c',
'gstplaybackutils.c',
'gstplaybin2.c',
'gstplaybin3.c',