#define GST_CAT_DEFAULT GST_CAT_PADS
-#define GST_TYPE_PROXY_PAD (gst_proxy_pad_get_type ())
-#define GST_IS_PROXY_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PROXY_PAD))
-#define GST_IS_PROXY_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PROXY_PAD))
-#define GST_PROXY_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PROXY_PAD, GstProxyPad))
-#define GST_PROXY_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PROXY_PAD, GstProxyPadClass))
#define GST_PROXY_PAD_CAST(obj) ((GstProxyPad *)obj)
-
-#define GST_PROXY_PAD_TARGET(pad) (GST_PROXY_PAD_CAST (pad)->target)
-#define GST_PROXY_PAD_INTERNAL(pad) (GST_PROXY_PAD_CAST (pad)->internal)
-
-typedef struct _GstProxyPad GstProxyPad;
-typedef struct _GstProxyPadClass GstProxyPadClass;
-
-#define GST_PROXY_GET_LOCK(pad) (GST_PROXY_PAD_CAST (pad)->proxy_lock)
+#define GST_PROXY_PAD_PRIVATE(obj) (GST_PROXY_PAD_CAST (obj)->private)
+#define GST_PROXY_PAD_TARGET(pad) (GST_PROXY_PAD_PRIVATE (pad)->target)
+#define GST_PROXY_PAD_INTERNAL(pad) (GST_PROXY_PAD_PRIVATE (pad)->internal)
+#define GST_PROXY_GET_LOCK(pad) (GST_PROXY_PAD_PRIVATE (pad)->proxy_lock)
#define GST_PROXY_LOCK(pad) (g_mutex_lock (GST_PROXY_GET_LOCK (pad)))
#define GST_PROXY_UNLOCK(pad) (g_mutex_unlock (GST_PROXY_GET_LOCK (pad)))
-struct _GstProxyPad
+struct _GstProxyPadPrivate
{
- GstPad pad;
-
/* with PROXY_LOCK */
GMutex *proxy_lock;
GstPad *target;
GstPad *internal;
};
-struct _GstProxyPadClass
-{
- GstPadClass parent_class;
-
- /*< private > */
- gpointer _gst_reserved[1];
-};
-
-static GType gst_proxy_pad_get_type (void);
-
G_DEFINE_TYPE (GstProxyPad, gst_proxy_pad, GST_TYPE_PAD);
static GstPad *gst_proxy_pad_get_target (GstPad * pad);
{
GObjectClass *gobject_class = (GObjectClass *) klass;
+ g_type_class_add_private (klass, sizeof (GstProxyPadPrivate));
+
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_proxy_pad_dispose);
gobject_class->finalize = GST_DEBUG_FUNCPTR (gst_proxy_pad_finalize);
{
GstProxyPad *pad = GST_PROXY_PAD (object);
- g_mutex_free (pad->proxy_lock);
- pad->proxy_lock = NULL;
+ g_mutex_free (GST_PROXY_GET_LOCK (pad));
+ GST_PROXY_GET_LOCK (pad) = NULL;
G_OBJECT_CLASS (gst_proxy_pad_parent_class)->finalize (object);
}
{
GstPad *pad = (GstPad *) ppad;
- ppad->proxy_lock = g_mutex_new ();
+ GST_PROXY_PAD_PRIVATE (ppad) = G_TYPE_INSTANCE_GET_PRIVATE (ppad,
+ GST_TYPE_PROXY_PAD, GstProxyPadPrivate);
+ GST_PROXY_GET_LOCK (pad) = g_mutex_new ();
gst_pad_set_query_type_function (pad,
GST_DEBUG_FUNCPTR (gst_proxy_pad_do_query_type));
*/
-struct _GstGhostPad
-{
- GstProxyPad pad;
+#define GST_GHOST_PAD_CAST(obj) ((GstGhostPad*)(obj))
+#define GST_GHOST_PAD_PRIVATE(obj) (GST_GHOST_PAD_CAST (obj)->private)
+struct _GstGhostPadPrivate
+{
/* with PROXY_LOCK */
gulong notify_id;
- gpointer constructed;
-
- /*< private > */
- gpointer _gst_reserved[GST_PADDING - 1];
-};
-
-struct _GstGhostPadClass
-{
- GstProxyPadClass parent_class;
-
- /*< private > */
- gpointer _gst_reserved[GST_PADDING];
+ gboolean constructed;
};
-
G_DEFINE_TYPE (GstGhostPad, gst_ghost_pad, GST_TYPE_PROXY_PAD);
static void gst_ghost_pad_dispose (GObject * object);
{
GObjectClass *gobject_class = (GObjectClass *) klass;
+ g_type_class_add_private (klass, sizeof (GstGhostPadPrivate));
+
gobject_class->dispose = GST_DEBUG_FUNCPTR (gst_ghost_pad_dispose);
}
static void
gst_ghost_pad_init (GstGhostPad * pad)
{
+ GST_GHOST_PAD_PRIVATE (pad) = G_TYPE_INSTANCE_GET_PRIVATE (pad,
+ GST_TYPE_GHOST_PAD, GstGhostPadPrivate);
+
gst_pad_set_activatepull_function (GST_PAD_CAST (pad),
GST_DEBUG_FUNCPTR (gst_ghost_pad_do_activate_pull));
gst_pad_set_activatepush_function (GST_PAD_CAST (pad),
gst_pad_set_activatepull_function (internal, NULL);
gst_pad_set_activatepush_function (internal, NULL);
- g_signal_handler_disconnect (internal, GST_GHOST_PAD_CAST (pad)->notify_id);
+ g_signal_handler_disconnect (internal,
+ GST_GHOST_PAD_PRIVATE (pad)->notify_id);
intpeer = gst_pad_get_peer (internal);
if (intpeer) {
GstPad *pad, *internal;
g_return_val_if_fail (GST_IS_GHOST_PAD (gpad), FALSE);
- g_return_val_if_fail (!gpad->constructed, FALSE);
+ g_return_val_if_fail (GST_GHOST_PAD_PRIVATE (gpad)->constructed == FALSE,
+ FALSE);
g_object_get (gpad, "direction", &dir, "template", &templ, NULL);
/* could be more general here, iterating over all writable properties...
* taking the short road for now tho */
- GST_GHOST_PAD_CAST (pad)->notify_id =
+ GST_GHOST_PAD_PRIVATE (pad)->notify_id =
g_signal_connect (internal, "notify::caps", G_CALLBACK (on_int_notify),
pad);
GST_PROXY_UNLOCK (pad);
- gpad->constructed = (gpointer) 1;
+ GST_GHOST_PAD_PRIVATE (gpad)->constructed = TRUE;
return TRUE;
/* ERRORS */
G_BEGIN_DECLS
+#define GST_TYPE_PROXY_PAD (gst_proxy_pad_get_type ())
+#define GST_IS_PROXY_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_PROXY_PAD))
+#define GST_IS_PROXY_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_PROXY_PAD))
+#define GST_PROXY_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_PROXY_PAD, GstProxyPad))
+#define GST_PROXY_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_PROXY_PAD, GstProxyPadClass))
+
+typedef struct _GstProxyPad GstProxyPad;
+typedef struct _GstProxyPadPrivate GstProxyPadPrivate;
+typedef struct _GstProxyPadClass GstProxyPadClass;
+
+struct _GstProxyPad
+{
+ GstPad pad;
+
+ /*< private > */
+ GstProxyPadPrivate *private;
+};
+
+struct _GstProxyPadClass
+{
+ GstPadClass parent_class;
+
+ /*< private > */
+ gpointer _gst_reserved[1];
+};
+
+GType gst_proxy_pad_get_type (void);
+
+
#define GST_TYPE_GHOST_PAD (gst_ghost_pad_get_type ())
#define GST_IS_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_GHOST_PAD))
#define GST_IS_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_GHOST_PAD))
#define GST_GHOST_PAD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_GHOST_PAD, GstGhostPad))
#define GST_GHOST_PAD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_GHOST_PAD, GstGhostPadClass))
-#define GST_GHOST_PAD_CAST(obj) ((GstGhostPad*)(obj))
/**
* GstGhostPad:
* Opaque #GstGhostPad structure.
*/
typedef struct _GstGhostPad GstGhostPad;
+typedef struct _GstGhostPadPrivate GstGhostPadPrivate;
typedef struct _GstGhostPadClass GstGhostPadClass;
+struct _GstGhostPad
+{
+ GstProxyPad pad;
+
+ /*< private > */
+ GstGhostPadPrivate *private;
+};
+
+struct _GstGhostPadClass
+{
+ GstProxyPadClass parent_class;
+
+ /*< private > */
+ gpointer _gst_reserved[GST_PADDING];
+};
+
+
GType gst_ghost_pad_get_type (void);
GstPad* gst_ghost_pad_new (const gchar *name, GstPad *target);