diff options
author | Terry Wilson <twilson@digium.com> | 2012-02-24 00:32:20 +0000 |
---|---|---|
committer | Terry Wilson <twilson@digium.com> | 2012-02-24 00:32:20 +0000 |
commit | ebaf59a656ef94e19332c08e0d0562b8cbe59f65 (patch) | |
tree | 6e75fd13924808bddacc18e14d5e02975a322481 /res | |
parent | 235f88d12270b328ad466889189400666b3e56c1 (diff) |
Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res')
-rw-r--r-- | res/res_adsi.c | 4 | ||||
-rw-r--r-- | res/res_agi.c | 6 | ||||
-rw-r--r-- | res/res_calendar.c | 10 | ||||
-rw-r--r-- | res/res_fax.c | 16 | ||||
-rw-r--r-- | res/res_musiconhold.c | 8 |
5 files changed, 22 insertions, 22 deletions
diff --git a/res/res_adsi.c b/res/res_adsi.c index 0987b494a..30d8cfc85 100644 --- a/res/res_adsi.c +++ b/res/res_adsi.c @@ -371,8 +371,8 @@ int AST_OPTIONAL_API_NAME(ast_adsi_transmit_message_full)(struct ast_channel *ch struct ast_format writeformat; struct ast_format readformat; - ast_format_copy(&writeformat, &chan->writeformat); - ast_format_copy(&readformat, &chan->readformat); + ast_format_copy(&writeformat, ast_channel_writeformat(chan)); + ast_format_copy(&readformat, ast_channel_readformat(chan)); for (x = 0; x < msglen; x += (msg[x+1]+2)) { if (msg[x] == ADSI_SWITCH_TO_DATA) { diff --git a/res/res_agi.c b/res/res_agi.c index b8c39f929..4ea10bf30 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -2289,7 +2289,7 @@ static int handle_recordfile(struct ast_channel *chan, AGI *agi, int argc, const } if (silence > 0) { - ast_format_copy(&rfmt, &chan->readformat); + ast_format_copy(&rfmt, ast_channel_readformat(chan)); res = ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR); if (res < 0) { ast_log(LOG_WARNING, "Unable to set to linear mode, giving up\n"); @@ -2937,7 +2937,7 @@ static int handle_speechrecognize(struct ast_channel *chan, AGI *agi, int argc, offset = atoi(argv[4]); /* We want frames coming in signed linear */ - ast_format_copy(&old_read_format, &chan->readformat); + ast_format_copy(&old_read_format, ast_channel_readformat(chan)); if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) { ast_agi_send(agi->fd, chan, "200 result=0\n"); return RESULT_SUCCESS; @@ -3934,7 +3934,7 @@ static int eagi_exec(struct ast_channel *chan, const char *data) ast_log(LOG_ERROR, "EAGI cannot be run on a dead/hungup channel, please use AGI.\n"); return 0; } - ast_format_copy(&readformat, &chan->readformat); + ast_format_copy(&readformat, ast_channel_readformat(chan)); if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR)) { ast_log(LOG_WARNING, "Unable to set channel '%s' to linear mode\n", ast_channel_name(chan)); return -1; diff --git a/res/res_calendar.c b/res/res_calendar.c index 4bcb2639b..5ddcaae07 100644 --- a/res/res_calendar.c +++ b/res/res_calendar.c @@ -746,12 +746,12 @@ static void *do_notify(void *data) } ast_channel_tech_set(chan, &null_tech); - ast_format_set(&chan->writeformat, AST_FORMAT_SLINEAR, 0); - ast_format_set(&chan->readformat, AST_FORMAT_SLINEAR, 0); - ast_format_set(&chan->rawwriteformat, AST_FORMAT_SLINEAR, 0); - ast_format_set(&chan->rawreadformat, AST_FORMAT_SLINEAR, 0); + ast_format_set(ast_channel_writeformat(chan), AST_FORMAT_SLINEAR, 0); + ast_format_set(ast_channel_readformat(chan), AST_FORMAT_SLINEAR, 0); + ast_format_set(ast_channel_rawwriteformat(chan), AST_FORMAT_SLINEAR, 0); + ast_format_set(ast_channel_rawreadformat(chan), AST_FORMAT_SLINEAR, 0); /* clear native formats and set to slinear. write format is signlear so just use that to set it */ - ast_format_cap_set(ast_channel_nativeformats(chan), &chan->writeformat); + ast_format_cap_set(ast_channel_nativeformats(chan), ast_channel_writeformat(chan)); if (!(datastore = ast_datastore_alloc(&event_notification_datastore, NULL))) { ast_log(LOG_ERROR, "Could not allocate datastore, notification not being sent!\n"); diff --git a/res/res_fax.c b/res/res_fax.c index cea74b726..5b9df5252 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -1355,7 +1355,7 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det if (details->caps & AST_FAX_TECH_AUDIO) { expected_frametype = AST_FRAME_VOICE;; ast_format_set(&expected_framesubclass.format, AST_FORMAT_SLINEAR, 0); - ast_format_copy(&orig_write_format, &chan->writeformat); + ast_format_copy(&orig_write_format, ast_channel_writeformat(chan)); if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) { ast_log(LOG_ERROR, "channel '%s' failed to set write format to signed linear'.\n", ast_channel_name(chan)); ao2_lock(faxregistry.container); @@ -1365,7 +1365,7 @@ static int generic_fax_exec(struct ast_channel *chan, struct ast_fax_session_det ast_channel_unlock(chan); return -1; } - ast_format_copy(&orig_read_format, &chan->readformat); + ast_format_copy(&orig_read_format, ast_channel_readformat(chan)); if (ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) { ast_log(LOG_ERROR, "channel '%s' failed to set read format to signed linear.\n", ast_channel_name(chan)); ao2_lock(faxregistry.container); @@ -3004,11 +3004,11 @@ static struct ast_frame *fax_gateway_framehook(struct ast_channel *chan, struct /* we are bridged, change r/w formats to SLIN for v21 preamble * detection and T.30 */ - ast_format_copy(&gateway->chan_read_format, &chan->readformat); - ast_format_copy(&gateway->chan_write_format, &chan->readformat); + ast_format_copy(&gateway->chan_read_format, ast_channel_readformat(chan)); + ast_format_copy(&gateway->chan_write_format, ast_channel_readformat(chan)); - ast_format_copy(&gateway->peer_read_format, &peer->readformat); - ast_format_copy(&gateway->peer_write_format, &peer->readformat); + ast_format_copy(&gateway->peer_read_format, ast_channel_readformat(peer)); + ast_format_copy(&gateway->peer_write_format, ast_channel_readformat(peer)); ast_set_read_format_by_id(chan, AST_FORMAT_SLINEAR); ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR); @@ -3272,8 +3272,8 @@ static struct ast_frame *fax_detect_framehook(struct ast_channel *chan, struct a switch (event) { case AST_FRAMEHOOK_EVENT_ATTACHED: /* Setup format for DSP on ATTACH*/ - ast_format_copy(&faxdetect->orig_format, &chan->readformat); - switch (chan->readformat.id) { + ast_format_copy(&faxdetect->orig_format, ast_channel_readformat(chan)); + switch (ast_channel_readformat(chan)->id) { case AST_FORMAT_SLINEAR: case AST_FORMAT_ALAW: case AST_FORMAT_ULAW: diff --git a/res/res_musiconhold.c b/res/res_musiconhold.c index eb4330e21..6411af242 100644 --- a/res/res_musiconhold.c +++ b/res/res_musiconhold.c @@ -392,7 +392,7 @@ static void moh_files_write_format_change(struct ast_channel *chan, void *data) if (&state->origwfmt.id) { struct ast_format tmp; - ast_format_copy(&tmp, &chan->writeformat); + ast_format_copy(&tmp, ast_channel_writeformat(chan)); if (state->mohwfmt.id) { ast_format_clear(&state->origwfmt); ast_set_write_format(chan, &state->mohwfmt); @@ -470,8 +470,8 @@ static void *moh_files_alloc(struct ast_channel *chan, void *params) } state->class = mohclass_ref(class, "Reffing music class for channel"); - ast_format_copy(&state->origwfmt, &chan->writeformat); - ast_format_copy(&state->mohwfmt, &chan->writeformat); + ast_format_copy(&state->origwfmt, ast_channel_writeformat(chan)); + ast_format_copy(&state->mohwfmt, ast_channel_writeformat(chan)); /* For comparison on restart of MOH (see above) */ ast_copy_string(state->name, class->name, sizeof(state->name)); @@ -992,7 +992,7 @@ static void *moh_alloc(struct ast_channel *chan, void *params) } if ((res = mohalloc(class))) { - ast_format_copy(&res->origwfmt, &chan->writeformat); + ast_format_copy(&res->origwfmt, ast_channel_writeformat(chan)); if (ast_set_write_format(chan, &class->format)) { ast_log(LOG_WARNING, "Unable to set channel '%s' to format '%s'\n", ast_channel_name(chan), ast_codec2str(&class->format)); moh_release(NULL, res); |