diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/asterisk/file.h | 12 | ||||
-rw-r--r-- | include/asterisk/mod_format.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/include/asterisk/file.h b/include/asterisk/file.h index c17cb327b..1c2c7a84a 100644 --- a/include/asterisk/file.h +++ b/include/asterisk/file.h @@ -427,6 +427,18 @@ char *ast_format_str_reduce(char *fmts); */ struct ast_format *ast_get_format_for_file_ext(const char *file_ext); +/*! + * \brief Get a suitable filename extension for the given MIME type + * + * \param mime_type The MIME type for which to find extensions + * \param buffer A pointer to a buffer to receive the extension + * \param capacity The size of 'buffer' in bytes + * + * \retval 1 if an extension was found for the provided MIME type + * \retval 0 if the MIME type was not found + */ +int ast_get_extension_for_mime_type(const char *mime_type, char *buffer, size_t capacity); + #if defined(__cplusplus) || defined(c_plusplus) } #endif diff --git a/include/asterisk/mod_format.h b/include/asterisk/mod_format.h index 5f93ea442..6e772f05b 100644 --- a/include/asterisk/mod_format.h +++ b/include/asterisk/mod_format.h @@ -44,6 +44,7 @@ struct ast_format_def { char name[80]; /*!< Name of format */ char exts[80]; /*!< Extensions (separated by | if more than one) * this format can read. First is assumed for writing (e.g. .mp3) */ + char mime_types[80]; /*!< MIME Types related to the format (separated by | if more than one)*/ struct ast_format *format; /*!< Format of frames it uses/provides (one only) */ /*! * \brief Prepare an input stream for playback. |