aboutsummaryrefslogtreecommitdiffstats
path: root/include/asterisk/translate.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/translate.h')
-rw-r--r--include/asterisk/translate.h23
1 files changed, 22 insertions, 1 deletions
diff --git a/include/asterisk/translate.h b/include/asterisk/translate.h
index 48b5bf091..b1f615f7f 100644
--- a/include/asterisk/translate.h
+++ b/include/asterisk/translate.h
@@ -138,7 +138,14 @@ struct ast_trans_pvt {
struct ast_translator *t;
struct ast_frame f; /*!< used in frameout */
int samples; /*!< samples available in outbuf */
- int datalen; /*!< actual space used in outbuf */
+ /*!
+ * \brief actual space used in outbuf
+ *
+ * Also, for the sake of ABI compatability, a magic value of -1 in this
+ * field means that the pvt has been requested to be destroyed, but is
+ * pending destruction until ast_translate_frame_freed() gets called.
+ */
+ int datalen;
void *pvt; /*!< more private data, if any */
char *outbuf; /*!< the useful portion of the buffer */
plc_state_t *plc; /*!< optional plc pointer */
@@ -250,6 +257,20 @@ unsigned int ast_translate_path_steps(unsigned int dest, unsigned int src);
*/
unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src);
+/*!
+ * \brief Hint that a frame from a translator has been freed
+ *
+ * This is sort of a hack. This function gets called when ast_frame_free() gets
+ * called on a frame that has the AST_FRFLAG_FROM_TRANSLATOR flag set. This is
+ * because it is possible for a translation path to be destroyed while a frame
+ * from a translator is still in use. Specifically, this happens if a masquerade
+ * happens after a call to ast_read() but before the frame is done being processed,
+ * since the frame processing is generally done without the channel lock held.
+ *
+ * \return nothing
+ */
+void ast_translate_frame_freed(struct ast_frame *fr);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif