GST_DEBUG_CATEGORY (videodecoder_debug);
#define GST_CAT_DEFAULT videodecoder_debug
-#define GST_VIDEO_DECODER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_VIDEO_DECODER, \
- GstVideoDecoderPrivate))
-
struct _GstVideoDecoderPrivate
{
/* FIXME introduce a context ? */
};
static GstElementClass *parent_class = NULL;
+static gint private_offset = 0;
+
static void gst_video_decoder_class_init (GstVideoDecoderClass * klass);
static void gst_video_decoder_init (GstVideoDecoder * dec,
GstVideoDecoderClass * klass);
_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstVideoDecoder", &info, G_TYPE_FLAG_ABSTRACT);
+
+ private_offset =
+ g_type_add_instance_private (_type, sizeof (GstVideoDecoderPrivate));
+
g_once_init_leave (&type, _type);
}
return type;
}
+static inline GstVideoDecoderPrivate *
+gst_video_decoder_get_instance_private (GstVideoDecoder * self)
+{
+ return (G_STRUCT_MEMBER_P (self, private_offset));
+}
+
static void
gst_video_decoder_class_init (GstVideoDecoderClass * klass)
{
"Base Video Decoder");
parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (GstVideoDecoderPrivate));
+
+ if (private_offset != 0)
+ g_type_class_adjust_private_offset (klass, &private_offset);
gobject_class->finalize = gst_video_decoder_finalize;
GST_DEBUG_OBJECT (decoder, "gst_video_decoder_init");
- decoder->priv = GST_VIDEO_DECODER_GET_PRIVATE (decoder);
+ decoder->priv = gst_video_decoder_get_instance_private (decoder);
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (klass), "sink");
GST_DEBUG_CATEGORY (videoencoder_debug);
#define GST_CAT_DEFAULT videoencoder_debug
-#define GST_VIDEO_ENCODER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_VIDEO_ENCODER, \
- GstVideoEncoderPrivate))
-
/* properties */
#define DEFAULT_QOS FALSE
}
static GstElementClass *parent_class = NULL;
+static gint private_offset = 0;
+
static void gst_video_encoder_class_init (GstVideoEncoderClass * klass);
static void gst_video_encoder_init (GstVideoEncoder * enc,
GstVideoEncoderClass * klass);
_type = g_type_register_static (GST_TYPE_ELEMENT,
"GstVideoEncoder", &info, G_TYPE_FLAG_ABSTRACT);
+ private_offset =
+ g_type_add_instance_private (_type, sizeof (GstVideoEncoderPrivate));
g_type_add_interface_static (_type, GST_TYPE_PRESET,
&preset_interface_info);
g_once_init_leave (&type, _type);
return type;
}
+static inline GstVideoEncoderPrivate *
+gst_video_encoder_get_instance_private (GstVideoEncoder * self)
+{
+ return (G_STRUCT_MEMBER_P (self, private_offset));
+}
+
static void
gst_video_encoder_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (GstVideoEncoderPrivate));
+ if (private_offset != 0)
+ g_type_class_adjust_private_offset (klass, &private_offset);
gobject_class->set_property = gst_video_encoder_set_property;
gobject_class->get_property = gst_video_encoder_get_property;
GST_DEBUG_OBJECT (encoder, "gst_video_encoder_init");
- priv = encoder->priv = GST_VIDEO_ENCODER_GET_PRIVATE (encoder);
+ priv = encoder->priv = gst_video_encoder_get_instance_private (encoder);
pad_template =
gst_element_class_get_pad_template (GST_ELEMENT_CLASS (klass), "sink");
static void gst_video_buffer_pool_finalize (GObject * object);
-#define GST_VIDEO_BUFFER_POOL_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_VIDEO_BUFFER_POOL, GstVideoBufferPoolPrivate))
-
#define gst_video_buffer_pool_parent_class parent_class
-G_DEFINE_TYPE (GstVideoBufferPool, gst_video_buffer_pool, GST_TYPE_BUFFER_POOL);
+G_DEFINE_TYPE_WITH_PRIVATE (GstVideoBufferPool, gst_video_buffer_pool,
+ GST_TYPE_BUFFER_POOL);
static const gchar **
video_buffer_pool_get_options (GstBufferPool * pool)
GObjectClass *gobject_class = (GObjectClass *) klass;
GstBufferPoolClass *gstbufferpool_class = (GstBufferPoolClass *) klass;
- g_type_class_add_private (klass, sizeof (GstVideoBufferPoolPrivate));
-
gobject_class->finalize = gst_video_buffer_pool_finalize;
gstbufferpool_class->get_options = video_buffer_pool_get_options;
static void
gst_video_buffer_pool_init (GstVideoBufferPool * pool)
{
- pool->priv = GST_VIDEO_BUFFER_POOL_GET_PRIVATE (pool);
+ pool->priv = gst_video_buffer_pool_get_instance_private (pool);
}
static void
#include "gstvideosink.h"
-G_DEFINE_TYPE (GstVideoSink, gst_video_sink, GST_TYPE_BASE_SINK);
-
enum
{
PROP_SHOW_PREROLL_FRAME = 1
gboolean show_preroll_frame; /* ATOMIC */
};
+G_DEFINE_TYPE_WITH_PRIVATE (GstVideoSink, gst_video_sink, GST_TYPE_BASE_SINK);
+
#ifndef GST_DISABLE_GST_DEBUG
#define GST_CAT_DEFAULT gst_video_sink_ensure_debug_category()
gst_base_sink_set_max_lateness (GST_BASE_SINK (videosink), 20 * GST_MSECOND);
gst_base_sink_set_qos_enabled (GST_BASE_SINK (videosink), TRUE);
- videosink->priv = G_TYPE_INSTANCE_GET_PRIVATE (videosink,
- GST_TYPE_VIDEO_SINK, GstVideoSinkPrivate);
+ videosink->priv = gst_video_sink_get_instance_private (videosink);
}
static void
basesink_class->render = GST_DEBUG_FUNCPTR (gst_video_sink_show_frame);
basesink_class->preroll =
GST_DEBUG_FUNCPTR (gst_video_sink_show_preroll_frame);
-
- g_type_class_add_private (klass, sizeof (GstVideoSinkPrivate));
}
static GstFlowReturn