[asterisk-commits] dvossel: branch dvossel/fixtheworld_phase1_step3 r303282 - in /team/dvossel/f...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 21 12:48:24 CST 2011


Author: dvossel
Date: Fri Jan 21 12:48:19 2011
New Revision: 303282

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=303282
Log:
fixes an issue in chan_sip and formatting in format.h

Modified:
    team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c
    team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h

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=303282&r1=303281&r2=303282
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c (original)
+++ team/dvossel/fixtheworld_phase1_step3/channels/chan_sip.c Fri Jan 21 12:48:19 2011
@@ -10872,7 +10872,14 @@
 			if (ast_format_cap_iscompatible(alreadysent, &tmp_fmt))
 				continue;
 
-			add_codec_to_sdp(p, &tmp_fmt, &m_audio, &a_audio, debug, &min_audio_packet_size);
+			if (AST_FORMAT_GET_TYPE(tmp_fmt.id) == AST_FORMAT_TYPE_AUDIO) {
+				add_codec_to_sdp(p, &tmp_fmt, &m_audio, &a_audio, debug, &min_audio_packet_size);
+			} else if (needvideo && (AST_FORMAT_GET_TYPE(tmp_fmt.id) == AST_FORMAT_TYPE_VIDEO)) {
+				add_vcodec_to_sdp(p, &tmp_fmt, &m_video, &a_video, debug, &min_video_packet_size);
+			} else if (needtext && (AST_FORMAT_GET_TYPE(tmp_fmt.id) == AST_FORMAT_TYPE_TEXT)) {
+				add_tcodec_to_sdp(p, &tmp_fmt, &m_text, &a_text, debug, &min_text_packet_size);
+			}
+
 			ast_format_cap_add(alreadysent, &tmp_fmt);
 		}
 
@@ -11046,7 +11053,7 @@
 	ast_debug(3, "Done building SDP. Settling with this capability: %s\n", ast_getformatname_multiple(buf, SIPBUFSIZE, capability));
 
 add_sdp_cleanup:
