- Timestamp:
- 08/24/10 07:51:02 (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp
r88 r96 69 69 sent = sendmsg(fd, &vd, 0); \ 70 70 } \ 71 RTP_DEBUG_MESSAGE(sent); \ 72 } while(0) 71 /*FATAL("TS: %02x%02x%02x%02x", \ 72 ((uint8_t *)vd.msg_iov[0].iov_base)[4], \ 73 ((uint8_t *)vd.msg_iov[0].iov_base)[5], \ 74 ((uint8_t *)vd.msg_iov[0].iov_base)[6], \ 75 ((uint8_t *)vd.msg_iov[0].iov_base)[7]); */\ 76 RTP_DEBUG_MESSAGE(sent); \ 77 } \ 78 while (0) 73 79 74 80 OutboundConnectivity::OutboundConnectivity() … … 93 99 _message.msg_iovlen = 1; 94 100 _message.msg_namelen = sizeof (sockaddr_in); 101 102 _startupTime = 0; 95 103 WARN("OC created: %p", this); 96 104 } … … 396 404 put_htonl(pDest + 4, ssrc); //SSRC 397 405 398 //5. NTP 406 FINEST("-----%s-----", isAudio ? "AUDIO" : "VIDEO"); 407 408 //5. setup the startup time 409 if (_startupTime == 0) { 410 GETCLOCKS(_startupTime); 411 } 412 FINEST("_startupTime: %.2f", _startupTime); 413 414 //6. Get the current time 415 double currentTime; 416 GETCLOCKS(currentTime); 417 FINEST("currentTime: %.2f", currentTime); 418 419 //7. NTP 399 420 uint64_t ntp; 400 //GETCUSTOMNTP(ntp, (ntohlp(pSrc + 4) / rate)*1000); 401 GETNTP(ntp); 421 GETCUSTOMNTP(ntp, currentTime); 402 422 put_htonll(pDest + 8, ntp); 403 423 404 424 //6. RTP 405 // double rtpDouble; 406 // GETCLOCKS(rtpDouble); 407 // rtpDouble = (rtpDouble / CLOCKS_PER_SEC) * rate; 408 // uint32_t rtp = (uint32_t) rtpDouble; 409 // put_htonl(pDest + 16, rtp); 410 memcpy(pDest + 16, pSrc + 4, 4); 425 FINEST("rate: %d", rate); 426 double rtpDouble = ((currentTime - _startupTime) / (double) CLOCKS_PER_SEC) * rate; 427 FINEST("rtpDouble: %.2f", rtpDouble); 428 uint32_t rtp = (uint32_t) rtpDouble; 429 FINEST("rtp: %d", rtp); 430 put_htonl(pDest + 16, rtp); 431 //memcpy(pDest + 16, pSrc + 4, 4); 411 432 412 433 //7. sender's packet count
Note: See TracChangeset
for help on using the changeset viewer.
