summaryrefslogtreecommitdiff
path: root/main/channel.c
diff options
context:
space:
mode:
authorDavid Vossel <dvossel@digium.com>2011-04-21 18:11:40 +0000
committerDavid Vossel <dvossel@digium.com>2011-04-21 18:11:40 +0000
commit7f23115ad2faeee58865afbec6bc11a43210fde7 (patch)
tree3be8de1bbbce5eb12a63028caa39167d69b54e96 /main/channel.c
parentb8f253161b0bc60953fdd5a82b495dd0ddbf61a3 (diff)
New HD ConfBridge conferencing application.
Includes a new highly optimized and customizable ConfBridge application capable of mixing audio at sample rates ranging from 8khz-192khz. Review: https://reviewboard.asterisk.org/r/1147/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/channel.c')
-rw-r--r--main/channel.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/main/channel.c b/main/channel.c
index bb815e728..09be9395d 100644
--- a/main/channel.c
+++ b/main/channel.c
@@ -3011,6 +3011,15 @@ void ast_deactivate_generator(struct ast_channel *chan)
ast_channel_unlock(chan);
}
+static void generator_write_format_change(struct ast_channel *chan)
+{
+ ast_channel_lock(chan);
+ if (chan->generator && chan->generator->write_format_change) {
+ chan->generator->write_format_change(chan, chan->generatordata);
+ }
+ ast_channel_unlock(chan);
+}
+
static int generator_force(const void *data)
{
/* Called if generator doesn't have data */
@@ -5035,10 +5044,9 @@ static int set_format(struct ast_channel *chan,
ast_debug(1, "Channel driver natively set channel %s to %s format %s\n", chan->name,
direction ? "write" : "read", ast_getformatname(&best_set_fmt));
+ ast_channel_lock(chan);
ast_format_copy(format, &best_set_fmt);
ast_format_copy(rawformat, &best_set_fmt);
-
- ast_channel_lock(chan);
ast_format_cap_set(chan->nativeformats, &best_set_fmt);
ast_channel_unlock(chan);
@@ -5046,6 +5054,11 @@ static int set_format(struct ast_channel *chan,
ast_translator_free_path(*trans);
}
*trans = NULL;
+ /* If there is a generator on the channel, it needs to know about this
+ * change if it is the write format. */
+ if (direction && chan->generatordata) {
+ generator_write_format_change(chan);
+ }
return 0;
}
@@ -5110,6 +5123,12 @@ static int set_format(struct ast_channel *chan,
chan->name,
direction ? "write" : "read",
ast_getformatname(&best_set_fmt));
+
+ /* If there is a generator on the channel, it needs to know about this
+ * change if it is the write format. */
+ if (direction && chan->generatordata) {
+ generator_write_format_change(chan);
+ }
return res;
}