[svn-commits] mvanbaak: branch mvanbaak/ast_frame_dataunion r117245 - /team/mvanbaak/ast_fr...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Mon May 19 16:31:47 CDT 2008


Author: mvanbaak
Date: Mon May 19 16:31:46 2008
New Revision: 117245

URL: http://svn.digium.com/view/asterisk?view=rev&rev=117245
Log:
make channels/ compile again after the ast_frame.data => ast_frame.data.ptr change

Modified:
    team/mvanbaak/ast_frame_dataunion/channels/chan_alsa.c
    team/mvanbaak/ast_frame_dataunion/channels/chan_iax2.c
    team/mvanbaak/ast_frame_dataunion/channels/chan_local.c
    team/mvanbaak/ast_frame_dataunion/channels/chan_oss.c
    team/mvanbaak/ast_frame_dataunion/channels/chan_phone.c
    team/mvanbaak/ast_frame_dataunion/channels/chan_sip.c
    team/mvanbaak/ast_frame_dataunion/channels/chan_zap.c
    team/mvanbaak/ast_frame_dataunion/channels/iax2-parser.c

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_alsa.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_alsa.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_alsa.c Mon May 19 16:31:46 2008
@@ -377,7 +377,7 @@
 		ast_log(LOG_WARNING, "Frame too large\n");
 		res = -1;
 	} else {
-		memcpy(sizbuf + sizpos, f->data, f->datalen);
+		memcpy(sizbuf + sizpos, f->data.ptr, f->datalen);
 		len += f->datalen;
 		pos = 0;
 		state = snd_pcm_state(alsa.ocard);
@@ -426,7 +426,7 @@
 	f.subclass = 0;
 	f.samples = 0;
 	f.datalen = 0;
-	f.data = NULL;
+	f.data.ptr = NULL;
 	f.offset = 0;
 	f.src = "Console";
 	f.mallocd = 0;
@@ -471,7 +471,7 @@
 		f.subclass = AST_FORMAT_SLINEAR;
 		f.samples = FRAME_SIZE;
 		f.datalen = FRAME_SIZE * 2;
-		f.data = buf;
+		f.data.ptr = buf;
 		f.offset = AST_FRIENDLY_OFFSET;
 		f.src = "Console";
 		f.mallocd = 0;
@@ -718,14 +718,14 @@
 		}
 
 		text2send[strlen(text2send) - 1] = '\n';
-		f.data = text2send;
+		f.data.ptr = text2send;
 		f.datalen = strlen(text2send) + 1;
 		grab_owner();
 		if (alsa.owner) {
 			ast_queue_frame(alsa.owner, &f);
 			f.frametype = AST_FRAME_CONTROL;
 			f.subclass = AST_CONTROL_ANSWER;
-			f.data = NULL;
+			f.data.ptr = NULL;
 			f.datalen = 0;
 			ast_queue_frame(alsa.owner, &f);
 			ast_channel_unlock(alsa.owner);

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_iax2.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_iax2.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_iax2.c Mon May 19 16:31:46 2008
@@ -3030,7 +3030,7 @@
 
 static int iax2_sendimage(struct ast_channel *c, struct ast_frame *img)
 {
-	return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass, 0, img->data, img->datalen, -1);
+	return send_command_locked(PTR_TO_CALLNO(c->tech_pvt), AST_FRAME_IMAGE, img->subclass, 0, img->data.ptr, img->datalen, -1);
 }
 
 static int iax2_sendhtml(struct ast_channel *c, int subclass, const char *data, int datalen)
@@ -4418,7 +4418,7 @@
 			tpeer->trunkdatalen += sizeof(struct ast_iax2_meta_trunk_entry);
 		}
 		/* Copy actual trunk data */
-		memcpy(ptr, f->data, f->datalen);
+		memcpy(ptr, f->data.ptr, f->datalen);
 		tpeer->trunkdatalen += f->datalen;
 
 		tpeer->calls++;
@@ -4698,7 +4698,7 @@
 		else
 			fr->oseqno = pvt->oseqno++;
 		fr->iseqno = pvt->iseqno;
