frame: Fix for Doxygen.
ASTERISK-29755 Change-Id: I8240013ec3db0669c0acf67e26bf6c9cbb5b72af
This commit is contained in:
parent
9ae084ff44
commit
c30ed45c94
|
@ -78,11 +78,12 @@ enum ast_audiohook_init_flags {
|
|||
struct ast_audiohook;
|
||||
|
||||
/*! \brief Callback function for manipulate audiohook type
|
||||
* \param audiohook Audiohook structure
|
||||
* \param chan Channel
|
||||
* \param audiohook
|
||||
* \param chan
|
||||
* \param frame Frame of audio to manipulate
|
||||
* \param direction Direction frame came from
|
||||
* \return Returns 0 on success, -1 on failure.
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
* \note An audiohook does not have any reference to a private data structure for manipulate
|
||||
* types. It is up to the manipulate callback to store this data via it's own method.
|
||||
* An example would be datastores.
|
||||
|
@ -116,64 +117,69 @@ struct ast_audiohook {
|
|||
struct ast_trans_pvt *trans_pvt; /*!< Translation path for reading frames */
|
||||
ast_audiohook_manipulate_callback manipulate_callback; /*!< Manipulation callback */
|
||||
struct ast_audiohook_options options; /*!< Applicable options */
|
||||
unsigned int hook_internal_samp_rate; /*!< internal read/write sample rate on the audiohook.*/
|
||||
unsigned int hook_internal_samp_rate; /*!< internal read/write sample rate on the audiohook.*/
|
||||
AST_LIST_ENTRY(ast_audiohook) list; /*!< Linked list information */
|
||||
};
|
||||
|
||||
struct ast_audiohook_list;
|
||||
|
||||
/*! \brief Initialize an audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \param audiohook
|
||||
* \param type Type of audiohook to initialize this as
|
||||
* \param source Who is initializing this audiohook
|
||||
* \param init flags
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \param flags
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type type, const char *source, enum ast_audiohook_init_flags flags);
|
||||
|
||||
/*! \brief Destroys an audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \param audiohook
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int ast_audiohook_destroy(struct ast_audiohook *audiohook);
|
||||
|
||||
/*! \brief Writes a frame into the audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \param audiohook
|
||||
* \param direction Direction the audio frame came from
|
||||
* \param frame Frame to write in
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int ast_audiohook_write_frame(struct ast_audiohook *audiohook, enum ast_audiohook_direction direction, struct ast_frame *frame);
|
||||
|
||||
/*! \brief Reads a frame in from the audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \param audiohook
|
||||
* \param samples Number of samples wanted
|
||||
* \param direction Direction the audio frame came from
|
||||
* \param format Format of frame remote side wants back
|
||||
* \return Returns frame on success, NULL on failure
|
||||
* \return frame on success
|
||||
* \retval NULL on failure
|
||||
*/
|
||||
struct ast_frame *ast_audiohook_read_frame(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, struct ast_format *format);
|
||||
|
||||
/*! \brief Reads a frame in from the audiohook structure in mixed audio mode and copies read and write frame data to provided arguments.
|
||||
* \param audiohook Audiohook structure
|
||||
* \param audiohook
|
||||
* \param samples Number of samples wanted
|
||||
* \param ast_format Format of frame remote side wants back
|
||||
* \param format Format of frame remote side wants back
|
||||
* \param read_frame if available, we'll copy the read buffer to this.
|
||||
* \param write_frame if available, we'll copy the write buffer to this.
|
||||
* \param direction
|
||||
* \return Returns frame on success, NULL on failure
|
||||
* \return frame on success
|
||||
* \retval NULL on failure
|
||||
*/
|
||||
struct ast_frame *ast_audiohook_read_frame_all(struct ast_audiohook *audiohook, size_t samples, struct ast_format *format, struct ast_frame **read_frame, struct ast_frame **write_frame);
|
||||
|
||||
/*! \brief Attach audiohook to channel
|
||||
* \param chan Channel
|
||||
* \param audiohook Audiohook structure
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \param chan
|
||||
* \param audiohook
|
||||
* \return 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
int ast_audiohook_attach(struct ast_channel *chan, struct ast_audiohook *audiohook);
|
||||
|
||||
/*! \brief Detach audiohook from channel
|
||||
* \param audiohook Audiohook structure
|
||||
* \param audiohook
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_detach(struct ast_audiohook *audiohook);
|
||||
|
@ -181,7 +187,6 @@ int ast_audiohook_detach(struct ast_audiohook *audiohook);
|
|||
/*!
|
||||
* \brief Detach audiohooks from list and destroy said list
|
||||
* \param audiohook_list List of audiohooks (NULL tolerant)
|
||||
* \return Nothing
|
||||
*/
|
||||
void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list);
|
||||
|
||||
|
@ -217,7 +222,8 @@ void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *ne
|
|||
* \param chan Channel to detach from
|
||||
* \param source Name of source to detach
|
||||
*
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*
|
||||
* \note The channel does not need to be locked before calling this function.
|
||||
*/
|
||||
|
@ -229,7 +235,8 @@ int ast_audiohook_detach_source(struct ast_channel *chan, const char *source);
|
|||
* \param chan Channel to remove from
|
||||
* \param audiohook Audiohook to remove
|
||||
*
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*
|
||||
* \note The channel does not need to be locked before calling this function
|
||||
*/
|
||||
|
@ -238,9 +245,10 @@ int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audioho
|
|||
/*!
|
||||
* \brief Determine if a audiohook_list is empty or not.
|
||||
*
|
||||
* \param audiohook Audiohook to check. (NULL also means empty)
|
||||
* \param audiohook_list Audiohook to check. (NULL also means empty)
|
||||
*
|
||||
* retval 0 false, 1 true
|
||||
* \retval 0 false
|
||||
* \retval 1 true
|
||||
*/
|
||||
int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list);
|
||||
|
||||
|
@ -249,13 +257,14 @@ int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list);
|
|||
* \param audiohook_list List of audiohooks
|
||||
* \param direction Direction frame is coming in from
|
||||
* \param frame The frame itself
|
||||
* \return Return frame on success, NULL on failure
|
||||
* \return frame on success
|
||||
* \retval NULL on failure
|
||||
*/
|
||||
struct ast_frame *ast_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame);
|
||||
|
||||
/*! \brief Update audiohook's status
|
||||
* \param audiohook Audiohook structure
|
||||
* \param audiohook status enum
|
||||
* \param audiohook
|
||||
* \param status
|
||||
*
|
||||
* \note once status is updated to DONE, this function can not be used to set the
|
||||
* status back to any other setting. Setting DONE effectively locks the status as such.
|
||||
|
@ -272,7 +281,7 @@ void ast_audiohook_trigger_wait(struct ast_audiohook *audiohook);
|
|||
\param chan The channel on which to find the spies
|
||||
\param source The audiohook's source
|
||||
\param type The type of audiohook
|
||||
\return Return the number of audiohooks which are from the source specified
|
||||
\return number of audiohooks which are from the source specified
|
||||
|
||||
Note: Function performs nlocking.
|
||||
*/
|
||||
|
@ -283,7 +292,7 @@ int ast_channel_audiohook_count_by_source(struct ast_channel *chan, const char *
|
|||
\param chan The channel on which to find the spies
|
||||
\param source The source of the audiohook
|
||||
\param type The type of spy to look for
|
||||
\return Return the number of running audiohooks which are from the source specified
|
||||
\return number of running audiohooks which are from the source specified
|
||||
|
||||
Note: Function performs no locking.
|
||||
*/
|
||||
|
@ -304,7 +313,8 @@ int ast_channel_audiohook_count_by_source_running(struct ast_channel *chan, cons
|
|||
* \param chan Channel to muck with
|
||||
* \param direction Direction to set on
|
||||
* \param volume Value to adjust the volume by
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
* \since 1.6.1
|
||||
*/
|
||||
int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume);
|
||||
|
@ -313,7 +323,7 @@ int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direct
|
|||
* \brief Retrieve the volume adjustment value on frames read from or written to a channel
|
||||
* \param chan Channel to retrieve volume adjustment from
|
||||
* \param direction Direction to retrieve
|
||||
* \return Returns adjustment value
|
||||
* \return adjustment value
|
||||
* \since 1.6.1
|
||||
*/
|
||||
int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direction direction);
|
||||
|
@ -323,7 +333,8 @@ int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direct
|
|||
* \param chan Channel to muck with
|
||||
* \param direction Direction to increase
|
||||
* \param volume Value to adjust the adjustment by
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
* \since 1.6.1
|
||||
*/
|
||||
int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume);
|
||||
|
|
|
@ -535,23 +535,23 @@ struct ast_option_header {
|
|||
uint8_t data[0];
|
||||
};
|
||||
|
||||
#if 0 /* Unimplemented */
|
||||
/*! \brief Requests a frame to be allocated
|
||||
*
|
||||
* \param source
|
||||
* \param source, len
|
||||
* Request a frame be allocated. source is an optional source of the frame,
|
||||
* len is the requested length, or "0" if the caller will supply the buffer
|
||||
*/
|
||||
#if 0 /* Unimplemented */
|
||||
struct ast_frame *ast_fralloc(char *source, int len);
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* \brief Frees a frame or list of frames
|
||||
*
|
||||
* \param fr Frame to free, or head of list to free
|
||||
* \param frame Frame to free, or head of list to free
|
||||
* \param cache Whether to consider this frame for frame caching
|
||||
*/
|
||||
void ast_frame_free(struct ast_frame *fr, int cache);
|
||||
void ast_frame_free(struct ast_frame *frame, int cache);
|
||||
|
||||
#define ast_frfree(fr) ast_frame_free(fr, 1)
|
||||
|
||||
|
|
|
@ -174,12 +174,12 @@ enum ast_framehook_event {
|
|||
* The ast_channel will always be locked during this callback. Never attempt to unlock the
|
||||
* channel for any reason.
|
||||
*
|
||||
* \param channel, The ast_channel this framehook is attached to
|
||||
* \param frame, The ast_frame being intercepted for viewing and manipulation
|
||||
* \param event, The type of event which is occurring
|
||||
* \param data, The data pointer provided at framehook initialization.
|
||||
* \param chan The ast_channel this framehook is attached to
|
||||
* \param frame The ast_frame being intercepted for viewing and manipulation
|
||||
* \param event The type of event which is occurring
|
||||
* \param data The data pointer provided at framehook initialization.
|
||||
*
|
||||
* \retval the resulting frame.
|
||||
* \return the resulting frame.
|
||||
*/
|
||||
typedef struct ast_frame *(*ast_framehook_event_callback)(
|
||||
struct ast_channel *chan,
|
||||
|
@ -193,7 +193,7 @@ typedef struct ast_frame *(*ast_framehook_event_callback)(
|
|||
* \note This function should be used to clean up any pointers pointing to the
|
||||
* framehook structure as the framehook will be freed immediately afterwards.
|
||||
*
|
||||
* \param data, The data pointer provided at framehook initialization. This
|
||||
* \param data The data pointer provided at framehook initialization. This
|
||||
* is a good place to clean up any state data allocated for the framehook stored in this
|
||||
* pointer.
|
||||
*/
|
||||
|
@ -204,8 +204,8 @@ typedef void (*ast_framehook_destroy_callback)(void *data);
|
|||
* frames of a given type
|
||||
* \since 12
|
||||
*
|
||||
* \param data, The data pointer provided at framehook initialization.
|
||||
* \param type, The type of frame.
|
||||
* \param data The data pointer provided at framehook initialization.
|
||||
* \param type The type of frame.
|
||||
*
|
||||
* \return 0 if frame type is being ignored
|
||||
* \return 1 if frame type is not being ignored
|
||||
|
@ -216,10 +216,10 @@ typedef int (*ast_framehook_consume_callback)(void *data, enum ast_frame_type ty
|
|||
* \brief This callback is called when a masquerade occurs on a channel with a framehook
|
||||
* \since 12
|
||||
*
|
||||
* \param data, The data pointer provided at framehook initialization.
|
||||
* \param framehook_id, The framehook ID where the framehook lives now
|
||||
* \param old_chan, The channel that was masqueraded.
|
||||
* \param new_chan, The channel that the masqueraded channel became.
|
||||
* \param data The data pointer provided at framehook initialization.
|
||||
* \param framehook_id The framehook ID where the framehook lives now
|
||||
* \param old_chan The channel that was masqueraded.
|
||||
* \param new_chan The channel that the masqueraded channel became.
|
||||
*/
|
||||
typedef void (*ast_framehook_chan_fixup_callback)(void *data, int framehook_id,
|
||||
struct ast_channel *old_chan, struct ast_channel *new_chan);
|
||||
|
@ -268,8 +268,8 @@ struct ast_framehook_interface {
|
|||
* provide it during the event and destruction callbacks. It is entirely up to the
|
||||
* application using this API to manage the memory associated with the data pointer.
|
||||
*
|
||||
* \retval On success, non-negative id representing this hook on the channel
|
||||
* \retval On failure, -1
|
||||
* \retval non-negative success, id representing this hook on the channel
|
||||
* \retval -1 failure
|
||||
*/
|
||||
int ast_framehook_attach(struct ast_channel *chan, struct ast_framehook_interface *i);
|
||||
|
||||
|
@ -356,8 +356,8 @@ struct ast_frame *ast_framehook_list_write_event(struct ast_framehook_list *fram
|
|||
* \pre The Channel must be locked during this function call.
|
||||
*
|
||||
* \param framehooks the framehook list
|
||||
* \retval 0, not empty
|
||||
* \retval 1, is empty
|
||||
* \retval 0 not empty
|
||||
* \retval 1 is empty
|
||||
*/
|
||||
int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks);
|
||||
|
||||
|
@ -367,8 +367,8 @@ int ast_framehook_list_is_empty(struct ast_framehook_list *framehooks);
|
|||
* \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)
|
||||
* \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.
|
||||
|
@ -381,8 +381,9 @@ int ast_framehook_list_contains_no_active(struct ast_framehook_list *framehooks)
|
|||
* \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)
|
||||
* \param type type of frame
|
||||
* \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.
|
||||
|
|
113
main/audiohook.c
113
main/audiohook.c
|
@ -97,14 +97,6 @@ static int audiohook_set_internal_rate(struct ast_audiohook *audiohook, int rate
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Initialize an audiohook structure
|
||||
*
|
||||
* \param audiohook Audiohook structure
|
||||
* \param type
|
||||
* \param source, init_flags
|
||||
*
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type type, const char *source, enum ast_audiohook_init_flags init_flags)
|
||||
{
|
||||
/* Need to keep the type and source */
|
||||
|
@ -126,10 +118,6 @@ int ast_audiohook_init(struct ast_audiohook *audiohook, enum ast_audiohook_type
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Destroys an audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_destroy(struct ast_audiohook *audiohook)
|
||||
{
|
||||
/* Drop the factories used by this audiohook type */
|
||||
|
@ -161,12 +149,6 @@ int ast_audiohook_destroy(struct ast_audiohook *audiohook)
|
|||
(ast_test_flag(hook, AST_AUDIOHOOK_MUTE_WRITE) && (dir == AST_AUDIOHOOK_DIRECTION_WRITE)) || \
|
||||
(ast_test_flag(hook, AST_AUDIOHOOK_MUTE_READ | AST_AUDIOHOOK_MUTE_WRITE) == (AST_AUDIOHOOK_MUTE_READ | AST_AUDIOHOOK_MUTE_WRITE)))
|
||||
|
||||
/*! \brief Writes a frame into the audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \param direction Direction the audio frame came from
|
||||
* \param frame Frame to write in
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_write_frame(struct ast_audiohook *audiohook, enum ast_audiohook_direction direction, struct ast_frame *frame)
|
||||
{
|
||||
struct ast_slinfactory *factory = (direction == AST_AUDIOHOOK_DIRECTION_READ ? &audiohook->read_factory : &audiohook->write_factory);
|
||||
|
@ -439,27 +421,11 @@ static struct ast_frame *audiohook_read_frame_helper(struct ast_audiohook *audio
|
|||
return final_frame;
|
||||
}
|
||||
|
||||
/*! \brief Reads a frame in from the audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \param samples Number of samples wanted in requested output format
|
||||
* \param direction Direction the audio frame came from
|
||||
* \param format Format of frame remote side wants back
|
||||
* \return Returns frame on success, NULL on failure
|
||||
*/
|
||||
struct ast_frame *ast_audiohook_read_frame(struct ast_audiohook *audiohook, size_t samples, enum ast_audiohook_direction direction, struct ast_format *format)
|
||||
{
|
||||
return audiohook_read_frame_helper(audiohook, samples, direction, format, NULL, NULL);
|
||||
}
|
||||
|
||||
/*! \brief Reads a frame in from the audiohook structure
|
||||
* \param audiohook Audiohook structure
|
||||
* \param samples Number of samples wanted
|
||||
* \param direction Direction the audio frame came from
|
||||
* \param format Format of frame remote side wants back
|
||||
* \param read_frame frame pointer for copying read frame data
|
||||
* \param write_frame frame pointer for copying write frame data
|
||||
* \return Returns frame on success, NULL on failure
|
||||
*/
|
||||
struct ast_frame *ast_audiohook_read_frame_all(struct ast_audiohook *audiohook, size_t samples, struct ast_format *format, struct ast_frame **read_frame, struct ast_frame **write_frame)
|
||||
{
|
||||
return audiohook_read_frame_helper(audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, format, read_frame, write_frame);
|
||||
|
@ -493,11 +459,6 @@ static void audiohook_list_set_samplerate_compatibility(struct ast_audiohook_lis
|
|||
}
|
||||
}
|
||||
|
||||
/*! \brief Attach audiohook to channel
|
||||
* \param chan Channel
|
||||
* \param audiohook Audiohook structure
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_attach(struct ast_channel *chan, struct ast_audiohook *audiohook)
|
||||
{
|
||||
ast_channel_lock(chan);
|
||||
|
@ -554,14 +515,6 @@ int ast_audiohook_attach(struct ast_channel *chan, struct ast_audiohook *audioho
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Update audiohook's status
|
||||
* \param audiohook Audiohook structure
|
||||
* \param status Audiohook status enum
|
||||
*
|
||||
* \note once status is updated to DONE, this function can not be used to set the
|
||||
* status back to any other setting. Setting DONE effectively locks the status as such.
|
||||
*/
|
||||
|
||||
void ast_audiohook_update_status(struct ast_audiohook *audiohook, enum ast_audiohook_status status)
|
||||
{
|
||||
ast_audiohook_lock(audiohook);
|
||||
|
@ -572,10 +525,6 @@ void ast_audiohook_update_status(struct ast_audiohook *audiohook, enum ast_audio
|
|||
ast_audiohook_unlock(audiohook);
|
||||
}
|
||||
|
||||
/*! \brief Detach audiohook from channel
|
||||
* \param audiohook Audiohook structure
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_detach(struct ast_audiohook *audiohook)
|
||||
{
|
||||
if (audiohook->status == AST_AUDIOHOOK_STATUS_NEW || audiohook->status == AST_AUDIOHOOK_STATUS_DONE) {
|
||||
|
@ -635,7 +584,8 @@ void ast_audiohook_detach_list(struct ast_audiohook_list *audiohook_list)
|
|||
/*! \brief find an audiohook based on its source
|
||||
* \param audiohook_list The list of audiohooks to search in
|
||||
* \param source The source of the audiohook we wish to find
|
||||
* \return Return the corresponding audiohook or NULL if it cannot be found.
|
||||
* \return corresponding audiohook
|
||||
* \retval NULL if it cannot be found
|
||||
*/
|
||||
static struct ast_audiohook *find_audiohook_by_source(struct ast_audiohook_list *audiohook_list, const char *source)
|
||||
{
|
||||
|
@ -723,11 +673,6 @@ void ast_audiohook_move_all(struct ast_channel *old_chan, struct ast_channel *ne
|
|||
AST_LIST_TRAVERSE_SAFE_END;
|
||||
}
|
||||
|
||||
/*! \brief Detach specified source audiohook from channel
|
||||
* \param chan Channel to detach from
|
||||
* \param source Name of source to detach
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_detach_source(struct ast_channel *chan, const char *source)
|
||||
{
|
||||
struct ast_audiohook *audiohook = NULL;
|
||||
|
@ -751,16 +696,6 @@ int ast_audiohook_detach_source(struct ast_channel *chan, const char *source)
|
|||
return (audiohook ? 0 : -1);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Remove an audiohook from a specified channel
|
||||
*
|
||||
* \param chan Channel to remove from
|
||||
* \param audiohook Audiohook to remove
|
||||
*
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*
|
||||
* \note The channel does not need to be locked before calling this function
|
||||
*/
|
||||
int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audiohook)
|
||||
{
|
||||
ast_channel_lock(chan);
|
||||
|
@ -795,7 +730,8 @@ int ast_audiohook_remove(struct ast_channel *chan, struct ast_audiohook *audioho
|
|||
* \param audiohook_list List of audiohooks
|
||||
* \param direction Direction frame is coming in from
|
||||
* \param frame The frame itself
|
||||
* \return Return frame on success, NULL on failure
|
||||
* \return frame on success
|
||||
* \retval NULL on failure
|
||||
*/
|
||||
static struct ast_frame *dtmf_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame)
|
||||
{
|
||||
|
@ -950,7 +886,8 @@ static void audiohook_list_set_hook_rate(struct ast_audiohook_list *audiohook_li
|
|||
* \param audiohook_list List of audiohooks
|
||||
* \param direction Direction frame is coming in from
|
||||
* \param frame The frame itself
|
||||
* \return Return frame on success, NULL on failure
|
||||
* \return frame on success
|
||||
* \retval NULL on failure
|
||||
*/
|
||||
static struct ast_frame *audio_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame)
|
||||
{
|
||||
|
@ -1117,13 +1054,6 @@ int ast_audiohook_write_list_empty(struct ast_audiohook_list *audiohook_list)
|
|||
&& AST_LIST_EMPTY(&audiohook_list->manipulate_list));
|
||||
}
|
||||
|
||||
/*! \brief Pass a frame off to be handled by the audiohook core
|
||||
* \param chan Channel that the list is coming off of
|
||||
* \param audiohook_list List of audiohooks
|
||||
* \param direction Direction frame is coming in from
|
||||
* \param frame The frame itself
|
||||
* \return Return frame on success, NULL on failure
|
||||
*/
|
||||
struct ast_frame *ast_audiohook_write_list(struct ast_channel *chan, struct ast_audiohook_list *audiohook_list, enum ast_audiohook_direction direction, struct ast_frame *frame)
|
||||
{
|
||||
/* Pass off frame to it's respective list write function */
|
||||
|
@ -1236,7 +1166,6 @@ struct audiohook_volume {
|
|||
|
||||
/*! \brief Callback used to destroy the audiohook volume datastore
|
||||
* \param data Volume information structure
|
||||
* \return Returns nothing
|
||||
*/
|
||||
static void audiohook_volume_destroy(void *data)
|
||||
{
|
||||
|
@ -1262,7 +1191,8 @@ static const struct ast_datastore_info audiohook_volume_datastore = {
|
|||
* \param chan Channel we are attached to
|
||||
* \param frame Frame of audio we want to manipulate
|
||||
* \param direction Direction the audio came in from
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
* \retval 0 on success
|
||||
* \retval -1 on failure
|
||||
*/
|
||||
static int audiohook_volume_callback(struct ast_audiohook *audiohook, struct ast_channel *chan, struct ast_frame *frame, enum ast_audiohook_direction direction)
|
||||
{
|
||||
|
@ -1300,7 +1230,8 @@ static int audiohook_volume_callback(struct ast_audiohook *audiohook, struct ast
|
|||
/*! \brief Helper function which finds and optionally creates an audiohook_volume_datastore datastore on a channel
|
||||
* \param chan Channel to look on
|
||||
* \param create Whether to create the datastore if not found
|
||||
* \return Returns audiohook_volume structure on success, NULL on failure
|
||||
* \return audiohook_volume structure on success
|
||||
* \retval NULL on failure
|
||||
*/
|
||||
static struct audiohook_volume *audiohook_volume_get(struct ast_channel *chan, int create)
|
||||
{
|
||||
|
@ -1337,12 +1268,6 @@ static struct audiohook_volume *audiohook_volume_get(struct ast_channel *chan, i
|
|||
return audiohook_volume;
|
||||
}
|
||||
|
||||
/*! \brief Adjust the volume on frames read from or written to a channel
|
||||
* \param chan Channel to muck with
|
||||
* \param direction Direction to set on
|
||||
* \param volume Value to adjust the volume by
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume)
|
||||
{
|
||||
struct audiohook_volume *audiohook_volume = NULL;
|
||||
|
@ -1363,11 +1288,6 @@ int ast_audiohook_volume_set(struct ast_channel *chan, enum ast_audiohook_direct
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Retrieve the volume adjustment value on frames read from or written to a channel
|
||||
* \param chan Channel to retrieve volume adjustment from
|
||||
* \param direction Direction to retrieve
|
||||
* \return Returns adjustment value
|
||||
*/
|
||||
int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direction direction)
|
||||
{
|
||||
struct audiohook_volume *audiohook_volume = NULL;
|
||||
|
@ -1388,12 +1308,6 @@ int ast_audiohook_volume_get(struct ast_channel *chan, enum ast_audiohook_direct
|
|||
return adjustment;
|
||||
}
|
||||
|
||||
/*! \brief Adjust the volume on frames read from or written to a channel
|
||||
* \param chan Channel to muck with
|
||||
* \param direction Direction to increase
|
||||
* \param volume Value to adjust the adjustment by
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_direction direction, int volume)
|
||||
{
|
||||
struct audiohook_volume *audiohook_volume = NULL;
|
||||
|
@ -1414,13 +1328,6 @@ int ast_audiohook_volume_adjust(struct ast_channel *chan, enum ast_audiohook_dir
|
|||
return 0;
|
||||
}
|
||||
|
||||
/*! \brief Mute frames read from or written to a channel
|
||||
* \param chan Channel to muck with
|
||||
* \param source Type of audiohook
|
||||
* \param flag which flag to set / clear
|
||||
* \param clear set or clear
|
||||
* \return Returns 0 on success, -1 on failure
|
||||
*/
|
||||
int ast_audiohook_set_mute(struct ast_channel *chan, const char *source, enum ast_audiohook_flags flag, int clear)
|
||||
{
|
||||
struct ast_audiohook *audiohook = NULL;
|
||||
|
|
Loading…
Reference in New Issue