Changeset 394
- Timestamp:
- Apr 7, 2006 3:01:51 PM (19 years ago)
- Location:
- pjproject/trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
pjproject/trunk/pjmedia/include/pjmedia/config.h
r371 r394 76 76 77 77 78 /** 79 * Maximum frame duration (in msec) to be supported. 80 */ 81 #ifndef PJMEDIA_MAX_FRAME_DURATION_MS 82 # define PJMEDIA_MAX_FRAME_DURATION_MS 200 83 #endif 84 85 86 /** 87 * Max packet size to support. 88 */ 89 #ifndef PJMEDIA_MAX_MTU 90 # define PJMEDIA_MAX_MTU 1500 91 #endif 92 93 94 /** 95 * DTMF/telephone-event duration, in timestamp. 96 */ 97 #ifndef PJMEDIA_DTMF_DURATION 98 # define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */ 99 #endif 100 101 102 /** 103 * Number of packets received from different source IP address from the 104 * remote address required to make the stream switch transmission 105 * to the source address. 106 */ 107 #ifndef PJMEDIA_RTP_NAT_PROBATION_CNT 108 # define PJMEDIA_RTP_NAT_PROBATION_CNT 10 109 #endif 110 111 112 /** 113 * Interval to send RTCP packets, in msec 114 */ 115 #ifndef PJMEDIA_RTCP_INTERVAL 116 # define PJMEDIA_RTCP_INTERVAL 5000 /* msec*/ 117 #endif 118 119 78 120 #endif /* __PJMEDIA_CONFIG_H__ */ 79 121 122 -
pjproject/trunk/pjmedia/src/pjmedia/rtcp.c
r390 r394 340 340 } else { 341 341 PJ_LOG(3, (THIS_FILE, "Internal NTP clock skew detected: " 342 "lsr=%p, now=%p, dlsr=%p (%d:%03dms)", 342 "lsr=%p, now=%p, dlsr=%p (%d:%03dms), " 343 "diff=%d", 343 344 lsr, now, dlsr, dlsr/65536, 344 (dlsr%65536)*1000/65536)); 345 (dlsr%65536)*1000/65536, 346 dlsr-(now-lsr))); 345 347 } 346 348 } -
pjproject/trunk/pjmedia/src/pjmedia/stream.c
r390 r394 39 39 #define TRACE_(expr) stream_perror expr 40 40 #define TRC_(expr) PJ_LOG(4,expr) 41 #define PJMEDIA_MAX_FRAME_DURATION_MS 20042 #define PJMEDIA_MAX_BUFFER_SIZE_MS 200043 #define PJMEDIA_MAX_MTU 150044 #define PJMEDIA_DTMF_DURATION 1600 /* in timestamp */45 #define PJMEDIA_RTP_NAT_PROBATION_CNT 1046 #define PJMEDIA_RTCP_INTERVAL 5 /* seconds */47 48 41 49 42 /** … … 342 335 /* Check if this is the time to transmit RTCP packet */ 343 336 if (stream->rtcp_tx_time == 0) { 337 unsigned first_interval; 338 339 first_interval = PJMEDIA_RTCP_INTERVAL + (pj_rand() % 2000); 344 340 stream->rtcp_tx_time = pj_ntohl(channel->rtp.out_hdr.ts) + 345 PJMEDIA_RTCP_INTERVAL *346 stream->port.info.sample_rate;341 first_interval* stream->port.info.sample_rate / 342 1000; 347 343 } else if (pj_ntohl(channel->rtp.out_hdr.ts) >= stream->rtcp_tx_time) { 348 344 349 345 pjmedia_rtcp_pkt *rtcp_pkt; 350 346 pj_ssize_t size; 347 unsigned interval; 351 348 int len; 352 349 … … 356 353 &stream->rem_rtcp_addr, 357 354 sizeof(stream->rem_rtcp_addr)); 355 #if 0 358 356 if (status != PJ_SUCCESS) { 359 ; 357 char errmsg[PJ_ERR_MSG_SIZE]; 358 359 pj_strerror(status, errmsg, sizeof(errmsg)); 360 PJ_LOG(4,(THIS_FILE, "Error sending RTCP: %s [%d]", 361 errmsg, status)); 360 362 } 361 363 #endif 364 365 interval = PJMEDIA_RTCP_INTERVAL + (pj_rand() % 500); 362 366 stream->rtcp_tx_time = pj_ntohl(channel->rtp.out_hdr.ts) + 363 PJMEDIA_RTCP_INTERVAL *364 stream->port.info.sample_rate;367 interval * stream->port.info.sample_rate / 368 1000; 365 369 } 366 370 -
pjproject/trunk/pjsip-apps/src/samples/siprtp.c
r393 r394 991 991 static int media_thread(void *arg) 992 992 { 993 enum { RTCP_INTERVAL = 5 };993 enum { RTCP_INTERVAL = 5000, RTCP_RAND = 2000 }; 994 994 struct media_stream *strm = arg; 995 995 char packet[1500]; … … 1004 1004 1005 1005 next_rtcp = next_rtp; 1006 next_rtcp.u64 += (freq.u64 * RTCP_INTERVAL);1006 next_rtcp.u64 += (freq.u64 * (RTCP_INTERVAL+(pj_rand()%RTCP_RAND)) / 1000); 1007 1007 1008 1008 … … 1166 1166 1167 1167 /* Schedule next send */ 1168 next_rtcp.u64 += (freq.u64 * RTCP_INTERVAL); 1168 next_rtcp.u64 += (freq.u64 * (RTCP_INTERVAL+(pj_rand()%RTCP_RAND)) / 1169 1000); 1169 1170 } 1170 1171 }
Note: See TracChangeset
for help on using the changeset viewer.