-		fh = (struct ast_iax2_full_hdr *)(fr->af.data - sizeof(struct ast_iax2_full_hdr));
+		fh = (struct ast_iax2_full_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_full_hdr));
 		fh->scallno = htons(fr->callno | IAX_FLAG_FULL);
 		fh->ts = htonl(fr->ts);
 		fh->oseqno = fr->oseqno;
@@ -4763,7 +4763,7 @@
 			/* Video frame have no sequence number */
 			fr->oseqno = -1;
 			fr->iseqno = -1;
-			vh = (struct ast_iax2_video_hdr *)(fr->af.data - sizeof(struct ast_iax2_video_hdr));
+			vh = (struct ast_iax2_video_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_video_hdr));
 			vh->zeros = 0;
 			vh->callno = htons(0x8000 | fr->callno);
 			vh->ts = htons((fr->ts & 0x7FFF) | (fr->af.subclass & 0x1 ? 0x8000 : 0));
@@ -4779,7 +4779,7 @@
 			fr->oseqno = -1;
 			fr->iseqno = -1;
 			/* Mini frame will do */
-			mh = (struct ast_iax2_mini_hdr *)(fr->af.data - sizeof(struct ast_iax2_mini_hdr));
+			mh = (struct ast_iax2_mini_hdr *)(fr->af.data.ptr - sizeof(struct ast_iax2_mini_hdr));
 			mh->callno = htons(fr->callno);
 			mh->ts = htons(fr->ts & 0xFFFF);
 			fr->datalen = fr->af.datalen + sizeof(struct ast_iax2_mini_hdr);
@@ -5666,7 +5666,7 @@
 	f.subclass = command;
 	f.datalen = datalen;
 	f.src = __FUNCTION__;
-	f.data = (void *) data;
+	f.data.ptr = (void *) data;
 
 	return iax2_send(i, &f, ts, seqno, now, transfer, final, media);
 }
@@ -7810,9 +7810,9 @@
 			f.datalen = len;
 			if (f.datalen >= 0) {
 				if (f.datalen)
-					f.data = ptr;
+					f.data.ptr = ptr;
 				else
-					f.data = NULL;
+					f.data.ptr = NULL;
 				if (trunked_ts)
 					fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | (trunked_ts & 0xffff);
 				else
@@ -8217,15 +8217,15 @@
 					ast_mutex_unlock(&iaxsl[fr->callno]);
 					return 1;
 				}
-				f.data = NULL;
+				f.data.ptr = NULL;
 				f.datalen = 0;
 			} else
-				f.data = thread->buf + sizeof(*fh);
+				f.data.ptr = thread->buf + sizeof(*fh);
 		} else {
 			if (f.frametype == AST_FRAME_IAX)
-				f.data = NULL;
+				f.data.ptr = NULL;
 			else
-				f.data = empty;
+				f.data.ptr = empty;
 			memset(&ies, 0, sizeof(ies));
 		}
 
@@ -9421,9 +9421,9 @@
 		}
 		f.datalen = res - sizeof(*vh);
 		if (f.datalen)
-			f.data = thread->buf + sizeof(*vh);
+			f.data.ptr = thread->buf + sizeof(*vh);
 		else
-			f.data = NULL;
+			f.data.ptr = NULL;
 #ifdef IAXTESTS
 		if (test_resync) {
 			fr->ts = (iaxs[fr->callno]->last & 0xFFFF8000L) | ((ntohs(vh->ts) + test_resync) & 0x7fff);
@@ -9448,9 +9448,9 @@
 			return 1;
 		}
 		if (f.datalen)
-			f.data = thread->buf + sizeof(*mh);
+			f.data.ptr = thread->buf + sizeof(*mh);
 		else
