playback: allow per feature registration

Split plugin into features including
elements and device providers 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-base/-/merge_requests/900>
This commit is contained in:
Stéphane Cerveau 2020-10-22 11:07:26 +02:00 committed by GStreamer Merge Bot
parent 4a2981f906
commit 1e02717e83
18 changed files with 244 additions and 330 deletions

View file

@ -99,7 +99,7 @@
#include <gst/pbutils/pbutils.h> #include <gst/pbutils/pbutils.h>
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstrawcaps.h" #include "gstrawcaps.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
@ -584,37 +584,29 @@ static GstPadProbeReturn pad_event_cb (GstPad * pad, GstPadProbeInfo * info,
* Standard GObject boilerplate * * 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_dispose (GObject * object);
static void gst_decode_bin_finalize (GObject * object); static void gst_decode_bin_finalize (GObject * object);
static GType /* Register some quarks here for the stream topology message */
gst_decode_bin_get_type (void) static GQuark topology_structure_name = 0;
{ static GQuark topology_caps = 0;
static GType gst_decode_bin_type = 0; static GQuark topology_next = 0;
static GQuark topology_pad = 0;
static GQuark topology_element_srcpad = 0;
if (!gst_decode_bin_type) { GType gst_decode_bin_get_type (void);
static const GTypeInfo gst_decode_bin_info = { G_DEFINE_TYPE (GstDecodeBin, gst_decode_bin, GST_TYPE_BIN);
sizeof (GstDecodeBinClass), #define _do_init \
NULL, GST_DEBUG_CATEGORY_INIT (gst_decode_bin_debug, "decodebin", 0, "decoder bin");\
NULL, topology_structure_name = g_quark_from_static_string ("stream-topology"); \
(GClassInitFunc) gst_decode_bin_class_init, topology_caps = g_quark_from_static_string ("caps");\
NULL, topology_next = g_quark_from_static_string ("next");\
NULL, topology_pad = g_quark_from_static_string ("pad");\
sizeof (GstDecodeBin), topology_element_srcpad = g_quark_from_static_string ("element-srcpad");\
0, ret |= playback_element_init (plugin);\
(GInstanceInitFunc) gst_decode_bin_init,
NULL
};
gst_decode_bin_type = GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (decodebin, "decodebin", GST_RANK_NONE,
g_type_register_static (GST_TYPE_BIN, "GstDecodeBin", GST_TYPE_DECODE_BIN, _do_init);
&gst_decode_bin_info, 0);
}
return gst_decode_bin_type;
}
static gboolean static gboolean
_gst_boolean_accumulator (GSignalInvocationHint * ihint, _gst_boolean_accumulator (GSignalInvocationHint * ihint,
@ -4527,12 +4519,6 @@ _gst_element_get_linked_caps (GstElement * src, GstElement * sink,
return caps; 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 /* FIXME: Invent gst_structure_take_structure() to prevent all the
* structure copying for nothing * structure copying for nothing
*/ */
@ -5704,19 +5690,3 @@ gst_decode_bin_remove_element (GstBin * bin, GstElement * element)
return GST_BIN_CLASS (parent_class)->remove_element (bin, element); 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);
}

View file

@ -30,7 +30,7 @@
#include <gst/gst.h> #include <gst/gst.h>
#include <gst/pbutils/pbutils.h> #include <gst/pbutils/pbutils.h>
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstrawcaps.h" #include "gstrawcaps.h"
@ -425,6 +425,11 @@ static guint gst_decodebin3_signals[LAST_SIGNAL] = { 0 };
GType gst_decodebin3_get_type (void); GType gst_decodebin3_get_type (void);
#define gst_decodebin3_parent_class parent_class #define gst_decodebin3_parent_class parent_class
G_DEFINE_TYPE (GstDecodebin3, gst_decodebin3, GST_TYPE_BIN); 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); static GstStaticCaps default_raw_caps = GST_STATIC_CAPS (DEFAULT_RAW_CAPS);
@ -3011,12 +3016,3 @@ gst_decodebin3_change_state (GstElement * element, GstStateChange transition)
beach: beach:
return ret; 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);
}

View file