-	ast_format_cap_destroy(alreadysent);
+	alreadysent = ast_format_cap_destroy(alreadysent);
 
 	return res;
 }

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=303282&r1=303281&r2=303282
==============================================================================
--- team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h (original)
+++ team/dvossel/fixtheworld_phase1_step3/include/asterisk/format.h Fri Jan 21 12:48:19 2011
@@ -44,68 +44,68 @@
 
 enum ast_format_id {
 	/*! G.723.1 compression */
-	AST_FORMAT_G723_1			= 1 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_G723_1           = 1 + AST_FORMAT_TYPE_AUDIO,
 	/*! GSM compression */
-	AST_FORMAT_GSM				= 2 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_GSM              = 2 + AST_FORMAT_TYPE_AUDIO,
 	/*! Raw mu-law data (G.711) */
-	AST_FORMAT_ULAW				= 3 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_ULAW             = 3 + AST_FORMAT_TYPE_AUDIO,
 	/*! Raw A-law data (G.711) */
-	AST_FORMAT_ALAW				= 4 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_ALAW             = 4 + AST_FORMAT_TYPE_AUDIO,
 	/*! ADPCM (G.726, 32kbps, AAL2 codeword packing) */
-	AST_FORMAT_G726_AAL2			= 5 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_G726_AAL2        = 5 + AST_FORMAT_TYPE_AUDIO,
 	/*! ADPCM (IMA) */
-	AST_FORMAT_ADPCM				= 6 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_ADPCM            = 6 + AST_FORMAT_TYPE_AUDIO,
 	/*! Raw 16-bit Signed Linear (8000 Hz) PCM */
-	AST_FORMAT_SLINEAR			= 7 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_SLINEAR          = 7 + AST_FORMAT_TYPE_AUDIO,
 	/*! LPC10, 180 samples/frame */
-	AST_FORMAT_LPC10				= 8 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_LPC10            = 8 + AST_FORMAT_TYPE_AUDIO,
 	/*! G.729A audio */
-	AST_FORMAT_G729A				= 9 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_G729A            = 9 + AST_FORMAT_TYPE_AUDIO,
 	/*! SpeeX Free Compression */
-	AST_FORMAT_SPEEX				= 10 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_SPEEX            = 10 + AST_FORMAT_TYPE_AUDIO,
 	/*! iLBC Free Compression */
-	AST_FORMAT_ILBC				= 11 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_ILBC             = 11 + AST_FORMAT_TYPE_AUDIO,
 	/*! ADPCM (G.726, 32kbps, RFC3551 codeword packing) */
-	AST_FORMAT_G726				= 12 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_G726             = 12 + AST_FORMAT_TYPE_AUDIO,
 	/*! G.722 */
-	AST_FORMAT_G722				= 13 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_G722             = 13 + AST_FORMAT_TYPE_AUDIO,
 	/*! G.722.1 (also known as Siren7, 32kbps assumed) */
-	AST_FORMAT_SIREN7			= 14 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_SIREN7           = 14 + AST_FORMAT_TYPE_AUDIO,
 	/*! G.722.1 Annex C (also known as Siren14, 48kbps assumed) */
-	AST_FORMAT_SIREN14			= 15 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_SIREN14          = 15 + AST_FORMAT_TYPE_AUDIO,
 	/*! Raw 16-bit Signed Linear (16000 Hz) PCM */
-	AST_FORMAT_SLINEAR16			= 16 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_SLINEAR16        = 16 + AST_FORMAT_TYPE_AUDIO,
 	/*! G.719 (64 kbps assumed) */
-	AST_FORMAT_G719				= 17 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_G719             = 17 + AST_FORMAT_TYPE_AUDIO,
 	/*! SpeeX Wideband (16kHz) Free Compression */
-	AST_FORMAT_SPEEX16			= 18 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_SPEEX16          = 18 + AST_FORMAT_TYPE_AUDIO,
 	/*! Raw mu-law data (G.711) */
-	AST_FORMAT_TESTLAW			= 19 + AST_FORMAT_TYPE_AUDIO,
+	AST_FORMAT_TESTLAW          = 19 + AST_FORMAT_TYPE_AUDIO,
 
 	/*! H.261 Video */
-	AST_FORMAT_H261				= 1 + AST_FORMAT_TYPE_VIDEO,
+	AST_FORMAT_H261             = 1 + AST_FORMAT_TYPE_VIDEO,
 	/*! H.263 Video */
-	AST_FORMAT_H263				= 2 + AST_FORMAT_TYPE_VIDEO,
+	AST_FORMAT_H263             = 2 + AST_FORMAT_TYPE_VIDEO,
 	/*! H.263+ Video */
-	AST_FORMAT_H263_PLUS			= 3 + AST_FORMAT_TYPE_VIDEO,
+	AST_FORMAT_H263_PLUS        = 3 + AST_FORMAT_TYPE_VIDEO,
 	/*! H.264 Video */
-	AST_FORMAT_H264				= 4 + AST_FORMAT_TYPE_VIDEO,
+	AST_FORMAT_H264             = 4 + AST_FORMAT_TYPE_VIDEO,
 	/*! MPEG4 Video */
-	AST_FORMAT_MP4_VIDEO			= 5 + AST_FORMAT_TYPE_VIDEO,
+	AST_FORMAT_MP4_VIDEO        = 5 + AST_FORMAT_TYPE_VIDEO,
 
 	/*! JPEG Images */
-	AST_FORMAT_JPEG				= 1 + AST_FORMAT_TYPE_IMAGE,
+	AST_FORMAT_JPEG             = 1 + AST_FORMAT_TYPE_IMAGE,
 	/*! PNG Images */
-	AST_FORMAT_PNG				= 2 + AST_FORMAT_TYPE_IMAGE,
+	AST_FORMAT_PNG              = 2 + AST_FORMAT_TYPE_IMAGE,
 
 	/*! T.140 RED Text format RFC 4103 */
-	AST_FORMAT_T140RED			= 1 + AST_FORMAT_TYPE_TEXT,
+	AST_FORMAT_T140RED          = 1 + AST_FORMAT_TYPE_TEXT,
 	/*! T.140 Text format - ITU T.140, RFC 4103 */
-	AST_FORMAT_T140				= 2 + AST_FORMAT_TYPE_TEXT,
+	AST_FORMAT_T140             = 2 + AST_FORMAT_TYPE_TEXT,
 };
 
 /*! Determine what type of media a ast_format_id is. */
-#define AST_FORMAT_GET_TYPE(id) (((enum ast_format_id) (id / AST_FORMAT_INC)) * AST_FORMAT_INC)
+#define AST_FORMAT_GET_TYPE(id) (((int) (id / AST_FORMAT_INC)) * AST_FORMAT_INC)
 
 /*! \brief This structure contains the buffer used for format attributes */
 struct ast_format_attr {




More information about the asterisk-commits mailing list