[asterisk-commits] rizzo: branch rizzo/video_v2 r85352 - /team/rizzo/video_v2/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 10 12:09:31 CDT 2007


Author: rizzo
Date: Wed Oct 10 12:09:31 2007
New Revision: 85352

URL: http://svn.digium.com/view/asterisk?view=rev&rev=85352
Log:
diagnostics

Modified:
    team/rizzo/video_v2/channels/console_video.c

Modified: team/rizzo/video_v2/channels/console_video.c
URL: http://svn.digium.com/view/asterisk/team/rizzo/video_v2/channels/console_video.c?view=diff&rev=85352&r1=85351&r2=85352
==============================================================================
--- team/rizzo/video_v2/channels/console_video.c (original)
+++ team/rizzo/video_v2/channels/console_video.c Wed Oct 10 12:09:31 2007
@@ -753,7 +753,6 @@
 		/* This frame is up to offset i (not inclusive).
 		 * We do not split it yet even if larger than MTU.
 		 */
-		//ast_log(LOG_WARNING, "frame size %d at %d\n", i - start, start);
 		f = create_video_frame(d + start, d+i, AST_FORMAT_H263,
 				pheader_len, cur);
 
@@ -838,6 +837,7 @@
 	uint8_t h261_hdr[4];
 	uint8_t *h = h261_hdr;	/* shorthand */
 	int sbit = 0, ebit = 0;
+	int nframes = 0;
 
 #define H261_MIN_LEN 10
 	if (len < H261_MIN_LEN)	/* unreasonably small */
@@ -880,7 +880,7 @@
 			/* now we have a GBSC starting somewhere in d[i-1],
 			 * but it might be not byte-aligned. Just remember it.
 			 */
-			if (i > out->mtu)	/* too large, stop now */
+			if (i - start > out->mtu)	/* too large, stop now */
 				break;
 			found_ebit = ebit;
 			found = i;
@@ -890,11 +890,12 @@
 			i = len;
 			ebit = 0;	/* hopefully... should ask the bitstream ? */
 		}
-		if (i > out->mtu && found) {	/* hope the previous one is still ok */
+		if (i - start > out->mtu && found) {	/* hope the previous one is still ok */
 			i = found;
 			ebit = found_ebit;
 		}
-		// ast_log(LOG_WARNING, "found %d of %d/%d\n", i - start, start, len);
+		if (i - start > out->mtu)
+			ast_log(LOG_WARNING, "found %d of %d/%d\n", i - start, start, len);
 		/* This frame is up to offset i (not inclusive).
 		 * We do not split it yet even if larger than MTU.
 		 */
@@ -903,6 +904,7 @@
 
 		if (!f)
 			break;
+		nframes++;
 		/* recompute header with I=0, V=1 */
 		h[0] = ( (sbit & 7) << 5 ) | ( (ebit & 7) << 2 ) | 1;
 		bcopy(h, f->data, 4);	/* copy the h261 header */
@@ -919,6 +921,7 @@
 		cur->subclass |= 1;	// RTP Marker
 
 	*tail = cur;
+	ast_log(LOG_WARNING, "send %d bytes %d frames\n", len, nframes);
 	return first;
 }
 




More information about the asterisk-commits mailing list