@ -104,7 +104,7 @@
#include <gst/pbutils/pbutils.h> #include <gst/pbutils/pbutils.h>
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
#include "gstrawcaps.h" #include "gstrawcaps.h"
@ -495,37 +495,16 @@ static GstPadProbeReturn pad_event_cb (GstPad * pad, GstPadProbeInfo * info,
* Standard GObject boilerplate * * 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_dispose (GObject * object);
static void gst_parse_bin_finalize (GObject * object); static void gst_parse_bin_finalize (GObject * object);
static GType gst_parse_bin_get_type (void);
static GType G_DEFINE_TYPE (GstParseBin, gst_parse_bin, GST_TYPE_BIN);
gst_parse_bin_get_type (void) #define _do_init \
{ GST_DEBUG_CATEGORY_INIT (gst_parse_bin_debug, "parsebin", 0, "parser bin");\
static GType gst_parse_bin_type = 0; ret |= playback_element_init (plugin);
GST_ELEMENT_REGISTER_DEFINE_WITH_CODE (parsebin, "parsebin", GST_RANK_NONE,
if (!gst_parse_bin_type) { GST_TYPE_PARSE_BIN, _do_init);
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;
}
static gboolean static gboolean
_gst_boolean_accumulator (GSignalInvocationHint * ihint, _gst_boolean_accumulator (GSignalInvocationHint * ihint,
@ -4399,12 +4378,3 @@ gst_parse_bin_handle_message (GstBin * bin, GstMessage * msg)
else else
GST_BIN_CLASS (parent_class)->handle_message (bin, msg); 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);
}

View file

@ -1,5 +1,7 @@
/* GStreamer /* GStreamer
* Copyright (C) <2007> Wim Taymans <wim.taymans@gmail.com> * 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 * This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public * modify it under the terms of the GNU Library General Public
@ -16,23 +18,38 @@
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
* Boston, MA 02110-1301, USA. * 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.
*/
#ifndef __GST_PLAY_BACK_H__ #ifdef HAVE_CONFIG_H
#define __GST_PLAY_BACK_H__ #include "config.h"
#endif
#include <gst/gst.h> #include <gst/gst.h>
gboolean gst_decode_bin_plugin_init (GstPlugin * plugin); #include <gst/gst-i18n-plugin.h>
gboolean gst_decodebin3_plugin_init (GstPlugin * plugin); #include <gst/pbutils/pbutils.h>
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); #include "gstplaybackelements.h"
gboolean gst_play_bin2_plugin_init (GstPlugin * plugin);
gboolean gst_play_bin3_plugin_init (GstPlugin * plugin, gboolean as_playbin);
#endif /* __GST_PLAY_BACK_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;
}

View file

@ -0,0 +1,44 @@
/* 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__ */

View file

@ -32,45 +32,25 @@
#include <gst/gst-i18n-plugin.h> #include <gst/gst-i18n-plugin.h>
#include <gst/pbutils/pbutils.h> #include <gst/pbutils/pbutils.h>
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaysink.h"
#include "gstsubtitleoverlay.h"
#include "gststreamsynchronizer.h"
static gboolean static gboolean
plugin_init (GstPlugin * plugin) plugin_init (GstPlugin * plugin)
{ {
gboolean res; gboolean res = FALSE;
if (!g_getenv ("USE_PLAYBIN3"))
gst_pb_utils_init (); res |= GST_ELEMENT_REGISTER (playbin, plugin);
res |= GST_ELEMENT_REGISTER (playbin3, plugin);
#ifdef ENABLE_NLS res |= GST_ELEMENT_REGISTER (playsink, plugin);
GST_DEBUG ("binding text domain %s to locale dir %s", GETTEXT_PACKAGE, res |= GST_ELEMENT_REGISTER (subtitleoverlay, plugin);
LOCALEDIR); res |= GST_ELEMENT_REGISTER (streamsynchronizer, plugin);
bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); res |= GST_ELEMENT_REGISTER (decodebin, plugin);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); res |= GST_ELEMENT_REGISTER (decodebin3, plugin);
#endif /* ENABLE_NLS */ res |= GST_ELEMENT_REGISTER (uridecodebin, plugin);
res |= GST_ELEMENT_REGISTER (uridecodebin3, plugin);
/* Swap in playbin3 as 'playbin' if USE_PLAYBIN3=1 */ res |= GST_ELEMENT_REGISTER (urisourcebin, plugin);
{ res |= GST_ELEMENT_REGISTER (parsebin, plugin);
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; return res;
} }

