예제 #1
0
파일: sdp.c 프로젝트: jungle0755/rtpengine
static void insert_candidate(struct sdp_chopper *chop, struct packet_stream *ps, unsigned int component,
		unsigned int type_pref, unsigned int local_pref, enum ice_candidate_type type,
		struct interface_address *ifa)
{
	unsigned long priority;

	priority = ice_priority_pref(type_pref, local_pref, component);
	chopper_append_c(chop, "a=candidate:");
	chopper_append_str(chop, &ifa->ice_foundation);
	chopper_append_printf(chop, " %u UDP %lu ", component, priority);
	insert_ice_address(chop, ps, ifa);
	chopper_append_c(chop, " typ ");
	chopper_append_c(chop, ice_candidate_type_str(type));
	/* raddr and rport are required for non-host candidates: rfc5245 section-15.1 */
	if(type != ICT_HOST)
		insert_raddr_rport(chop, ps, ifa);
	chopper_append_c(chop, "\r\n");
}
예제 #2
0
파일: sdp.c 프로젝트: gnufreex/rtpengine
static void insert_candidate(struct sdp_chopper *chop, struct stream_fd *sfd,
		unsigned int type_pref, unsigned int local_pref, enum ice_candidate_type type)
{
	unsigned long priority;
	struct packet_stream *ps = sfd->stream;
	const struct local_intf *ifa = sfd->local_intf;

	if (local_pref == -1)
		local_pref = ifa->unique_id;

	priority = ice_priority_pref(type_pref, local_pref, ps->component);
	chopper_append_c(chop, "a=candidate:");
	chopper_append_str(chop, &ifa->ice_foundation);
	chopper_append_printf(chop, " %u UDP %lu ", ps->component, priority);
	insert_ice_address(chop, sfd);
	chopper_append_c(chop, " typ ");
	chopper_append_c(chop, ice_candidate_type_str(type));
	/* raddr and rport are required for non-host candidates: rfc5245 section-15.1 */
	if(type != ICT_HOST)
		insert_raddr_rport(chop, ps, ifa);
	chopper_append_c(chop, "\r\n");
}