summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2011-05-13 19:48:42 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2011-10-11 15:46:13 -0400
commit9bf185861238db37c973a1dfe497888eb5ea7598 (patch)
tree4099ff02d05217513db5bffbd0807942ebf0d9ae
parent4f5d87bc48fd2d595427b2deda307db3fd66215e (diff)
downloadfarstream-9bf185861238db37c973a1dfe497888eb5ea7598.tar.gz
stream: add _destroy() method
This will remove all references to other objects and remove it from the session.
-rw-r--r--docs/libs/farsight2-libs-sections.txt5
-rw-r--r--gst-libs/gst/farsight/fs-stream.c21
-rw-r--r--gst-libs/gst/farsight/fs-stream.h2
-rw-r--r--python/pyfarsight.defs7
4 files changed, 33 insertions, 2 deletions
diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 3f261a76..18ddb2c6 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -26,12 +26,13 @@ FsStream
FsStreamClass
FsStreamDirection
FsStreamState
+fs_stream_set_transmitter
fs_stream_add_remote_candidates
fs_stream_set_remote_codecs
fs_stream_force_remote_candidates
-fs_stream_add_id
+fs_stream_destroy
fs_stream_iterate_src_pads
-fs_stream_set_transmitter
+fs_stream_add_id
fs_stream_emit_error
fs_stream_emit_src_pad_added
<SUBSECTION Standard>
diff --git a/gst-libs/gst/farsight/fs-stream.c b/gst-libs/gst/farsight/fs-stream.c
index 33da6cb4..60144fee 100644
--- a/gst-libs/gst/farsight/fs-stream.c
+++ b/gst-libs/gst/farsight/fs-stream.c
@@ -637,3 +637,24 @@ fs_stream_set_transmitter (FsStream *stream,
return FALSE;
}
+
+/**
+ * fs_stream_destroy:
+ * @stream: a #FsStream
+ *
+ * This will cause the stream to remove all links to other objects and to
+ * remove itself from the #FsSession. Once a #FsStream has been destroyed, it
+ * can not be used anymore.
+ *
+ * It is strongly recommended to call this function from the main thread because
+ * releasing the application's reference to a stream.
+ */
+
+void
+fs_stream_destroy (FsStream *stream)
+{
+ g_return_if_fail (stream);
+ g_return_if_fail (FS_IS_STREAM (stream));
+
+ g_object_run_dispose (G_OBJECT (stream));
+}
diff --git a/gst-libs/gst/farsight/fs-stream.h b/gst-libs/gst/farsight/fs-stream.h
index 3a614294..ee9d026e 100644
--- a/gst-libs/gst/farsight/fs-stream.h
+++ b/gst-libs/gst/farsight/fs-stream.h
@@ -185,6 +185,8 @@ gboolean fs_stream_set_transmitter (FsStream *stream,
guint stream_transmitter_n_parameters,
GError **error);
+void fs_stream_destroy (FsStream *stream);
+
G_END_DECLS
#endif /* __FS_STREAM_H__ */
diff --git a/python/pyfarsight.defs b/python/pyfarsight.defs
index 1979c57a..b3b3c02e 100644
--- a/python/pyfarsight.defs
+++ b/python/pyfarsight.defs
@@ -658,6 +658,13 @@
)
)
+(define-method destroy
+ (of-object "FsStream")
+ (unblock-threads t)
+ (c-name "fs_stream_destroy")
+ (return-type "none")
+)
+
;; -*- scheme -*-
; object definitions ...