};
-G_DEFINE_TYPE (GstVideoAggregatorPad, gst_video_aggregator_pad,
+G_DEFINE_TYPE_WITH_PRIVATE (GstVideoAggregatorPad, gst_video_aggregator_pad,
GST_TYPE_AGGREGATOR_PAD);
static void
DEFAULT_PAD_REPEAT_AFTER_EOS,
G_PARAM_READWRITE | GST_PARAM_CONTROLLABLE | G_PARAM_STATIC_STRINGS));
- g_type_class_add_private (klass, sizeof (GstVideoAggregatorPadPrivate));
-
aggpadclass->flush = GST_DEBUG_FUNCPTR (_flush_pad);
aggpadclass->skip_buffer =
GST_DEBUG_FUNCPTR (gst_video_aggregator_pad_skip_buffer);
static void
gst_video_aggregator_pad_init (GstVideoAggregatorPad * vaggpad)
{
- vaggpad->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (vaggpad, GST_TYPE_VIDEO_AGGREGATOR_PAD,
- GstVideoAggregatorPadPrivate);
+ vaggpad->priv = gst_video_aggregator_pad_get_instance_private (vaggpad);
vaggpad->priv->zorder = DEFAULT_PAD_ZORDER;
vaggpad->priv->repeat_after_eos = DEFAULT_PAD_REPEAT_AFTER_EOS;
gboolean converter_config_changed;
};
-G_DEFINE_TYPE (GstVideoAggregatorConvertPad, gst_video_aggregator_convert_pad,
- GST_TYPE_VIDEO_AGGREGATOR_PAD);
+G_DEFINE_TYPE_WITH_PRIVATE (GstVideoAggregatorConvertPad,
+ gst_video_aggregator_convert_pad, GST_TYPE_VIDEO_AGGREGATOR_PAD);
static void
gst_video_aggregator_convert_pad_finalize (GObject * o)
gobject_class->set_property =
GST_DEBUG_FUNCPTR (gst_video_aggregator_convert_pad_set_property);
- g_type_class_add_private (klass,
- sizeof (GstVideoAggregatorConvertPadPrivate));
-
g_object_class_install_property (gobject_class,
PROP_CONVERT_PAD_CONVERTER_CONFIG, g_param_spec_boxed ("converter-config",
"Converter configuration",
gst_video_aggregator_convert_pad_init (GstVideoAggregatorConvertPad * vaggpad)
{
vaggpad->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (vaggpad,
- GST_TYPE_VIDEO_AGGREGATOR_CONVERT_PAD,
- GstVideoAggregatorConvertPadPrivate);
+ gst_video_aggregator_convert_pad_get_instance_private (vaggpad);
vaggpad->priv->converted_buffer = NULL;
vaggpad->priv->convert = NULL;
GstVideoAggregatorClass * klass);
static void gst_video_aggregator_class_init (GstVideoAggregatorClass * klass);
static gpointer gst_video_aggregator_parent_class = NULL;
+static gint video_aggregator_private_offset = 0;
GType
gst_video_aggregator_get_type (void)
sizeof (GstVideoAggregator),
(GInstanceInitFunc) gst_video_aggregator_init,
(GTypeFlags) G_TYPE_FLAG_ABSTRACT);
+
+ video_aggregator_private_offset =
+ g_type_add_instance_private (g_define_type_id,
+ sizeof (GstVideoAggregatorPrivate));
+
g_once_init_leave (&g_define_type_id_volatile, g_define_type_id);
}
return g_define_type_id_volatile;
}
+static inline GstVideoAggregatorPrivate *
+gst_video_aggregator_get_instance_private (GstVideoAggregator * self)
+{
+ return (G_STRUCT_MEMBER_P (self, video_aggregator_private_offset));
+}
+
static void
gst_video_aggregator_find_best_format (GstVideoAggregator * vagg,
GstCaps * downstream_caps, GstVideoInfo * best_info,
gst_video_aggregator_parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (GstVideoAggregatorPrivate));
+ if (video_aggregator_private_offset != 0)
+ g_type_class_adjust_private_offset (klass,
+ &video_aggregator_private_offset);
gobject_class->finalize = gst_video_aggregator_finalize;
gobject_class->dispose = gst_video_aggregator_dispose;
gst_video_aggregator_init (GstVideoAggregator * vagg,
GstVideoAggregatorClass * klass)
{
- vagg->priv =
- G_TYPE_INSTANCE_GET_PRIVATE (vagg, GST_TYPE_VIDEO_AGGREGATOR,
- GstVideoAggregatorPrivate);
+ vagg->priv = gst_video_aggregator_get_instance_private (vagg);
vagg->priv->current_caps = NULL;