summaryrefslogtreecommitdiff
path: root/include/asterisk/translate.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asterisk/translate.h')
-rw-r--r--include/asterisk/translate.h58
1 files changed, 29 insertions, 29 deletions
diff --git a/include/asterisk/translate.h b/include/asterisk/translate.h
index 0e0eae1ec..8a5ac2106 100644
--- a/include/asterisk/translate.h
+++ b/include/asterisk/translate.h
@@ -24,8 +24,8 @@
#ifndef _ASTERISK_TRANSLATE_H
#define _ASTERISK_TRANSLATE_H
-#define MAX_AUDIO_FORMAT 15 /* Do not include video here */
-#define MAX_FORMAT 32 /* Do include video here */
+#define MAX_AUDIO_FORMAT 47 /* Do not include video here */
+#define MAX_FORMAT 64 /* Do include video here */
#if defined(__cplusplus) || defined(c_plusplus)
extern "C" {
@@ -69,51 +69,51 @@ struct ast_trans_pvt; /* declared below */
* Generic plc is only available for dstfmt = SLINEAR
*/
struct ast_translator {
- const char name[80]; /*!< Name of translator */
- int srcfmt; /*!< Source format (note: bit position,
- converted to index during registration) */
- int dstfmt; /*!< Destination format (note: bit position,
- converted to index during registration) */
+ const char name[80]; /*!< Name of translator */
+ format_t srcfmt; /*!< Source format (note: bit position,
+ * converted to index during registration) */
+ format_t dstfmt; /*!< Destination format (note: bit position,
+ * converted to index during registration) */
int (*newpvt)(struct ast_trans_pvt *); /*!< initialize private data
- associated with the translator */
+ * associated with the translator */
int (*framein)(struct ast_trans_pvt *pvt, struct ast_frame *in);
- /*!< Input frame callback. Store
- (and possibly convert) input frame. */
+ /*!< Input frame callback. Store
+ * (and possibly convert) input frame. */
struct ast_frame * (*frameout)(struct ast_trans_pvt *pvt);
- /*!< Output frame callback. Generate a frame
- with outbuf content. */
+ /*!< Output frame callback. Generate a frame
+ * with outbuf content. */
void (*destroy)(struct ast_trans_pvt *pvt);
- /*!< cleanup private data, if needed
- (often unnecessary). */
+ /*!< cleanup private data, if needed
+ * (often unnecessary). */
- struct ast_frame * (*sample)(void); /*!< Generate an example frame */
+ struct ast_frame * (*sample)(void); /*!< Generate an example frame */
- /*! \brief size of outbuf, in samples. Leave it 0 if you want the framein
+ /*!\brief size of outbuf, in samples. Leave it 0 if you want the framein
* callback deal with the frame. Set it appropriately if you
* want the code to checks if the incoming frame fits the
* outbuf (this is e.g. required for plc).
*/
- int buffer_samples; /*< size of outbuf, in samples */
+ int buffer_samples; /*< size of outbuf, in samples */
/*! \brief size of outbuf, in bytes. Mandatory. The wrapper code will also
* allocate an AST_FRIENDLY_OFFSET space before.
*/
int buf_size;
- int desc_size; /*!< size of private descriptor in pvt->pvt, if any */
- int plc_samples; /*!< set to the plc block size if used, 0 otherwise */
- int useplc; /*!< current status of plc, changed at runtime */
- int native_plc; /*!< true if the translator can do native plc */
+ int desc_size; /*!< size of private descriptor in pvt->pvt, if any */
+ int plc_samples; /*!< set to the plc block size if used, 0 otherwise */
+ int useplc; /*!< current status of plc, changed at runtime */
+ int native_plc; /*!< true if the translator can do native plc */
- struct ast_module *module; /* opaque reference to the parent module */
+ struct ast_module *module; /*!< opaque reference to the parent module */
- int cost; /*!< Cost in milliseconds for encoding/decoding 1 second of sound */
- int active; /*!< Whether this translator should be used or not */
- AST_LIST_ENTRY(ast_translator) list; /*!< link field */
+ int cost; /*!< Cost in milliseconds for encoding/decoding 1 second of sound */
+ int active; /*!< Whether this translator should be used or not */
+ AST_LIST_ENTRY(ast_translator) list; /*!< link field */
};
/*! \brief
@@ -205,7 +205,7 @@ void ast_translator_deactivate(struct ast_translator *t);
* \return Returns 0 on success, -1 if no path could be found.
* \note Modifies dests and srcs in place
*/
-int ast_translator_best_choice(int *dsts, int *srcs);
+format_t ast_translator_best_choice(format_t *dsts, format_t *srcs);
/*!
* \brief Builds a translator path
@@ -214,7 +214,7 @@ int ast_translator_best_choice(int *dsts, int *srcs);
* \param source source format
* \return ast_trans_pvt on success, NULL on failure
* */
-struct ast_trans_pvt *ast_translator_build_path(int dest, int source);
+struct ast_trans_pvt *ast_translator_build_path(format_t dest, format_t source);
/*!
* \brief Frees a translator path
@@ -240,7 +240,7 @@ struct ast_frame *ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, i
* \param src source format
* \return the number of translation steps required, or -1 if no path is available
*/
-unsigned int ast_translate_path_steps(unsigned int dest, unsigned int src);
+unsigned int ast_translate_path_steps(format_t dest, format_t src);
/*!
* \brief Mask off unavailable formats from a format bitmask
@@ -254,7 +254,7 @@ unsigned int ast_translate_path_steps(unsigned int dest, unsigned int src);
* \note Only a single audio format and a single video format can be
* present in 'src', or the function will produce unexpected results.
*/
-unsigned int ast_translate_available_formats(unsigned int dest, unsigned int src);
+format_t ast_translate_available_formats(format_t dest, format_t src);
#if defined(__cplusplus) || defined(c_plusplus)
}