mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-05 15:08:48 +00:00
play: Initialize debug category and error quark in class_init
Doing it in gst_play_new() means that bindings that directly call g_object_new() with the GType wouldn't end up initializing both. This affects at least the Python and GJS bindings. gst_init() is nonetheless only called from gst_play_new() once because calling it from class_init would likely lead to problems as that's called from somewhere in the middle of GObject. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6821>
This commit is contained in:
parent
6f508684e7
commit
f67559716e
2 changed files with 6 additions and 6 deletions
|
@ -382,6 +382,9 @@ gst_play_class_init (GstPlayClass * klass)
|
|||
{
|
||||
GObjectClass *gobject_class = (GObjectClass *) klass;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (gst_play_debug, "gst-play", 0, "GstPlay");
|
||||
gst_play_error_quark ();
|
||||
|
||||
gobject_class->set_property = gst_play_set_property;
|
||||
gobject_class->get_property = gst_play_get_property;
|
||||
gobject_class->dispose = gst_play_dispose;
|
||||
|
@ -2722,9 +2725,6 @@ gst_play_init_once (G_GNUC_UNUSED gpointer user_data)
|
|||
{
|
||||
gst_init (NULL, NULL);
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (gst_play_debug, "gst-play", 0, "GstPlay");
|
||||
gst_play_error_quark ();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -206,6 +206,9 @@ gst_player_class_init (GstPlayerClass * klass)
|
|||
{
|
||||
GObjectClass *gobject_class = (GObjectClass *) klass;
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (gst_player_debug, "gst-player", 0, "GstPlayer");
|
||||
gst_player_error_quark ();
|
||||
|
||||
gobject_class->set_property = gst_player_set_property;
|
||||
gobject_class->get_property = gst_player_get_property;
|
||||
gobject_class->finalize = gst_player_finalize;
|
||||
|
@ -444,9 +447,6 @@ gst_player_init_once (G_GNUC_UNUSED gpointer user_data)
|
|||
{
|
||||
gst_init (NULL, NULL);
|
||||
|
||||
GST_DEBUG_CATEGORY_INIT (gst_player_debug, "gst-player", 0, "GstPlayer");
|
||||
gst_player_error_quark ();
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue