|
|
|
@ -199,20 +199,7 @@ typedef struct ast_frame *(*ast_framehook_event_callback)(
|
|
|
|
|
*/
|
|
|
|
|
typedef void (*ast_framehook_destroy_callback)(void *data);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \brief This callback is called to determine if the framehook is currently consuming
|
|
|
|
|
* frames of a given type
|
|
|
|
|
* \since 12
|
|
|
|
|
*
|
|
|
|
|
* \param data, The data pointer provided at framehook initilization.
|
|
|
|
|
* \param type, The type of frame.
|
|
|
|
|
*
|
|
|
|
|
* \return 0 if frame type is being ignored
|
|
|
|
|
* \return 1 if frame type is not being ignored
|
|
|
|
|
*/
|
|
|
|
|
typedef int (*ast_framehook_consume_callback)(void *data, enum ast_frame_type type);
|
|
|
|
|
|
|
|
|
|
#define AST_FRAMEHOOK_INTERFACE_VERSION 2
|
|
|
|
|
#define AST_FRAMEHOOK_INTERFACE_VERSION 1
|
|
|
|
|
/*! This interface is required for attaching a framehook to a channel. */
|
|
|
|
|
struct ast_framehook_interface {
|
|
|
|
|
/*! framehook interface version number */
|
|
|
|
@ -222,10 +209,6 @@ struct ast_framehook_interface {
|
|
|
|
|
/*! destroy_cb is optional. This function is called immediately before the framehook
|
|
|
|
|
* is destroyed to allow for stored_data cleanup. */
|
|
|
|
|
ast_framehook_destroy_callback destroy_cb;
|
|
|
|
|
/*! consume_cb is optional. This function is called to query whether the framehook is consuming
|
|
|
|
|
* frames of a specific type at this time. If this callback is not implemented it is assumed that the
|
|
|
|
|
* framehook will consume frames of all types. */
|
|
|
|
|
ast_framehook_consume_callback consume_cb;
|
|
|
|
|
/*! This pointer can represent any custom data to be stored on the !framehook. This
|
|
|
|
|
* data pointer will be provided during each event callback which allows the framehook
|
|
|
|
|
* to store any stateful data associated with the application using the hook. */
|
|
|
|
@ -340,19 +323,4 @@ int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks);
|
|
|
|
|
*/
|
|
|
|
|
int ast_framehook_list_contains_no_active(struct ast_framehook_list *framehooks);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* \brief Determine if a framehook list is free of active framehooks consuming a specific type of frame
|
|
|
|
|
* \since 12.3.0
|
|
|
|
|
* \pre The channel must be locked during this function call.
|
|
|
|
|
*
|
|
|
|
|
* \param framehooks the framehook list
|
|
|
|
|
* \retval 0, not empty
|
|
|
|
|
* \retval 1, is empty (aside from dying framehooks)
|
|
|
|
|
*
|
|
|
|
|
* \note This function is very similar to ast_framehook_list_is_empty, but it checks individual
|
|
|
|
|
* framehooks to see if they have been marked for destruction and doesn't count them if they are.
|
|
|
|
|
*/
|
|
|
|
|
int ast_framehook_list_contains_no_active_of_type(struct ast_framehook_list *framehooks,
|
|
|
|
|
enum ast_frame_type type);
|
|
|
|
|
|
|
|
|
|
#endif /* _AST_FRAMEHOOK_H */
|
|
|
|
|