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 1e65857e6f
commit 70e5887906
7 changed files with 125 additions and 51 deletions

View File

@@ -37,6 +37,7 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
#include "asterisk/format.h"
#include "asterisk/format_cache.h"
#include "asterisk/frame.h"
#include "asterisk/smoother.h"
int __ast_codec_register_with_format(struct ast_codec *codec, const char *format_name,
struct ast_module *mod);
@@ -264,7 +265,7 @@ static struct ast_codec slin8 = {
.minimum_bytes = 160,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin12 = {
@@ -278,7 +279,7 @@ static struct ast_codec slin12 = {
.minimum_bytes = 240,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin16 = {
@@ -292,7 +293,7 @@ static struct ast_codec slin16 = {
.minimum_bytes = 320,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin24 = {
@@ -306,7 +307,7 @@ static struct ast_codec slin24 = {
.minimum_bytes = 480,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin32 = {
@@ -320,7 +321,7 @@ static struct ast_codec slin32 = {
.minimum_bytes = 640,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin44 = {
@@ -334,7 +335,7 @@ static struct ast_codec slin44 = {
.minimum_bytes = 882,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin48 = {
@@ -348,7 +349,7 @@ static struct ast_codec slin48 = {
.minimum_bytes = 960,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin96 = {
@@ -362,7 +363,7 @@ static struct ast_codec slin96 = {
.minimum_bytes = 1920,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static struct ast_codec slin192 = {
@@ -376,7 +377,7 @@ static struct ast_codec slin192 = {
.minimum_bytes = 3840,
.samples_count = slin_samples,
.get_length = slin_length,
.smooth = 1,
.smooth = AST_SMOOTHER_FLAGS_PACK(AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED),
};
static int lpc10_samples(struct ast_frame *frame)