yet another massive performance and memory savings improvement

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Kevin P. Fleming 20 years ago
parent b0260c1039
commit 427df3f6c3

@ -27,7 +27,7 @@
/*! /*!
* To init the ulaw to slinear conversion stuff, this needs to be run. * To init the ulaw to slinear conversion stuff, this needs to be run.
*/ */
extern void ast_alaw_init(void); void ast_alaw_init(void);
/*! converts signed linear to mulaw */ /*! converts signed linear to mulaw */
/*! /*!

@ -999,7 +999,7 @@ int ast_channel_setoption(struct ast_channel *channel, int option, void *data, i
/*! Pick the best codec */ /*! Pick the best codec */
/* Choose the best codec... Uhhh... Yah. */ /* Choose the best codec... Uhhh... Yah. */
extern int ast_best_codec(int fmts); int ast_best_codec(int fmts);
/*! Checks the value of an option */ /*! Checks the value of an option */
@ -1254,10 +1254,10 @@ static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
ast_set_flag(c, AST_FLAG_BLOCKING); \ ast_set_flag(c, AST_FLAG_BLOCKING); \
} } } }
extern ast_group_t ast_get_group(char *s); ast_group_t ast_get_group(char *s);
/*! \brief print call- and pickup groups into buffer */ /*! \brief print call- and pickup groups into buffer */
extern char *ast_print_group(char *buf, int buflen, ast_group_t group); char *ast_print_group(char *buf, int buflen, ast_group_t group);
/*! \brief Convert enum channelreloadreason to text string for manager event /*! \brief Convert enum channelreloadreason to text string for manager event
\param reason Enum channelreloadreason - reason for reload (manager, cli, start etc) \param reason Enum channelreloadreason - reason for reload (manager, cli, start etc)
@ -1265,7 +1265,7 @@ extern char *ast_print_group(char *buf, int buflen, ast_group_t group);
const char *channelreloadreason2txt(enum channelreloadreason reason); const char *channelreloadreason2txt(enum channelreloadreason reason);
/*! \brief return an ast_variable list of channeltypes */ /*! \brief return an ast_variable list of channeltypes */
extern struct ast_variable *ast_channeltype_list(void); struct ast_variable *ast_channeltype_list(void);
#if defined(__cplusplus) || defined(c_plusplus) #if defined(__cplusplus) || defined(c_plusplus)
} }

@ -394,7 +394,7 @@ struct ast_frame *ast_readframe(struct ast_filestream *s);
* Initializes all the various file stuff. Basically just registers the cli stuff * Initializes all the various file stuff. Basically just registers the cli stuff
* Returns 0 all the time * Returns 0 all the time
*/ */
extern int ast_file_init(void); int ast_file_init(void);
#define AST_RESERVED_POINTERS 20 #define AST_RESERVED_POINTERS 20

