[asterisk-commits] oej: branch oej/videocaps r100791 - in /team/oej/videocaps: ./ channels/ incl...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 29 03:26:39 CST 2008


Author: oej
Date: Tue Jan 29 03:26:39 2008
New Revision: 100791

URL: http://svn.digium.com/view/asterisk?view=rev&rev=100791
Log:
Mostly formatting changes

Modified:
    team/oej/videocaps/   (props changed)
    team/oej/videocaps/channels/chan_sip.c
    team/oej/videocaps/include/asterisk/channel.h

Propchange: team/oej/videocaps/
------------------------------------------------------------------------------
    automerge = http://www.codename-pineapple.org/

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=100791&r1=100790&r2=100791
==============================================================================
--- team/oej/videocaps/channels/chan_sip.c (original)
+++ team/oej/videocaps/channels/chan_sip.c Tue Jan 29 03:26:39 2008
@@ -1,5 +1,3 @@
-/* TIAS support seems half done...
-*/
 /*
  * Asterisk -- An open source telephony toolkit.
  *
@@ -84,6 +82,11 @@
  * the sip_hangup() function
  */
 
+/*!
+\todo Videocaps	TIAS support seems half done...
+\todo Videocaps	MPEG4 support is missing. Needs to be added to capabilities.h and capabilities.c
+*/
+
 /*** MODULEINFO
         <depend>chan_local</depend>
  ***/
@@ -1253,7 +1256,6 @@
 	int noncodeccapability;			/*!< DTMF RFC2833 telephony-event */
 	int jointnoncodeccapability;            /*!< Joint Non codec capability */
 	int redircodecs;			/*!< Redirect codecs */
-	int maxcallbitrate;			/*!< Maximum Call Bitrate for Video Calls */	
 	struct sip_proxy *outboundproxy;	/*!< Outbound proxy for this dialog */
 	struct t38properties t38;		/*!< T38 settings */
 	struct sockaddr_in udptlredirip;	/*!< Where our T.38 UDPTL should be going if not to us */
@@ -1423,7 +1425,6 @@
 	enum transfermodes allowtransfer;	/*! SIP Refer restriction scheme */
 	struct ast_ha *ha;		/*!< ACL setting */
 	struct ast_variable *chanvars;	/*!< Variables to set for channel created by user */
-	int maxcallbitrate;		/*!< Maximum Call Bitrate for Video Calls */	
 	int videoupdate                 /*!< Defines use of XML or RTCP for video update */;
 	int autoframing;
 	struct sip_st_cfg stimer;	/*!< SIP Session-Timers */
@@ -1492,7 +1493,7 @@
 
 	int expire;			/*!<  When to expire this peer registration */
 	int capability;			/*!<  Codec capability */
-	struct ast_capabilities caps;	/*!< Codec capability */
+	struct ast_capabilities caps;	/*!<  Codec capability */
 	int rtptimeout;			/*!<  RTP timeout */
 	int rtpholdtimeout;		/*!<  RTP Hold Timeout */
 	int rtpkeepalive;		/*!<  Send RTP packets for keepalive */
@@ -1502,7 +1503,6 @@
 	struct ast_dnsmgr_entry *dnsmgr;/*!<  DNS refresh manager for peer */
 	struct sockaddr_in addr;	/*!<  IP address of peer */
 	int videoupdate;		/*!< Defines use of XML or RTCP for video update */
-	int maxcallbitrate;		/*!< Maximum Call Bitrate for Video Calls */	
 	
 	/* Qualification */
 	struct sip_pvt *call;		/*!<  Call pointer */
@@ -3893,7 +3893,6 @@
 	dialog->allowtransfer = peer->allowtransfer;
 	dialog->jointnoncodeccapability = dialog->noncodeccapability;
 	dialog->rtptimeout = peer->rtptimeout;
-	dialog->maxcallbitrate = peer->maxcallbitrate;
 	if (ast_strlen_zero(dialog->tohost))
 		ast_string_field_set(dialog, tohost, ast_inet_ntoa(dialog->sa.sin_addr));
 	if (!ast_strlen_zero(peer->fromdomain)) {
@@ -4864,33 +4863,33 @@
 	return res;
 }
 
