diff options
author | Damien Lespiau <damien.lespiau@intel.com> | 2011-10-27 19:23:41 +0100 |
---|---|---|
committer | Damien Lespiau <damien.lespiau@intel.com> | 2011-10-28 11:31:26 +0100 |
commit | ddbb091b4a4d4cce0f3b324819af975a246faf4d (patch) | |
tree | 07b1c5fe9099f70c040ade7978669b7964beaa59 | |
parent | 9f9ad6266c9e7cd870c86c8d5a346f9912cdad42 (diff) |
sink: Make the sink hold a weak reference to the ClutterTexture
The sink does not need to hold a reference to the Texture, it better to
leave the life cycle of the ClutterTexture entirely to Clutter.
If the texture disapears when the sink is still live and pushing buffers
to it, you will get warnings not nothing dramatic. It's your
responsibility to ensure the GStreamer pipeline has been stopped when
removing/destroying the texture.
-rw-r--r-- | clutter-gst/clutter-gst-video-sink.c | 3 | ||||
-rw-r--r-- | tests/test-video-texture-new-unref-loop.c | 3 |
2 files changed, 1 insertions, 5 deletions
diff --git a/clutter-gst/clutter-gst-video-sink.c b/clutter-gst/clutter-gst-video-sink.c index 22a5a2f..2d15455 100644 --- a/clutter-gst/clutter-gst-video-sink.c +++ b/clutter-gst/clutter-gst-video-sink.c @@ -1189,7 +1189,6 @@ clutter_gst_video_sink_set_texture (ClutterGstVideoSink *sink, g_signal_handler_disconnect (priv->texture, id); } g_array_set_size (priv->signal_handler_ids, 0); - g_object_unref (priv->texture); } priv->texture = texture; @@ -1219,7 +1218,7 @@ clutter_gst_video_sink_set_property (GObject *object, switch (prop_id) { case PROP_TEXTURE: - clutter_gst_video_sink_set_texture (sink, g_value_dup_object (value)); + clutter_gst_video_sink_set_texture (sink, g_value_get_object (value)); break; case PROP_UPDATE_PRIORITY: clutter_gst_video_sink_set_priority (sink, g_value_get_int (value)); diff --git a/tests/test-video-texture-new-unref-loop.c b/tests/test-video-texture-new-unref-loop.c index 3ff89e5..10ba16e 100644 --- a/tests/test-video-texture-new-unref-loop.c +++ b/tests/test-video-texture-new-unref-loop.c @@ -44,11 +44,8 @@ main (int argc, char *argv[]) { g_debug("VideoTexure #%d", i); vtexture = clutter_gst_video_texture_new(); - if (vtexture == NULL) - g_error("failed to create VideoTexture"); g_object_ref_sink (vtexture); g_object_unref (vtexture); - g_object_unref (vtexture); } return EXIT_SUCCESS; |