diff --git a/gst/gststreamcollection.h b/gst/gststreamcollection.h
index 49734bd..c1b8caa 100644
--- a/gst/gststreamcollection.h
+++ b/gst/gststreamcollection.h
@@ -103,6 +103,10 @@ GstStream *gst_stream_collection_get_stream (GstStreamCollection *collection, gu
 gboolean gst_stream_collection_add_stream (GstStreamCollection *collection,
                                            GstStream *stream);
 
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstStreamCollection, gst_object_unref)
+#endif
+
 G_END_DECLS
 
 #endif /* __GST_STREAM_COLLECTION_H__ */
diff --git a/gst/gststreams.h b/gst/gststreams.h
index 2df1c76..4cd1858 100644
--- a/gst/gststreams.h
+++ b/gst/gststreams.h
@@ -130,6 +130,11 @@ void     gst_stream_set_caps (GstStream *stream, GstCaps *caps);
 GstCaps *gst_stream_get_caps (GstStream *stream);
 
 const gchar *gst_stream_type_get_name (GstStreamType stype);
+
+#ifdef G_DEFINE_AUTOPTR_CLEANUP_FUNC
+G_DEFINE_AUTOPTR_CLEANUP_FUNC(GstStream, gst_object_unref)
+#endif
+
 G_END_DECLS
 
 #endif /* __GST_STREAMS_H__ */
