summaryrefslogtreecommitdiff
path: root/pjmedia/include/pjmedia/endpoint.h
diff options
context:
space:
mode:
Diffstat (limited to 'pjmedia/include/pjmedia/endpoint.h')
-rw-r--r--pjmedia/include/pjmedia/endpoint.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/pjmedia/include/pjmedia/endpoint.h b/pjmedia/include/pjmedia/endpoint.h
index 9956b95f..0e5debb8 100644
--- a/pjmedia/include/pjmedia/endpoint.h
+++ b/pjmedia/include/pjmedia/endpoint.h
@@ -61,6 +61,12 @@ typedef enum pjmedia_endpt_flag
/**
+ * Type of callback to register to pjmedia_endpt_atexit().
+ */
+typedef void (*pjmedia_endpt_exit_callback)(pjmedia_endpt *endpt);
+
+
+/**
* Create an instance of media endpoint.
*
* @param pf Pool factory, which will be used by the media endpoint
@@ -260,6 +266,23 @@ PJ_DECL(pj_status_t) pjmedia_endpt_create_video_sdp(pjmedia_endpt *endpt,
PJ_DECL(pj_status_t) pjmedia_endpt_dump(pjmedia_endpt *endpt);
+/**
+ * Register cleanup function to be called by media endpoint when
+ * #pjmedia_endpt_destroy() is called. Note that application should not
+ * use or access any endpoint resource (such as pool, ioqueue) from within
+ * the callback as such resource may have been released when the callback
+ * function is invoked.
+ *
+ * @param endpt The media endpoint.
+ * @param func The function to be registered.
+ *
+ * @return PJ_SUCCESS on success.
+ */
+PJ_DECL(pj_status_t) pjmedia_endpt_atexit(pjmedia_endpt *endpt,
+ pjmedia_endpt_exit_callback func);
+
+
+
PJ_END_DECL