Ignore:
Timestamp:
08/24/10 07:51:02 (21 months ago)
Author:
shiretu
Message:

-- android related

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/thelib/src/protocols/rtp/connectivity/outboundconnectivity.cpp

    r88 r96  
    6969        sent = sendmsg(fd, &vd, 0); \ 
    7070    } \ 
    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} \ 
     78while (0) 
    7379 
    7480OutboundConnectivity::OutboundConnectivity() 
     
    9399        _message.msg_iovlen = 1; 
    94100        _message.msg_namelen = sizeof (sockaddr_in); 
     101 
     102        _startupTime = 0; 
    95103        WARN("OC created: %p", this); 
    96104} 
     
    396404        put_htonl(pDest + 4, ssrc); //SSRC 
    397405 
    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 
    399420        uint64_t ntp; 
    400         //GETCUSTOMNTP(ntp, (ntohlp(pSrc + 4) / rate)*1000); 
    401         GETNTP(ntp); 
     421        GETCUSTOMNTP(ntp, currentTime); 
    402422        put_htonll(pDest + 8, ntp); 
    403423 
    404424        //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); 
    411432 
    412433        //7. sender's packet count 
Note: See TracChangeset for help on using the changeset viewer.