diff options
author | David Vossel <dvossel@digium.com> | 2011-02-03 16:22:10 +0000 |
---|---|---|
committer | David Vossel <dvossel@digium.com> | 2011-02-03 16:22:10 +0000 |
commit | c26c190711a1bbe3b5fff1a93facae333757c56e (patch) | |
tree | 00da0caa5a07b7b25729f089dbcafb08129fa9be /main/indications.c | |
parent | 652fb64a01c7a8656697d07e606620ee0ced6929 (diff) |
Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal. For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal
The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs. Functionally
no change in behavior should be present in this patch. Thanks to twilson
and russell for all the time they spent reviewing these changes.
Review: https://reviewboard.asterisk.org/r/1083/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/indications.c')
-rw-r--r-- | main/indications.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/main/indications.c b/main/indications.c index dcd597ac7..f93239380 100644 --- a/main/indications.c +++ b/main/indications.c @@ -116,7 +116,7 @@ struct playtones_state { int npos; int oldnpos; int pos; - int origwfmt; + struct ast_format origwfmt; struct ast_frame f; unsigned char offset[AST_FRIENDLY_OFFSET]; short data[4000]; @@ -127,7 +127,7 @@ static void playtones_release(struct ast_channel *chan, void *params) struct playtones_state *ps = params; if (chan) { - ast_set_write_format(chan, ps->origwfmt); + ast_set_write_format(chan, &ps->origwfmt); } if (ps->items) { @@ -147,9 +147,9 @@ static void *playtones_alloc(struct ast_channel *chan, void *params) return NULL; } - ps->origwfmt = chan->writeformat; + ast_format_copy(&ps->origwfmt, &chan->writeformat); - if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) { + if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR)) { ast_log(LOG_WARNING, "Unable to set '%s' to signed linear format (write)\n", chan->name); playtones_release(NULL, ps); ps = NULL; @@ -223,7 +223,7 @@ static int playtones_generator(struct ast_channel *chan, void *data, int len, in } ps->f.frametype = AST_FRAME_VOICE; - ps->f.subclass.codec = AST_FORMAT_SLINEAR; + ast_format_set(&ps->f.subclass.format, AST_FORMAT_SLINEAR, 0); ps->f.datalen = len; ps->f.samples = samples; ps->f.offset = AST_FRIENDLY_OFFSET; |