[asterisk-commits] oej: branch oej/videocaps-ng2 r99969 - /team/oej/videocaps-ng2/channels/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Jan 23 13:34:00 CST 2008


Author: oej
Date: Wed Jan 23 13:33:59 2008
New Revision: 99969

URL: http://svn.digium.com/view/asterisk?view=rev&rev=99969
Log:
Look, ma, it compiles again!

Modified:
    team/oej/videocaps-ng2/channels/chan_sip.c

Change Statistics:
 0 files changed

Modified: team/oej/videocaps-ng2/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps-ng2/channels/chan_sip.c?view=diff&rev=99969&r1=99968&r2=99969
==============================================================================
--- team/oej/videocaps-ng2/channels/chan_sip.c (original)
+++ team/oej/videocaps-ng2/channels/chan_sip.c Wed Jan 23 13:33:59 2008
@@ -1,6 +1,3 @@
-/* NOTE: a_size=0 in the function that appends FMTP is just dummy, to make it compile. 
-   Needs to be fixed in the ast_add_fmtp functions
-*/
 /* TIAS support seems half done...
 */
 /*
@@ -976,7 +973,6 @@
 #define SIP_PAGE2_RTCACHEFRIENDS	(1 << 0)	/*!< GP: Should we keep RT objects in memory for extended time? */
 #define SIP_PAGE2_RTAUTOCLEAR		(1 << 2)	/*!< GP: Should we clean memory from peers after expiry? */
 /* Space for addition of other realtime flags in the future */
-#define SIP_PAGE2_DEBUG_CAPS		(1 << 31)	/*!< 31: Debug Caps  */
 
 #define SIP_PAGE2_VIDEOSUPPORT		(1 << 14)	/*!< DP: Video supported if offered? */
 #define SIP_PAGE2_TEXTSUPPORT		(1 << 15)	/*!< GDP: Global text enable */
@@ -997,6 +993,9 @@
 #define SIP_PAGE2_RFC2833_COMPENSATE    (1 << 25)	/*!< DP: Compensate for buggy RFC2833 implementations */
 #define SIP_PAGE2_BUGGY_MWI		(1 << 26)	/*!< DP: Buggy CISCO MWI fix */
 #define SIP_PAGE2_REGISTERTRYING        (1 << 29)       /*!< DP: Send 100 Trying on REGISTER attempts */
+
+#define SIP_PAGE2_DEBUG_TEXT		(1 << 30)	/*!< 31: Debug Caps  */
+#define SIP_PAGE2_DEBUG_CAPS		(1 << 31)	/*!< 31: Debug Caps  */
 
 #define SIP_PAGE2_FLAGS_TO_COPY \
 	(SIP_PAGE2_ALLOWSUBSCRIBE | SIP_PAGE2_ALLOWOVERLAP | SIP_PAGE2_VIDEOSUPPORT | \
@@ -1781,8 +1780,8 @@
 static int process_h2613_fmtp(const char *fmtstr, struct ast_h2613_video_cap *vidcap, unsigned int framerate);
 static int process_h264_fmtp(const char *fmtstr, struct ast_h264_video_cap *vidcap, int framerate);
 static int process_sdp(struct sip_pvt *p, struct sip_request *req);
-static void ast_build_h2613_fmtp(char **buf, size_t *size, int rtp_code, struct ast_h2613_video_cap *video_cap);
-static void ast_build_h264_fmtp(char **buf, size_t *size, int rtp_code, struct ast_h264_video_cap *video_cap);
+static void ast_build_h2613_fmtp(struct ast_str **buf, int rtp_code, struct ast_h2613_video_cap *video_cap);
+static void ast_build_h264_fmtp(struct ast_str **buf, int rtp_code, struct ast_h264_video_cap *video_cap);
 static void add_codec_to_sdp(const struct sip_pvt *p, int codec, int sample_rate,
 			     struct ast_str **m_buf, struct ast_str **a_buf,
 			     int debug, int *min_packet_size);
@@ -7928,37 +7927,39 @@
 	return 0;
 }
 
