GST_DEBUG_CATEGORY (adaptivedemux_debug);
#define GST_CAT_DEFAULT adaptivedemux_debug
-#define GST_ADAPTIVE_DEMUX_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_ADAPTIVE_DEMUX, \
- GstAdaptiveDemuxPrivate))
-
#define MAX_DOWNLOAD_ERROR_COUNT 3
#define DEFAULT_FAILED_COUNT 3
#define DEFAULT_CONNECTION_SPEED 0
} GstAdaptiveDemuxTimer;
static GstBinClass *parent_class = NULL;
+static gint private_offset = 0;
+
static void gst_adaptive_demux_class_init (GstAdaptiveDemuxClass * klass);
static void gst_adaptive_demux_init (GstAdaptiveDemux * dec,
GstAdaptiveDemuxClass * klass);
_type = g_type_register_static (GST_TYPE_BIN,
"GstAdaptiveDemux", &info, G_TYPE_FLAG_ABSTRACT);
+
+ private_offset =
+ g_type_add_instance_private (_type, sizeof (GstAdaptiveDemuxPrivate));
+
g_once_init_leave (&type, _type);
}
return type;
}
+static inline GstAdaptiveDemuxPrivate *
+gst_adaptive_demux_get_instance_private (GstAdaptiveDemux * self)
+{
+ return (G_STRUCT_MEMBER_P (self, private_offset));
+}
+
static void
gst_adaptive_demux_set_property (GObject * object, guint prop_id,
const GValue * value, GParamSpec * pspec)
"Base Adaptive Demux");
parent_class = g_type_class_peek_parent (klass);
- g_type_class_add_private (klass, sizeof (GstAdaptiveDemuxPrivate));
+
+ if (private_offset != 0)
+ g_type_class_adjust_private_offset (klass, &private_offset);
gobject_class->set_property = gst_adaptive_demux_set_property;
gobject_class->get_property = gst_adaptive_demux_get_property;
GST_DEBUG_OBJECT (demux, "gst_adaptive_demux_init");
- demux->priv = GST_ADAPTIVE_DEMUX_GET_PRIVATE (demux);
+ demux->priv = gst_adaptive_demux_get_instance_private (demux);
demux->priv->input_adapter = gst_adapter_new ();
demux->downloader = gst_uri_downloader_new ();
gst_uri_downloader_set_parent (demux->downloader, GST_ELEMENT_CAST (demux));
static GstPadProbeReturn pad_blocked_cb (GstPad * pad, GstPadProbeInfo * info,
gpointer user_data);
-G_DEFINE_TYPE (GstInsertBin, gst_insert_bin, GST_TYPE_BIN);
+G_DEFINE_TYPE_WITH_PRIVATE (GstInsertBin, gst_insert_bin, GST_TYPE_BIN);
static void
gst_insert_bin_class_init (GstInsertBinClass * klass)
GST_DEBUG_CATEGORY_INIT (insert_bin_debug, "insertbin", 0, "Insert Bin");
- g_type_class_add_private (klass, sizeof (GstInsertBinPrivate));
-
gst_element_class_add_static_pad_template (gstelement_class,
&gst_insert_bin_src_template);
gst_element_class_add_static_pad_template (gstelement_class,
{
GstProxyPad *internal;
- self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, GST_TYPE_INSERT_BIN,
- GstInsertBinPrivate);
+ self->priv = gst_insert_bin_get_instance_private (self);
g_queue_init (&self->priv->change_queue);
#define GST_CAT_DEFAULT uridownloader_debug
-#define GST_FRAGMENT_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE ((obj), GST_TYPE_FRAGMENT, GstFragmentPrivate))
-
enum
{
PROP_0,
GMutex lock;
};
-G_DEFINE_TYPE (GstFragment, gst_fragment, G_TYPE_OBJECT);
+G_DEFINE_TYPE_WITH_PRIVATE (GstFragment, gst_fragment, G_TYPE_OBJECT);
static void gst_fragment_dispose (GObject * object);
static void gst_fragment_finalize (GObject * object);
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
- g_type_class_add_private (klass, sizeof (GstFragmentPrivate));
-
gobject_class->set_property = gst_fragment_set_property;
gobject_class->get_property = gst_fragment_get_property;
gobject_class->dispose = gst_fragment_dispose;
{
GstFragmentPrivate *priv;
- fragment->priv = priv = GST_FRAGMENT_GET_PRIVATE (fragment);
+ fragment->priv = priv = gst_fragment_get_instance_private (fragment);
g_mutex_init (&fragment->priv->lock);
priv->buffer = NULL;
#define GST_CAT_DEFAULT uridownloader_debug
GST_DEBUG_CATEGORY (uridownloader_debug);
-#define GST_URI_DOWNLOADER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((obj), \
- GST_TYPE_URI_DOWNLOADER, GstUriDownloaderPrivate))
-
struct _GstUriDownloaderPrivate
{
/* Fragments fetcher */
}
G_DEFINE_TYPE_WITH_CODE (GstUriDownloader, gst_uri_downloader, GST_TYPE_OBJECT,
+ G_ADD_PRIVATE (GstUriDownloader)
_do_init);
static void
gobject_class = (GObjectClass *) klass;
- g_type_class_add_private (klass, sizeof (GstUriDownloaderPrivate));
-
gobject_class->dispose = gst_uri_downloader_dispose;
gobject_class->finalize = gst_uri_downloader_finalize;
}
static void
gst_uri_downloader_init (GstUriDownloader * downloader)
{
- downloader->priv = GST_URI_DOWNLOADER_GET_PRIVATE (downloader);
+ downloader->priv = gst_uri_downloader_get_instance_private (downloader);
/* Initialize the sink pad. This pad will be connected to the src pad of the
* element created with gst_element_make_from_uri and will handle the download */