Changeset 637 for pjproject/trunk
- Timestamp:
- Jul 31, 2006 3:19:36 PM (18 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 19 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/build/Makefile
r631 r637 12 12 # "#define PJMEDIA_HAS_SPEEX_CODEC 0" in pj/config_site.h. 13 13 # 14 export CODEC_OBJS = $(GSM_OBJS) $(SPEEX_OBJS) 14 export CODEC_OBJS = $(GSM_OBJS) $(SPEEX_OBJS) $(ILBC_OBJS) 15 15 16 16 … … 107 107 SPEEX_CFLAGS := -DHAVE_CONFIG_H=1 -I../src/pjmedia-codec 108 108 109 ILBC_OBJS := ilbc.o \ 110 ilbc/FrameClassify.o ilbc/LPCdecode.o ilbc/LPCencode.o \ 111 ilbc/StateConstructW.o ilbc/StateSearchW.o ilbc/anaFilter.o \ 112 ilbc/constants.o ilbc/createCB.o ilbc/doCPLC.o \ 113 ilbc/enhancer.o ilbc/filter.o ilbc/gainquant.o \ 114 ilbc/getCBvec.o ilbc/helpfun.o ilbc/hpInput.o \ 115 ilbc/hpOutput.o ilbc/iCBConstruct.o ilbc/iCBSearch.o \ 116 ilbc/iLBC_decode.o ilbc/iLBC_encode.o ilbc/lsf.o \ 117 ilbc/packing.o ilbc/syntFilter.o 118 ILBC_CFLAGS := 119 109 120 export PJMEDIA_CODEC_SRCDIR = ../src/pjmedia-codec 110 121 export PJMEDIA_CODEC_OBJS += l16.o \ 111 122 $(OS_OBJS) $(M_OBJS) $(CC_OBJS) $(HOST_OBJS) \ 112 123 $(CODEC_OBJS) 113 export PJMEDIA_CODEC_CFLAGS += $(_CFLAGS) $(GSM_CFLAGS) $(SPEEX_CFLAGS) 124 export PJMEDIA_CODEC_CFLAGS += $(_CFLAGS) $(GSM_CFLAGS) $(SPEEX_CFLAGS) \ 125 $(ILBC_CFLAGS) 114 126 115 127 -
pjproject/trunk/pjmedia/build/pjmedia_codec.dsp
r630 r637 101 101 # Begin Source File 102 102 103 SOURCE="..\src\pjmedia-codec\ilbc.c" 104 # End Source File 105 # Begin Source File 106 103 107 SOURCE="..\src\pjmedia-codec\l16.c" 104 108 … … 139 143 # Begin Source File 140 144 145 SOURCE="..\include\pjmedia-codec\ilbc.h" 146 # End Source File 147 # Begin Source File 148 141 149 SOURCE="..\include\pjmedia-codec\l16.h" 142 150 # End Source File … … 663 671 # End Source File 664 672 # End Group 673 # End Group 674 # Begin Group "iLBC Codec" 675 676 # PROP Default_Filter "" 677 # Begin Source File 678 679 SOURCE="..\src\pjmedia-codec\ilbc\anaFilter.c" 680 # End Source File 681 # Begin Source File 682 683 SOURCE="..\src\pjmedia-codec\ilbc\anaFilter.h" 684 # End Source File 685 # Begin Source File 686 687 SOURCE="..\src\pjmedia-codec\ilbc\constants.c" 688 # End Source File 689 # Begin Source File 690 691 SOURCE="..\src\pjmedia-codec\ilbc\constants.h" 692 # End Source File 693 # Begin Source File 694 695 SOURCE="..\src\pjmedia-codec\ilbc\createCB.c" 696 # End Source File 697 # Begin Source File 698 699 SOURCE="..\src\pjmedia-codec\ilbc\createCB.h" 700 # End Source File 701 # Begin Source File 702 703 SOURCE="..\src\pjmedia-codec\ilbc\doCPLC.c" 704 # End Source File 705 # Begin Source File 706 707 SOURCE="..\src\pjmedia-codec\ilbc\doCPLC.h" 708 # End Source File 709 # Begin Source File 710 711 SOURCE="..\src\pjmedia-codec\ilbc\enhancer.c" 712 # End Source File 713 # Begin Source File 714 715 SOURCE="..\src\pjmedia-codec\ilbc\enhancer.h" 716 # End Source File 717 # Begin Source File 718 719 SOURCE="..\src\pjmedia-codec\ilbc\filter.c" 720 # End Source File 721 # Begin Source File 722 723 SOURCE="..\src\pjmedia-codec\ilbc\filter.h" 724 # End Source File 725 # Begin Source File 726 727 SOURCE="..\src\pjmedia-codec\ilbc\FrameClassify.c" 728 # End Source File 729 # Begin Source File 730 731 SOURCE="..\src\pjmedia-codec\ilbc\FrameClassify.h" 732 # End Source File 733 # Begin Source File 734 735 SOURCE="..\src\pjmedia-codec\ilbc\gainquant.c" 736 # End Source File 737 # Begin Source File 738 739 SOURCE="..\src\pjmedia-codec\ilbc\gainquant.h" 740 # End Source File 741 # Begin Source File 742 743 SOURCE="..\src\pjmedia-codec\ilbc\getCBvec.c" 744 # End Source File 745 # Begin Source File 746 747 SOURCE="..\src\pjmedia-codec\ilbc\getCBvec.h" 748 # End Source File 749 # Begin Source File 750 751 SOURCE="..\src\pjmedia-codec\ilbc\helpfun.c" 752 # End Source File 753 # Begin Source File 754 755 SOURCE="..\src\pjmedia-codec\ilbc\helpfun.h" 756 # End Source File 757 # Begin Source File 758 759 SOURCE="..\src\pjmedia-codec\ilbc\hpInput.c" 760 # End Source File 761 # Begin Source File 762 763 SOURCE="..\src\pjmedia-codec\ilbc\hpInput.h" 764 # End Source File 765 # Begin Source File 766 767 SOURCE="..\src\pjmedia-codec\ilbc\hpOutput.c" 768 # End Source File 769 # Begin Source File 770 771 SOURCE="..\src\pjmedia-codec\ilbc\hpOutput.h" 772 # End Source File 773 # Begin Source File 774 775 SOURCE="..\src\pjmedia-codec\ilbc\iCBConstruct.c" 776 # End Source File 777 # Begin Source File 778 779 SOURCE="..\src\pjmedia-codec\ilbc\iCBConstruct.h" 780 # End Source File 781 # Begin Source File 782 783 SOURCE="..\src\pjmedia-codec\ilbc\iCBSearch.c" 784 # End Source File 785 # Begin Source File 786 787 SOURCE="..\src\pjmedia-codec\ilbc\iCBSearch.h" 788 # End Source File 789 # Begin Source File 790 791 SOURCE="..\src\pjmedia-codec\ilbc\iLBC_decode.c" 792 # End Source File 793 # Begin Source File 794 795 SOURCE="..\src\pjmedia-codec\ilbc\iLBC_decode.h" 796 # End Source File 797 # Begin Source File 798 799 SOURCE="..\src\pjmedia-codec\ilbc\iLBC_define.h" 800 # End Source File 801 # Begin Source File 802 803 SOURCE="..\src\pjmedia-codec\ilbc\iLBC_encode.c" 804 # End Source File 805 # Begin Source File 806 807 SOURCE="..\src\pjmedia-codec\ilbc\iLBC_encode.h" 808 # End Source File 809 # Begin Source File 810 811 SOURCE="..\src\pjmedia-codec\ilbc\iLBC_test.c" 812 # PROP Exclude_From_Build 1 813 # End Source File 814 # Begin Source File 815 816 SOURCE="..\src\pjmedia-codec\ilbc\LPCdecode.c" 817 # End Source File 818 # Begin Source File 819 820 SOURCE="..\src\pjmedia-codec\ilbc\LPCdecode.h" 821 # End Source File 822 # Begin Source File 823 824 SOURCE="..\src\pjmedia-codec\ilbc\LPCencode.c" 825 # End Source File 826 # Begin Source File 827 828 SOURCE="..\src\pjmedia-codec\ilbc\LPCencode.h" 829 # End Source File 830 # Begin Source File 831 832 SOURCE="..\src\pjmedia-codec\ilbc\lsf.c" 833 # End Source File 834 # Begin Source File 835 836 SOURCE="..\src\pjmedia-codec\ilbc\lsf.h" 837 # End Source File 838 # Begin Source File 839 840 SOURCE="..\src\pjmedia-codec\ilbc\packing.c" 841 # End Source File 842 # Begin Source File 843 844 SOURCE="..\src\pjmedia-codec\ilbc\packing.h" 845 # End Source File 846 # Begin Source File 847 848 SOURCE="..\src\pjmedia-codec\ilbc\StateConstructW.c" 849 # End Source File 850 # Begin Source File 851 852 SOURCE="..\src\pjmedia-codec\ilbc\StateConstructW.h" 853 # End Source File 854 # Begin Source File 855 856 SOURCE="..\src\pjmedia-codec\ilbc\StateSearchW.c" 857 # End Source File 858 # Begin Source File 859 860 SOURCE="..\src\pjmedia-codec\ilbc\StateSearchW.h" 861 # End Source File 862 # Begin Source File 863 864 SOURCE="..\src\pjmedia-codec\ilbc\syntFilter.c" 865 # End Source File 866 # Begin Source File 867 868 SOURCE="..\src\pjmedia-codec\ilbc\syntFilter.h" 869 # End Source File 665 870 # End Group 666 871 # End Target -
pjproject/trunk/pjmedia/include/pjmedia-codec.h
r531 r637 28 28 #include <pjmedia-codec/gsm.h> 29 29 #include <pjmedia-codec/speex.h> 30 #include <pjmedia-codec/ilbc.h> 30 31 31 32 -
pjproject/trunk/pjmedia/include/pjmedia-codec/config.h
r411 r637 47 47 48 48 49 /** 50 * Unless specified otherwise, iLBC codec is included by default. 51 */ 52 #ifndef PJMEDIA_HAS_ILBC_CODEC 53 # define PJMEDIA_HAS_ILBC_CODEC 1 54 #endif 55 56 49 57 50 58 #endif /* __PJMEDIA_CODEC_CONFIG_H__ */ -
pjproject/trunk/pjmedia/include/pjmedia-codec/types.h
r622 r637 49 49 PJMEDIA_RTP_PT_L16_32KHZ_STEREO, /**< L16 @ 32KHz, stereo */ 50 50 PJMEDIA_RTP_PT_L16_48KHZ_MONO, /**< L16 @ 48KHz, mono */ 51 PJMEDIA_RTP_PT_L16_48KHZ_STEREO /**< L16 @ 48KHz, stereo */ 51 PJMEDIA_RTP_PT_L16_48KHZ_STEREO, /**< L16 @ 48KHz, stereo */ 52 PJMEDIA_RTP_PT_ILBC /**< iLBC (13.3/15.2Kbps) */ 52 53 }; 53 54 -
pjproject/trunk/pjmedia/include/pjmedia/codec.h
r622 r637 272 272 unsigned vad:1; /**< Voice Activity Detector. */ 273 273 unsigned cng:1; /**< Comfort Noise Generator. */ 274 unsigned lpf:1; /**< Low pass filter */275 unsigned hpf:1; /**< High pass filter */276 274 unsigned penh:1; /**< Perceptual Enhancement */ 277 275 unsigned plc:1; /**< Packet loss concealment */ 278 276 unsigned reserved:1; /**< Reserved, must be zero. */ 277 pj_uint8_t enc_fmtp_mode; /**< Mode param in fmtp (def:0) */ 278 pj_uint8_t dec_fmtp_mode; /**< Mode param in fmtp (def:0) */ 279 279 } setting; 280 280 } pjmedia_codec_param; -
pjproject/trunk/pjmedia/include/pjmedia/errno.h
r568 r637 299 299 */ 300 300 #define PJMEDIA_CODEC_EFRMINLEN (PJMEDIA_ERRNO_START+84) /* 220084 */ 301 /** 302 * @hideinitializer 303 * Invalid PCM frame length. 304 */ 305 #define PJMEDIA_CODEC_EPCMFRMINLEN (PJMEDIA_ERRNO_START+85) /* 220085 */ 306 /** 307 * @hideinitializer 308 * Invalid mode. 309 */ 310 #define PJMEDIA_CODEC_EINMODE (PJMEDIA_ERRNO_START+86) /* 220086 */ 301 311 302 312 -
pjproject/trunk/pjmedia/include/pjmedia/transport_udp.h
r622 r637 145 145 146 146 /** 147 * Simulate packet lost in the specified direction (for testing purposes). 148 * When enabled, the transport will randomly drop packets to the specified 149 * direction. 150 * 151 * @param tp The UDP media transport. 152 * @param dir Media direction to which packets will be randomly dropped. 153 * @param pct_lost Percent lost (0-100). Set to zero to disable packet 154 * lost simulation. 155 * 156 * @return PJ_SUCCESS on success. 157 */ 158 PJ_DECL(pj_status_t) pjmedia_transport_udp_simulate_lost(pjmedia_transport *tp, 159 pjmedia_dir dir, 160 unsigned pct_lost); 161 162 163 164 /** 147 165 * Close UDP transport. Application can also use the "destroy" member of 148 166 * media transport interface to close the UDP transport. 167 * 168 * @param tp The UDP media transport. 169 * 170 * @return PJ_SUCCESS on success. 149 171 */ 150 172 PJ_DECL(pj_status_t) pjmedia_transport_udp_close(pjmedia_transport *tp); -
pjproject/trunk/pjmedia/src/pjmedia-codec/speex_codec.c
r628 r637 409 409 attr->setting.cng = 1; 410 410 attr->setting.plc = 1; 411 attr->setting.hpf = 1;412 attr->setting.lpf =1 ;413 411 attr->setting.penh =1 ; 414 412 attr->setting.vad = 1; -
pjproject/trunk/pjmedia/src/pjmedia/dsound.c
r582 r637 45 45 46 46 #define MAX_PACKET_BUFFER_COUNT 32 47 #define DEFAULT_BUFFER_COUNT 1647 #define DEFAULT_BUFFER_COUNT 32 48 48 49 49 #define MAX_HARDWARE 16 -
pjproject/trunk/pjmedia/src/pjmedia/endpoint.c
r635 r637 347 347 #endif 348 348 349 /* Add format and rtpmapfor each codec */349 /* Add format, rtpmap, and fmtp (when applicable) for each codec */ 350 350 for (i=0; i<endpt->codec_mgr.codec_cnt; ++i) { 351 351 … … 354 354 char tmp_param[3]; 355 355 pjmedia_sdp_attr *attr; 356 pjmedia_codec_param codec_param; 356 357 pj_str_t *fmt; 357 358 … … 360 361 361 362 codec_info = &endpt->codec_mgr.codec_desc[i].info; 363 pjmedia_codec_mgr_get_default_param(&endpt->codec_mgr, codec_info, 364 &codec_param); 362 365 fmt = &m->desc.fmt[m->desc.fmt_count++]; 363 366 … … 391 394 m->attr[m->attr_count++] = attr; 392 395 396 /* Add fmtp mode where applicable */ 397 if (codec_param.setting.dec_fmtp_mode != 0) { 398 const pj_str_t fmtp = { "fmtp", 4 }; 399 attr = pj_pool_zalloc(pool, sizeof(pjmedia_sdp_attr)); 400 401 attr->name = fmtp; 402 attr->value.ptr = pj_pool_alloc(pool, 32); 403 attr->value.slen = 404 pj_ansi_snprintf( attr->value.ptr, 32, 405 ":%d mode=%d", 406 codec_info->pt, 407 codec_param.setting.dec_fmtp_mode); 408 m->attr[m->attr_count++] = attr; 409 } 393 410 } 394 411 -
pjproject/trunk/pjmedia/src/pjmedia/errno.c
r568 r637 90 90 PJ_BUILD_ERR( PJMEDIA_CODEC_EPCMTOOSHORT, "PCM frame is too short" ), 91 91 PJ_BUILD_ERR( PJMEDIA_CODEC_EFRMINLEN, "Invalid codec frame length" ), 92 PJ_BUILD_ERR( PJMEDIA_CODEC_EPCMFRMINLEN, "Invalid PCM frame length" ), 93 PJ_BUILD_ERR( PJMEDIA_CODEC_EINMODE, "Invalid codec mode (no fmtp?)" ), 92 94 93 95 /* Media errors. */ -
pjproject/trunk/pjmedia/src/pjmedia/session.c
r582 r637 59 59 60 60 /* 61 * Get fmtp mode parameter associated with the codec. 62 */ 63 static pj_status_t get_fmtp_mode(const pjmedia_sdp_media *m, 64 const pj_str_t *fmt, 65 int *p_mode) 66 { 67 const pjmedia_sdp_attr *attr; 68 pjmedia_sdp_fmtp fmtp; 69 const pj_str_t str_mode = { "mode=", 5 }; 70 char *pos; 71 72 /* Get "fmtp" attribute for the format */ 73 attr = pjmedia_sdp_media_find_attr2(m, "fmtp", fmt); 74 if (attr == NULL) 75 return -1; 76 77 /* Parse "fmtp" attribute */ 78 if (pjmedia_sdp_attr_get_fmtp(attr, &fmtp) != PJ_SUCCESS) 79 return -1; 80 81 /* Look for "mode=" string in the fmtp */ 82 while (fmtp.fmt_param.slen >= str_mode.slen + 1) { 83 if (pj_strnicmp(&fmtp.fmt_param, &str_mode, str_mode.slen)==0) { 84 /* Found "mode=" string */ 85 break; 86 } 87 88 fmtp.fmt_param.ptr++; 89 fmtp.fmt_param.slen--; 90 } 91 92 if (fmtp.fmt_param.slen < str_mode.slen + 1) { 93 /* "mode=" param not found */ 94 return -1; 95 } 96 97 /* Get the mode */ 98 pos = fmtp.fmt_param.ptr + str_mode.slen; 99 *p_mode = 0; 100 while (pj_isdigit(*pos)) { 101 *p_mode = *p_mode * 10 + (*pos - '0'); 102 ++pos; 103 } 104 105 return PJ_SUCCESS; 106 } 107 108 109 /* 61 110 * Create stream info from SDP media line. 62 111 */ … … 76 125 const pjmedia_sdp_conn *rem_conn; 77 126 pjmedia_sdp_rtpmap *rtpmap; 127 int local_fmtp_mode = 0, rem_fmtp_mode = 0; 78 128 unsigned i, pt; 79 129 pj_status_t status; … … 271 321 272 322 } else { 323 273 324 attr = pjmedia_sdp_media_find_attr(local_m, &ID_RTPMAP, 274 325 &local_m->desc.fmt[0]); … … 305 356 } 306 357 358 /* Get fmtp mode= param in local SDP, if any */ 359 get_fmtp_mode(local_m, &local_m->desc.fmt[0], &local_fmtp_mode); 360 307 361 /* Determine payload type for outgoing channel, by finding 308 362 * dynamic payload type in remote SDP that matches the answer. … … 331 385 /* Found matched codec. */ 332 386 si->tx_pt = rpt; 387 388 /* Get fmtp mode param in remote SDP, if any */ 389 get_fmtp_mode(rem_m, &rtpmap->pt, &rem_fmtp_mode); 390 333 391 break; 334 392 } … … 345 403 if (status != PJ_SUCCESS) 346 404 return status; 405 406 /* Set fmtp mode for both local and remote */ 407 if (local_fmtp_mode != 0) 408 si->param->setting.dec_fmtp_mode = (pj_int8_t)local_fmtp_mode; 409 if (rem_fmtp_mode != 0) 410 si->param->setting.enc_fmtp_mode = (pj_int8_t)rem_fmtp_mode; 411 347 412 348 413 /* Get incomming payload type for telephone-events */ -
pjproject/trunk/pjmedia/src/pjmedia/transport_udp.c
r582 r637 22 22 #include <pj/ioqueue.h> 23 23 #include <pj/log.h> 24 #include <pj/rand.h> 24 25 #include <pj/string.h> 25 26 … … 58 59 const void*, 59 60 pj_ssize_t); 61 62 unsigned tx_drop_pct; /**< Percent of tx pkts to drop. */ 63 unsigned rx_drop_pct; /**< Percent of rx pkts to drop. */ 60 64 61 65 pj_sock_t rtp_sock; /**< RTP socket */ … … 372 376 user_data = udp->user_data; 373 377 378 /* Simulate packet lost on RX direction */ 379 if (udp->rx_drop_pct) { 380 if ((pj_rand() % 100) <= (int)udp->rx_drop_pct) { 381 PJ_LOG(5,(udp->base.name, 382 "RX RTP packet dropped because of pkt lost " 383 "simulation")); 384 goto read_next_packet; 385 } 386 } 387 388 374 389 if (udp->attached && cb) 375 390 (*cb)(user_data, udp->rtp_pkt, bytes_read); … … 426 441 } 427 442 443 read_next_packet: 428 444 bytes_read = sizeof(udp->rtp_pkt); 429 445 udp->rtp_addrlen = sizeof(pj_sockaddr_in); … … 582 598 PJ_ASSERT_RETURN(size <= RTP_LEN, PJ_ETOOBIG); 583 599 600 /* Simulate packet lost on TX direction */ 601 if (udp->tx_drop_pct) { 602 if ((pj_rand() % 100) <= (int)udp->tx_drop_pct) { 603 PJ_LOG(5,(udp->base.name, 604 "TX RTP packet dropped because of pkt lost " 605 "simulation")); 606 return PJ_SUCCESS; 607 } 608 } 609 610 584 611 id = udp->rtp_write_op_id; 585 612 pw = &udp->rtp_pending_write[id]; … … 629 656 } 630 657 658 659 PJ_DEF(pj_status_t) pjmedia_transport_udp_simulate_lost(pjmedia_transport *tp, 660 pjmedia_dir dir, 661 unsigned pct_lost) 662 { 663 struct transport_udp *udp = (struct transport_udp*)tp; 664 665 PJ_ASSERT_RETURN(tp && 666 (dir==PJMEDIA_DIR_ENCODING||dir==PJMEDIA_DIR_DECODING) && 667 pct_lost <= 100, PJ_EINVAL); 668 669 if (dir == PJMEDIA_DIR_ENCODING) 670 udp->tx_drop_pct = pct_lost; 671 else if (dir == PJMEDIA_DIR_DECODING) 672 udp->rx_drop_pct = pct_lost; 673 else 674 return PJ_EINVAL; 675 676 return PJ_SUCCESS; 677 } 678 -
pjproject/trunk/pjsip-apps/src/pjsua/pjsua_app.c
r632 r637 124 124 puts (" --auto-loop Automatically loop incoming RTP to outgoing RTP"); 125 125 puts (" --rtp-port=N Base port to try for RTP (default=4000)"); 126 puts (" --quality=N Specify media quality (0-10, default=10)");126 puts (" --quality=N Specify media quality (0-10, default=6)"); 127 127 puts (" --ptime=MSEC Override codec ptime to MSEC (default=specific)"); 128 128 puts (" --no-vad Disable VAD/silence detector (default=vad enabled)"); 129 puts (" --ilbc-mode=MODE Set iLBC codec mode (20 or 30, default is 20)"); 130 puts (" --rx-drop-pct=PCT Drop PCT percent of RX RTP (for pkt lost sim, default: 0)"); 131 puts (" --tx-drop-pct=PCT Drop PCT percent of TX RTP (for pkt lost sim, default: 0)"); 132 129 133 130 134 puts (""); … … 256 260 OPT_AUTO_ANSWER, OPT_AUTO_HANGUP, OPT_AUTO_PLAY, OPT_AUTO_LOOP, 257 261 OPT_AUTO_CONF, OPT_CLOCK_RATE, 258 OPT_PLAY_FILE, OPT_RTP_PORT, OPT_ADD_CODEC, 262 OPT_PLAY_FILE, OPT_RTP_PORT, OPT_ADD_CODEC, OPT_ILBC_MODE, 259 263 OPT_COMPLEXITY, OPT_QUALITY, OPT_PTIME, OPT_NO_VAD, 264 OPT_RX_DROP_PCT, OPT_TX_DROP_PCT, 260 265 OPT_NEXT_ACCOUNT, OPT_NEXT_CRED, OPT_MAX_CALLS, 261 266 OPT_DURATION, OPT_NO_TCP, OPT_NO_UDP, … … 299 304 { "ptime", 1, 0, OPT_PTIME}, 300 305 { "no-vad", 0, 0, OPT_NO_VAD}, 306 { "ilbc-mode", 1, 0, OPT_ILBC_MODE}, 307 { "rx-drop-pct",1, 0, OPT_RX_DROP_PCT}, 308 { "tx-drop-pct",1, 0, OPT_TX_DROP_PCT}, 301 309 { "next-account",0,0, OPT_NEXT_ACCOUNT}, 302 310 { "next-cred", 0, 0, OPT_NEXT_CRED}, … … 621 629 PJ_LOG(1,(THIS_FILE, 622 630 "Error: invalid --quality (expecting 0-10")); 631 return -1; 632 } 633 break; 634 635 case OPT_ILBC_MODE: 636 cfg->media_cfg.ilbc_mode = my_atoi(pj_optarg); 637 if (cfg->media_cfg.ilbc_mode!=20 && cfg->media_cfg.ilbc_mode!=30) { 638 PJ_LOG(1,(THIS_FILE, 639 "Error: invalid --ilbc-mode (expecting 20 or 30")); 640 return -1; 641 } 642 break; 643 644 case OPT_RX_DROP_PCT: 645 cfg->media_cfg.rx_drop_pct = my_atoi(pj_optarg); 646 if (cfg->media_cfg.rx_drop_pct > 100) { 647 PJ_LOG(1,(THIS_FILE, 648 "Error: invalid --rx-drop-pct (expecting <= 100")); 649 return -1; 650 } 651 break; 652 653 case OPT_TX_DROP_PCT: 654 cfg->media_cfg.tx_drop_pct = my_atoi(pj_optarg); 655 if (cfg->media_cfg.tx_drop_pct > 100) { 656 PJ_LOG(1,(THIS_FILE, 657 "Error: invalid --tx-drop-pct (expecting <= 100")); 623 658 return -1; 624 659 } -
pjproject/trunk/pjsip/include/pjsua-lib/pjsua.h
r632 r637 2088 2088 * number. 2089 2089 * 2090 * Default: 5.2090 * Default: 6. 2091 2091 */ 2092 2092 unsigned quality; … … 2105 2105 */ 2106 2106 pj_bool_t no_vad; 2107 2108 /** 2109 * iLBC mode (20 or 30). 2110 * 2111 * Default: 20 2112 */ 2113 unsigned ilbc_mode; 2114 2115 /** 2116 * Percentage of RTP packet to drop in TX direction 2117 * (to simulate packet lost). 2118 * 2119 * Default: 0 2120 */ 2121 unsigned tx_drop_pct; 2122 2123 /** 2124 * Percentage of RTP packet to drop in RX direction 2125 * (to simulate packet lost). 2126 * 2127 * Default: 0 2128 */ 2129 unsigned rx_drop_pct; 2130 2107 2131 }; 2108 2132 … … 2121 2145 cfg->has_ioqueue = PJ_TRUE; 2122 2146 cfg->thread_cnt = 1; 2123 cfg->quality = 5; 2147 cfg->quality = 6; 2148 cfg->ilbc_mode = 20; 2124 2149 } 2125 2150 -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_call.c
r635 r637 942 942 943 943 /* Create SDP */ 944 PJ_UNUSED_ARG(unhold); 944 945 PJ_TODO(create_active_inactive_sdp_based_on_unhold_arg); 945 946 status = pjmedia_endpt_create_sdp( pjsua_var.med_endpt, call->inv->pool, … … 1854 1855 /* Override ptime, if this option is specified. */ 1855 1856 if (pjsua_var.media_cfg.ptime != 0) { 1856 sess_info.stream_info[0].param->setting.frm_per_pkt = 1857 pjsua_var.media_cfg.ptime / sess_info.stream_info[0].param->info.frm_ptime;1857 sess_info.stream_info[0].param->setting.frm_per_pkt = (pj_uint8_t) 1858 (pjsua_var.media_cfg.ptime / sess_info.stream_info[0].param->info.frm_ptime); 1858 1859 if (sess_info.stream_info[0].param->setting.frm_per_pkt == 0) 1859 1860 sess_info.stream_info[0].param->setting.frm_per_pkt = 1; -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_core.c
r612 r637 1115 1115 1116 1116 /* To be done!! */ 1117 1117 PJ_UNUSED_ARG(force); 1118 1118 1119 1119 PJ_TODO(pjsua_transport_close); -
pjproject/trunk/pjsip/src/pjsua-lib/pjsua_media.c
r632 r637 86 86 #endif /* PJMEDIA_HAS_SPEEX_CODEC */ 87 87 88 #if PJMEDIA_HAS_ILBC_CODEC 89 /* Register iLBC. */ 90 status = pjmedia_codec_ilbc_init( pjsua_var.med_endpt, 91 pjsua_var.media_cfg.ilbc_mode); 92 if (status != PJ_SUCCESS) { 93 pjsua_perror(THIS_FILE, "Error initializing iLBC codec", 94 status); 95 return status; 96 } 97 #endif /* PJMEDIA_HAS_ILBC_CODEC */ 98 88 99 #if PJMEDIA_HAS_GSM_CODEC 89 100 /* Register GSM */ … … 485 496 goto on_error; 486 497 } 498 499 pjmedia_transport_udp_simulate_lost(pjsua_var.calls[i].med_tp, 500 PJMEDIA_DIR_ENCODING, 501 pjsua_var.media_cfg.tx_drop_pct); 502 503 pjmedia_transport_udp_simulate_lost(pjsua_var.calls[i].med_tp, 504 PJMEDIA_DIR_DECODING, 505 pjsua_var.media_cfg.rx_drop_pct); 506 487 507 } 488 508 … … 661 681 pjsua_var.mconf_cfg.samples_per_frame * 662 682 1000 / pjsua_var.media_cfg.clock_rate, 663 0, 0, &port);683 options, 0, &port); 664 684 if (status != PJ_SUCCESS) { 665 685 PJSUA_UNLOCK(); … … 759 779 pj_status_t status; 760 780 781 /* Don't support max_size at present */ 782 PJ_ASSERT_RETURN(max_size == 0, PJ_EINVAL); 783 784 /* Don't support file format at present */ 785 PJ_ASSERT_RETURN(file_format == 0, PJ_EINVAL); 786 787 /* Don't support encoding at present */ 788 PJ_ASSERT_RETURN(encoding == NULL, PJ_EINVAL); 789 761 790 if (pjsua_var.rec_cnt >= PJ_ARRAY_SIZE(pjsua_var.recorder)) 762 791 return PJ_ETOOMANY; … … 783 812 pjsua_var.mconf_cfg.samples_per_frame, 784 813 pjsua_var.mconf_cfg.bits_per_sample, 785 0, 0, &port);814 options, 0, &port); 786 815 if (status != PJ_SUCCESS) { 787 816 PJSUA_UNLOCK(); … … 1093 1122 const pjmedia_codec_param *param) 1094 1123 { 1124 PJ_UNUSED_ARG(id); 1125 PJ_UNUSED_ARG(param); 1095 1126 PJ_TODO(set_codec_param); 1096 1127 return PJ_SUCCESS; 1097 1128 } 1098 1099
Note: See TracChangeset
for help on using the changeset viewer.