浏览代码

parser/sdp: added 'a:remote-candidates' media stream attribute

Juha Heinanen 12 年之前
父节点
当前提交
88a8eb3483
共有 2 个文件被更改,包括 8 次插入2 次删除
  1. 7 2
      parser/sdp/sdp.c
  2. 1 0
      parser/sdp/sdp.h

+ 7 - 2
parser/sdp/sdp.c

@@ -369,6 +369,7 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_
 	sdp_payload_attr_t *payload_attr;
 	int parse_payload_attr;
 	str fmtp_string;
+	str remote_candidates = {"a:remote-candidates:", 20};
 
 	/* hook the start and lenght of sdp body inside structure
 	 * - shorcut useful for multi-part bodies and sdp operations
@@ -553,6 +554,9 @@ static int parse_sdp_session(str *sdp_body, int session_num, str *cnt_disp, sdp_
 				set_sdp_payload_fmtp(payload_attr, &fmtp_string);
 			} else if (parse_payload_attr && extract_candidate(&tmpstr1, stream) == 0) {
 			        a1p += 2;
+			} else if (parse_payload_attr && extract_field(&tmpstr1, &stream->remote_candidates,
+								       remote_candidates) == 0) {
+			        a1p += 2;
 			} else if (extract_accept_types(&tmpstr1, &stream->accept_types) == 0) {
 				a1p = stream->accept_types.s + stream->accept_types.len;
 			} else if (extract_accept_wrapped_types(&tmpstr1, &stream->accept_wrapped_types) == 0) {
@@ -822,7 +826,7 @@ void print_sdp_stream(sdp_stream_cell_t *stream, int log_level)
 	sdp_payload_attr_t *payload;
         sdp_ice_attr_t *ice_attr;
 
-	LOG(log_level , "....stream[%d]:%p=>%p {%p} '%.*s' '%.*s:%.*s:%.*s' '%.*s' [%d] '%.*s' '%.*s:%.*s' (%d)=>%p (%d)=>%p '%.*s' '%.*s' '%.*s' '%.*s' '%.*s' '%.*s'\n",
+	LOG(log_level , "....stream[%d]:%p=>%p {%p} '%.*s' '%.*s:%.*s:%.*s' '%.*s' [%d] '%.*s' '%.*s:%.*s' (%d)=>%p (%d)=>%p '%.*s' '%.*s' '%.*s' '%.*s' '%.*s' '%.*s' '%.*s'\n",
 		stream->stream_num, stream, stream->next,
 		stream->p_payload_attr,
 		stream->media.len, stream->media.s,
@@ -838,7 +842,8 @@ void print_sdp_stream(sdp_stream_cell_t *stream, int log_level)
 		stream->path.len, stream->path.s,
 		stream->max_size.len, stream->max_size.s,
 		stream->accept_types.len, stream->accept_types.s,
-		stream->accept_wrapped_types.len, stream->accept_wrapped_types.s);
+	        stream->accept_wrapped_types.len, stream->accept_wrapped_types.s,
+	    	stream->remote_candidates.len, stream->remote_candidates.s);
 	payload = stream->payload_attr;
 	while (payload) {
 		LOG(log_level, "......payload[%d]:%p=>%p p_payload_attr[%d]:%p '%.*s' '%.*s' '%.*s' '%.*s' '%.*s'\n",

+ 1 - 0
parser/sdp/sdp.h

@@ -86,6 +86,7 @@ typedef struct sdp_stream_cell {
         int ice_attrs_num;                        /**< number of ICE attrs inside a stream */
         /* add fast access pointers to ice attributes if you need them */
         sdp_ice_attr_t *ice_attr;
+	str remote_candidates;                    /**< ICE a:remote-candidates */
 } sdp_stream_cell_t;
 
 typedef struct sdp_session_cell {