diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2013-06-10 11:56:21 +0200 |
---|---|---|
committer | Lionel Landwerlin <llandwerlin@gmail.com> | 2013-07-22 16:41:41 +0100 |
commit | 652ab502a68e8eb32328780f8ba68e82562532dc (patch) | |
tree | a92c92c6be1d205cb3eb6d3c0ae5e970e14a4c80 | |
parent | 39dcfac70d02604857ee313d48f78ed858198292 (diff) | |
download | clutter-gst-652ab502a68e8eb32328780f8ba68e82562532dc.tar.gz |
Handle subclassing of gst-player implementations
When subclassing a GstPlayer implementation (e.g. GstVideoTexture), the
property mixing information isn't simply on the instance class, it's on
a parent class. So traverse the class hierachy to find the information
instead of simply looking at the current object class.
-rw-r--r-- | clutter-gst/clutter-gst-player.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/clutter-gst/clutter-gst-player.c b/clutter-gst/clutter-gst-player.c index 25a10e6..badea37 100644 --- a/clutter-gst/clutter-gst-player.c +++ b/clutter-gst/clutter-gst-player.c @@ -78,10 +78,6 @@ G_DEFINE_INTERFACE_WITH_CODE (ClutterGstPlayer, clutter_gst_player, G_TYPE_OBJEC clutter_gst_player_private_quark, \ private)) -#define PLAYER_GET_CLASS_PRIVATE(player) \ - (g_type_get_qdata (G_OBJECT_TYPE (player), \ - clutter_gst_player_class_quark)) - /* idle timeouts (in ms) */ #define TICK_TIMEOUT 500 #define BUFFERING_TIMEOUT 250 @@ -200,6 +196,18 @@ static guint signals[LAST_SIGNAL] = { 0, }; static gboolean player_buffering_timeout (gpointer data); /* Logic */ +static ClutterGstPlayerIfacePrivate * +clutter_gst_player_get_class_iface_priv (GObject *object) +{ + GType k = G_OBJECT_TYPE (object); + ClutterGstPlayerIfacePrivate *ret = NULL; + while (k != 0 && ret == NULL) + { + ret = g_type_get_qdata (k, clutter_gst_player_class_quark); + k = g_type_parent (k); + } + return ret; +} #ifdef CLUTTER_GST_ENABLE_DEBUG static gchar * @@ -1422,7 +1430,8 @@ clutter_gst_player_set_property (GObject *object, break; default: - iface_priv = PLAYER_GET_CLASS_PRIVATE (object); + iface_priv = clutter_gst_player_get_class_iface_priv (object); + g_assert (iface_priv != NULL); iface_priv->set_property (object, property_id, value, pspec); } } @@ -1531,7 +1540,7 @@ clutter_gst_player_get_property (GObject *object, break; default: - iface_priv = PLAYER_GET_CLASS_PRIVATE (object); + iface_priv = clutter_gst_player_get_class_iface_priv (object); iface_priv->get_property (object, property_id, value, pspec); } } |