View file

@ -216,7 +216,7 @@
#include <gst/video/navigation.h> #include <gst/video/navigation.h>
#include <gst/video/colorbalance.h> #include <gst/video/colorbalance.h>
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaysink.h" #include "gstplaysink.h"
#include "gstsubtitleoverlay.h" #include "gstsubtitleoverlay.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
@ -591,8 +591,6 @@ enum
static GstStaticCaps raw_audio_caps = GST_STATIC_CAPS ("audio/x-raw(ANY)"); 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 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_finalize (GObject * object);
static void gst_play_bin_set_property (GObject * object, guint prop_id, static void gst_play_bin_set_property (GObject * object, guint prop_id,
@ -655,57 +653,43 @@ static void gst_play_bin_navigation_init (gpointer g_iface,
static void gst_play_bin_colorbalance_init (gpointer g_iface, static void gst_play_bin_colorbalance_init (gpointer g_iface,
gpointer g_iface_data); gpointer g_iface_data);
static GType static GType gst_play_bin_get_type (void);
gst_play_bin_get_type (void)
{
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 void static void
_do_init_type (GType 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);
}
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) gst_play_bin_class_init (GstPlayBinClass * klass)
{ {
GObjectClass *gobject_klass; GObjectClass *gobject_klass;
@ -6091,12 +6075,3 @@ gst_play_bin_colorbalance_init (gpointer g_iface, gpointer g_iface_data)
iface->get_value = gst_play_bin_colorbalance_get_value; iface->get_value = gst_play_bin_colorbalance_get_value;
iface->get_balance_type = gst_play_bin_colorbalance_get_balance_type; 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);
}

View file

@ -228,7 +228,7 @@
#include <gst/video/navigation.h> #include <gst/video/navigation.h>
#include <gst/video/colorbalance.h> #include <gst/video/colorbalance.h>
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaysink.h" #include "gstplaysink.h"
#include "gstsubtitleoverlay.h" #include "gstsubtitleoverlay.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
@ -601,8 +601,6 @@ 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 GstStaticCaps raw_video_caps = GST_STATIC_CAPS ("video/x-raw(ANY)");
#endif #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_finalize (GObject * object);
static void gst_play_bin3_set_property (GObject * object, guint prop_id, static void gst_play_bin3_set_property (GObject * object, guint prop_id,
@ -653,56 +651,38 @@ static void gst_play_bin3_navigation_init (gpointer g_iface,
static void gst_play_bin3_colorbalance_init (gpointer g_iface, static void gst_play_bin3_colorbalance_init (gpointer g_iface,
gpointer g_iface_data); gpointer g_iface_data);
static GType static void
gst_play_bin3_get_type (void) _do_init_type (GType type)
{ {
static GType gst_play_bin3_type = 0; 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
};
if (!gst_play_bin3_type) { g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info);
static const GTypeInfo gst_play_bin3_info = { g_type_add_interface_static (type, GST_TYPE_VIDEO_OVERLAY, &ov_info);
sizeof (GstPlayBin3Class), g_type_add_interface_static (type, GST_TYPE_NAVIGATION, &nav_info);
NULL, g_type_add_interface_static (type, GST_TYPE_COLOR_BALANCE, &col_info);
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 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 static void
gst_play_bin3_class_init (GstPlayBin3Class * klass) gst_play_bin3_class_init (GstPlayBin3Class * klass)
{ {
@ -5168,14 +5148,20 @@ gst_play_bin3_colorbalance_init (gpointer g_iface, gpointer g_iface_data)
} }
gboolean 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) GST_DEBUG_CATEGORY_INIT (gst_play_bin3_debug, "playbin3", 0, "play bin3");
return gst_element_register (plugin, "playbin", GST_RANK_NONE,
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); GST_TYPE_PLAY_BIN);
return gst_element_register (plugin, "playbin3", GST_RANK_NONE, return ret;
GST_TYPE_PLAY_BIN);
} }

View file

@ -33,6 +33,7 @@
#include <gst/video/videooverlay.h> #include <gst/video/videooverlay.h>
#include <gst/video/navigation.h> #include <gst/video/navigation.h>
#include "gstplaybackelements.h"
#include "gstplaysink.h" #include "gstplaysink.h"
#include "gststreamsynchronizer.h" #include "gststreamsynchronizer.h"
#include "gstplaysinkvideoconvert.h" #include "gstplaysinkvideoconvert.h"
@ -412,7 +413,7 @@ static void gst_play_sink_colorbalance_init (gpointer g_iface,
gpointer g_iface_data); gpointer g_iface_data);
static void static void
_do_init (GType type) _do_init_type (GType type)
{ {
static const GInterfaceInfo svol_info = { static const GInterfaceInfo svol_info = {
NULL, NULL, NULL NULL, NULL, NULL
@ -437,7 +438,13 @@ _do_init (GType type)
} }
G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN, 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 static void
gst_play_sink_class_init (GstPlaySinkClass * klass) gst_play_sink_class_init (GstPlaySinkClass * klass)
@ -5521,11 +5528,3 @@ gst_play_sink_colorbalance_init (gpointer g_iface, gpointer g_iface_data)
iface->get_value = gst_play_sink_colorbalance_get_value; iface->get_value = gst_play_sink_colorbalance_get_value;
iface->get_balance_type = gst_play_sink_colorbalance_get_balance_type; 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);
}

View file

@ -101,8 +101,6 @@ GstSample * gst_play_sink_convert_sample (GstPlaySink * playsink, GstCaps
gboolean gst_play_sink_reconfigure (GstPlaySink * playsink); gboolean gst_play_sink_reconfigure (GstPlaySink * playsink);
gboolean gst_play_sink_plugin_init (GstPlugin * plugin);
G_END_DECLS G_END_DECLS
#endif /* __GST_PLAY_SINK_H__ */ #endif /* __GST_PLAY_SINK_H__ */

View file

@ -21,6 +21,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gstplaybackelements.h"
#include "gststreamsynchronizer.h" #include "gststreamsynchronizer.h"
GST_DEBUG_CATEGORY_STATIC (stream_synchronizer_debug); GST_DEBUG_CATEGORY_STATIC (stream_synchronizer_debug);
@ -55,6 +56,10 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink_%u",
#define gst_stream_synchronizer_parent_class parent_class #define gst_stream_synchronizer_parent_class parent_class
G_DEFINE_TYPE (GstStreamSynchronizer, gst_stream_synchronizer, G_DEFINE_TYPE (GstStreamSynchronizer, gst_stream_synchronizer,
GST_TYPE_ELEMENT); 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 typedef struct
{ {
@ -1193,14 +1198,7 @@ gst_stream_synchronizer_class_init (GstStreamSynchronizerClass * klass)
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_request_new_pad); GST_DEBUG_FUNCPTR (gst_stream_synchronizer_request_new_pad);
element_class->release_pad = element_class->release_pad =
GST_DEBUG_FUNCPTR (gst_stream_synchronizer_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, GST_DEBUG_CATEGORY_INIT (stream_synchronizer_debug,
"streamsynchronizer", 0, "Stream Synchronizer"); "streamsynchronizer", 0, "Stream Synchronizer");
return gst_element_register (plugin, "streamsynchronizer", GST_RANK_NONE,
GST_TYPE_STREAM_SYNCHRONIZER);
} }

View file

@ -66,8 +66,6 @@ struct _GstStreamSynchronizerClass
GType gst_stream_synchronizer_get_type (void); GType gst_stream_synchronizer_get_type (void);
gboolean gst_stream_synchronizer_plugin_init (GstPlugin * plugin);
G_END_DECLS G_END_DECLS
#endif /* __GST_STREAM_SYNCHRONIZER_H__ */ #endif /* __GST_STREAM_SYNCHRONIZER_H__ */

View file

@ -39,6 +39,7 @@
#include "config.h" #include "config.h"
#endif #endif
#include "gstplaybackelements.h"
#include "gstsubtitleoverlay.h" #include "gstsubtitleoverlay.h"
#include <gst/pbutils/missing-plugins.h> #include <gst/pbutils/missing-plugins.h>
@ -85,6 +86,13 @@ G_DEFINE_TYPE (GstSubtitleOverlay, gst_subtitle_overlay, GST_TYPE_BIN);
static GQuark _subtitle_overlay_event_marker_id = 0; 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 static void
do_async_start (GstSubtitleOverlay * self) do_async_start (GstSubtitleOverlay * self)
{ {
@ -2106,16 +2114,3 @@ gst_subtitle_overlay_init (GstSubtitleOverlay * self)
self->fps_n = 0; self->fps_n = 0;
self->fps_d = 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);
}

View file

@ -112,7 +112,6 @@ struct _GstSubtitleOverlayClass
}; };
GType gst_subtitle_overlay_get_type (void); GType gst_subtitle_overlay_get_type (void);
gboolean gst_subtitle_overlay_plugin_init (GstPlugin * plugin);
GstCaps *gst_subtitle_overlay_create_factory_caps (void); GstCaps *gst_subtitle_overlay_create_factory_caps (void);

View file

@ -41,7 +41,7 @@
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstrawcaps.h" #include "gstrawcaps.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
#define GST_TYPE_URI_DECODE_BIN \ #define GST_TYPE_URI_DECODE_BIN \
@ -208,6 +208,12 @@ GType gst_uri_decode_bin_get_type (void);
#define gst_uri_decode_bin_parent_class parent_class #define gst_uri_decode_bin_parent_class parent_class
G_DEFINE_TYPE (GstURIDecodeBin, gst_uri_decode_bin, GST_TYPE_BIN); 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 remove_decoders (GstURIDecodeBin * bin, gboolean force);
static void gst_uri_decode_bin_set_property (GObject * object, guint prop_id, static void gst_uri_decode_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
@ -2924,13 +2930,3 @@ setup_failed:
return GST_STATE_CHANGE_FAILURE; 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);
}