-static void ast_build_h2613_fmtp(char **buf, size_t *size, int rtp_code, struct ast_h2613_video_cap *video_cap)
+/*! \brief Build fmtp headers for H261, H263 video */
+static void ast_build_h2613_fmtp(struct ast_str **buf, int rtp_code, struct ast_h2613_video_cap *video_cap)
 {
 	int i;
 	
 	if(video_cap->valid) {
-	  ast_build_string(buf, size, "a=fmtp:%d ",rtp_code);
-	  for (i = 0; i < MAX_VIDEO_SIZES; i++) {
-	  	if (video_cap->maxfr[i] > 0)
-	  		ast_build_string(buf, size, "%s=%d ", videoSizes[i].type, 30/video_cap->maxfr[i]);
-	  }
-	  if (video_cap->maxbr > 0)
-	  	ast_build_string(buf, size, "maxbr=%d",video_cap->maxbr/100);
-	  ast_build_string(buf, size, "\r\n");
+		ast_str_append(buf, 0, "a=fmtp:%d ",rtp_code);
+		for (i = 0; i < MAX_VIDEO_SIZES; i++) {
+	  		if (video_cap->maxfr[i] > 0)
+				ast_str_append(buf, 0, "%s=%d ", videoSizes[i].type, 30/video_cap->maxfr[i]);
+	  	}
+		if (video_cap->maxbr > 0)
+	  		ast_str_append(buf, 0, "maxbr=%d",video_cap->maxbr/100);
+		ast_str_append(buf, 0, "\r\n");
 	} else {
 		ast_verbose("WARNING Video cap is not valid but have been asked to add fmtp\n");
-		ast_build_string(buf, size, "a=fmtp:%d;CIF=1;QCIF=1;maxbr=3840\r\n", rtp_code);
-	}
-}
-
-static void ast_build_h264_fmtp(char **buf, size_t *size, int rtp_code, struct ast_h264_video_cap *video_cap)
+		ast_str_append(buf, 0, "a=fmtp:%d;CIF=1;QCIF=1;maxbr=3840\r\n", rtp_code);
+	}
+}
+
+/*! \brief Build fmtp headers for H264 video */
+static void ast_build_h264_fmtp(struct ast_str **buf, int rtp_code, struct ast_h264_video_cap *video_cap)
 {
 	/* ast_build_string(a_buf, a_size, "a=fmtp:%d profile-level-id=42800C; packetization-mode=0; max-br=384; max-mbps=10000\r\n", rtp_code); */
 	
 	if(video_cap->valid) {
-	  ast_build_string(buf, size, "a=fmtp:%d ",rtp_code);
-	  ast_build_string(buf, size, "profile-level-id=42800C; packetization-mode=0; ");
-	  if (video_cap->maxmbps > 0)
-	  	ast_build_string(buf, size, "max-mbps=%d; ",video_cap->maxmbps);
-	  if (video_cap->maxbr > 0)
-	  	ast_build_string(buf, size, "max-br=%d",video_cap->maxbr/1000);
-	  ast_build_string(buf, size, "\r\n");
+		ast_str_append(buf, 0, "a=fmtp:%d ", rtp_code);
+		ast_str_append(buf, 0, "profile-level-id=42800C; packetization-mode=0; ");
+		if (video_cap->maxmbps > 0)
+			ast_str_append(buf, 0, "max-mbps=%d; ",video_cap->maxmbps);
+		if (video_cap->maxbr > 0)
+			ast_str_append(buf, 0, "max-br=%d",video_cap->maxbr/1000);
+		ast_str_append(buf, 0, "\r\n");
 	}
 }
 
@@ -7969,7 +7970,6 @@
 {
 	int rtp_code;
 	struct ast_format_list fmt;
-
 
 	if (debug)
 		ast_verbose("Adding codec 0x%x (%s) to SDP\n", codec, ast_getformatname(codec));
@@ -8011,7 +8011,6 @@
 			     int debug, int *min_packet_size)
 {
 	int rtp_code;
-	int a_size = 0;
 
 	if (!p->vrtp)
 		return;
@@ -8028,16 +8027,16 @@
 	if (codec == AST_FORMAT_H261) {
 		if (sipdebug_caps)
 			ast_verbose("Adding h261 fmtp\n");
-		ast_build_h2613_fmtp(a_buf, a_size, rtp_code, (struct ast_h2613_video_cap*)&p->jointcaps.h261);
+		ast_build_h2613_fmtp(a_buf, rtp_code, (struct ast_h2613_video_cap*)&p->jointcaps.h261);
 	} else if (codec == AST_FORMAT_H263) {
 		if (sipdebug_caps)
 			ast_verbose("Adding h263 fmtp\n");
-		ast_build_h2613_fmtp(a_buf, a_size, rtp_code, (struct ast_h2613_video_cap*)&p->jointcaps.h263);
+		ast_build_h2613_fmtp(a_buf, rtp_code, (struct ast_h2613_video_cap*)&p->jointcaps.h263);
 	}	else if (codec == AST_FORMAT_H264) {
 		if (sipdebug_caps) {
 			ast_verbose("Adding h264 fmtp with rtpnum %d\n",p->jointcaps.h264.rtpnum);
 		}
-		ast_build_h264_fmtp(a_buf, a_size, rtp_code, (struct ast_h264_video_cap*)&p->jointcaps.h264);
+		ast_build_h264_fmtp(a_buf, rtp_code, (struct ast_h264_video_cap*)&p->jointcaps.h264);
 	}
 
 }
@@ -8270,8 +8269,6 @@
 
 	int x;
 	int capability;
-	int videocapability=0;
-	int textcapability=0;
 	int needvideo = FALSE;
 	int needtext = FALSE;
 	int debug = sip_debug_test_pvt(p);




More information about the asterisk-commits mailing list