/* $Id$ */ /* * Copyright (C) 2008-2009 Teluu Inc. (http://www.teluu.com) * Copyright (C) 2003-2008 Benny Prijono * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include static char *sdp[] = { /* "v=0\r\n" "o=mhandley 2890844526 2890842807 IN IP4 126.16.64.4\r\n" "s=SDP Seminar\r\n" "i=A Seminar on the session description protocol\r\n" "u=http://www.cs.ucl.ac.uk/staff/M.Handley/sdp.03.ps\r\n" "e=mjh@isi.edu (Mark Handley)\r\n" "c=IN IP4 224.2.17.12/127\r\n" "t=2873397496 2873404696\r\n" "a=recvonly\r\n" "m=audio 49170 RTP/AVP 0\r\n" "m=video 51372 RTP/AVP 31\r\n" "m=application 32416 udp wb\r\n" "a=orient:portrait\r\n" "m=audio 49230 RTP/AVP 96 97 98\r\n" "a=rtpmap:96 L8/8000\r\n" "a=rtpmap:97 L16/8000\r\n" "a=rtpmap:98 L16/11025/2\r\n", */ "v=0\r\n" "o=usera 2890844526 2890844527 IN IP4 alice.example.com\r\n" "s=\r\n" "c=IN IP4 alice.example.com\r\n" "t=0 0\r\n" "m=message 7394 msrp/tcp *\r\n" "a=accept-types: message/cpim text/plain text/html\r\n" "a=path:msrp://alice.example.com:7394/2s93i9;tcp\r\n" }; static int sdp_perform_test(pj_pool_factory *pf) { pj_pool_t *pool; int inputlen, len; pjsdp_session_desc *ses; char buf[1500]; enum { LOOP=1000000 }; int i; pj_time_val start, end; printf("Parsing and printing %d SDP messages..\n", LOOP); pool = pj_pool_create(pf, "", 4096, 0, NULL); inputlen = strlen(sdp[0]); pj_gettimeofday(&start); for (i=0; i