From 5c27fe218776b499cff772660f2b4b7ee42b3802 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Sun, 28 May 2017 16:43:12 -0400 Subject: 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 --- main/codec_builtin.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'main/codec_builtin.c') diff --git a/main/codec_builtin.c b/main/codec_builtin.c index 3320900c2..32ec12d3d 100644 --- a/main/codec_builtin.c +++ b/main/codec_builtin.c @@ -36,6 +36,7 @@ #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); @@ -288,6 +289,7 @@ static struct ast_codec slin8 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin12 = { @@ -302,6 +304,7 @@ static struct ast_codec slin12 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin16 = { @@ -316,6 +319,7 @@ static struct ast_codec slin16 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin24 = { @@ -330,6 +334,7 @@ static struct ast_codec slin24 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin32 = { @@ -344,6 +349,7 @@ static struct ast_codec slin32 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin44 = { @@ -358,6 +364,7 @@ static struct ast_codec slin44 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin48 = { @@ -372,6 +379,7 @@ static struct ast_codec slin48 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin96 = { @@ -386,6 +394,7 @@ static struct ast_codec slin96 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static struct ast_codec slin192 = { @@ -400,6 +409,7 @@ static struct ast_codec slin192 = { .samples_count = slin_samples, .get_length = slin_length, .smooth = 1, + .smoother_flags = AST_SMOOTHER_FLAG_BE | AST_SMOOTHER_FLAG_FORCED, }; static int lpc10_samples(struct ast_frame *frame) -- cgit v1.2.3