[asterisk-commits] oej: branch oej/videocaps r103762 - in /team/oej/videocaps: channels/ include...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 18 09:24:24 CST 2008


Author: oej
Date: Mon Feb 18 09:24:23 2008
New Revision: 103762

URL: http://svn.digium.com/view/asterisk?view=rev&rev=103762
Log:
Make sure that we avoid a situation where we set payload type H263 for T140 and T140/RED offers that 
use conflicting payload numbers. Previously, we got report that the text RTP had H264 video support. 

Well, there are pieces of software out there that convert a video to ASCII art, but it's not
ready for the text stream yet...

- Also, add T140RED (patch coming soon)


Modified:
    team/oej/videocaps/channels/chan_sip.c
    team/oej/videocaps/include/asterisk/frame.h
    team/oej/videocaps/main/rtp.c

Modified: team/oej/videocaps/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/channels/chan_sip.c?view=diff&rev=103762&r1=103761&r2=103762
==============================================================================
--- team/oej/videocaps/channels/chan_sip.c (original)
+++ team/oej/videocaps/channels/chan_sip.c Mon Feb 18 09:24:23 2008
@@ -6879,6 +6879,23 @@
 				if (p->trtp) {
 					/* ast_verbose("Adding t140 mimeSubtype to textrtp struct\n"); */
 					ast_rtp_set_rtpmap_type(newtextrtp, codec, "text", mimeSubtype, 0);
+				} else {	/* We got T.140, but haven't got textsupport on, so remove it from declaration */
+					ast_rtp_unset_m_type(newtextrtp, codec);
+					if (debug) 
+						ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
+				}
+			} else if (!strncasecmp(mimeSubtype, "RED", 3)) { /* Text */
+				ast_debug(2, "***** FOUND setting T140 red mime type!!! \n");
+				if (p->trtp) {
+
+					/* ast_verbose("Adding t140-red mimeSubtype to textrtp struct\n"); */
+					int res = ast_rtp_set_rtpmap_type(newtextrtp, codec, "text", mimeSubtype, 0);
+					if (!res)
+						ast_debug(2, "***** FAILED setting T140 red mime type!!! \n");
+				} else {	/* We got RED, but haven't got textsupport on, so remove it from declaration */
+					ast_rtp_unset_m_type(newtextrtp, codec);
+					if (debug) 
+						ast_verbose("Found unknown media description format %s for ID %d\n", mimeSubtype, codec);
 				}
 			} else {                                          /* Must be audio?? */
 				if(ast_rtp_set_rtpmap_type(newaudiortp, codec, "audio", mimeSubtype,

Modified: team/oej/videocaps/include/asterisk/frame.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/frame.h?view=diff&rev=103762&r1=103761&r2=103762
==============================================================================
--- team/oej/videocaps/include/asterisk/frame.h (original)
+++ team/oej/videocaps/include/asterisk/frame.h Mon Feb 18 09:24:23 2008
@@ -271,6 +271,8 @@
 #define AST_FORMAT_VIDEO_MASK   (((1 << 25)-1) & ~(AST_FORMAT_AUDIO_MASK))
 /*! T.140 Text format - ITU T.140, RFC 4351*/
 #define AST_FORMAT_T140		(1 << 25)
+/*! T.140 Text format with RTP redundant packets - ITU T.140, RFC 4351*/
+#define AST_FORMAT_T140RED	(1 << 26)
 #define AST_FORMAT_TEXT_MASK   (((1 << 30)-1) & ~(AST_FORMAT_AUDIO_MASK) & ~(AST_FORMAT_VIDEO_MASK))
 
 

Modified: team/oej/videocaps/main/rtp.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/main/rtp.c?view=diff&rev=103762&r1=103761&r2=103762
==============================================================================
--- team/oej/videocaps/main/rtp.c (original)
+++ team/oej/videocaps/main/rtp.c Mon Feb 18 09:24:23 2008
@@ -1670,6 +1670,7 @@
 	{{1, AST_FORMAT_H264}, "video", "H264"},
 	{{1, AST_FORMAT_MP4_VIDEO}, "video", "MP4V-ES"},
 	{{1, AST_FORMAT_T140}, "text", "T140"},
+	{{1, AST_FORMAT_T140RED}, "text", "RED"},
 };
 
 /*! 
@@ -1711,6 +1712,7 @@
 	[102] = {1, AST_FORMAT_T140},	/* Real time text chat */
 	[103] = {1, AST_FORMAT_H263_PLUS},
 	[104] = {1, AST_FORMAT_MP4_VIDEO},
+	[105] = {1, AST_FORMAT_T140RED},	/* Real time text chat */
 	[110] = {1, AST_FORMAT_SPEEX},
 	[111] = {1, AST_FORMAT_G726},
 	[112] = {1, AST_FORMAT_G726_AAL2},
@@ -2007,6 +2009,8 @@
 	}
 
 	rtp_bridge_unlock(rtp);
+	if (found)
+		ast_debug(3, "------- Payload %s/%s code %d Format %s\n", mimeType, mimeSubtype, pt, ast_getformatname(rtp->current_RTP_PT[pt].code));
 
 	return (found ? 0 : -1);
 } 




More information about the asterisk-commits mailing list