View file

@ -55,7 +55,7 @@
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstrawcaps.h" #include "gstrawcaps.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
#define GST_TYPE_URI_DECODE_BIN3 \ #define GST_TYPE_URI_DECODE_BIN3 \
@ -329,6 +329,12 @@ GType gst_uri_decode_bin3_get_type (void);
#define gst_uri_decode_bin3_parent_class parent_class #define gst_uri_decode_bin3_parent_class parent_class
G_DEFINE_TYPE (GstURIDecodeBin3, gst_uri_decode_bin3, GST_TYPE_BIN); 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) \ #define REMOVE_SIGNAL(obj,id) \
if (id) { \ if (id) { \
g_signal_handler_disconnect (obj, id); \ g_signal_handler_disconnect (obj, id); \
@ -1144,13 +1150,3 @@ gst_uri_decodebin3_send_event (GstElement * element, GstEvent * event)
return GST_ELEMENT_CLASS (parent_class)->send_event (element, event); 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);
}

View file

@ -50,7 +50,7 @@
#include "gstplay-enum.h" #include "gstplay-enum.h"
#include "gstrawcaps.h" #include "gstrawcaps.h"
#include "gstplayback.h" #include "gstplaybackelements.h"
#include "gstplaybackutils.h" #include "gstplaybackutils.h"
#define GST_TYPE_URI_SOURCE_BIN \ #define GST_TYPE_URI_SOURCE_BIN \
@ -256,6 +256,12 @@ GType gst_uri_source_bin_get_type (void);
#define gst_uri_source_bin_parent_class parent_class #define gst_uri_source_bin_parent_class parent_class
G_DEFINE_TYPE (GstURISourceBin, gst_uri_source_bin, GST_TYPE_BIN); 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, static void gst_uri_source_bin_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec); const GValue * value, GParamSpec * pspec);
static void gst_uri_source_bin_get_property (GObject * object, guint prop_id, static void gst_uri_source_bin_get_property (GObject * object, guint prop_id,
@ -2853,13 +2859,3 @@ setup_failed:
return GST_STATE_CHANGE_FAILURE; 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);
}

View file

@ -5,7 +5,8 @@ playback_sources = [
'gsturidecodebin3.c', 'gsturidecodebin3.c',
'gsturisourcebin.c', 'gsturisourcebin.c',
'gstparsebin.c', 'gstparsebin.c',
'gstplayback.c', 'gstplaybackplugin.c',
'gstplaybackelement.c',
'gstplaybackutils.c', 'gstplaybackutils.c',
'gstplaybin2.c', 'gstplaybin2.c',
'gstplaybin3.c', 'gstplaybin3.c',