format: Reintroduce smoother flags

In review 4843 (ASTERISK-24858), we added a hack that forced a smoother
creation when sending signed linear so that the byte order was adjusted
during transmission. This was needed because smoother flags were lost
during the new format work that was done in Asterisk 13.

Rather than rolling that same hack into res_rtp_multicast, re-introduce
smoother flags so that formats can dictate their own options.

Change-Id: I77b835fba0e539c6ce50014a984766f63cab2c16
This commit is contained in:
Sean Bright
2017-05-28 16:43:12 -04:00
parent cf60a0c5bd
commit 5c27fe2187
7 changed files with 130 additions and 49 deletions

View File

@@ -76,6 +76,8 @@ struct ast_codec {
int (*get_length)(unsigned int samples);
/*! \brief Whether the media can be smoothed or not */
unsigned int smooth;
/*! \brief Flags to be passed to the smoother */
unsigned int smoother_flags;
/*! \brief The module that registered this codec */
struct ast_module *mod;
};

View File

@@ -355,6 +355,17 @@ const char *ast_format_get_codec_name(const struct ast_format *format);
*/
int ast_format_can_be_smoothed(const struct ast_format *format);
/*!
* \since 13.17.0
*
* \brief Get smoother flags for this format
*
* \param format The media format
*
* \return smoother flags for the provided format
*/
int ast_format_get_smoother_flags(const struct ast_format *format);
/*!
* \brief Get the media type of a format
*

View File

@@ -33,6 +33,7 @@ extern "C" {
#define AST_SMOOTHER_FLAG_G729 (1 << 0)
#define AST_SMOOTHER_FLAG_BE (1 << 1)
#define AST_SMOOTHER_FLAG_FORCED (1 << 2)
/*! \name AST_Smoother
*/