summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2011-05-13 20:08:29 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2011-10-11 15:46:13 -0400
commit643096fc4444d5e54bbba6247f481796dcf08615 (patch)
tree8a947086f4b4fa5833c6afe94e3fe806407d3f4f
parent9bf185861238db37c973a1dfe497888eb5ea7598 (diff)
downloadfarstream-643096fc4444d5e54bbba6247f481796dcf08615.tar.gz
session: add _destroy() method
This will remove all references to other objects and remove it from the conference and _destroy() all of its child streams.
-rw-r--r--docs/libs/farsight2-libs-sections.txt3
-rw-r--r--gst-libs/gst/farsight/fs-session.c22
-rw-r--r--gst-libs/gst/farsight/fs-session.h2
-rw-r--r--python/pyfarsight.defs7
4 files changed, 33 insertions, 1 deletions
diff --git a/docs/libs/farsight2-libs-sections.txt b/docs/libs/farsight2-libs-sections.txt
index 18ddb2c6..2362eb22 100644
--- a/docs/libs/farsight2-libs-sections.txt
+++ b/docs/libs/farsight2-libs-sections.txt
@@ -56,10 +56,11 @@ FsDTMFMethod
FsSession
FsSessionClass
fs_session_new_stream
+fs_session_set_codec_preferences
+fs_session_destroy
fs_session_start_telephony_event
fs_session_stop_telephony_event
fs_session_set_send_codec
-fs_session_set_codec_preferences
fs_session_list_transmitters
fs_session_get_stream_transmitter_type
fs_session_codecs_need_resend
diff --git a/gst-libs/gst/farsight/fs-session.c b/gst-libs/gst/farsight/fs-session.c
index a84807bd..062e0a27 100644
--- a/gst-libs/gst/farsight/fs-session.c
+++ b/gst-libs/gst/farsight/fs-session.c
@@ -658,3 +658,25 @@ fs_session_codecs_need_resend (FsSession *session,
return NULL;
}
+
+/**
+ * fs_session_destroy:
+ * @session: a #FsSession
+ *
+ * This will cause the session to remove all links to other objects and to
+ * remove itself from the #FsConference, it will also destroy all #FsStream
+ * inside this #FsSession Once a #FsSession 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 session.
+ */
+
+void
+fs_session_destroy (FsSession *session)
+{
+ g_return_if_fail (session);
+ g_return_if_fail (FS_IS_SESSION (session));
+
+ g_object_run_dispose (G_OBJECT (session));
+}
diff --git a/gst-libs/gst/farsight/fs-session.h b/gst-libs/gst/farsight/fs-session.h
index e731d276..05af5df9 100644
--- a/gst-libs/gst/farsight/fs-session.h
+++ b/gst-libs/gst/farsight/fs-session.h
@@ -196,6 +196,8 @@ GType fs_session_get_stream_transmitter_type (FsSession *session,
GList* fs_session_codecs_need_resend (FsSession *session,
GList *old_codecs, GList *new_codecs);
+void fs_session_destroy (FsSession *session);
+
G_END_DECLS
diff --git a/python/pyfarsight.defs b/python/pyfarsight.defs
index b3b3c02e..4eecaa0e 100644
--- a/python/pyfarsight.defs
+++ b/python/pyfarsight.defs
@@ -507,6 +507,13 @@
)
)
+(define-method destroy
+ (of-object "FsSession")
+ (unblock-threads t)
+ (c-name "fs_session_destroy")
+ (return-type "none")
+)
+
;; -*- scheme -*-
; object definitions ...