-			f.data = NULL;
+			f.data.ptr = NULL;
 #ifdef IAXTESTS
 		if (test_resync) {
 			fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | ((ntohs(mh->ts) + test_resync) & 0xffff);

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_local.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_local.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_local.c Mon May 19 16:31:46 2008
@@ -396,7 +396,7 @@
 		ast_mutex_lock(&p->lock);
 		isoutbound = IS_OUTBOUND(ast, p);
 		f.subclass = condition;
-		f.data = (void*)data;
+		f.data.ptr = (void*)data;
 		f.datalen = datalen;
 		if (!(res = local_queue_frame(p, isoutbound, &f, ast, 1)))
 			ast_mutex_unlock(&p->lock);
@@ -456,7 +456,7 @@
 
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
-	f.data = (char *) text;
+	f.data.ptr = (char *) text;
 	f.datalen = strlen(text) + 1;
 	if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
 		ast_mutex_unlock(&p->lock);
@@ -476,7 +476,7 @@
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
 	f.subclass = subclass;
-	f.data = (char *)data;
+	f.data.ptr = (char *)data;
 	f.datalen = datalen;
 	if (!(res = local_queue_frame(p, isoutbound, &f, ast, 0)))
 		ast_mutex_unlock(&p->lock);
@@ -537,7 +537,7 @@
 {
 	struct local_pvt *p = ast->tech_pvt;
 	int isoutbound;
-	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, data.uint32 = ast->hangupcause };
+	struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_HANGUP, .data.uint32 = ast->hangupcause };
 	struct ast_channel *ochan = NULL;
 	int glaredetect = 0, res = 0;
 

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_oss.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_oss.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_oss.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_oss.c Mon May 19 16:31:46 2008
@@ -679,13 +679,13 @@
 		int l = sizeof(o->oss_write_buf) - o->oss_write_dst;
 
 		if (f->datalen - src >= l) {	/* enough to fill a frame */
-			memcpy(o->oss_write_buf + o->oss_write_dst, f->data + src, l);
+			memcpy(o->oss_write_buf + o->oss_write_dst, f->data.ptr + src, l);
 			soundcard_writeframe(o, (short *) o->oss_write_buf);
 			src += l;
 			o->oss_write_dst = 0;
 		} else {				/* copy residue */
 			l = f->datalen - src;
-			memcpy(o->oss_write_buf + o->oss_write_dst, f->data + src, l);
+			memcpy(o->oss_write_buf + o->oss_write_dst, f->data.ptr + src, l);
 			src += l;			/* but really, we are done */
 			o->oss_write_dst += l;
 		}
@@ -724,10 +724,10 @@
 	f->subclass = AST_FORMAT_SLINEAR;
 	f->samples = FRAME_SIZE;
 	f->datalen = FRAME_SIZE * 2;
-	f->data = o->oss_read_buf + AST_FRIENDLY_OFFSET;
+	f->data.ptr = o->oss_read_buf + AST_FRIENDLY_OFFSET;
 	if (o->boost != BOOST_SCALE) {	/* scale and clip values */
 		int i, x;
-		int16_t *p = (int16_t *) f->data;
+		int16_t *p = (int16_t *) f->data.ptr;
 		for (i = 0; i < f->samples; i++) {
 			x = (p[i] * o->boost) / BOOST_SCALE;
 			if (x > 32767)
@@ -1012,7 +1012,7 @@
 		buf[i] = '\n';
 		f.frametype = AST_FRAME_TEXT;
 		f.subclass = 0;
-		f.data = buf;
+		f.data.ptr = buf;
 		f.datalen = i + 1;
 		ast_queue_frame(o->owner, &f);
 	}

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_phone.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_phone.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_phone.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_phone.c Mon May 19 16:31:46 2008
@@ -494,7 +494,7 @@
 	/* Some nice norms */
 	p->fr.datalen = 0;
 	p->fr.samples = 0;
-	p->fr.data =  NULL;
+	p->fr.data.ptr =  NULL;
 	p->fr.src = "Phone";
 	p->fr.offset = 0;
 	p->fr.mallocd=0;
@@ -553,7 +553,7 @@
 	/* Some nice norms */
 	p->fr.datalen = 0;
 	p->fr.samples = 0;
-	p->fr.data =  NULL;
+	p->fr.data.ptr =  NULL;
 	p->fr.src = "Phone";
 	p->fr.offset = 0;
 	p->fr.mallocd=0;
@@ -575,7 +575,7 @@
 		ast_log(LOG_WARNING, "Error reading: %s\n", strerror(errno));
 		return NULL;
 	}