@ -408,7 +408,7 @@ void ast_swapcopy_samples(void *dst, const void *src, int samples);
* \param format id of format * \param format id of format
* \return A static string containing the name of the format or "UNKN" if unknown. * \return A static string containing the name of the format or "UNKN" if unknown.
*/ */
extern char* ast_getformatname(int format); char* ast_getformatname(int format);
/*! \brief Get the names of a set of formats /*! \brief Get the names of a set of formats
* \param buf a buffer for the output string * \param buf a buffer for the output string
@ -418,33 +418,33 @@ extern char* ast_getformatname(int format);
* ex: for format=AST_FORMAT_GSM|AST_FORMAT_SPEEX|AST_FORMAT_ILBC it will return "0x602 (GSM|SPEEX|ILBC)" * ex: for format=AST_FORMAT_GSM|AST_FORMAT_SPEEX|AST_FORMAT_ILBC it will return "0x602 (GSM|SPEEX|ILBC)"
* \return The return value is buf. * \return The return value is buf.
*/ */
extern char* ast_getformatname_multiple(char *buf, size_t size, int format); char* ast_getformatname_multiple(char *buf, size_t size, int format);
/*! /*!
* \brief Gets a format from a name. * \brief Gets a format from a name.
* \param name string of format * \param name string of format
* \return This returns the form of the format in binary on success, 0 on error. * \return This returns the form of the format in binary on success, 0 on error.
*/ */
extern int ast_getformatbyname(const char *name); int ast_getformatbyname(const char *name);
/*! \brief Get a name from a format /*! \brief Get a name from a format
* Gets a name from a format * Gets a name from a format
* \param codec codec number (1,2,4,8,16,etc.) * \param codec codec number (1,2,4,8,16,etc.)
* \return This returns a static string identifying the format on success, 0 on error. * \return This returns a static string identifying the format on success, 0 on error.
*/ */
extern char *ast_codec2str(int codec); char *ast_codec2str(int codec);
struct ast_smoother; struct ast_smoother;
extern struct ast_format_list *ast_get_format_list_index(int index); struct ast_format_list *ast_get_format_list_index(int index);
extern struct ast_format_list *ast_get_format_list(size_t *size); struct ast_format_list *ast_get_format_list(size_t *size);
extern struct ast_smoother *ast_smoother_new(int bytes); struct ast_smoother *ast_smoother_new(int bytes);
extern void ast_smoother_set_flags(struct ast_smoother *smoother, int flags); void ast_smoother_set_flags(struct ast_smoother *smoother, int flags);
extern int ast_smoother_get_flags(struct ast_smoother *smoother); int ast_smoother_get_flags(struct ast_smoother *smoother);
extern void ast_smoother_free(struct ast_smoother *s); void ast_smoother_free(struct ast_smoother *s);
extern void ast_smoother_reset(struct ast_smoother *s, int bytes); void ast_smoother_reset(struct ast_smoother *s, int bytes);
extern int __ast_smoother_feed(struct ast_smoother *s, struct ast_frame *f, int swap); int __ast_smoother_feed(struct ast_smoother *s, struct ast_frame *f, int swap);
extern struct ast_frame *ast_smoother_read(struct ast_smoother *s); struct ast_frame *ast_smoother_read(struct ast_smoother *s);
#define ast_smoother_feed(s,f) __ast_smoother_feed(s, f, 0) #define ast_smoother_feed(s,f) __ast_smoother_feed(s, f, 0)
#if __BYTE_ORDER == __LITTLE_ENDIAN #if __BYTE_ORDER == __LITTLE_ENDIAN
#define ast_smoother_feed_be(s,f) __ast_smoother_feed(s, f, 1) #define ast_smoother_feed_be(s,f) __ast_smoother_feed(s, f, 1)
@ -454,7 +454,7 @@ extern struct ast_frame *ast_smoother_read(struct ast_smoother *s);
#define ast_smoother_feed_le(s,f) __ast_smoother_feed(s, f, 1) #define ast_smoother_feed_le(s,f) __ast_smoother_feed(s, f, 1)
#endif #endif
extern void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix); void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix);
/*! \par AudioCodecPref Audio Codec Preferences /*! \par AudioCodecPref Audio Codec Preferences
In order to negotiate audio codecs in the order they are configured In order to negotiate audio codecs in the order they are configured
@ -470,43 +470,43 @@ extern void ast_frame_dump(const char *name, struct ast_frame *f, char *prefix);
*/ */
/*! \brief Initialize an audio codec preference to "no preference" See \ref AudioCodecPref */ /*! \brief Initialize an audio codec preference to "no preference" See \ref AudioCodecPref */
extern void ast_codec_pref_init(struct ast_codec_pref *pref); void ast_codec_pref_init(struct ast_codec_pref *pref);
/*! \brief Codec located at a particular place in the preference index See \ref AudioCodecPref */ /*! \brief Codec located at a particular place in the preference index See \ref AudioCodecPref */
extern int ast_codec_pref_index(struct ast_codec_pref *pref, int index); int ast_codec_pref_index(struct ast_codec_pref *pref, int index);
/*! \brief Remove audio a codec from a preference list */ /*! \brief Remove audio a codec from a preference list */
extern void ast_codec_pref_remove(struct ast_codec_pref *pref, int format); void ast_codec_pref_remove(struct ast_codec_pref *pref, int format);
/*! \brief Append a audio codec to a preference list, removing it first if it was already there /*! \brief Append a audio codec to a preference list, removing it first if it was already there
*/ */
extern int ast_codec_pref_append(struct ast_codec_pref *pref, int format); int ast_codec_pref_append(struct ast_codec_pref *pref, int format);
/*! \brief Select the best audio format according to preference list from supplied options. /*! \brief Select the best audio format according to preference list from supplied options.
If "find_best" is non-zero then if nothing is found, the "Best" format of If "find_best" is non-zero then if nothing is found, the "Best" format of
the format list is selected, otherwise 0 is returned. */ the format list is selected, otherwise 0 is returned. */
extern int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best); int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best);
/*! \brief Parse an "allow" or "deny" line in a channel or device configuration /*! \brief Parse an "allow" or "deny" line in a channel or device configuration
and update the capabilities mask and pref if provided. and update the capabilities mask and pref if provided.
Video codecs are not added to codec preference lists, since we can not transcode Video codecs are not added to codec preference lists, since we can not transcode
*/ */
extern void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, const char *list, int allowing); void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, const char *list, int allowing);
/*! \brief Dump audio codec preference list into a string */ /*! \brief Dump audio codec preference list into a string */
extern int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size); int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size);
/*! \brief Shift an audio codec preference list up or down 65 bytes so that it becomes an ASCII string */ /*! \brief Shift an audio codec preference list up or down 65 bytes so that it becomes an ASCII string */
extern void ast_codec_pref_convert(struct ast_codec_pref *pref, char *buf, size_t size, int right); void ast_codec_pref_convert(struct ast_codec_pref *pref, char *buf, size_t size, int right);
/*! \brief Returns the number of samples contained in the frame */ /*! \brief Returns the number of samples contained in the frame */
extern int ast_codec_get_samples(struct ast_frame *f); int ast_codec_get_samples(struct ast_frame *f);
/*! \brief Returns the number of bytes for the number of samples of the given format */ /*! \brief Returns the number of bytes for the number of samples of the given format */
extern int ast_codec_get_len(int format, int samples); int ast_codec_get_len(int format, int samples);
/*! \brief Appends a frame to the end of a list of frames, truncating the maximum length of the list */ /*! \brief Appends a frame to the end of a list of frames, truncating the maximum length of the list */
extern struct ast_frame *ast_frame_enqueue(struct ast_frame *head, struct ast_frame *f, int maxlen, int dupe); struct ast_frame *ast_frame_enqueue(struct ast_frame *head, struct ast_frame *f, int maxlen, int dupe);
/*! \brief Gets duration in ms of interpolation frame for a format */ /*! \brief Gets duration in ms of interpolation frame for a format */

@ -27,7 +27,7 @@
/*! /*!
* To init the ulaw to slinear conversion stuff, this needs to be run. * To init the ulaw to slinear conversion stuff, this needs to be run.
*/ */
extern void ast_ulaw_init(void); void ast_ulaw_init(void);
/*! converts signed linear to mulaw */ /*! converts signed linear to mulaw */
/*! /*!

Loading…
Cancel
Save