[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase1_step3 r301777 - in /team/dvossel/f...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 13 16:01:51 CST 2011
Author: dvossel
Date: Thu Jan 13 16:01:45 2011
New Revision: 301777
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=301777
Log:
fixes copy function parameter order
Modified:
team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c
team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c
team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h
team/dvossel/fixtheworld_phase1_step3/include/asterisk/format_cap.h
team/dvossel/fixtheworld_phase1_step3/main/abstract_jb.c
team/dvossel/fixtheworld_phase1_step3/main/app.c
team/dvossel/fixtheworld_phase1_step3/main/audiohook.c
team/dvossel/fixtheworld_phase1_step3/main/bridging.c
team/dvossel/fixtheworld_phase1_step3/main/channel.c
team/dvossel/fixtheworld_phase1_step3/main/file.c
team/dvossel/fixtheworld_phase1_step3/main/format.c
team/dvossel/fixtheworld_phase1_step3/main/format_cap.c
team/dvossel/fixtheworld_phase1_step3/main/format_pref.c
team/dvossel/fixtheworld_phase1_step3/main/frame.c
team/dvossel/fixtheworld_phase1_step3/main/indications.c
team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c
team/dvossel/fixtheworld_phase1_step3/main/slinfactory.c
team/dvossel/fixtheworld_phase1_step3/main/translate.c
team/dvossel/fixtheworld_phase1_step3/res/res_rtp_asterisk.c
team/dvossel/fixtheworld_phase1_step3/tests/test_format_api.c
Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_local.c Thu Jan 13 16:01:45 2011
@@ -1046,19 +1046,19 @@
tmp2->tech = tmp->tech = &local_tech;
- ast_cap_append(p->reqcap, tmp->nativeformats);
- ast_cap_append(p->reqcap, tmp2->nativeformats);
+ ast_cap_append(tmp->nativeformats, p->reqcap);
+ ast_cap_append(tmp2->nativeformats, p->reqcap);
/* Determine our read/write format and set it on each channel */
ast_best_codec(p->reqcap, &fmt);
- ast_format_copy(&fmt, &tmp->writeformat);
- ast_format_copy(&fmt, &tmp2->writeformat);
- ast_format_copy(&fmt, &tmp->rawwriteformat);
- ast_format_copy(&fmt, &tmp2->rawwriteformat);
- ast_format_copy(&fmt, &tmp->readformat);
- ast_format_copy(&fmt, &tmp2->readformat);
- ast_format_copy(&fmt, &tmp->rawreadformat);
- ast_format_copy(&fmt, &tmp2->rawreadformat);
+ ast_format_copy(&tmp->writeformat, &fmt);
+ ast_format_copy(&tmp2->writeformat, &fmt);
+ ast_format_copy(&tmp->rawwriteformat, &fmt);
+ ast_format_copy(&tmp2->rawwriteformat, &fmt);
+ ast_format_copy(&tmp->readformat, &fmt);
+ ast_format_copy(&tmp2->readformat, &fmt);
+ ast_format_copy(&tmp->rawreadformat, &fmt);
+ ast_format_copy(&tmp2->rawreadformat, &fmt);
tmp->tech_pvt = p;
tmp2->tech_pvt = p;
Modified: team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c Thu Jan 13 16:01:45 2011
@@ -4887,7 +4887,7 @@
ast_copy_flags(&dialog->flags[0], &peer->flags[0], SIP_FLAGS_TO_COPY);
ast_copy_flags(&dialog->flags[1], &peer->flags[1], SIP_PAGE2_FLAGS_TO_COPY);
ast_copy_flags(&dialog->flags[2], &peer->flags[2], SIP_PAGE3_FLAGS_TO_COPY);
- ast_cap_append(peer->caps, dialog->caps);
+ ast_cap_append(dialog->caps, peer->caps);
dialog->prefs = peer->prefs;
if (ast_test_flag(&dialog->flags[1], SIP_PAGE2_T38SUPPORT)) {
/* t38pt_udptl was enabled in the peer and not in [general] */
@@ -6589,23 +6589,23 @@
/* Select our native format based on codec preference until we receive
something from another device to the contrary. */
if (!(ast_cap_is_empty(i->jointcaps))) { /* The joint capabilities of us and peer */
- ast_cap_append(i->jointcaps, what);
+ ast_cap_append(what, i->jointcaps);
video = ast_cap_get_type(i->jointcaps, AST_FORMAT_TYPE_VIDEO);
text = ast_cap_get_type(i->jointcaps, AST_FORMAT_TYPE_TEXT);
} else if (!(ast_cap_is_empty(i->caps))) { /* Our configured capability for this peer */
- ast_cap_append(i->caps, what);
+ ast_cap_append(what, i->caps);
video = ast_cap_get_type(i->caps, AST_FORMAT_TYPE_VIDEO);
text = ast_cap_get_type(i->caps, AST_FORMAT_TYPE_TEXT);
} else {
- ast_cap_append(sip_cfg.caps, what); /* Global codec support */
+ ast_cap_append(what, sip_cfg.caps); /* Global codec support */
video = ast_cap_get_type(sip_cfg.caps, AST_FORMAT_TYPE_VIDEO);
text = ast_cap_get_type(sip_cfg.caps, AST_FORMAT_TYPE_TEXT);
}
/* Set the native formats for audio and merge in video */
ast_codec_choose(&i->prefs, what, 1, &fmt);
- ast_cap_append(video, tmp->nativeformats);
- ast_cap_append(text, tmp->nativeformats);
+ ast_cap_append(tmp->nativeformats, video);
+ ast_cap_append(tmp->nativeformats, text);
ast_cap_add(tmp->nativeformats, &fmt);
ast_debug(3, "*** Our native formats are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, tmp->nativeformats));
ast_debug(3, "*** Joint capabilities are %s \n", ast_getformatname_multiple(buf, SIPBUFSIZE, i->jointcaps));
@@ -6678,12 +6678,12 @@
}
tmp->adsicpe = AST_ADSI_UNAVAILABLE;
- ast_format_copy(&fmt, &tmp->writeformat);
- ast_format_copy(&fmt, &tmp->rawwriteformat);
+ ast_format_copy(&tmp->writeformat, &fmt);
+ ast_format_copy(&tmp->rawwriteformat, &fmt);
ast_rtp_instance_set_write_format(i->rtp, &fmt);
- ast_format_copy(&fmt, &tmp->readformat);
- ast_format_copy(&fmt, &tmp->rawreadformat);
+ ast_format_copy(&tmp->readformat, &fmt);
+ ast_format_copy(&tmp->rawreadformat, &fmt);
ast_rtp_instance_set_read_format(i->rtp, &fmt);
tmp->tech_pvt = dialog_ref(i, "sip_new: set chan->tech_pvt to i");
@@ -7289,7 +7289,7 @@
/* Assign default music on hold class */
ast_string_field_set(p, mohinterpret, default_mohinterpret);
ast_string_field_set(p, mohsuggest, default_mohsuggest);
- ast_cap_append(sip_cfg.caps, p->caps);
+ ast_cap_append(p->caps, sip_cfg.caps);
p->allowtransfer = sip_cfg.allowtransfer;
if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833) ||
(ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO))
@@ -8654,9 +8654,9 @@
ast_rtp_codecs_payload_formats(&newvideortp, vpeercapability, &vpeernoncodeccapability);
ast_rtp_codecs_payload_formats(&newtextrtp, tpeercapability, &tpeernoncodeccapability);
- ast_cap_append(peercapability, newpeercapability);
- ast_cap_append(vpeercapability, newpeercapability);
- ast_cap_append(tpeercapability, newpeercapability);
+ ast_cap_append(newpeercapability, peercapability);
+ ast_cap_append(newpeercapability, vpeercapability);
+ ast_cap_append(newpeercapability, tpeercapability);
ast_cap_joint_copy(p->caps, newpeercapability, newjointcapability);
if (ast_cap_is_empty(newjointcapability) && (portno != -1)) {
@@ -8702,10 +8702,10 @@
/* We are now ready to change the sip session and p->rtp and p->vrtp with the offered codecs, since
they are acceptable */
ast_cap_remove_all(p->jointcaps);
- ast_cap_append(newjointcapability, p->jointcaps); /* Our joint codec profile for this call */
+ ast_cap_append(p->jointcaps, newjointcapability); /* Our joint codec profile for this call */
ast_cap_remove_all(p->peercaps);
- ast_cap_append(newpeercapability, p->peercaps); /* The other sides capability in latest offer */
+ ast_cap_append(p->peercaps, newpeercapability); /* The other sides capability in latest offer */
p->jointnoncodeccapability = newnoncodeccapability; /* DTMF capabilities */
@@ -15299,10 +15299,10 @@
p->pickupgroup = peer->pickupgroup;
ast_cap_remove_all(p->caps);
- ast_cap_append(peer->caps, p->caps);
+ ast_cap_append(p->caps, peer->caps);
ast_cap_remove_all(p->jointcaps);
- ast_cap_append(peer->caps, p->jointcaps);
+ ast_cap_append(p->jointcaps, peer->caps);
p->prefs = peer->prefs;
if (peer->maxforwards > 0) {
@@ -21534,7 +21534,7 @@
ast_queue_control(p->owner, AST_CONTROL_SRCUPDATE);
} else {
ast_cap_remove_all(p->jointcaps);
- ast_cap_append(p->caps, p->jointcaps);
+ ast_cap_append(p->jointcaps, p->caps);
ast_debug(1, "Hm.... No sdp for the moment\n");
/* Some devices signal they want to be put off hold by sending a re-invite
*without* an SDP, which is supposed to mean "Go back to your state"
@@ -21617,7 +21617,7 @@
}
} else { /* No SDP in invite, call control session */
ast_cap_remove_all(p->jointcaps);
- ast_cap_append(p->caps, p->jointcaps);
+ ast_cap_append(p->jointcaps, p->caps);
ast_debug(2, "No SDP in Invite, third party call control\n");
}
@@ -25530,7 +25530,7 @@
#if 0
printf("Setting up to call extension '%s' at '%s'\n", ext ? ext : "<none>", host);
#endif
- ast_cap_append(cap, p->prefcaps);
+ ast_cap_append(p->prefcaps, cap);
ast_cap_joint_copy(cap, p->caps, p->jointcaps);
sip_pvt_lock(p);
@@ -25959,7 +25959,7 @@
ast_sockaddr_setnull(&peer->addr);
ast_sockaddr_setnull(&peer->defaddr);
ast_cap_remove_all(peer->caps);
- ast_cap_append(sip_cfg.caps, peer->caps);
+ ast_cap_append(peer->caps, sip_cfg.caps);
peer->maxcallbitrate = default_maxcallbitrate;
peer->rtptimeout = global_rtptimeout;
peer->rtpholdtimeout = global_rtpholdtimeout;
@@ -28033,7 +28033,7 @@
}
if (cap && !(ast_cap_is_empty(cap) && !(ast_cap_identical(p->redircaps, cap)))) {
ast_cap_remove_all(p->redircaps);
- ast_cap_append(cap, p->redircaps);
+ ast_cap_append(p->redircaps, cap);
changed = 1;
}
if (changed && !ast_test_flag(&p->flags[0], SIP_GOTREFER) && !ast_test_flag(&p->flags[0], SIP_DEFER_BYE_ON_TRANSFER)) {
@@ -28059,7 +28059,7 @@
static void sip_get_codec(struct ast_channel *chan, struct ast_cap *result)
{
struct sip_pvt *p = chan->tech_pvt;
- ast_cap_append(ast_cap_is_empty(p->peercaps) ? p->caps : p->peercaps, result);
+ ast_cap_append(result, ast_cap_is_empty(p->peercaps) ? p->caps : p->peercaps);
}
static struct ast_rtp_glue sip_rtp_glue = {
Modified: team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h (original)
+++ team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h Thu Jan 13 16:01:45 2011
@@ -217,7 +217,7 @@
/*!
* \brief copy format src into format dst.
*/
-void ast_format_copy(const struct ast_format *src, struct ast_format *dst);
+void ast_format_copy(struct ast_format *dst, const struct ast_format *src);
/*!
* \brief Set the rtp mark value on the format to indicate to the interface
@@ -250,7 +250,7 @@
* \retval on success, pointer to the dst format in the input parameters
* \retval on failure, NULL
*/
-struct ast_format *ast_format_from_iax2(uint64_t src, struct ast_format *dst);
+struct ast_format *ast_format_from_iax2(struct ast_format *dst, uint64_t src);
/*!
* \brief register ast_format_attr_interface with core.
Modified: team/dvossel/fixtheworld_phase1_step3/include/asterisk/format_cap.h
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/include/asterisk/format_cap.h?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/include/asterisk/format_cap.h (original)
+++ team/dvossel/fixtheworld_phase1_step3/include/asterisk/format_cap.h Thu Jan 13 16:01:45 2011
@@ -73,7 +73,7 @@
/*!
* \brief Append the formats in src to dst
*/
-void ast_cap_append(const struct ast_cap *src, struct ast_cap *dst);
+void ast_cap_append(struct ast_cap *dst, const struct ast_cap *src);
/*!
* \brief create a deep copy of an ast_cap structure
@@ -227,6 +227,6 @@
* \brief convert iax2 bitfield format to ast_cap represenatation
* \note This is only to be used for IAX2 compatibility
*/
-void ast_cap_from_iax2(uint64_t src, struct ast_cap *dst);
+void ast_cap_from_iax2(struct ast_cap *dst, uint64_t src);
#endif /* _AST_FORMATCAP_H */
Modified: team/dvossel/fixtheworld_phase1_step3/main/abstract_jb.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/abstract_jb.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/abstract_jb.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/abstract_jb.c Thu Jan 13 16:01:45 2011
@@ -409,13 +409,13 @@
case JB_IMPL_DROP:
jb_framelog("\tJB_GET {now=%ld}: %s frame with ts=%ld and len=%ld\n",
now, jb_get_actions[res], f->ts, f->len);
- ast_format_copy(&f->subclass.format, &jb->last_format);
+ ast_format_copy(&jb->last_format, &f->subclass.format);
ast_frfree(f);
break;
case JB_IMPL_INTERP:
/* interpolate a frame */
f = &finterp;
- ast_format_copy(&jb->last_format, &f->subclass.format);
+ ast_format_copy(&f->subclass.format, &jb->last_format);
f->samples = interpolation_len * 8;
f->src = "JB interpolation";
f->delivery = ast_tvadd(jb->timebase, ast_samp2tv(jb->next, 1000));
@@ -476,7 +476,7 @@
jb->next = jbimpl->next(jbobj);
/* Init last format for a first time. */
- ast_format_copy(&frr->subclass.format, &jb->last_format);
+ ast_format_copy(&jb->last_format, &frr->subclass.format);
/* Create a frame log file */
if (ast_test_flag(jbconf, AST_JB_LOG)) {
Modified: team/dvossel/fixtheworld_phase1_step3/main/app.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/app.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/app.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/app.c Thu Jan 13 16:01:45 2011
@@ -468,7 +468,7 @@
ast_clear_flag(chan, AST_FLAG_WRITE_INT);
}
- ast_format_copy(&chan->writeformat, &ls->origwfmt);
+ ast_format_copy(&ls->origwfmt, &chan->writeformat);
if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR)) {
ast_log(LOG_WARNING, "Unable to set '%s' to linear format (write)\n", chan->name);
@@ -776,7 +776,7 @@
return -1;
}
ast_dsp_set_threshold(sildet, silencethreshold);
- ast_format_copy(&chan->readformat, &rfmt);
+ ast_format_copy(&rfmt, &chan->readformat);
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");
Modified: team/dvossel/fixtheworld_phase1_step3/main/audiohook.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/audiohook.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/audiohook.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/audiohook.c Thu Jan 13 16:01:45 2011
@@ -631,7 +631,7 @@
ast_translator_free_path(in_translate->trans_pvt);
if (!(in_translate->trans_pvt = ast_translator_build_path(ast_format_set(&tmp_fmt, AST_FORMAT_SLINEAR, 0), &frame->subclass.format)))
return frame;
- ast_format_copy(&frame->subclass.format, &in_translate->format);
+ ast_format_copy(&in_translate->format, &frame->subclass.format);
}
if (!(middle_frame = ast_translate(in_translate->trans_pvt, frame, 0)))
return frame;
@@ -718,7 +718,7 @@
ast_frfree(middle_frame);
return start_frame;
}
- ast_format_copy(&start_frame->subclass.format, &out_translate->format);
+ ast_format_copy(&out_translate->format, &start_frame->subclass.format);
}
/* Transcode from our middle (signed linear) frame to new format of the frame that came in */
if (!(end_frame = ast_translate(out_translate->trans_pvt, middle_frame, 0))) {
Modified: team/dvossel/fixtheworld_phase1_step3/main/bridging.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/bridging.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/bridging.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/bridging.c Thu Jan 13 16:01:45 2011
@@ -536,8 +536,8 @@
static int bridge_make_compatible(struct ast_bridge *bridge, struct ast_bridge_channel *bridge_channel)
{
struct ast_format formats[2];
- ast_format_copy(&bridge_channel->chan->readformat, &formats[0]);
- ast_format_copy(&bridge_channel->chan->writeformat, &formats[1]);
+ ast_format_copy(&formats[0], &bridge_channel->chan->readformat);
+ ast_format_copy(&formats[1], &bridge_channel->chan->writeformat);
/* Are the formats currently in use something ths bridge can handle? */
if (!ast_cap_iscompatible(bridge->technology->format_capabilities, &bridge_channel->chan->readformat)) {
@@ -869,8 +869,8 @@
{
struct ast_format formats[2];
enum ast_bridge_channel_state state;
- ast_format_copy(&bridge_channel->chan->readformat, &formats[0]);
- ast_format_copy(&bridge_channel->chan->writeformat, &formats[1]);
+ ast_format_copy(&formats[0], &bridge_channel->chan->readformat);
+ ast_format_copy(&formats[1], &bridge_channel->chan->writeformat);
/* Record the thread that will be the owner of us */
bridge_channel->thread = pthread_self();
Modified: team/dvossel/fixtheworld_phase1_step3/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/channel.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/channel.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/channel.c Thu Jan 13 16:01:45 2011
@@ -4531,7 +4531,7 @@
/* Send an empty audio frame to get things moving */
if (chan->_state != AST_STATE_UP) {
ast_debug(1, "Prodding channel '%s'\n", chan->name);
- ast_format_copy(&chan->rawwriteformat, &a.subclass.format);
+ ast_format_copy(&a.subclass.format, &chan->rawwriteformat);
a.data.ptr = nothing + AST_FRIENDLY_OFFSET;
a.src = "ast_prod"; /* this better match check in ast_write */
if (ast_write(chan, &a))
@@ -4961,8 +4961,8 @@
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_format_copy(&best_set_fmt, format);
- ast_format_copy(&best_set_fmt, rawformat);
+ ast_format_copy(format, &best_set_fmt);
+ ast_format_copy(rawformat, &best_set_fmt);
ast_channel_lock(chan);
ast_cap_remove_all(chan->nativeformats);
@@ -5003,9 +5003,9 @@
return 0;
}
- ast_format_copy(&best_native_fmt, rawformat);
+ ast_format_copy(rawformat, &best_native_fmt);
/* User perspective is fmt */
- ast_format_copy(&best_set_fmt, format);
+ ast_format_copy(format, &best_set_fmt);
/* Free any read translation we have right now */
if (*trans) {
@@ -6323,8 +6323,8 @@
char masqn[AST_CHANNEL_NAME];
char zombn[AST_CHANNEL_NAME];
- ast_format_copy(&original->readformat, &rformat);
- ast_format_copy(&original->writeformat, &wformat);
+ ast_format_copy(&rformat, &original->readformat);
+ ast_format_copy(&wformat, &original->writeformat);
/* XXX This operation is a bit odd. We're essentially putting the guts of
* the clone channel into the original channel. Start by killing off the
@@ -6484,13 +6484,13 @@
}
/* Swap the raw formats */
- ast_format_copy(&original->rawreadformat, &tmp_format);
- ast_format_copy(&clonechan->rawreadformat, &original->rawreadformat);
- ast_format_copy(&tmp_format, &clonechan->rawreadformat);
-
- ast_format_copy(&original->rawwriteformat, &tmp_format);
- ast_format_copy(&clonechan->rawwriteformat, &original->rawwriteformat);
- ast_format_copy(&tmp_format, &clonechan->rawwriteformat);
+ ast_format_copy(&tmp_format, &original->rawreadformat);
+ ast_format_copy(&original->rawreadformat, &clonechan->rawreadformat);
+ ast_format_copy(&clonechan->rawreadformat, &tmp_format);
+
+ ast_format_copy(&tmp_format, &original->rawwriteformat);
+ ast_format_copy(&original->rawwriteformat, &clonechan->rawwriteformat);
+ ast_format_copy(&clonechan->rawwriteformat, &tmp_format);
clonechan->_softhangup = AST_SOFTHANGUP_DEV;
@@ -7400,8 +7400,8 @@
ast_cap_remove_all(o0nativeformats);
ast_cap_remove_all(o0nativeformats);
- ast_cap_append(c0->nativeformats, o0nativeformats);
- ast_cap_append(c1->nativeformats, o1nativeformats);
+ ast_cap_append(o0nativeformats, c0->nativeformats);
+ ast_cap_append(o1nativeformats, c1->nativeformats);
}
update_bridge_vars(c0, c1);
@@ -7511,7 +7511,7 @@
if (!(ts = ast_calloc(1, sizeof(*ts))))
return NULL;
- ast_format_copy(&chan->writeformat, &ts->origwfmt);
+ ast_format_copy(&ts->origwfmt, &chan->writeformat);
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);
tonepair_release(NULL, ts);
@@ -7940,7 +7940,7 @@
return NULL;
}
- ast_format_copy(&chan->writeformat, &state->old_write_format);
+ ast_format_copy(&state->old_write_format, &chan->writeformat);
if (ast_set_write_format_by_id(chan, AST_FORMAT_SLINEAR) < 0) {
ast_log(LOG_ERROR, "Could not set write format to SLINEAR\n");
Modified: team/dvossel/fixtheworld_phase1_step3/main/file.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/file.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/file.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/file.c Thu Jan 13 16:01:45 2011
@@ -188,7 +188,7 @@
fs->fmt->name, ast_getformatname(&f->subclass.format));
else {
struct ast_frame *trf;
- ast_format_copy(&f->subclass.format, &fs->lastwriteformat);
+ ast_format_copy(&fs->lastwriteformat, &f->subclass.format);
/* Get the translated frame but don't consume the original in case they're using it on another stream */
if ((trf = ast_translate(fs->trans, f, 0))) {
struct ast_frame *cur;
@@ -677,7 +677,7 @@
}
/* Set the channel to a format we can work with and save off the previous format. */
- ast_format_copy(&chan->writeformat, &chan->oldwriteformat);
+ ast_format_copy(&chan->oldwriteformat, &chan->writeformat);
/* Set the channel to the best format that exists for the file. */
res = ast_set_write_format_from_cap(chan, file_fmt_cap);
/* don't need this anymore now that the channel's write format is set. */
Modified: team/dvossel/fixtheworld_phase1_step3/main/format.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/format.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/format.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/format.c Thu Jan 13 16:01:45 2011
@@ -71,7 +71,7 @@
ast_rwlock_destroy(&wrapper->wraplock);
}
-void ast_format_copy(const struct ast_format *src, struct ast_format *dst)
+void ast_format_copy(struct ast_format *dst, const struct ast_format *src)
{
memcpy(dst, src, sizeof(struct ast_format));
}
@@ -378,7 +378,7 @@
return 0;
}
-struct ast_format *ast_format_from_iax2(uint64_t src, struct ast_format *dst)
+struct ast_format *ast_format_from_iax2(struct ast_format *dst, uint64_t src)
{
switch (src) {
/*! G.723.1 compression */
Modified: team/dvossel/fixtheworld_phase1_step3/main/format_cap.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/format_cap.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/format_cap.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/format_cap.c Thu Jan 13 16:01:45 2011
@@ -98,7 +98,7 @@
if (!(fnew = ao2_alloc(sizeof(struct ast_format), NULL))) {
return;
}
- ast_format_copy(format, fnew);
+ ast_format_copy(fnew, format);
ao2_link(cap->formats, fnew);
ao2_ref(fnew, -1);
}
@@ -129,7 +129,7 @@
}
}
-void ast_cap_append(const struct ast_cap *src, struct ast_cap *dst)
+void ast_cap_append(struct ast_cap *dst, const struct ast_cap *src)
{
struct ast_format tmp_fmt;
struct ast_cap *tmp_cap = (struct ast_cap *) src;
@@ -470,7 +470,7 @@
if (!tmp) {
return -1;
}
- ast_format_copy(tmp, format);
+ ast_format_copy(format, tmp);
ao2_ref(tmp, -1);
return 0;
@@ -491,7 +491,7 @@
return res;
}
-void ast_cap_from_iax2(uint64_t src, struct ast_cap *dst)
+void ast_cap_from_iax2(struct ast_cap *dst, uint64_t src)
{
uint64_t tmp = 0;
int x;
@@ -500,7 +500,7 @@
for (x = 0; x < 64; x++) {
tmp = (1ULL << x);
if (tmp & src) {
- ast_cap_add(dst, ast_format_from_iax2(tmp, &tmp_format));
- }
- }
-}
+ ast_cap_add(dst, ast_format_from_iax2(&tmp_format, tmp));
+ }
+ }
+}
Modified: team/dvossel/fixtheworld_phase1_step3/main/format_pref.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/format_pref.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/format_pref.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/format_pref.c Thu Jan 13 16:01:45 2011
@@ -95,7 +95,7 @@
struct ast_format *ast_codec_pref_index(struct ast_codec_pref *pref, int idx, struct ast_format *result)
{
if ((idx >= 0) && (idx < sizeof(pref->order)) && pref->formats[idx].id) {
- ast_format_copy(&pref->formats[idx], result);
+ ast_format_copy(result, &pref->formats[idx]);
} else {
return NULL;
}
@@ -122,7 +122,7 @@
break;
if (f_list[oldorder.order[x]-1].id != format->id) {
pref->order[y] = oldorder.order[x];
- ast_format_copy(&oldorder.formats[x], &pref->formats[y]);
+ ast_format_copy(&pref->formats[y], &oldorder.formats[x]);
pref->framing[y++] = oldorder.framing[x];
}
}
@@ -148,7 +148,7 @@
for (x = 0; x < f_len; x++) {
if (!pref->order[x]) {
pref->order[x] = newindex;
- ast_format_copy(format, &pref->formats[x]);
+ ast_format_copy(&pref->formats[x], format);
break;
}
}
@@ -189,13 +189,13 @@
for (; x > 0; x--) {
pref->order[x] = pref->order[x - 1];
pref->framing[x] = pref->framing[x - 1];
- ast_format_copy(&pref->formats[x - 1], &pref->formats[x]);
+ ast_format_copy(&pref->formats[x], &pref->formats[x - 1]);
}
/* And insert the new entry */
pref->order[0] = newindex;
pref->framing[0] = 0; /* ? */
- ast_format_copy(format, &pref->formats[0]);
+ ast_format_copy(&pref->formats[0], format);
}
/*! \brief Set packet size for codec */
@@ -299,7 +299,7 @@
}
}
if (found && (AST_FORMAT_GET_TYPE(tmp_fmt.id) == AST_FORMAT_TYPE_AUDIO)) {
- ast_format_copy(&tmp_fmt, result);
+ ast_format_copy(result, &tmp_fmt);
return result;
}
Modified: team/dvossel/fixtheworld_phase1_step3/main/frame.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/frame.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/frame.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/frame.c Thu Jan 13 16:01:45 2011
@@ -208,7 +208,7 @@
return -1;
}
if (!s->format.id) {
- ast_format_copy(&f->subclass.format, &s->format);
+ ast_format_copy(&s->format, &f->subclass.format);
s->samplesperbyte = (float)f->samples / (float)f->datalen;
} else if (ast_format_cmp(&s->format, &f->subclass.format) == AST_FORMAT_CMP_NOT_EQUAL) {
ast_log(LOG_WARNING, "Smoother was working on %s format frames, now trying to feed %s?\n",
@@ -263,7 +263,7 @@
len = s->len;
/* Make frame */
s->f.frametype = AST_FRAME_VOICE;
- ast_format_copy(&s->format, &s->f.subclass.format);
+ ast_format_copy(&s->f.subclass.format, &s->format);
s->f.data.ptr = s->framedata + AST_FRIENDLY_OFFSET;
s->f.offset = AST_FRIENDLY_OFFSET;
s->f.datalen = len;
@@ -408,7 +408,7 @@
return NULL;
}
out->frametype = fr->frametype;
- ast_format_copy(&fr->subclass.format, &out->subclass.format);
+ ast_format_copy(&out->subclass.format, &fr->subclass.format);
out->datalen = fr->datalen;
out->samples = fr->samples;
out->offset = fr->offset;
@@ -515,7 +515,7 @@
}
out->frametype = f->frametype;
- ast_format_copy(&f->subclass.format, &out->subclass.format);
+ ast_format_copy(&out->subclass.format, &f->subclass.format);
out->datalen = f->datalen;
out->samples = f->samples;
out->delivery = f->delivery;
Modified: team/dvossel/fixtheworld_phase1_step3/main/indications.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/indications.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/indications.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/indications.c Thu Jan 13 16:01:45 2011
@@ -147,7 +147,7 @@
return NULL;
}
- ast_format_copy(&chan->writeformat, &ps->origwfmt);
+ ast_format_copy(&ps->origwfmt, &chan->writeformat);
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);
Modified: team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/rtp_engine.c Thu Jan 13 16:01:45 2011
@@ -502,7 +502,7 @@
codecs->payloads[i].asterisk_format = static_RTP_PT[i].asterisk_format;
codecs->payloads[i].rtp_code = static_RTP_PT[i].rtp_code;
- ast_format_copy(&static_RTP_PT[i].format, &codecs->payloads[i].format);
+ ast_format_copy(&codecs->payloads[i].format, &static_RTP_PT[i].format);
if (instance && instance->engine && instance->engine->payload_set) {
instance->engine->payload_set(instance, i, codecs->payloads[i].asterisk_format, &codecs->payloads[i].format, codecs->payloads[i].rtp_code);
}
@@ -519,7 +519,7 @@
ast_debug(2, "Copying payload %d from %p to %p\n", i, src, dest);
dest->payloads[i].asterisk_format = src->payloads[i].asterisk_format;
dest->payloads[i].rtp_code = src->payloads[i].rtp_code;
- ast_format_copy(&src->payloads[i].format, &dest->payloads[i].format);
+ ast_format_copy(&dest->payloads[i].format, &src->payloads[i].format);
if (instance && instance->engine && instance->engine->payload_set) {
instance->engine->payload_set(instance, i, dest->payloads[i].asterisk_format, &dest->payloads[i].format, dest->payloads[i].rtp_code);
}
@@ -535,7 +535,7 @@
codecs->payloads[payload].asterisk_format = static_RTP_PT[payload].asterisk_format;
codecs->payloads[payload].rtp_code = static_RTP_PT[payload].rtp_code;
- ast_format_copy(&static_RTP_PT[payload].format, &codecs->payloads[payload].format);
+ ast_format_copy(&codecs->payloads[payload].format, &static_RTP_PT[payload].format);
ast_debug(1, "Setting payload %d based on m type on %p\n", payload, codecs);
@@ -623,7 +623,7 @@
result.asterisk_format = codecs->payloads[payload].asterisk_format;
result.rtp_code = codecs->payloads[payload].rtp_code;
- ast_format_copy(&codecs->payloads[payload].format, &result.format);
+ ast_format_copy(&result.format, &codecs->payloads[payload].format);
if (!result.rtp_code && !result.asterisk_format) {
result = static_RTP_PT[payload];
@@ -1143,7 +1143,7 @@
ast_sockaddr_copy(&vac1, &vt1);
ast_sockaddr_copy(&tac1, &tt1);
ast_cap_remove_all(oldcap1);
- ast_cap_append(cap1, oldcap1);
+ ast_cap_append(oldcap1, cap1);
}
if ((ast_sockaddr_cmp(&t0, &ac0)) ||
(vinstance0 && ast_sockaddr_cmp(&vt0, &vac0)) ||
@@ -1166,7 +1166,7 @@
ast_sockaddr_copy(&vac0, &vt0);
ast_sockaddr_copy(&tac0, &tt0);
ast_cap_remove_all(oldcap0);
- ast_cap_append(cap0, oldcap0);
+ ast_cap_append(oldcap0, cap0);
}
/* Wait for frame to come in on the channels */
@@ -1223,14 +1223,14 @@
ast_cap_remove_all(cap0);
ast_cap_remove_all(oldcap0);
glue0->get_codec(c0, cap0);
- ast_cap_append(cap0, oldcap0);
+ ast_cap_append(oldcap0, cap0);
}
if (glue1->get_codec && c1->tech_pvt) {
ast_cap_remove_all(cap1);
ast_cap_remove_all(oldcap1);
glue0->get_codec(c1, cap1);
- ast_cap_append(cap1, oldcap1);
+ ast_cap_append(oldcap1, cap1);
}
ast_indicate_data(other, fr->subclass.integer, fr->data.ptr, fr->datalen);
ast_frfree(fr);
Modified: team/dvossel/fixtheworld_phase1_step3/main/slinfactory.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/slinfactory.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/slinfactory.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/slinfactory.c Thu Jan 13 16:01:45 2011
@@ -97,7 +97,7 @@
ast_getformatname(&sf->output_format));
return 0;
}
- ast_format_copy(&f->subclass.format, &sf->format);
+ ast_format_copy(&sf->format, &f->subclass.format);
}
if (!(begin_frame = ast_translate(sf->trans, f, 0))) {
Modified: team/dvossel/fixtheworld_phase1_step3/main/translate.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/main/translate.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/main/translate.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/main/translate.c Thu Jan 13 16:01:45 2011
@@ -379,7 +379,7 @@
}
f->frametype = AST_FRAME_VOICE;
- ast_format_copy(&pvt->t->dst_format, &f->subclass.format);
+ ast_format_copy(&f->subclass.format, &pvt->t->dst_format);
f->mallocd = 0;
f->offset = AST_FRIENDLY_OFFSET;
f->src = pvt->t->name;
@@ -1172,12 +1172,12 @@
while (!ast_cap_iter_next(joint_cap, &tmp_fmt)) {
/* We are guaranteed to find one common format. */
if (!best.id) {
- ast_format_copy(&tmp_fmt, &best);
+ ast_format_copy(&best, &tmp_fmt);
continue;
}
/* If there are multiple common formats, pick the one with the highest sample rate */
if (ast_format_rate(&best) < ast_format_rate(&tmp_fmt)) {
- ast_format_copy(&tmp_fmt, &best);
+ ast_format_copy(&best, &tmp_fmt);
continue;
}
@@ -1185,8 +1185,8 @@
ast_cap_iter_end(joint_cap);
/* We are done, this is a common format to both. */
- ast_format_copy(&best, dst_fmt_out);
- ast_format_copy(&best, src_fmt_out);
+ ast_format_copy(dst_fmt_out, &best);
+ ast_format_copy(src_fmt_out, &best);
ast_cap_destroy(joint_cap);
return 0;
} else { /* No, we will need to translate */
@@ -1208,8 +1208,8 @@
}
if ((matrix_get(x, y)->table_cost < besttablecost || matrix_get(x, y)->multistep < beststeps)) {
/* better than what we have so far */
- ast_format_copy(&cur_src, &best);
- ast_format_copy(&cur_dst, &bestdst);
+ ast_format_copy(&best, &cur_src);
+ ast_format_copy(&bestdst, &cur_dst);
besttablecost = matrix_get(x, y)->table_cost;
beststeps = matrix_get(x, y)->multistep;
}
@@ -1220,8 +1220,8 @@
ast_cap_iter_end(dst_cap);
AST_RWLIST_UNLOCK(&translators);
if (best.id) {
- ast_format_copy(&bestdst, dst_fmt_out);
- ast_format_copy(&best, src_fmt_out);
+ ast_format_copy(dst_fmt_out, &bestdst);
+ ast_format_copy(src_fmt_out, &best);
return 0;
}
return -1;
@@ -1259,7 +1259,7 @@
int src_video = 0;
int index;
ast_cap_remove_all(result);
- ast_cap_append(dest, result);
+ ast_cap_append(result, dest);
/* if we don't have a source format, we just have to try all
possible destination formats */
Modified: team/dvossel/fixtheworld_phase1_step3/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/res/res_rtp_asterisk.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/res/res_rtp_asterisk.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/res/res_rtp_asterisk.c Thu Jan 13 16:01:45 2011
@@ -1226,7 +1226,7 @@
}
/* Grab the subclass and look up the payload we are going to use */
- ast_format_copy(&frame->subclass.format, &subclass);
+ ast_format_copy(&subclass, &frame->subclass.format);
if ((codec = ast_rtp_codecs_payload_code(ast_rtp_instance_get_codecs(instance), 1, &subclass, 0)) < 0) {
ast_log(LOG_WARNING, "Don't know how to send format %s packets with RTP\n", ast_getformatname(&frame->subclass.format));
return -1;
@@ -1236,7 +1236,7 @@
if (ast_format_cmp(&rtp->lasttxformat, &subclass) == AST_FORMAT_CMP_NOT_EQUAL) {
ast_debug(1, "Ooh, format changed from %s to %s\n", ast_getformatname(&rtp->lasttxformat), ast_getformatname(&subclass));
rtp->lasttxformat = subclass;
- ast_format_copy(&subclass, &rtp->lasttxformat);
+ ast_format_copy(&rtp->lasttxformat, &subclass);
if (rtp->smoother) {
ast_smoother_free(rtp->smoother);
rtp->smoother = NULL;
@@ -2204,8 +2204,8 @@
return &ast_null_frame;
}
- ast_format_copy(&payload.format, &rtp->lastrxformat);
- ast_format_copy(&payload.format, &rtp->f.subclass.format);
+ ast_format_copy(&rtp->lastrxformat, &payload.format);
+ ast_format_copy(&rtp->f.subclass.format, &payload.format);
rtp->f.frametype = (AST_FORMAT_GET_TYPE(rtp->f.subclass.format.id) == AST_FORMAT_TYPE_AUDIO) ? AST_FRAME_VOICE : (AST_FORMAT_GET_TYPE(rtp->f.subclass.format.id) == AST_FORMAT_TYPE_VIDEO) ? AST_FRAME_VIDEO : AST_FRAME_TEXT;
rtp->rxseqno = seqno;
Modified: team/dvossel/fixtheworld_phase1_step3/tests/test_format_api.c
URL: http://svnview.digium.com/svn/asterisk/team/dvossel/fixtheworld_phase1_step3/tests/test_format_api.c?view=diff&rev=301777&r1=301776&r2=301777
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/tests/test_format_api.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/tests/test_format_api.c Thu Jan 13 16:01:45 2011
@@ -529,7 +529,7 @@
ast_cap_iter_end(cap_joint);
/* test append */
- ast_cap_append(cap1, cap_joint);
+ ast_cap_append(cap_joint, cap1);
ast_cap_iter_start(cap1);
while (!(ast_cap_iter_next(cap1, &tmpformat))) {
if (!ast_cap_iscompatible(cap_joint, &tmpformat)) {
More information about the asterisk-commits
mailing list