-	p->fr.data = p->buf;
+	p->fr.data.ptr = p->buf;
 	if (p->mode != MODE_FXS)
 	switch(p->buf[0] & 0x3) {
 	case '0':
@@ -797,7 +797,7 @@
 	}
 	/* If we get here, we have a frame of Appropriate data */
 	sofar = 0;
-	pos = frame->data;
+	pos = frame->data.ptr;
 	while(sofar < frame->datalen) {
 		/* Write in no more than maxfr sized frames */
 		expected = frame->datalen - sofar;
@@ -808,7 +808,7 @@
 		if (frame->datalen == 4) {
 			if (p->silencesupression) {
 				memset(tmpbuf + 4, 0, sizeof(tmpbuf) - 4);
-				memcpy(tmpbuf, frame->data, 4);
+				memcpy(tmpbuf, frame->data.ptr, 4);
 				expected = 24;
 				res = phone_write_buf(p, tmpbuf, expected, maxfr, 0);
 			}

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_sip.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_sip.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_sip.c Mon May 19 16:31:46 2008
@@ -5832,7 +5832,7 @@
 		f = ast_rtp_read(p->trtp);	/* RTP Text */
 		if (sipdebug_text) {
 			int i;
-			unsigned char* arr = f->data;
+			unsigned char* arr = f->data.ptr;
 			for (i=0; i < f->datalen; i++)
 				ast_verbose("%c", (arr[i] > ' ' && arr[i] < '}') ? arr[i] : '.');
 			ast_verbose(" -> ");
@@ -12055,7 +12055,7 @@
 		f.frametype = AST_FRAME_TEXT;
 		f.subclass = 0;
 		f.offset = 0;
-		f.data = buf;
+		f.data.ptr = buf;
 		f.datalen = strlen(buf);
 		ast_queue_frame(p->owner, &f);
 		transmit_response(p, "202 Accepted", req); /* We respond 202 accepted, since we relay the message */

Modified: team/mvanbaak/ast_frame_dataunion/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/chan_zap.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/chan_zap.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/chan_zap.c Mon May 19 16:31:46 2008
@@ -4306,7 +4306,7 @@
 	p->subs[index].f.mallocd = 0;
 	p->subs[index].f.offset = 0;
 	p->subs[index].f.src = "zt_handle_event";
-	p->subs[index].f.data = NULL;
+	p->subs[index].f.data.ptr = NULL;
 	f = &p->subs[index].f;
 
 	if (index < 0)
@@ -5123,7 +5123,7 @@
 	p->subs[index].f.subclass = 0;
 	p->subs[index].f.delivery = ast_tv(0,0);
 	p->subs[index].f.src = "zt_exception";
-	p->subs[index].f.data = NULL;
+	p->subs[index].f.data.ptr = NULL;
 	
 	
 	if ((!p->owner) && (!(p->radio || (p->oprmode < 0)))) {
@@ -5250,7 +5250,7 @@
 	p->subs[index].f.subclass = 0;
 	p->subs[index].f.delivery = ast_tv(0,0);
 	p->subs[index].f.src = "zt_read";
-	p->subs[index].f.data = NULL;
+	p->subs[index].f.data.ptr = NULL;
 	
 	/* make sure it sends initial key state as first frame */
 	if ((p->radio || (p->oprmode < 0)) && (!p->firstradio))
@@ -5416,9 +5416,9 @@
 			p->subs[index].f.frametype = AST_FRAME_TEXT;
 			p->subs[index].f.mallocd = 0;
 			p->subs[index].f.offset = AST_FRIENDLY_OFFSET;
-			p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET;
+			p->subs[index].f.data.ptr = p->subs[index].buffer + AST_FRIENDLY_OFFSET;
 			p->subs[index].f.datalen = 1;
-			*((char *) p->subs[index].f.data) = c;
+			*((char *) p->subs[index].f.data.ptr) = c;
 			ast_mutex_unlock(&p->lock);
 			return &p->subs[index].f;
 		}
@@ -5452,7 +5452,7 @@
 	p->subs[index].f.samples = READ_SIZE;
 	p->subs[index].f.mallocd = 0;
 	p->subs[index].f.offset = AST_FRIENDLY_OFFSET;
-	p->subs[index].f.data = p->subs[index].buffer + AST_FRIENDLY_OFFSET / sizeof(p->subs[index].buffer[0]);
+	p->subs[index].f.data.ptr = p->subs[index].buffer + AST_FRIENDLY_OFFSET / sizeof(p->subs[index].buffer[0]);
 #if 0
 	ast_debug(1, "Read %d of voice on %s\n", p->subs[index].f.datalen, ast->name);
 #endif	
@@ -5467,7 +5467,7 @@
 		p->subs[index].f.samples = 0;
 		p->subs[index].f.mallocd = 0;
 		p->subs[index].f.offset = 0;
-		p->subs[index].f.data = NULL;
+		p->subs[index].f.data.ptr = NULL;
 		p->subs[index].f.datalen= 0;
 	}
 	if (p->dsp && (!p->ignoredtmf || p->callwaitcas || p->busydetect  || p->callprogress) && !index) {
@@ -5592,7 +5592,7 @@
 		return 0;
 	}
 	/* Return if it's not valid data */
-	if (!frame->data || !frame->datalen)
+	if (!frame->data.ptr || !frame->datalen)
 		return 0;
 
 	if (frame->subclass == AST_FORMAT_SLINEAR) {
@@ -5602,7 +5602,7 @@
 			if (res)
 				ast_log(LOG_WARNING, "Unable to set linear mode on channel %d\n", p->channel);
 		}
-		res = my_zt_write(p, (unsigned char *)frame->data, frame->datalen, index, 1);
+		res = my_zt_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 1);
 	} else {
 		/* x-law already */
 		if (p->subs[index].linear) {
@@ -5611,7 +5611,7 @@
 			if (res)
 				ast_log(LOG_WARNING, "Unable to set companded mode on channel %d\n", p->channel);
 		}
-		res = my_zt_write(p, (unsigned char *)frame->data, frame->datalen, index, 0);
+		res = my_zt_write(p, (unsigned char *)frame->data.ptr, frame->datalen, index, 0);
 	}
 	if (res < 0) {
 		ast_log(LOG_WARNING, "write failed: %s\n", strerror(errno));

Modified: team/mvanbaak/ast_frame_dataunion/channels/iax2-parser.c
URL: http://svn.digium.com/view/asterisk/team/mvanbaak/ast_frame_dataunion/channels/iax2-parser.c?view=diff&rev=117245&r1=117244&r2=117245
==============================================================================
--- team/mvanbaak/ast_frame_dataunion/channels/iax2-parser.c (original)
+++ team/mvanbaak/ast_frame_dataunion/channels/iax2-parser.c Mon May 19 16:31:46 2008
@@ -966,7 +966,7 @@
 	fr->af.src = f->src;
 	fr->af.delivery.tv_sec = 0;
 	fr->af.delivery.tv_usec = 0;
-	fr->af.data = fr->afdata;
+	fr->af.data.ptr = fr->afdata;
 	fr->af.len = f->len;
 	if (fr->af.datalen) {
 		size_t copy_len = fr->af.datalen;
@@ -979,10 +979,10 @@
 		/* We need to byte-swap slinear samples from network byte order */
 		if ((fr->af.frametype == AST_FRAME_VOICE) && (fr->af.subclass == AST_FORMAT_SLINEAR)) {
 			/* 2 bytes / sample for SLINEAR */
-			ast_swapcopy_samples(fr->af.data, f->data, copy_len / 2);
+			ast_swapcopy_samples(fr->af.data.ptr, f->data.ptr, copy_len / 2);
 		} else
 #endif
-			memcpy(fr->af.data, f->data, copy_len);
+			memcpy(fr->af.data.ptr, f->data.ptr, copy_len);
 	}
 }
 




More information about the svn-commits mailing list