Update for g_type_class_add_private() deprecation in recent GLib

https://gitlab.gnome.org/GNOME/glib/merge_requests/7
This commit is contained in:
Tim-Philipp Müller 2018-06-23 23:44:19 +02:00
parent 8842d51ff8
commit 238a37295c
4 changed files with 13 additions and 31 deletions

View file

@ -51,13 +51,6 @@
#define GST_CAT_DEFAULT gtk_gst_gl_widget_debug
GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT);
G_DEFINE_TYPE_WITH_CODE (GtkGstGLWidget, gtk_gst_gl_widget, GTK_TYPE_GL_AREA,
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gtkgstglwidget", 0,
"Gtk Gst GL Widget"););
#define GTK_GST_GL_WIDGET_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
GTK_TYPE_GST_GL_WIDGET, GtkGstGLWidgetPrivate))
struct _GtkGstGLWidgetPrivate
{
gboolean initted;
@ -82,6 +75,11 @@ static const GLfloat vertices[] = {
1.0f, -1.0f, 0.0f, 1.0f, 1.0f
};
G_DEFINE_TYPE_WITH_CODE (GtkGstGLWidget, gtk_gst_gl_widget, GTK_TYPE_GL_AREA,
G_ADD_PRIVATE (GtkGstGLWidget)
GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "gtkgstglwidget", 0,
"Gtk Gst GL Widget"););
static void
gtk_gst_gl_widget_bind_buffer (GtkGstGLWidget * gst_widget)
{
@ -365,7 +363,6 @@ gtk_gst_gl_widget_class_init (GtkGstGLWidgetClass * klass)
GObjectClass *gobject_klass = (GObjectClass *) klass;
GtkGLAreaClass *gl_widget_klass = (GtkGLAreaClass *) klass;
g_type_class_add_private (klass, sizeof (GtkGstGLWidgetPrivate));
gtk_gst_base_widget_class_init (GTK_GST_BASE_WIDGET_CLASS (klass));
gobject_klass->finalize = gtk_gst_gl_widget_finalize;
@ -381,7 +378,7 @@ gtk_gst_gl_widget_init (GtkGstGLWidget * gst_widget)
gtk_gst_base_widget_init (base_widget);
gst_widget->priv = priv = GTK_GST_GL_WIDGET_GET_PRIVATE (gst_widget);
gst_widget->priv = priv = gtk_gst_gl_widget_get_instance_private (gst_widget);
display = gdk_display_get_default ();

View file

@ -204,9 +204,6 @@ static GstStaticPadTemplate rtpbin_send_rtp_src_template =
GST_STATIC_CAPS ("application/x-rtp;application/x-srtp")
);
#define GST_RTP_BIN_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_BIN, GstRtpBinPrivate))
#define GST_RTP_BIN_LOCK(bin) g_mutex_lock (&(bin)->priv->bin_lock)
#define GST_RTP_BIN_UNLOCK(bin) g_mutex_unlock (&(bin)->priv->bin_lock)
@ -1983,7 +1980,7 @@ static void gst_rtp_bin_release_pad (GstElement * element, GstPad * pad);
static void gst_rtp_bin_handle_message (GstBin * bin, GstMessage * message);
#define gst_rtp_bin_parent_class parent_class
G_DEFINE_TYPE (GstRtpBin, gst_rtp_bin, GST_TYPE_BIN);
G_DEFINE_TYPE_WITH_PRIVATE (GstRtpBin, gst_rtp_bin, GST_TYPE_BIN);
static gboolean
_gst_element_accumulator (GSignalInvocationHint * ihint,
@ -2028,8 +2025,6 @@ gst_rtp_bin_class_init (GstRtpBinClass * klass)
gstelement_class = (GstElementClass *) klass;
gstbin_class = (GstBinClass *) klass;
g_type_class_add_private (klass, sizeof (GstRtpBinPrivate));
gobject_class->dispose = gst_rtp_bin_dispose;
gobject_class->finalize = gst_rtp_bin_finalize;
gobject_class->set_property = gst_rtp_bin_set_property;
@ -2754,7 +2749,7 @@ gst_rtp_bin_init (GstRtpBin * rtpbin)
{
gchar *cname;
rtpbin->priv = GST_RTP_BIN_GET_PRIVATE (rtpbin);
rtpbin->priv = gst_rtp_bin_get_instance_private (rtpbin);
g_mutex_init (&rtpbin->priv->bin_lock);
g_mutex_init (&rtpbin->priv->dyn_lock);

View file

@ -400,10 +400,6 @@ typedef struct
guint num_rtx_received;
} TimerData;
#define GST_RTP_JITTER_BUFFER_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), GST_TYPE_RTP_JITTER_BUFFER, \
GstRtpJitterBufferPrivate))
static GstStaticPadTemplate gst_rtp_jitter_buffer_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink",
GST_PAD_SINK,
@ -436,7 +432,8 @@ GST_STATIC_PAD_TEMPLATE ("src",
static guint gst_rtp_jitter_buffer_signals[LAST_SIGNAL] = { 0 };
#define gst_rtp_jitter_buffer_parent_class parent_class
G_DEFINE_TYPE (GstRtpJitterBuffer, gst_rtp_jitter_buffer, GST_TYPE_ELEMENT);
G_DEFINE_TYPE_WITH_PRIVATE (GstRtpJitterBuffer, gst_rtp_jitter_buffer,
GST_TYPE_ELEMENT);
/* object overrides */
static void gst_rtp_jitter_buffer_set_property (GObject * object,
@ -516,8 +513,6 @@ gst_rtp_jitter_buffer_class_init (GstRtpJitterBufferClass * klass)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
g_type_class_add_private (klass, sizeof (GstRtpJitterBufferPrivate));
gobject_class->finalize = gst_rtp_jitter_buffer_finalize;
gobject_class->set_property = gst_rtp_jitter_buffer_set_property;
@ -994,7 +989,7 @@ gst_rtp_jitter_buffer_init (GstRtpJitterBuffer * jitterbuffer)
{
GstRtpJitterBufferPrivate *priv;
priv = GST_RTP_JITTER_BUFFER_GET_PRIVATE (jitterbuffer);
priv = gst_rtp_jitter_buffer_get_instance_private (jitterbuffer);
jitterbuffer->priv = priv;
priv->latency_ms = DEFAULT_LATENCY_MS;

View file

@ -251,9 +251,6 @@ enum
PROP_RTCP_SYNC_SEND_TIME
};
#define GST_RTP_SESSION_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_RTP_SESSION, GstRtpSessionPrivate))
#define GST_RTP_SESSION_LOCK(sess) g_mutex_lock (&(sess)->priv->lock)
#define GST_RTP_SESSION_UNLOCK(sess) g_mutex_unlock (&(sess)->priv->lock)
@ -473,7 +470,7 @@ on_notify_stats (RTPSession * session, GParamSpec * spec,
}
#define gst_rtp_session_parent_class parent_class
G_DEFINE_TYPE (GstRtpSession, gst_rtp_session, GST_TYPE_ELEMENT);
G_DEFINE_TYPE_WITH_PRIVATE (GstRtpSession, gst_rtp_session, GST_TYPE_ELEMENT);
static void
gst_rtp_session_class_init (GstRtpSessionClass * klass)
@ -484,8 +481,6 @@ gst_rtp_session_class_init (GstRtpSessionClass * klass)
gobject_class = (GObjectClass *) klass;
gstelement_class = (GstElementClass *) klass;
g_type_class_add_private (klass, sizeof (GstRtpSessionPrivate));
gobject_class->finalize = gst_rtp_session_finalize;
gobject_class->set_property = gst_rtp_session_set_property;
gobject_class->get_property = gst_rtp_session_get_property;
@ -802,7 +797,7 @@ gst_rtp_session_class_init (GstRtpSessionClass * klass)
static void
gst_rtp_session_init (GstRtpSession * rtpsession)
{
rtpsession->priv = GST_RTP_SESSION_GET_PRIVATE (rtpsession);
rtpsession->priv = gst_rtp_session_get_instance_private (rtpsession);
g_mutex_init (&rtpsession->priv->lock);
g_cond_init (&rtpsession->priv->cond);
rtpsession->priv->sysclock = gst_system_clock_obtain ();