-/*! \brief  sip_set_capabilities: called when channel needs to have caps updated from another channel */
-/* When * is making an outgoing call, the confcaps will be set (sip_new has already been called) but
-   jointcaps and peer caps will be zero */
-/* On the REVERSE cap exchange we'll need to do a MIN(joint, chancap); */
+/*! \brief  sip_set_capabilities: called when channel needs to have caps updated from another channel
+	When * is making an outgoing call, the confcaps will be set (sip_new has already been called) but
+   	jointcaps and peer caps will be zero
+	On the REVERSE cap exchange we'll need to do a MIN(joint, chancap); 
+*/
 static int sip_set_capabilities(struct ast_channel *ast, struct ast_capabilities *chancaps)
 {
 	struct sip_pvt *p = ast->tech_pvt;
 	int res = 0;
 	
-  if(sipdebug_caps)
-	{
+	if(sipdebug_caps) {
 		ast_verbose("Calling sip_set_capabilities for %s\n", ast->name);
 
 		if (chancaps->maxcallbitrate) {
-			ast_verbose("SET_CAPABILITIES: Chancaps (%s)\n",ast->name);
+			ast_verbose("SET_CAPABILITIES: Chancaps (%s)\n", ast->name);
 			ast_dump_caps(chancaps);
 		}
 		if (p->jointcaps.maxcallbitrate) {
-			ast_verbose("SET_CAPABILITIES: Jointcaps (%s)\n",ast->name);
+			ast_verbose("SET_CAPABILITIES: Jointcaps (%s)\n", ast->name);
 			ast_dump_caps(&p->jointcaps);
 		}
 		if (p->peercaps.maxcallbitrate) {
-			ast_verbose("SET_CAPABILITIES: Peercaps (%s)\n",ast->name);
+			ast_verbose("SET_CAPABILITIES: Peercaps (%s)\n", ast->name);
 			ast_dump_caps(&p->peercaps);
 		}
 		if (p->caps.maxcallbitrate) {
-			ast_verbose("SET_CAPABILITIES: Caps (%s)\n",ast->name);
+			ast_verbose("SET_CAPABILITIES: Caps (%s)\n", ast->name);
 			ast_dump_caps(&p->caps);
 		}
 	}
@@ -4899,7 +4898,7 @@
 	if (ast_are_caps_zero(&p->jointcaps)) {
 		ast_copy_capabilities(&p->jointcaps, chancaps);
 	} else {
-		ast_resolve_capabilities(&p->jointcaps,&p->jointcaps, chancaps, sipdebug_caps);
+		ast_resolve_capabilities(&p->jointcaps, &p->jointcaps, chancaps, sipdebug_caps);
 	}
 	
 	if (chancaps->h264.rtpnum != 99)
@@ -4907,7 +4906,7 @@
 	
 	ast_copy_capabilities(&ast->channelcaps, &p->jointcaps);
 
-  if(sipdebug_caps)	{
+	if(sipdebug_caps) {
 		if (p->jointcaps.maxcallbitrate) {
 			ast_verbose("SET_CAPABILITIES: New Jointcaps (%s)\n",ast->name);
 			ast_dump_caps(&p->jointcaps);
@@ -5097,11 +5096,11 @@
 		if (p->vrtp && !p->novideo) {
 			/* Can possibly send both! */
 			if ((p->videoupdate & VIDEO_UPDATE_XML) == VIDEO_UPDATE_XML) 
-			  transmit_info_with_vidupdate(p);
+				transmit_info_with_vidupdate(p);
 			if ((p->videoupdate & VIDEO_UPDATE_RTCP) == VIDEO_UPDATE_RTCP) 
-			  ast_rtcp_send_h261fur(p->vrtp);
+				ast_rtcp_send_h261fur(p->vrtp);
 			if (p->videoupdate && sipdebug)
-			  ast_verbose("Sending %s FUR to %s\n", (p->videoupdate == 0) ? "none" : (p->videoupdate == VIDEO_UPDATE_XML) ? "XML" : (p->videoupdate == VIDEO_UPDATE_RTCP) ? "RTCP": "XML and RTCP", p->cid_num);  
+				ast_verbose("Sending %s FUR to %s\n", (p->videoupdate == 0) ? "none" : (p->videoupdate == VIDEO_UPDATE_XML) ? "XML" : (p->videoupdate == VIDEO_UPDATE_RTCP) ? "RTCP": "XML and RTCP", p->cid_num);  
 		} else
 			res = -1;
 		break;
@@ -5110,7 +5109,7 @@
 			ast_resolve_capabilities(&p->jointcaps, &p->jointcaps, (struct ast_capabilities*)data, sipdebug_caps);
 			p->jointcapability = p->jointcapability | (AST_FORMAT_VIDEO_MASK & ast_get_int_from_capabilities(&p->jointcaps));
 			if(sipdebug_caps) {
-				ast_verbose("SIP INDICATE: We got a new cap of (0x%08x):\n",p->jointcapability);
+				ast_verbose("SIP INDICATE: We got a new cap of (0x%08x):\n", p->jointcapability);
 				ast_dump_caps(&p->jointcaps);
 			}
 		}
@@ -5712,7 +5711,7 @@
 	if (sip_methods[intended_method].need_rtp) {
 		p->rtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
 		/* If the global videosupport flag is on, we always create a RTP interface for video */
-		if (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT))
+		if (ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT)) 
 			p->vrtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
  		if (ast_test_flag(&p->flags[1], SIP_PAGE2_TEXTSUPPORT))
  			p->trtp = ast_rtp_new_with_bindaddr(sched, io, 1, 0, bindaddr.sin_addr);
@@ -7007,26 +7006,28 @@
 
   	/* The peercaps are now in. There will be videocap.valid=1 if there was an RTPMAP entry and there
 	   will be codec information in the videocap if there was an fmtp. We now need to reconcile all these
-		 caps... it is possible that a peer does not set CT for instance and we need to generate it */
-	/* It may be better to do this on the joint cap... rather than pollute the peercap with elements that
-	   are not actually from the peer. */
+	   caps... it is possible that a peer does not set CT for instance and we need to generate it 
+	   It may be better to do this on the joint cap... rather than pollute the peercap with elements that
+	   are not actually from the peer. 
+	 */
 	check_set_video_bitrates(&p->peercaps, sipdebug_caps);
 
 	/* We now have a four way set of caps to resolve:
-		 caps:        come from the conf file
-	   peercaps:    come from the sdp
-		 jointcaps:   are the min of caps, peercaps and owner caps
-		 owner->caps: are a copy of the new jointcaps */
+		caps:        come from the conf file
+		peercaps:    come from the sdp
+		jointcaps:   are the min of caps, peercaps and owner caps
+		owner->caps: are a copy of the new jointcaps 
+	*/
 	ast_copy_capabilities(&p->jointcaps, &p->peercaps);
 	if(p->owner) {
 		ast_resolve_capabilities(&p->jointcaps, &p->owner->channelcaps, &p->jointcaps, sipdebug_caps);
-		if(sipdebug_caps) {	
+		if(sipdebug_caps) {
 			ast_verbose("SIP PROCESS SDP: Joint = Min(Owner, Joint)...\n");
 			ast_dump_caps(&p->jointcaps);
 		}
 	}
 	ast_resolve_capabilities(&p->jointcaps, &p->jointcaps, &p->caps, sipdebug_caps);
-  if(sipdebug_caps) {	
+	if(sipdebug_caps) {	
 		ast_verbose("SIP PROCESS SDP: Joint = Min(Joint, ConfCaps)...\n");
 		ast_dump_caps(&p->jointcaps);
 	}
@@ -7189,9 +7190,10 @@
 			sip_peer_hold(p, TRUE);
 	}
 	
-	/* Tell the other end of the call what our cap is */
-	/* XXX This needs to be changed to pass back the complex cap not just the simple cap */
-  ast_queue_control_data(p->owner, AST_CONTROL_CAPABILITY, &p->jointcaps, sizeof(p->jointcaps));
+	/*! Tell the other end of the call what our cap is 
+	    \todo XXX This needs to be changed to pass back the complex cap not just the simple cap 
+	*/
+	ast_queue_control_data(p->owner, AST_CONTROL_CAPABILITY, &p->jointcaps, sizeof(p->jointcaps));
 
 	return 0;
 }
@@ -8024,12 +8026,13 @@
 		if (sipdebug_caps)
 			ast_verbose("Adding h263 fmtp\n");
 		ast_build_h2613_fmtp(a_buf, rtp_code, (struct ast_h2613_video_cap*)&p->jointcaps.h263);
-	}	else if (codec == AST_FORMAT_H264) {
+	} else if (codec == AST_FORMAT_H264) {
 		if (sipdebug_caps) {
-			ast_verbose("Adding h264 fmtp with rtpnum %d\n",p->jointcaps.h264.rtpnum);
+			ast_verbose("Adding h264 fmtp with rtpnum %d\n", p->jointcaps.h264.rtpnum);
 		}
 		ast_build_h264_fmtp(a_buf, rtp_code, (struct ast_h264_video_cap*)&p->jointcaps.h264);
 	}
+	/*! /todo Room for MPEG4 */
 
 }
 
@@ -11514,7 +11517,7 @@
 		ast_copy_capabilities(&p->caps, &user->caps);
  		ast_copy_capabilities(&p->jointcaps, &user->caps);
  		ast_copy_capabilities(&p->peercaps, &user->caps);
- 		ast_set_capabilities_from_int(&p->peercaps,0);
+ 		ast_set_capabilities_from_int(&p->peercaps, 0);
  		p->videoupdate = user->videoupdate;
 		if ((ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_RFC2833) ||
 		    (ast_test_flag(&p->flags[0], SIP_DTMF) == SIP_DTMF_AUTO))
@@ -11657,9 +11660,9 @@
 		ast_copy_capabilities(&p->caps, &peer->caps);
 		ast_copy_capabilities(&p->jointcaps, &peer->caps);
 		ast_copy_capabilities(&p->peercaps, &peer->caps);
-		ast_set_capabilities_from_int(&p->caps,p->capability);
-		ast_set_capabilities_from_int(&p->jointcaps,0);
-		ast_set_capabilities_from_int(&p->peercaps,0);
+		ast_set_capabilities_from_int(&p->caps, p->capability);
+		ast_set_capabilities_from_int(&p->jointcaps, 0);
+		ast_set_capabilities_from_int(&p->peercaps, 0);
 		p->videoupdate = peer->videoupdate;
 		if ((!ast_test_flag(&p->flags[1], SIP_PAGE2_VIDEOSUPPORT) || !(p->capability & AST_FORMAT_VIDEO_MASK)) && p->vrtp) {
 			ast_rtp_destroy(p->vrtp);

Modified: team/oej/videocaps/include/asterisk/channel.h
URL: http://svn.digium.com/view/asterisk/team/oej/videocaps/include/asterisk/channel.h?view=diff&rev=100791&r1=100790&r2=100791
==============================================================================
--- team/oej/videocaps/include/asterisk/channel.h (original)
+++ team/oej/videocaps/include/asterisk/channel.h Tue Jan 29 03:26:39 2008
@@ -499,7 +499,7 @@
 	struct ast_trans_pvt *readtrans;		/*!< Read translation path */
 	int rawreadformat;				/*!< Raw read format */
 	int rawwriteformat;				/*!< Raw write format */
-	struct ast_capabilities channelcaps; /*! Channel capabilities for the call */			
+	struct ast_capabilities channelcaps;		/*!< Channel capabilities for the call */			
 
 	struct ast_audiohook_list *audiohooks;
 




More information about the asterisk-commits mailing list