summaryrefslogtreecommitdiff
path: root/include/asterisk/format_cap.h
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2011-02-22 23:04:49 +0000
committerDavid Vossel <dvossel@digium.com>2011-02-22 23:04:49 +0000
commitd760e81f37b231a99865a40f67838c51079ed4f8 (patch)
treeb061487de973558358757bd1b6e457aaccf41638 /include/asterisk/format_cap.h
parent736133f874f270be81810c2c1fb36c47e6a479bf (diff)
Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
-Functional changes 1. Dynamic global format list build by codecs defined in codecs.conf 2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf 3. Negotiation of SILK attributes in chan_sip. 4. SPEEX 32khz with translation 5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation using codec_resample.c 6. Various changes to RTP code required to properly handle the dynamic format list and formats with attributes. 7. ConfBridge now dynamically jumps to the best possible sample rate. This allows for conferences to take advantage of HD audio (Which sounds awesome) 8. Audiohooks are no longer limited to 8khz audio, and most effects have been updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT. 9. codec_resample now uses its own code rather than depending on libresample. -Organizational changes Global format list is moved from frame.c to format.c Various format specific functions moved from frame.c to format.c Review: https://reviewboard.asterisk.org/r/1104/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'include/asterisk/format_cap.h')
-rw-r--r--include/asterisk/format_cap.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/include/asterisk/format_cap.h b/include/asterisk/format_cap.h
index cdb5421f9..234767685 100644
--- a/include/asterisk/format_cap.h
+++ b/include/asterisk/format_cap.h
@@ -70,7 +70,7 @@ void *ast_format_cap_destroy(struct ast_format_cap *cap);
* what is placed in the ast_format_cap structure. The actual
* input format ptr is not stored.
*/
-void ast_format_cap_add(struct ast_format_cap *cap, struct ast_format *format);
+void ast_format_cap_add(struct ast_format_cap *cap, const struct ast_format *format);
/*!
* \brief Add all formats Asterisk knows about for a specific type to
@@ -155,6 +155,15 @@ void ast_format_cap_remove_all(struct ast_format_cap *cap);
void ast_format_cap_set(struct ast_format_cap *cap, struct ast_format *format);
/*!
+ * \brief Find if input ast_format is within the capabilities of the ast_format_cap object
+ * then return the compatible format from the capabilities structure in the result.
+ *
+ * \retval 1 format is compatible with formats held in ast_format_cap object.
+ * \retval 0 format is not compatible with any formats in ast_format_cap object.
+ */
+int ast_format_cap_get_compatible_format(const struct ast_format_cap *cap, const struct ast_format *format, struct ast_format *result);
+
+/*!
* \brief Find if ast_format is within the capabilities of the ast_format_cap object.
*
* retval 1 format is compatible with formats held in ast_format_cap object.
@@ -163,6 +172,14 @@ void ast_format_cap_set(struct ast_format_cap *cap, struct ast_format *format);
int ast_format_cap_iscompatible(const struct ast_format_cap *cap, const struct ast_format *format);
/*!
+ * \brief Finds the best quality audio format for a given format id and returns it in result.
+ *
+ * \retval 1 format found and set to result structure.
+ * \retval 0 no format found, result structure is cleared.
+ */
+int ast_format_cap_best_byid(const struct ast_format_cap *cap, enum ast_format_id, struct ast_format *result);
+
+/*!
* \brief is cap1 identical to cap2
*
* retval 1 true, identical
@@ -278,4 +295,14 @@ uint64_t ast_format_cap_to_old_bitfield(const struct ast_format_cap *cap);
*/
void ast_format_cap_from_old_bitfield(struct ast_format_cap *dst, uint64_t src);
+/*! \brief Get the names of a set of formats
+ * \param buf a buffer for the output string
+ * \param size size of buf (bytes)
+ * \param format the format (combined IDs of codecs)
+ * Prints a list of readable codec names corresponding to "format".
+ * 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.
+ */
+char* ast_getformatname_multiple(char *buf, size_t size, struct ast_format_cap *cap);
+
#endif /* _AST_FORMATCAP_H */