gl: Update for g_type_class_add_private() deprecation in recent GLib

This commit is contained in:
Tim-Philipp Müller 2018-06-24 00:17:26 +02:00
parent 5934fb1bb6
commit 69534fe9a0
3 changed files with 12 additions and 29 deletions

View file

@ -28,10 +28,6 @@
#include "gstglbasemixer.h"
#define gst_gl_base_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE (GstGLBaseMixer, gst_gl_base_mixer,
GST_TYPE_VIDEO_AGGREGATOR);
#define GST_CAT_DEFAULT gst_gl_base_mixer_debug
GST_DEBUG_CATEGORY (gst_gl_base_mixer_debug);
@ -45,14 +41,6 @@ static void gst_gl_base_mixer_set_context (GstElement * element,
static GstStateChangeReturn gst_gl_base_mixer_change_state (GstElement *
element, GstStateChange transition);
enum
{
PROP_PAD_0
};
#define GST_GL_BASE_MIXER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_BASE_MIXER, GstGLBaseMixerPrivate))
struct _GstGLBaseMixerPrivate
{
gboolean negotiated;
@ -60,6 +48,10 @@ struct _GstGLBaseMixerPrivate
GstGLContext *other_context;
};
#define gst_gl_base_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLBaseMixer, gst_gl_base_mixer,
GST_TYPE_VIDEO_AGGREGATOR);
G_DEFINE_TYPE (GstGLBaseMixerPad, gst_gl_base_mixer_pad,
GST_TYPE_VIDEO_AGGREGATOR_PAD);
@ -260,8 +252,6 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass)
gobject_class = (GObjectClass *) klass;
element_class = GST_ELEMENT_CLASS (klass);
g_type_class_add_private (klass, sizeof (GstGLBaseMixerPrivate));
gobject_class->get_property = gst_gl_base_mixer_get_property;
gobject_class->set_property = gst_gl_base_mixer_set_property;
@ -292,7 +282,7 @@ gst_gl_base_mixer_class_init (GstGLBaseMixerClass * klass)
static void
gst_gl_base_mixer_init (GstGLBaseMixer * mix)
{
mix->priv = GST_GL_BASE_MIXER_GET_PRIVATE (mix);
mix->priv = gst_gl_base_mixer_get_instance_private (mix);
}
static void

View file

@ -30,9 +30,6 @@
#include "gstglmixer.h"
#define gst_gl_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE (GstGLMixer, gst_gl_mixer, GST_TYPE_GL_BASE_MIXER);
#define GST_CAT_DEFAULT gst_gl_mixer_debug
GST_DEBUG_CATEGORY (gst_gl_mixer_debug);
@ -51,9 +48,6 @@ enum
PROP_PAD_0
};
#define GST_GL_MIXER_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_GL_MIXER, GstGLMixerPrivate))
struct _GstGLMixerPrivate
{
gboolean negotiated;
@ -63,6 +57,10 @@ struct _GstGLMixerPrivate
GCond gl_resource_cond;
};
#define gst_gl_mixer_parent_class parent_class
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (GstGLMixer, gst_gl_mixer,
GST_TYPE_GL_BASE_MIXER);
G_DEFINE_TYPE (GstGLMixerPad, gst_gl_mixer_pad, GST_TYPE_GL_BASE_MIXER_PAD);
static void
@ -407,8 +405,6 @@ gst_gl_mixer_class_init (GstGLMixerClass * klass)
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixer", 0, "OpenGL mixer");
g_type_class_add_private (klass, sizeof (GstGLMixerPrivate));
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_gl_mixer_finalize);
gobject_class->get_property = gst_gl_mixer_get_property;
@ -446,7 +442,7 @@ gst_gl_mixer_reset (GstGLMixer * mix)
static void
gst_gl_mixer_init (GstGLMixer * mix)
{
mix->priv = GST_GL_MIXER_GET_PRIVATE (mix);
mix->priv = gst_gl_mixer_get_instance_private (mix);
mix->priv->gl_resource_ready = FALSE;
g_mutex_init (&mix->priv->gl_resource_lock);

View file

@ -126,9 +126,8 @@ enum
static void gst_gl_mixer_bin_child_proxy_init (gpointer g_iface,
gpointer iface_data);
#define GST_GL_MIXER_BIN_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE((o), GST_TYPE_GL_MIXER_BIN, GstGLMixerBinPrivate))
G_DEFINE_TYPE_WITH_CODE (GstGLMixerBin, gst_gl_mixer_bin, GST_TYPE_BIN,
G_ADD_PRIVATE (GstGLMixerBin)
G_IMPLEMENT_INTERFACE (GST_TYPE_CHILD_PROXY,
gst_gl_mixer_bin_child_proxy_init));
@ -159,8 +158,6 @@ gst_gl_mixer_bin_class_init (GstGLMixerBinClass * klass)
GstElementClass *element_class = GST_ELEMENT_CLASS (klass);
GstCaps *upload_caps;
g_type_class_add_private (klass, sizeof (GstGLMixerBinPrivate));
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "glmixerbin", 0,
"opengl mixer bin");
@ -233,7 +230,7 @@ gst_gl_mixer_bin_init (GstGLMixerBin * self)
gboolean res = TRUE;
GstPad *pad;
self->priv = GST_GL_MIXER_BIN_GET_PRIVATE (self);
self->priv = gst_gl_mixer_bin_get_instance_private (self);
self->out_convert = gst_element_factory_make ("glcolorconvert", NULL);
self->download = gst_element_factory_make ("gldownload", NULL);