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
This commit is contained in:
David Vossel
2011-02-03 16:22:10 +00:00
parent 652fb64a01
commit c26c190711
168 changed files with 8120 additions and 3764 deletions

View File

@@ -604,12 +604,12 @@ static void handle_jack_audio(struct ast_channel *chan, struct jack_data *jack_d
short buf[160];
struct ast_frame f = {
.frametype = AST_FRAME_VOICE,
.subclass.codec = AST_FORMAT_SLINEAR,
.src = "JACK",
.data.ptr = buf,
.datalen = sizeof(buf),
.samples = ARRAY_LEN(buf),
};
ast_format_set(&f.subclass.format, AST_FORMAT_SLINEAR, 0);
for (;;) {
size_t res, read_len;
@@ -754,12 +754,12 @@ static int jack_exec(struct ast_channel *chan, const char *data)
return -1;
}
if (ast_set_read_format(chan, AST_FORMAT_SLINEAR)) {
if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) {
destroy_jack_data(jack_data);
return -1;
}
if (ast_set_write_format(chan, AST_FORMAT_SLINEAR)) {
if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR)) {
destroy_jack_data(jack_data);
return -1;
}
@@ -823,9 +823,9 @@ static int jack_hook_callback(struct ast_audiohook *audiohook, struct ast_channe
if (frame->frametype != AST_FRAME_VOICE)
return 0;
if (frame->subclass.codec != AST_FORMAT_SLINEAR) {
if (frame->subclass.format.id != AST_FORMAT_SLINEAR) {
ast_log(LOG_WARNING, "Expected frame in SLINEAR for the audiohook, but got format %s\n",
ast_getformatname(frame->subclass.codec));
ast_getformatname(&frame->subclass.format));
return 0;
}